Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
& its going to ... lets just return user
function applyTaxToItems(user){ return user }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUser () {return user;}", "function getUser(next){\n if(!assignedto) return next(null);\n\n \n //get users to check current phlebo is eligible for visit\n ModelUser.findById(assignedto,{specialneedlist:1},{lean:true}, function (e,r) {\n if(e) return next(e);\n user = r;\n if(!params.specialneedlist.length && snPhleboRequired) changePhlebo = true; //need to change phlebo\n\n return next(null)\n });\n }//end of getUser ", "function findCurrentUser() {\n return \"stefan\"\n }", "tryRetrieveUser(userid) {\n this.userService.getUser(userid).then(reply => {\n this.authModel$.next(reply);\n if (reply.firstName == null && window.location.pathname != \"/register\") {\n this.logger.log(\"new user\", \"\");\n this.router.navigate([\"register\"]);\n }\n else {\n this.isUserAdmin(userid);\n }\n }).catch(err => {\n this.logger.error(\"in checkAuth$\", err);\n this.isAdmin$.next(false);\n });\n }", "function user()\n {\n\n }", "function user(){\r\n uProfile(req, res);\r\n }", "function gotUser(err, user) {\n if (err) return callback(err);\n callback(null, user);\n }", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}", "async bringUser(req,res){\n //función controladora con la lógica que muestra los usuarios\n }", "function getUser(){\n return user;\n }", "function proceed () {\n\t\t/*\n\t\t\tIf the user has been loaded determine where we should\n\t\t\tsend the user.\n\t\t*/\n if ( store.getters.getUserLoadStatus() == 2 ) {\n\t\t\t/*\n\t\t\t\tIf the user is not empty, that means there's a user\n\t\t\t\tauthenticated we allow them to continue. Otherwise, we\n\t\t\t\tsend the user back to the home page.\n\t\t\t*/\n\t\t\tif( store.getters.getUser != '' ){\n \tnext();\n\t\t\t}else{\n\t\t\t\tnext('/cafes');\n\t\t\t}\n }\n\t}", "function current() {\n return user;\n }", "get user() { return this.args.user }", "function proceed () {\n\t\t\t/*\n\t\t\t\tIf the user has been loaded determine where we should\n\t\t\t\tsend the user.\n\t\t\t*/\n\t\t\tif (store.getters.getBearerToken) {\n\t\t\t\tnext();\n\t\t\t} else {\n\t\t\t\t//user is not logged in\n\t\t\t\tconsole.log('you are not logged in');\n\t\t\t}\n\t\t}", "function getUserAndRedirect(){\n UserServices.getOne({action:$scope.user.id}).$promise.then(function(val){\n $scope.user = val;\n shareObjectService.addObject($scope.user);\n $state.go('app.auth.user.detail', {id:$scope.user.id});\n });\n }", "function getCurrentLoggedInUserAccount() {\n\t//access to the db\n\t//confirm they have proper credentials\n\treturn \"Kimberly\";\n}", "function proceed() {\n\t\t/*\n\t\t\tIf the user has been loaded determine where we should\n\t\t\tsend the user.\n\t\t*/\n if (store.getters.getUserLoadStatus == 2) {\n next();\n } else if (store.getters.getUserLoadStatus == 3) {\n //user is not logged in\n console.log('you are not logged in');\n }\n }", "user(obj) {\n\n // Perform action and return promise\n return user.getUser({id: obj.author});\n }", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t$state.go('otp');\n\t\t\t}\n\t\t}", "function return_login(res, friend) {\n\tres.send(friend);\n}", "function resolveAuthenticatedUser(data){\n\t\t\tif(data.status == true){\n\t\t\tif(data.applicationStatus == \"none\")\n\t\t\t\t$state.go('roorrmu',{userId: $state.params.userId});\n\t\t\t\telse if(data.applicationStatus == \"applicableForRenewal\")\n\t\t\t\t$state.go('loanrenewal',{mdnid: $state.params.mdnid , phone: $state.params.phone,userId: $state.params.userId});\n\t\t\t\telse\n\t\t\t\t$state.go('statusmessage',{statusmessage: data.applicationStatus,userId:$state.params.userId});\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\tloaderService.toggle(false);\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t\tvm.errorMessage = data.errorText;\n\t\t\t\tloaderService.toggle(false);\n\n\t\t\t}\n\t\t}", "function returnUseraccount(){\n\n return user_account;\n\n}", "function userGet(data) {\n data = data.split(\"Logged in user name: \").pop();\n data = data.substr(0, data.indexOf('\\n'));\n data = data.substr(0, data.indexOf('\\r'));\n console.log('Got username on startup')\n console.log(data)\n if(data !== undefined){\n encrypt(data);\n messaging(setup,'userSet', true, '')\n } else {\n messaging(setup,'userSet', false, '')\n }\n return\n}", "get user() { return this.user_; }", "function main() {\r\n // user.userLogin(\"sporkina@hotmail.com\", \"sporks\");\r\n}", "function api_getuser(ctx) {\n api_req({\n a: 'ug'\n }, ctx);\n}", "getUser(state, action){}", "function getCurrentUser()\n{ \n\treturn currentUser;\n}", "user(cb) {\n svclib.KVDataStore.get([{\n table: 'email_to_user',\n key: email,\n }], (err, items) => {\n if (err) return cb(err);\n if (!items[0].exists) {\n return cb(new Error('That user does not exist.'));\n }\n const userId = items[0].value.userId;\n svclib.KVDataStore.get([{\n table: 'users',\n key: _.toString(userId),\n }], (err, items) => {\n if (err) return cb(err);\n if (!items[0].exists) {\n return cb(new Error('That user does not exist.'));\n }\n return cb(null, items[0]);\n });\n });\n }", "cameBackForHelp (targetUserID) {\n return UserAPI.cameBackForHelp(targetUserID)\n .then(data => {\n if (!data) return;\n\n console.log('Came back from requesting user', data);\n }).catch(err => console.log('Failed coming back for help: ', err));\n }", "function successGetUserById(user) {\n return {\n type: ACTION.GET_USER_BY_ID_SUCCESS,\n user\n }\n}", "function getUser(){\n\n for (let index = 0; index < result.length; index++) {\n if (username == result[index].email && pass == result[index].pass) {\n const user = result[index];\n \n found = true;\n return user;\n \n } \n } \n \n\n }", "function saveSuccessCallback() {\n\t\t\treturn function (response) {\n\t\t\t\tsetUser(response);\n\t\t\t\tgotoUser.all();\n\t\t\t}\n\t\t}", "function loggedIn(userdata) {\n console.log(userdata.email + \" has now logged in\");\n console.log(\"Privlevel: \" + userdata.privileges);\n // New users should be directed to edit page\n if ( +userdata.privileges < 3 ) {\n window.location.href=\"edituser.php\";\n return true; // Function is finished\n }\n // What URL are you on? Special? Stay. Otherwise load personal start page.\n if ( window.ref ) {\n console.log(\"Going to \" + window.ref);\n window.location.href = window.ref;\n } else {\n console.log(\"Going to userpage\");\n window.location.href = \"./userpage.php\";\n }\n }", "doSpoofUser() {\n this.spoofUser(this.get('user.id'));\n }", "function login() {\n chattr.prompt('What is your name (or email)?', function (data) {\n username = data;\n //checkIfUserExists(username);\n\n if (username != '') {\n\n chattr.alert('Ok, you are now logged in as ' + username + ' ;)');\n newUser = users.push({ name: username });\n userId = newUser.name();\n\n if (validateEmail(username)) {\n username = username.toLowerCase();\n avatar = 'http://www.gravatar.com/avatar/' + md5(username);\n }\n } else {\n alert('Bad username, please try again!');\n login();\n }\n\n }, login);\n}", "getCurrentUser() {\n return HTTP.get('users/me')\n .then(response => {\n return response.data\n })\n .catch(err => {\n throw err\n })\n }", "function getUser(req,res,next) {\n db.one(`\n SELECT *\n FROM users\n WHERE email = lower(trim(from $/email/));\n `, req.body)\n .then( user=>{\n\n if(bcrypt.compareSync(req.body.password, user.password_digest)){\n res.user = user;\n }else{\n res.error = true\n }\n console.log(res.user)\n next()\n\n })\n /* NOTE: NO USERS or all ERRORS*/\n .catch( error=>{\n console.error('Error ', error);\n res.error = error\n next()\n })\n }", "function oneUser (input) {\n function myCallback(data) {\n for(i=0; i < data.length; i++){\n if(data[i].userId == input){ /*.id?*/\n let founduser = data[i];\n sessionStorage.setItem('foundUser', JSON.stringify(founduser))\n }\n }\n window.location.href = (\"adminUpdateUser.html\")\n }\n\n var admin = new Admin(null, null, 2);\n admin.getUser(myCallback);\n}", "function directUserFromMain () {\n if (nextStep == \"View departments, roles, or employees\") {\n // Prompt them which info they would like to view\n viewInfoPrompt()\n // Then capture the response and invoke the direct user from view info function\n .then (response => {\n nextStep = response.itemToView;\n directUserFromViewInfo();\n })\n // If there is an error, log the error\n .catch(err => {if (err) throw err});\n }\n if (nextStep == \"Add new departments, roles, or employees\") {\n // Prompt them for what specific information they would like to add...\n addInfoPrompt()\n // Then capture the response and invoke the direct user from add info function...\n .then (response => {\n nextStep = response.itemToAdd;\n directUserFromAddInfo();\n })\n // If there is an error, log the error\n .catch(err => {if (err) throw err});\n }\n if (nextStep == \"Update the role for an existing employee\") {\n // Prompt them for what specific information they would like to update on role, and for whom they would like to update for\n updateInfoPrompt()\n // Then capture the response and invoke the direct user from updtate info functoin\n .then(response => {\n nextStep = response.itemToUpdate\n directUserFromUpdateInfo();\n })\n // If there is an error, log the error\n .catch(err => {if (err) throw err});\n }\n if (nextStep == \"Finish session\") {\n // Log to the user the session is completed..\n console.log(`\\nsession completed!\\n`);\n // And end the connectoin to the DB...\n endConnectionToSQL();\n return;\n }\n }", "async function fetchUser() {\n\treturn 'shock';\n}", "user(state) {\n return state.user;\n }", "function getUserInfo_cb(err, resp, user) {\n\t\t\tif (!err && resp.statusCode === 200) {\n\t\t\t\treq.session.user = user;\n\t\t\t\tcache[req.session.user.id_str] = req.session;\n\t\t\t\tcheckFavorites(redsIndex_cb);\n\t\t\t}\n\t\t}", "function getUser(req,res){\n const userId = req.params.id;\n\n User.findById(userId, (err, user) =>{\n if(err) return res.status(500).send({message:\"Error en la peticion\"});\n\n if(!user) return res.status(404).send({message:\"El usuario no existe\"});\n\n followThisUser(req.user.sub, userId).then(value => {\n user.password = undefined;\n return res.status(200).send({user, following: value.following, followed: value.followed});\n });\n\n });\n}", "function userinfo_requester_routines() {\n\n}", "function processUser(){\n var parameters = location.search.substring(1).split(\"&\");\n var temp = parameters[0].split(\"=\");\n user = unescape(temp[1]);\n username = user;\n document.getElementById(\"curUser\").innerHTML = user;\n\n temp = parameters[1].split(\"=\");\n id = unescape(temp[1]);\n document.getElementById(\"idname\").innerHTML = id;\n if (typeof id !== 'undefined') {\n $.ajax({\n url: '/checkBuyer?id=' + id + '&username=' + user,\n type: 'GET',\n dataType: 'json',\n success: function (response){\n if (response == \"0\") {\n window.location = \"./login.html\";\n }else {\n buildHtml ();\n }\n }\n });\n }\n else {\n window.location = \"./login.html\";\n }\n}", "checkNewUserEnter(){\n if(this.props.isNewUser===true){\n return this.signUp()\n }\n else{\n return this.logIn()\n }\n }", "function getCurrentUser() {\n // SERVER_CALL Get information of user profile from server\n // For now return fake user we created\n user = patientList[0];\n}", "getCurrentUser() {\r\n return this.users[0];\r\n }", "async fetchUser(){\n\t\treturn res.status(200).send({\n\t\t\tmessage: 'Successful Operation',\n\t\t\tuser: req.user\n\t\t})\n\t}", "function findUser() {\n\t\tvar myUser;\n\n\t\t// Get the username value from the form and cleanup the @ if needed\n\t\tif (document.tweetfinder.user.value[0] == \"@\") {\n\t\t\tmyUser = document.tweetfinder.user.value.substring(1,20); //get rid of the @\n\t\t}\n\t\telse { myUser = document.tweetfinder.user.value };\n\n\t\t// Validate length of username\n\t\tif (myUser.length > 16) { // TODO: if true, return error msg and don't continue\n\t\t\t$('#error').html(\"This doesn't seem to be a username. Too long.\");\n\t\t\treturn \"usernameistoolong\";\n\t\t}\n\t\telse {\n\t\t\treturn myUser;\n\t\t}\n}", "function getUser(id) {\n return \"Akhil\";\n}", "function getUserId(req, res, next){\r\n\tlet send;\r\n\r\n\tUser.findOne()\r\n\t.where({_id:req.params.userID})\r\n\t.exec(function(err, result){\r\n\t\tif(err){\r\n\t\t\tres.status(500).send(\"No such person exist Maybe try logging in on the home page! and error => \" + err);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// if the privacy is true then the user can not see the page and is exited from the program\r\n\t\tif (req.session.username != result.username && result.privacy == true){\r\n\t\t\tres.status(403).send(\"YOU CAN NOT ACCESS DUE TO PRIVACY REASON!! BY THE PROFILE OWNER!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// display the result for testing and confirmation\r\n\t\t// console.log(result);\r\n\t\t// building response object to be rendered\r\n\t\tsend = result;\r\n\t\t// now we made a place where we can access the this all overa gain elsewhere\r\n\t\treq.session.user = result;\r\n\t\tsend.sessionName = req.session.username;\r\n\r\n\t\t// display the session username for testing and confirmation\r\n\t\tconsole.log(\"send.username \" + send.sessionName);\r\n\r\n\t\t// renders the page\r\n\t\tres.render(\"pages/userProfile\" , {result:send , id:req.session.userId})\r\n\t})\r\n}", "function authenticate_user(res, mysql, context, us, pw, complete){\n\tvar sql = 'SELECT user_id, email, member_since FROM users WHERE email=? AND password=?'\n\tvar inserts = [us, pw];\n\tmysql.pool.query(sql, inserts, function(err, results, fields){\n\t\t\tif(err){\n\t\t\t\tres.write(JSON.stringify(err));\n\t\t\t\tres.end();\n\t\t\t}\n\t\t\tcontext.user = results[0];\n\t\t\tif(typeof context.user === \"undefined\")\n\t\t\t{\n\t\t\t\tcontext.error = 1;\n\t\t\t}\n\t\t\tcomplete();\n\t\t});\n\t}", "function getUserById(userid) {\n}", "async AuthUser(parent, args, {req}) {\n try {\n let user = await UserModel.findOne({_id: req.user.user_id});\n\n if (user) {\n return user;\n }\n return null;\n } catch (err) {\n onError(err);\n }\n }", "function GetCurrentUser() {\r\n\t \r\n \tvar folder=GetFirstSelectedMsgFolder();\r\n\tvar identity = null;\t\r\n\tvar server;\r\n\t\r\n\ttry {\r\n\t\tif (folder){\r\n \t// Get the incoming server associated with this uri.\r\n \tserver = folder.server; \r\n \tidentity = getIdentityForServer(server);\r\n \t} \r\n \t}catch (ex){\r\n\t\tgConsole.logStringMessage(\"ximfmail error - failed to get an identity to pre-select: \" + error);\r\n\t return \"\";\r\n\t}\r\n\tif(identity){\r\n \t\tgCurrentIdentity=identity;\r\n \t\tvar prefName=\"mail.identity.\"+identity.key+\".useremail\"; \t\t\r\n \t\ttry{\r\n \t\t\tif(gXBranch.prefHasUserValue( prefName ))\r\n \t\t\treturn gXBranch.getCharPref(prefName); \t\t\r\n \t\t}catch(exp){ \t\r\n\t\t\tgConsole.logStringMessage(\"ximfmail error - failed to get the prefence account type : \" + error);\r\n\t \t}\r\n \t}\t\r\n}", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\tloaderService.toggle(false);\n\t\t\t\t$state.go('otp');\n\t\t\t}\n\t\t}", "function loginSuccess(res) {\n $state.go('users.routes', {\n username: res.user.username\n });\n }", "function findCurUser(username) {\n return username.username == curAcc.username;\n}", "user(...args) {\n // emit to eden\n return this.eden.call('slack.user', Array.from(args), true);\n }", "async setUser() {\n return Channel.promptedMessage('What\\'s your username?\\n\\n> ');\n }", "function GetUser() {\n showUsers(dataUsers[currentPage]);\n}", "function getUser(req,res){\n var userId = req.params.id;\n\n User.findById(userId, (err, user) => {\n if(err) return res.status(500).send({message: 'Error en la peticion'})\n\n if(!user) return res.status(404).send({message: 'El usuario no existe'})\n\n followThisUser(req.user.sub, userId).then((value) =>{\n user.password = undefined;\n return res.status(200).send({user,following : value.following, followed : value.followed})\n })\n\n })\n}", "redirect() {\n if( Meteor.user() && Meteor.user().profile.isDriver) {\n window.location.replace(FlowRouter.path('Make Offers'));\n }\n if (Meteor.user() && (! Meteor.user().profile.isDriver)) {\n window.location.replace(FlowRouter.path('Request Pickup'));\n }\n return !!Meteor.userId();\n }", "function findUser() {\n\t\tconsole.log(this, this.value);\n\n\t\t$.ajax({\n\t\t\ttype: 'GET', \t\t// define the type of HTTP verb we want to use (POST for our form)\n\t\t\turl: '/users/all?searchTerm='+this.value+'&searchBy=name', // the url where we want to POST\n\t\t\tdataType: 'json', \t// what type of data do we expect back from the server\n\t\t\tencode: true\n\t\t})\n\t\t// using the done promise callback\n\t\t.done(function(data) {\n\t\t\t_bindTemplate(\"#entry-template\", data, '#sample-data');\n\t\t});\n\t}", "check() {\n return this.user();\n }", "function handleGetUser(event) {\n if (DEBUG) {\n console.log (\"Triggered handleGetUser\");\n }\n\n event.preventDefault();\n $(\"#user_list li\").removeClass(\"active\");\n\n // Make the user element 'active' visually\n $(this).parent().addClass(\"active\");\n\n prepareUserDataVisualization();\n\n var url = $(this).attr(\"href\");\n get_user(url);\n\n return;\n}", "getNextUser() {\r\n return this.users[1];\r\n }", "function getUserByAuthId(authId){\r\n //console.log(email);\r\n BackandService.getUserByAuthId(authId).then(function(result){\r\n\r\n $scope.user = result.data[0];\r\n //console.log(result.data);\r\n console.log(result.data[0]);\r\n \r\n if (result.data[0] == null)\r\n {\r\n console.log(\"New User - > \" + authId);\r\n $scope.isNew = true; \r\n }\r\n else\r\n {\r\n initUserSession(result);\r\n $scope.isNew = false; \r\n }\r\n\r\n growl.success(\"\" ,{title: 'Login Success!'});\r\n $scope.loading = false;\r\n //setFooter($scope.user_type);\r\n $state.go('home'); \r\n\r\n });\r\n }", "function getCurrentUserData(){\n\n ApiCalls.getCurrentUser()\n .then((res) => {\n //console.log(\"current\" ,res.data);\n setCurrentUser(res.data);\n }\n ) \n}", "function handleGetUser(event) {\n\tif (DEBUG) {\n\t\tconsole.log (\"Triggered handleGetUser\")\n\t}\n\t//TODO 2\n\t// This event is triggered by the a.user_link element. Hence, $(this)\n\t// is the <a> that the user has pressed. $(this).parent() is the li element\n\t// containing such anchor.\n\t// Use the method event.preventDefault() in order to avoid default action\n // for anchor links.\n\tevent.preventDefault();//Avoid default link behaviour\n\t// Remove the class \"selected\" from the previous #user_list li element and\n\t// add it to the current #user_list li element. Remember, the current \n\t// #user_list li element is $(this).parent()\n\n // e.target is the clicked element!\n // If it was a list item\n $(this).parent().parent().children().each(function(){\n var user = $(this).children();\n if(user.hasClass(\"selected\")){\n user.removeClass(\"selected\");\n }\n });\n $(this).addClass(\"selected\");\n\t// Finally extract the href attribute from the current anchor ($(this)\n\t// and call the method getUser(url) to make the corresponding HTTP call \n\t// to the RESTful API. You can extract an HTML attribute using the \n\t// attr(\"attribute_name\") method from JQuery.\n var url = $(this).attr(\"href\");\n getUser(url);\n\n\treturn false; //IMPORTANT TO AVOID <A> DEFAULT ACTIONS\n}", "function getUser() {\n return user;\n }", "getUser(id){\n //postDB(\"user/Get\", { \"use_id\" : id });\n return { \"name\" : \"steven\", \"img\" : '', \"share\" : false };\n }", "get user() {\n return ( async () => this._user || await this.retrieve() )();\n }", "function newUser(){\r\r\n}", "function returnUser(userName) {\n return \"Welcome to Kodiri \" + userName;\n return `Welcome to Kodiri ${userName}`;\n}", "function fetchUser() {\n // do network request in 10 secs...\n return 'yuna';\n}", "function login() {\n let username = 'Andre';\n function displayUser() {\n console.log(\"Thanks for logging in \" + username + \"!\" + \" would you like to see your daily reports!\");\n }\n return displayUser();\n}", "static fetchUser(userid) {\r\n\t\treturn shen.db.fetchUser(userid).then(users => {\r\n\t\t\tif(users.length == 0) // user doesn't exist\r\n\t\t\t\tthrow new ReferenceError(\"This user does not exist.\");\r\n\t\t\treturn users[0];\r\n\t\t});\r\n\t}", "static async getLogin(ctx) {\n const context = ctx.flash.formdata || {};\n\n // user=email querystring?\n if (ctx.request.query.user) context.username = ctx.request.query.user;\n\n if (context.username) {\n // if username set & user has access to more than one org'n, show list of them\n const [ usr ] = await User.getBy('email', context.username);\n if (usr && usr.databases.length>1) context.databases = usr.databases;\n }\n\n await ctx.render('login', context);\n }", "async function getAndReturnUserData(username){\n let res = await fetch(config_data.baseUrl, {\n method: \"POST\",\n headers: config_data.headers,\n body: JSON.stringify(config_data.query_function(username))\n });\n\n let userdata = await res.json();\n\n if(userdata.errors){\n\n if(userdata.errors[0].type =\"NOT_FOUND\"){\n showErrors(\"😢 I'm sorry, I couldn't find that user\");\n };\n return;\n }\n\n localStorage.setItem(\"Git-user-data\", JSON.stringify(userdata) );\n console.log(userdata);\n location.href =\"profile.html\";\n return userdata;\n }", "function demoGithubUser() {\n let name = prompt(\"Enter a name?\", \"iliakan\");\n\n return loadJson(`https://api.github.com/users/${name}`)\n .then((user) => {\n alert(`Full name: ${user.name}.`);\n return user;\n })\n .catch((err) => {\n if (err instanceof HttpError && err.response.status == 404) {\n alert(\"No such user, please reenter.\");\n return demoGithubUser();\n } else {\n throw err;\n }\n });\n}", "function loginUserCallback() {\n loginUser();\n }", "function checkOwnership(req,res,next){\n\tif(req.isAuthenticated()){\n\t\tUser.findOne({username: req.params.id},function(err,user){\n\t\t\tif(err){\n\t\t\t\tres.redirect(\"back\");\n\t\t\t}else{\n\t\t\t\tif(user.username===req.user.username){\n\t\t\t\t\tnext();\n\t\t\t\t}else{\n\t\t\t\t\tres.redirect(\"back\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}else{\n\t\tres.redirect(\"back\");\n\t}\n}", "user(username) {\n return this.request(`/users/${username}`);\n }", "async user(parent,{id},{dataSources}) { \n const user = await dataSources.users.getUser(id)\n return user;\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 demoGithubUser() {\n let name = prompt('Enter a name?', 'iliakan');\n\n return loadJson(`https://api.github.com/users/${name}`)\n .then(user => {\n alert(`Full name: ${user.name}.`);\n return user;\n })\n .catch(err => {\n if (err instanceof HttpError && err.response.status == 404) {\n alert('No such user, please reenter.');\n return demoGithubUser();\n } else {\n throw err;\n }\n });\n}", "async me(_, args, { user }) {\n\t\t\t// console.log(user);\n\t\t\t// make sure user is logged in\n\t\t\tif (!user) {\n\t\t\t\tthrow new Error('You are not authenticated!');\n\t\t\t}\n\n\t\t\t// user is authenticated\n\t\t\treturn await User.findByPk(user.id);\n\t\t}", "function directUserAfterAuth(response) {\n if (response.id) { // user found\n createAuthState(response.firstName, response.lastName, response.email);\n getBillsForUser(response.email);\n $('.username').append(response.firstName + '.');\n\n modal.style.display = 'none';\n $('#addbillcard').show();\n $('#viewbills').show();\n $('html, body').animate({\n scrollTop: ($('#addbillcard').offset().top)\n }, 200);\n } else {\n alert('Please enter a valid email address OR make an account.');\n }\n }", "async function manageUser()\n{\n\tlet server = objActualServer.server\n\tlet txt = \"Choissisez la personne que vous souhaitez manager : \"\n\n\tlet choice = [\n\t{\n\t\tname: \"Retournez au menu précédent\",\n\t\tvalue: -1\n\t}]\n\tchoice.push(returnObjectLeave())\n\tserver.members.forEach((usr) =>\n\t{\n\t\tlet actualUser = usr.user\n\t\tchoice.unshift(\n\t\t{\n\t\t\tname: actualUser.username,\n\t\t\tvalue: actualUser\n\t\t})\n\t})\n\n\tlet data = await ask(\n\t{\n\t\ttype: \"list\",\n\t\tname: \"selectedUser\",\n\t\tmessage: txt,\n\t\tchoices: choice,\n\t})\n\n\tif (data.selectedUser == -1)\n\t{\n\t\tchooseWhatToHandle(data)\n\t}\n\telse if (data.selectedUser == -2)\n\t{\n\t\tendProcess()\n\t}\n\telse\n\t{\n\t\tmanageSingleUser(data.selectedUser)\n\t}\n\n}", "function getOneUser(req, res, next) {\n oneUserDetails(req, res).then((result) => {\n return res.status(200).json(result);\n }).catch((err) => {\n next(err);\n });\n}", "function getOtherUserNameById(id) {\n // codigo\n return \"Regulus\";\n}", "function currentUser(callback) {\n\tsendRequest({ request: 'current user' }, callback);\n}", "function getUser(req, res) {\n var userId = req.params.id;\n User.findById(userId, (err, user) => {\n if (err)\n return res.status(500).send({message: 'Error en la petición'});\n if (!user)\n return res.status(404).send({message: 'El usuario no existe'});\n followThisUser(req.user.sub, userId).then((value) => {\n user.password = undefined;\n return res.status(200).send({\n user,\n \"following\": value.following,\n \"followed\": value.followed\n });\n });\n });\n}", "function checkUser() {\n $.get(\"/api/user_data\").then(function (data) {\n userId = data.id;\n console.log(userId);\n return userId;\n });\n }", "function setUser(){\n\t\tvar token = {token: Auth.getToken()}\n\t\t$http({\n\t\t\turl: 'api/me', \n\t\t\tmethod: \"GET\",\n\t\t\tparams: {token: Auth.getToken()}\n\t\t }).then(successCallback, errorCallback);\n\t//$http.get('api/me', token).then(successCallback, errorCallback);\t\n\tfunction successCallback(result){\n\n\t\tif ( typeof result.data.username != 'undefined'){\n\t\t\t$http.get('api/users/username:' + result.data.username, token).then(successCallback, errorCallback);\n\t\t\tfunction successCallback(result){\n\t\t\t\tvm.user = result.data[0] \n\t\t\t\tconsole.log(result);\n\t\t\t\treturn vm.user;\n\t\t\t}\n\t\t\tfunction errorCallback(result){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn vm.user;\n\t\t}\n\t } \n\t function errorCallback(result){\n\t\t console.log( result)\n\t\t return null;\n\t }\n\t}", "UnknownFlightRequestUser() {\n req.flash('error', 'Error finding user associated with flight request.')\n this.redirectFailiure()\n }", "static async getCurrentUser(username) {\n let res = await this.request(`users/${username}`);\n return res.user;\n }" ]
[ "0.70447403", "0.6671202", "0.66637987", "0.6657244", "0.66301143", "0.65965635", "0.6594804", "0.6575853", "0.6575853", "0.6560633", "0.6511188", "0.6505736", "0.649421", "0.64578", "0.6443375", "0.6402335", "0.6399545", "0.63886416", "0.63550997", "0.6350499", "0.6336117", "0.6300185", "0.6290445", "0.6262338", "0.62538296", "0.6231404", "0.62299347", "0.6223996", "0.62172127", "0.6210506", "0.62027866", "0.619922", "0.6193992", "0.6190866", "0.6187174", "0.6156766", "0.61423486", "0.6141101", "0.6140728", "0.6132788", "0.6125991", "0.61134124", "0.61074513", "0.6107304", "0.6104158", "0.6095183", "0.6092981", "0.60878396", "0.60846305", "0.6081486", "0.60759914", "0.6075756", "0.6070483", "0.606717", "0.6066452", "0.60449225", "0.6040971", "0.6038706", "0.6037812", "0.60367846", "0.60348326", "0.6034626", "0.6027703", "0.6023188", "0.60176617", "0.6017106", "0.60083383", "0.6002359", "0.6000595", "0.5989661", "0.59767413", "0.5969081", "0.59675616", "0.596637", "0.59590083", "0.59575504", "0.59571576", "0.59564227", "0.5949619", "0.5948802", "0.59454936", "0.5944336", "0.59391665", "0.59389484", "0.5934026", "0.5928761", "0.59244627", "0.5916934", "0.5910334", "0.5909271", "0.5907321", "0.5906519", "0.5894971", "0.58932877", "0.58869267", "0.58853245", "0.58779925", "0.5875636", "0.5874845", "0.58691794", "0.58667684" ]
0.0
-1
for each of these functions so as the data funnels through we can see the output
function applyTaxToItems(user){ return user }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "outputs (_outputs) {\n for (let output in _outputs) {\n this.output(output, _outputs[output]);\n }\n }", "function getvals(mot) {\n// let v = mot.call('stat',null, (data, opt) => { console.log(\"call: \",JSON.stringify(data),typeof opt==='undefined'?\"\":opt); });\nlet v1 = mot.stat((data) => { \n //console.log(\"stat: \",JSON.stringify(data)); \n});\nlet v2 = mot.pos((data) => { \n //console.log(\"stat: \",JSON.stringify(data)); \n});\n}", "function mapFunction () {\n\n\t//list of events that are relevant for the behaviour to be found\n\t//var eventArray = [\"mousewheel\"];//\"scroll\",mouseUpEvent,\"keydown\"];\n\n\t//we filter out the events we don't want to consider\n\t//if (eventArray.indexOf(this.event) > -1){\n\t\t/*\n\t\t * \"emit\" function takes two arguments: 1) the key on which to group the data, 2) data itself to group. Both of them can be objects ({this.id, this.userId},{this.time, this.value}) for example\n\t\t */\n\t\t//emit({sid:this.sid, sessionstartms:this.sessionstartms, url:this.url, urlSessionCounter:this.urlSessionCounter},\n\t\temit({sid:this.sid, url:this.url, urlSessionCounter:this.urlSessionCounter},\n\t\t\t\t{ \"episodeEvents\":\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tevent:this.event,\n\t\t\t\t\t\t\ttimestamp:this.timestamp,\n\t\t\t\t\t\t\ttimestampms:this.timestampms,\n\t\t\t\t\t\t\tsid:this.sid,\n\t\t\t\t\t\t\tip:this.ip,\n\t\t\t\t\t\t\turl:this.url,\n\t\t\t\t\t\t\tsessionstartms:this.sessionstartms,\n\t\t\t\t\t\t\tsessionstartparsed:this.sessionstartparsed,\n\t\t\t\t\t\t\tvisitCounter:this.visitCounter,\n\t\t\t\t\t\t\tvisitDuration:this.visitDuration,\n\n\t\t\t\t\t\t\tsdSessionCounter:this.sdSessionCounter,\n\t\t\t\t\t\t\tsdTimeSinceLastSession:this.sdTimeSinceLastSession,\n\t\t\t\t\t\t\turlSessionCounter:this.urlSessionCounter,\n\t\t\t\t\t\t\turlSinceLastSession:this.urlSinceLastSession,\n\t\t\t\t\t\t\turlEpisodeLength:this.urlEpisodeLength,\n\n\t\t\t\t\t\t\tepisodeUrlActivity: this.episodeUrlActivity,\n\t\t\t\t\t\t\tepisodeSdActivity: this.episodeSdActivity,\n\n\n\t\t\t\t\t\t\thtmlSize : this.htmlSize,\n\t\t\t\t\t\t\tresolution : this.resolution,\n\t\t\t\t\t\t\tsize : this.size,\n\t\t\t\t\t\t\tusableSize : this.usableSize,\n\n\t\t\t\t\t\t\tidleTime:this.idleTime,\n\t\t\t\t\t\t\tcalculatedActiveTime:this.calculatedActiveTime,\n\t\t\t\t\t\t\tidleTimeSoFar:this.idleTimeSoFar,\n\t\t\t\t\t\t\tsdCalculatedActiveTime:this.sdCalculatedActiveTime,\n\n\t\t\t\t\t\t\tusertimezoneoffset:this.usertimezoneoffset,\n\t\t\t\t\t\t\tmouseCoordinates:this.mouseCoordinates,\n\t\t\t\t\t\t\tnodeInfo:this.nodeInfo,\n\t\t\t\t\t\t\tcount:1\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t);\n\t//}\n}", "function getFunnelDataMap() {\n return {\n impressionsFunnelValue: {\n metric: 'impressions',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n reachFunnelValue: {\n metric: 'reach',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n actionsFunnelValue: {\n metric: 'actions',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n clicksFunnelValue: {\n metric: 'clicks',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n\n impressionsValue: {\n metric: 'impressions',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n impressionsChangeValue: {\n metric: 'impressions',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n impressionsChangePercent: {\n metric: 'impressions',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent')\n },\n\n reachValue: {\n metric: 'reach',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n reachChangeValue: {\n metric: 'reach',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n reachChangePercent: {\n metric: 'reach',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent')\n },\n\n actionsValue: {\n metric: 'actions',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n actionsChangeValue: {\n metric: 'actions',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n actionsChangePercent: {\n metric: 'actions',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent')\n },\n\n clicksValue: {\n metric: 'clicks',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n clicksChangeValue: {\n metric: 'clicks',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n clicksChangePercent: {\n metric: 'clicks',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent')\n }\n };\n}", "getData() {\n\n this.getAbi(`/input_abi/${this.getInput(\"sourceAbi\")}`).then(data =>{\n this.addAbi(data)\n }).then(()=>{\n d3.csv(`/input_data/${this.getInput(\"sourceData\")}`).then(data => {\n return this.methodNumberOfCalls(data);\n }).then(data => {\n // data [0] is the # of functions calls\n // data [1] is the average gas expense\n this.drawPieChart(410, 400, 0, \"#plot1\", data[0], 200, \"Number of calls\");\n this.drawPieChart(410, 400, 0, \"#plot2\", data[1], 200, \"Average Gas expense\");\n //this.drawBarChart(data[1], \"#plot2\", 400, 400);\n this.relateToUml(Object.keys(data[0]), \"#uml\");\n\n });\n });\n\n }", "function showALL(data){\n\t*autistic screeching*\n\tconsole.log(data);\n}", "function runner(data, functs) {\n functs.forEach(element => {\n var result = element.funct(data);\n console.log(\"Result: \" + result);\n if (element.hasOwnProperty('exp')) {\n assert(result == element.exp)\n }\n });\n}", "function loopingData2() {\n\n}", "function combine_data(vis_function_args) {\n\n return function(error, raw_school_data, raw_state_data) {\n\n // Select the fields we want from school data\n raw_school_data.forEach(function(d) {\n school_data.push({\n college: d.college_name,\n state: d.state,\n college_type: d.type_des,\n campus_type: d.campus_des,\n median_income: +d.median_family_income,\n mean_price: +d.avg_net_price,\n median_earnings: +d.median_earnings,\n completion_rate: +d.completion_rate,\n median_debt_withdrawn: +d.debt_withdrew,\n median_debt_graduated: +d.debt_graduated,\n repayment_rate: +d.repayment_rate\n });\n });\n\n // Filter out schools in territories, not states\n school_data = school_data.filter(function(d) {\n return d.state in state_abbr;\n });\n\n // Filter out school records with non-number values in numerical fields\n school_data = school_data.filter(function(d) {\n var number_fields =\n [\"median_income\", \"mean_price\", \"median_earnings\",\n \"completion_rate\", \"median_debt_graduated\",\n \"median_debt_withdrawn\", \"repayment_rate\"];\n\n for (var i=0; i < number_fields.length; i++) {\n var property_value = d[number_fields[i]];\n if (isNaN(property_value) || property_value <= 0) {\n return false;\n }\n }\n return true;\n });\n\n // Select the fields we want from state data\n raw_state_data.forEach(function(d) {\n this.state_data.push({\n state: d.State,\n year: d.FiscalYear,\n inflation: 1/(+d.InflationDenom),\n cost_of_living: +d.CostOfLiving,\n state_funding: +d.StateSupport,\n ft_students: +d.FTEnrollment,\n funding_per_student: +d.StateSupport / +d.FTEnrollment\n });\n });\n\n // Filter out state records with non-number values in numerical fields\n state_data = state_data.filter(function(d) {\n var number_fields =\n [\"inflation\", \"cost_of_living\",\n \"state_funding\", \"ft_students\"];\n\n for (var i=0; i < number_fields.length; i++) {\n var property_value = d[number_fields[i]];\n if (isNaN(property_value) || property_value <= 0) {\n return false;\n }\n }\n return true;\n });\n\n // Group state data by state then year\n var nested_state_data = d3v4.nest()\n .key(function(d) { return abbrOf(d.state); })\n .sortKeys(d3v4.ascending)\n .key(function(d) { return d.year; })\n .sortKeys(d3v4.ascending)\n .entries(state_data);\n\n // Pull aggregate data from school file\n var aggregate_data = d3v4.nest()\n .key(function(d) { return d.state; }).sortKeys(d3v4.ascending)\n .rollup(function(states) {\n return {\n median_earnings: d3v4.median(states,\n function(d) { return d.median_earnings; }),\n median_debt: d3v4.median(states,\n function(d) { return d.median_debt_graduated; }),\n mean_price: d3v4.mean(states,\n function(d) { return d.mean_price; }),\n repayment_rate: d3v4.mean(states,\n function(d) { return d.repayment_rate; }),\n completion_rate: d3v4.mean(states,\n function(d) { return d.completion_rate; })\n };\n }).entries(school_data);\n\n // Add aggregated school data to state data\n for (var i=0; i < aggregate_data.length; i++) {\n var last = nested_state_data[i].values.length - 1;\n for (var property in aggregate_data[i].value) {\n nested_state_data[i].values[last].values[0][property] =\n aggregate_data[i].value[property];\n }\n }\n\n // Simplify nested data structure\n for (var j=0; j < nested_state_data.length; j++) {\n var state = nested_state_data[j];\n state_data[state.key] = [];\n for (var k=0; k < state.values.length; k++) {\n var year = state.values[k];\n state_data[state.key].push(year.values[0]);\n }\n }\n\n // Calculate national average statistics\n var state_last_year = get_year_data(\"2015\", this.state_data);\n this.national_avgs = {\n median_earnings: d3v4.median(state_last_year,\n function(d) { return d.median_earnings; }),\n median_debt: d3v4.median(state_last_year,\n function(d) { return d.median_debt; }),\n mean_price: d3v4.mean(state_last_year,\n function(d) { return d.mean_price; }),\n repayment_rate: d3v4.mean(state_last_year,\n function(d) { return d.repayment_rate; }),\n completion_rate: d3v4.mean(state_last_year,\n function(d) { return d.completion_rate; })\n };\n\n buildMap(vis_function_args);\n };\n}", "function logResults() {\n console.log(\"Experiment Complete!!\" );\n \n console.log(\"\\nFinal number of points in graphs:\");\n console.log(\"G1: \" + G1.numPoints);\n console.log(\"G2: \" + G2.numPoints);\n console.log(\"G3: \" + G3.numPoints);\n}", "function functionDelegator() {\n colorCalc();\n showColors();\n displayHex();\n displayRGB();\n displayHSL();\n}", "function loopData() {\n\n}", "function MultiFlattener() {}", "function run_all_scripts_data()\n\n{\n \n \n runDemo_test();\n runDemo_tiscali();\n runDemo_gnocca();\n \n// runDemo_test_events();\n// runDemo_test_events_2();\n// runDemo_tiscali_events ();\n}", "helpData() {\n console.log(\"2) finsemble.bootConfig timeout values\");\n console.log(\"\\tstartServiceTimeout value\", this.startServiceTimeout);\n console.log(\"\\tstartComponentTimeout value\", this.startComponentTimeout);\n console.log(\"\\tstartTaskTimeout value\", this.startTaskTimeout);\n console.log(\"\");\n console.log(\"3) Current boot stage:\", this.currentStage);\n console.log(\"\");\n console.log(`4) Lastest/current status of dependencyGraph for ${this.currentStage} stage`, this.dependencyGraphs[this.currentStage].getCurrentStatus());\n console.log(\"\");\n console.log(\"5) Dependency graphs by stage\", this.dependencyGraphs);\n console.log(\"\");\n console.log(\"6) Boot config data by stage\", this.bootConfigs);\n console.log(\"\");\n console.log(\"7) Active Checkpoint Engines\", this.checkpointEngines);\n console.log(\"\");\n console.log(\"8) Registered tasks\", this.registeredTasks);\n console.log(\"\");\n console.log(\"9) List of outstanding start timers\", this.startTimers);\n console.log(\"\");\n console.log(\"10) Dependency graphs display by stage\");\n this.outputDependencyGraphs(this.dependencyGraphs);\n console.log(\"\");\n }", "function output(result){ console.log(result); }", "function getConversionFunnelMap() {\n return {\n impressionsFunnelValue: {\n metric: 'impressions',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n reachFunnelValue: {\n metric: 'reach',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n clicksFunnelValue: {\n metric: 'clicks',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n conversionVolumeFunnelValue: {\n metric: 'conversionVolume',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n\n impressionsValue: {\n metric: 'impressions',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n impressionsChangeValue: {\n metric: 'impressions',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n impressionsChangePercent: {\n metric: 'impressions',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent'),\n formatters: [\n dataFormatters.decimalToPercent\n ]\n },\n\n reachValue: {\n metric: 'reach',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n reachChangeValue: {\n metric: 'reach',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n reachChangePercent: {\n metric: 'reach',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent'),\n formatters: [\n dataFormatters.decimalToPercent\n ]\n },\n\n clicksValue: {\n metric: 'clicks',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n clicksChangeValue: {\n metric: 'clicks',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n clicksChangePercent: {\n metric: 'clicks',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent'),\n formatters: [\n dataFormatters.decimalToPercent\n ]\n },\n\n conversionVolumeValue: {\n metric: 'conversionVolume',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n conversionVolumeChangeValue: {\n metric: 'conversionVolume',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n conversionVolumeChangePercent: {\n metric: 'conversionVolume',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent'),\n formatters: [\n dataFormatters.decimalToPercent\n ]\n }\n };\n}", "function outputPanelData(i, data) {\n console.log(data);\n\n dataBindings[i].outputData({\n title: panelParams[i].funnel[0].title || panelParams[i].funnel[0].kind || \"All\",\n subtitle: panelParams[i].funnel[0].property || \"\",\n text: \"\"\n });\n\n var chartData;\n if (Object.prototype.toString.call(data) == \"[object Array]\") {\n if (Object.keys(data[0]).includes(\"interval\")) {\n $(dataBindings[i]._el).find(\".content\")\n .html('<canvas id=\"chart' + i + '\" width=\"\" height=\"300\"></canvas>');\n // we know the \"interval\" key, find the other one\n var keys = Object.keys(data[0]).slice(); // copy don't mutate\n keys.splice(keys.indexOf(\"interval\"), 1);\n var key = keys[0];\n new Chart(document.getElementById(\"chart\" + i).getContext(\"2d\")).Line({\n labels: data.map(function(v) { return v.interval; }),\n datasets: [{\n label: key,\n fillColor: \"#FE9B08\",\n data: data.map(function(v) { return (v[key] * 1); })\n }]\n });\n }\n else {\n $(dataBindings[i]._el).find(\".content\")\n .html('<canvas id=\"chart' + i + '\" width=\"\" height=\"300\"></canvas>');\n var keys = Object.keys(data[0]).slice(); // copy don't mutate\n var key = keys[0];\n new Chart(document.getElementById(\"chart\" + i).getContext(\"2d\")).Line({\n labels: data.map(function() { return key; }),\n datasets: [{\n label: key,\n fillColor: \"#FE9B08\",\n data: data.map(function(v) { return (v[key] * 1); })\n }]\n });\n }\n }\n else if (Object.prototype.toString.call(data) == \"[object Object]\") {\n if (data.funnel) {\n if (data.funnel.length == 2) {\n dataBindings[i].outputData({ text: (+parseFloat(data.funnel[1].percent).toFixed(2)) + \"%\" });\n }\n else {\n $(dataBindings[i]._el).find(\".content\")\n .html('<canvas id=\"chart' + i + '\" height=\"300\"></canvas>');\n new Chart(document.getElementById(\"chart\" + i).getContext(\"2d\")).Bar({\n labels: data.funnel.map(function(v) { return v.label + \" (\" + v.value + \")\"; }),\n datasets: [{\n label: \"Funnel\",\n fillColor: \"#14A2FF\",\n data: data.funnel.map(function(v) { return v.percent; })\n }]\n });\n dataBindings[i].outputData({\n title: (data.funnel[0].label || \"All\") + \" - \" + (data.funnel[data.funnel.length - 1].label || \"All\"),\n subtitle: \"\"\n });\n }\n }\n else {\n // new Chart(document.getElementById(\"chart\" + i).getContext(\"2d\")).Bar({\n // labels: Object.keys(data),\n // datasets: [{\n // label: \"\",\n // fillColor: \"rgba(50, 100, 200, 0.6)\",\n // data: Object.keys(data).map(function (k) { return data[k]; })\n // }]\n // });\n $(dataBindings[i]._el).find(\".content\")\n .html('<canvas id=\"chart' + i + '\" height=\"300\"></canvas>');\n new Chart(document.getElementById(\"chart\" + i).getContext(\"2d\")).Doughnut(\n Object.keys(data).map(function (k) {\n return {\n label: k,\n value: data[k]\n };\n })\n );\n }\n }\n else { // Number\n dataBindings[i].outputData({ text: data });\n }\n}", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "function formatAllData([differentData, sameData], sourceOne, sourceTwo) {\n var out = '';\n for (var i in differentData) {\n\n out += \"<li class='descrepancy-data red-text'> <span>\" + space(differentData[i]) + \"</span> &nbsp;\" + \"<em class='tooltip' data-tip='HouseCanary'>\" + sourceOne[differentData[i]] + \"</em>\" + \"&nbsp;&nbsp;|\" + \"<em class='tooltip' data-tip='LPS'>\" + sourceTwo[differentData[i]] + \" </em> </li>\"\n }\n for (var i in sameData) {\n out += \"<li class='consensus-data'> <span>\" + space(sameData[i]) + \"</span> &nbsp;\" + sourceOne[sameData[i]] + \"</li>\"\n }\n return out\n}", "da () {\n\t\tfor (let i = 0; i < 3; i++)\n\t\t\tthis.d();\n\t}", "function accessesingData1() {\n\n}", "function accessesingData1() {\n\n}", "function dataFunc(data) {\n console.log(data.getData());\n console.log(data.getColumns());\n }", "function Cnds() {}", "function displayStreamersData() {\n\t\t\t\t// foreach streamer get info from api\n\t\t\t\tstreamers.forEach(function (streamerName) {\n\t\t\t\t\tgetStreamerData(streamerName);\n\t\t\t\t});\n\t\t\t}", "function displayData(dataSet, message = '')\r\n{\r\n // Typescrit this later\r\n console.log(\"-- \"+message+ \" --\");\r\n dataSet.map(x => console.log(x));\r\n}", "function callAllFunctions (){\n for (var i = 0; i < allStores.length; i++){\n allStores[i].hourlySalesCalculator();\n allStores[i].render();\n }\n}", "function dataRowCall(){\n for (var i in allStores){\n allStores[i].hourlyTrans();\n allStores[i].dailyTrans();\n allStores[i].render();\n }\n}", "function workshop() {\n\n end = shapeact.length\n start = end - 20\n // pts = shapechange.slice(start, end)\n actpts = shapeact.slice(start, end)\n\n //if shape has been added recently wait 25 iterations before finding a new one. prevent over crowding and counteractive shape reports\n //if at 10 point after the shape was determined (end of linear forecast) then output live data results to determine if profit or loss occured.\n //exports data to profit.js\n if (wait[0] == 1) {\n\n var arrayout1 = []\n arrayout2 = outdata()\n pipchange = mvmt[0]\n gold = profit[0]\n\n if (color[0] == 'green') {\n reco = \"Buy\"\n }\n else if (color[0] == 'red') {\n reco = \"Sell\"\n }\n\n arrayout1 = [pipchange, reco, gold]\n output = arrayout1.concat(arrayout2)\n\n console.log(output)\n\n newresult() \n \n mvmt.shift()\n profit.shift()\n }\n bors()\n}", "function runFuns(funArr){\n for(let el of funArr){\n sep(); \n var label = el[0], f = el[1]; \n console.log('Running ' + label);\n f();\n }\n}", "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}", "stitchData(stitchFunction) {\n let result = {}\n let queueLength = this.getCount()\n for(let i = 0;i<queueLength;i++) {\n stitchFunction(result,this.pop())\n }\n return result\n }", "run() {\n\t\tthis.boats.forEach( (boat) => {\n this.navigateShip(parseInt(boat[0]), parseInt(boat[1]), boat[2], boat[3])\n })\n\n console.log(this.output)\n\t}", "function getAllChannelDataTS(){\n getDataField1();\n getDataField2();\n getDataField3();\n getDataField4();\n getDataField5();\n getDataField6();\n getDataField7();\n getDataField8();\n }", "function dataLog(data) {\n console.log(\"--------------------\");\n console.log(data);\n console.log(\"--------------------\");\n}", "function callData() {\n for (let i = 0; i < 10; i++, index++) {\n let x = { post: data.colleges[index] };\n addDataToDOM(x);\n }\n lastLoaded = true;\n }", "function processData(allRows){\r\n\t\tlet date = [];\r\n\t\tlet peer = [];\r\n\t\tlet rockford = [];\r\n\t\tlet row;\r\n\t\r\n\t\tlet i = 0;\r\n\t\twhile (i < allRows.length) {\r\n\t\t\trow = allRows[i];\r\n\t\t\tdate.push(row[\"DATE\"]);\r\n\t\t\tpeer.push(row[\"Peer Average\"]);\r\n\t\t\trockford.push(row[\"Rockford\"]);\r\n\t\t\ti += 1;\r\n\t\t}\r\n\t\t\r\n\t\tmakePlotly(date, peer, rockford);\r\n\t\tconsole.log(date, peer, rockford);\r\n\t}//end of processData", "prepareDataUsageGraphData() {\n this.prepareUsageGraphData(\n this.streamUsageGraphData,\n this.streamData,\n 'logs_home_data_stream',\n );\n this.prepareUsageGraphData(\n this.archiveUsageGraphData,\n this.archiveData,\n 'logs_home_data_archive',\n );\n this.prepareUsageGraphData(\n this.indiceUsageGraphData,\n this.indiceData,\n 'logs_home_data_index',\n );\n }", "report() {\n //console.log.apply(console, arguments);\n reportfunc.apply(window, arguments);\n }", "function output(data) {\r\n console.log(data);\r\n}", "fire() {\n\t\tfor (var i = 0; i < this.outputs.length; i++) {\n\t\t\tthis.outputs[i].fire(this.activation);\n\t\t}\n\t}", "function getProcessResults() {\n StatusService.stopWaiting();\n getFlowRows();\n if ( $scope.paramGrid.dissipation) {\n $scope.compositionFlow = CompositionFlowService.get($scope.process.compositionFlowID);\n $scope.paramGrid.dissipation.extractData();\n }\n getLciaResults();\n }", "function on_all(){\n var res;\n var i;\n for ( i = 1; i<= 20; i++){\n res = i * i;\n console.log(res)\n }\n console.log(res)\n return res\n}", "function logResults(data) {\n console.log(data);\n}", "function drawFunctionPoints(func) {\n \n var point_options = {\n style: 6,\n withLabel: false\n };\n \n var xvals = $.map(func.data, function(o,i) { return pointFilter(o)[0]; });\n var yvals = $.map(func.data, function(o,i) { return pointFilter(o)[1]; });\n var x_min = Math.min.apply(this, xvals);\n var x_max = Math.max.apply(this, xvals);\n \n // create and bind event handler for each point\n var points = $.map(func.data, function(o,i) {\n \n var p = optimalApp.board.create('point', pointFilter(o), point_options);\n \n // mousemove highlight of data table\n JXG.addEvent(p.rendNode, 'click', function(e) {\n //selectFunction(func);\n }, p);\n \n // display tooltip when mouse is over function\n JXG.addEvent(p.rendNode, 'mouseover', function(e) {\n if (optimalApp.copyMode === true) {\n setTooltip('Drag to copy and edit function');\n } else {\n setTooltip('Drag to edit');\n }\n }, p);\n \n // clear tooltip when mouse is not over function\n JXG.addEvent(p.rendNode, 'mouseout', function(e) {\n setTooltip();\n }, p);\n \n // handle copying of functions\n JXG.addEvent(p.rendNode, 'mousedown', function(e) {\n if (!optimalApp.copyMode) return;\n addFunction(deepcopy(func.data));\n }, p);\n \n // handle editing of functions\n JXG.addEvent(p.rendNode, 'mouseup', function(e) {\n var newpoint = [p.coords.usrCoords[1], p.coords.usrCoords[2]];\n func.dataTable.setDataAtCell(i, 0, pointInvFilter(newpoint)[0]);\n func.dataTable.setDataAtCell(i, 1, pointInvFilter(newpoint)[1]);\n func.data[i][0] = pointInvFilter(newpoint)[0];\n func.data[i][1] = pointInvFilter(newpoint)[1];\n }, p);\n \n return p;\n });\n \n return points;\n}", "function iterativeLog(array1){\n//Call .forEach() on this array\n array1.forEach((element, index) => {\n//inside the callback,\n//log each element with the format\n//${index}: ${element}.\n console.log(`${index}: ${element}`)\n })\n}", "map(callback) {\n let result = [];\n for (let key in connections)\n if (connections[key] instanceof Function == false)\n if (!connections[key].data.irnore)\n result.push(callback(connections[key].data));\n return result;\n }", "function consoleLogs(){\n // console.log(\"API temperature is \" + tempApi);\n // console.log(\"expected Rain is \" + rainApi);\n // console.log(tempClient + \" is temperature of Client\")\n // console.log(\"type is \" + typeof tempClient)\n toClients(tempApi, rainApi, tempClient);\n}", "function main() {\n latestSimulationPrediction(),\n simulationPrediction()\n // latestAnalyticalPrediction(),\n // analyticalPrediction()\n // simulationPredictionKPIs(),\n analyticalPredictionKPIs()\n // startEvaluation(),\n // evaluationStatus(),\n // cancelEvaluation(),\n // simulatedEvaluation(),\n // simulatedEvaluationKPIs(),\n // setNowTime(),\n // getNowTime(),\n // ping()\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}", "forEach(callback) {\n for (let key in connections) {\n if (connections[key] instanceof Function == false)\n if (!connections[key].data.irnore)\n callback(connections[key].data);}\n }", "function listOutputs(event) {\nvar outputs=\"\";\nfor (var i = 0; i < event[\"outputs\"].length; i++) {\noutputs += event[\"outputs\"][i];\nif (i < event[\"outputs\"].length-1) {\noutputs += \", \";\n}\n}\nreturn outputs;\n}", "function runner(data, functs, name = \"Test\") {\n console.log(name);\n functs.forEach(element => {\n var result = element.funct(data);\n console.log(\" - \" + element.funct.name + \" result: \" + result + \", expected: \", element.exp);\n if (element.hasOwnProperty('exp')) {\n assert(result == element.exp)\n }\n });\n}", "function printValues(){\n /*console.log(inspection_data);\n console.log(report_data);\n console.log(iap_data);\n console.log(business_notes_data);*/\n\n noteBuilder();//should be called in new conversation\n\n}", "function Step1b(){\r\n\r\n d3.queue()\r\n .defer(d3.csv, \"../data/World_Exp_Full.csv\")\r\n .await(WorldExp);\r\n function WorldExp (error, incomingData) {\r\n d3.selectAll(\"#xAxisImp\").transition().duration(100).style(\"opacity\",0).remove()\r\n d3.selectAll(\"g#Glegend\").remove()\r\n // defining new colorScale on threshold basis. Need to rethink the clusters\r\n var exportColorScale = d3.scaleThreshold()\r\n .domain([1000000,1000000000,2000000000,4000000000, 9000000000,20000000000, 35000000000,70000000000])\r\n .range(d3.schemeGnBu[9])\r\n \r\n var newincomingData = incomingData.filter(function(d,i){return d.year===yearSet})\r\n var json = countries.features\r\n newincomingData.forEach(function(d, i) {\r\n json.forEach(function(e, j) {\r\n if (e.id === d.country_origin_id) {\r\n e.properties.export_val = d.export_val\r\n }\r\n });\r\n })\r\n\r\n // Change color of countries based on export\r\n MapGroupe.selectAll(\"path.countries\")\r\n .transition()\r\n .duration(1000)\r\n .attr(\"fill\", function(d){\r\n if (typeof d.properties.export_val!==\"undefined\"){\r\n return exportColorScale(d.properties.export_val)\r\n }\r\n else{\r\n d.properties.export_val=0\r\n return exportColorScale(0)}\r\n })\r\n\r\n // Set tooltip\r\n MapGroupe.selectAll(\"path.countries\")\r\n .on(\"mouseover\",function(d,i){\r\n d3.select(this).attr(\"fill\",\"#f5c373\").attr(\"stroke-width\",2);\r\n return tooltip.style(\"hidden\", false).html(d.properties.name);\r\n })\r\n .on(\"mousemove\",function(d){\r\n tooltip.classed(\"hidden\", false)\r\n .style(\"top\", (d3.event.pageY) + \"px\")\r\n .style(\"left\", (d3.event.pageX + 10) + \"px\")\r\n .html(\"country:\"+d.properties.name + \"<br> Export:\"+formatNum(d.properties.export_val)+\" $\");\r\n })\r\n .on(\"mouseout\",function(d,i){\r\n d3.select(this).attr(\"fill\", function(d){\r\n if (typeof d.properties.export_val!==\"undefined\"){\r\n return exportColorScale(d.properties.export_val)\r\n }\r\n else{\r\n return exportColorScale(0)}\r\n })\r\n .attr(\"stroke-width\",1);\r\n tooltip.classed(\"hidden\", true)\r\n })\r\n \r\n var sort = json.sort(function(a,b){return +b.properties.export_val- +a.properties.export_val})\r\n var filter = sort.filter(function(d,i){return i<5})\r\n\r\n d3.select(\"text.legendTitle\")\r\n .text(\"Top Five Gold Exporter [$]\") \r\n\r\n var scaleMax = parseInt(filter[0].properties.export_val)\r\n var scaleWidth = d3.scaleLinear().domain([0,scaleMax]).range([10,300])\r\n\r\n filter.forEach(function(e, j) {\r\n\r\n if (e.id === \"USA\") {\r\n e.properties.name = \"USA\" \r\n }\r\n if (e.id === \"ARE\") {\r\n e.properties.name = \"Emirates\" \r\n }\r\n })\r\n\r\n\r\n // barChart\r\n d3.selectAll(\"rect#barChart\")\r\n .data(filter)\r\n .transition().duration(1000)\r\n .style(\"fill\",\"rgb(48, 151, 199)\")\r\n .attr(\"width\", filter=>scaleWidth(parseInt(filter.properties.export_val)))\r\n\r\n teamG\r\n .data(filter)\r\n .select(\"text.graphLabel\")\r\n // change for full name country label\r\n .text(d=>d.properties.name)\r\n\r\n //Create scales \r\n var scaleMax = parseInt(filter[0].properties.export_val)\r\n var scaleWidth = d3.scaleLinear().domain([0,scaleMax]).range([10,300])\r\n\r\n //Scales + gradation de graduation \r\n var xScale = d3.scaleLinear().domain([0, scaleMax]).range([10, 300]);\r\n var xAxis = d3.axisTop()\r\n .scale(xScale)\r\n .tickSize(184)\r\n .ticks(3)\r\n \r\n d3.select(\"svg\").append(\"g\").attr(\"id\", \"xAxisImp\").call(xAxis)\r\n d3.selectAll(\"#xAxisImp\").attr(\"transform\",\"translate(\"+(width*0.55+120)+\",350)\")\r\n d3.select(\"g#xAxisImp\").select(\".domain\").remove();\r\n\r\n var legend = d3.legendColor()\r\n .title(\"GOLD EXPORTS IN \"+yearSet+\"[$]\")\r\n .labelFormat(d3.format(\".2s\"))\r\n .labels(d3.legendHelpers.thresholdLabels)\r\n .scale(exportColorScale)\r\n .ascending(true)\r\n .shapePadding(0)\r\n .shapeWidth(50)\r\n .shapeHeight(10)\r\n .labelOffset(10);\r\n\r\n d3.select(\"svg\")\r\n .append(\"g\")\r\n .attr(\"id\",\"Glegend\")\r\n .style(\"font-family\",\"Cooper\")\r\n .attr(\"transform\",\"translate(\"+width*0.2+\",550)\")\r\n .call(legend)\r\n\r\n // Filter for Swiss only data\r\n var plotfilter = incomingData.filter(function(d,i){return d.country_origin_id===\"CHE\"})\r\n console.log(plotfilter)\r\n var xScale = d3.scaleTime().domain([2007,2017]).range([0,spwidth])\r\n var plotscaleMax = d3.max(plotfilter, plotfilter=>parseInt(plotfilter.export_val))\r\n var yScale = d3.scaleLinear().domain([0,plotscaleMax]).range([spheight,0])\r\n\r\n // Update axis\r\n SPsvg.selectAll(\"g#yaxis\")\r\n .transition().duration(400)\r\n .call(d3.axisLeft(yScale));\r\n \r\n SPsvg.selectAll(\"text#scatterplotTitle\")\r\n .text(\"Switzerland's gold exports since 2008\")\r\n\r\n SPsvg.selectAll(\"path#scatterplot\")\r\n .datum(plotfilter)\r\n .transition().duration(400)\r\n .attr(\"stroke\", \"rgb(48, 151, 199)\")\r\n .attr(\"d\", d3.line()\r\n .x(function(d) { return xScale(d.year) })\r\n .y(function(d) { return yScale(d.export_val) })\r\n ) \r\n\r\n // Add pulsing circle to current year on scatter plot\r\n\r\n \r\n plotfilter.forEach(function(d,i){\r\n if(yearSet===d.year){\r\n valSet=d.export_val\r\n }\r\n })\r\n\r\n yearCircle\r\n .data(plotfilter)\r\n .attr(\"id\",\"highlight\")\r\n .attr(\"cx\", function(d) { return xScale(yearSet) } )\r\n .attr(\"cy\", function(d) { return yScale(valSet) } )\r\n .attr(\"r\", 8)\r\n .attr(\"fill\", \"SteelBlue\")\r\n .style(\"opacity\",0.7)\r\n \r\n repeat()\r\n \r\n function repeat(){\r\n yearCircle\r\n .attr(\"r\",5)\r\n .style(\"opacity\",0.7)\r\n .transition() \r\n .duration(1500) \r\n .attr(\"r\",20)\r\n .style(\"opacity\",0)\r\n .on(\"end\", repeat); \r\n }\r\n\r\n\r\n // update data on circle for the scatter plot\r\n SPsvg.selectAll(\"circle#scatterplot\")\r\n .data(plotfilter)\r\n .transition().duration(400)\r\n .attr(\"cy\", function(d) { return yScale(d.export_val) } )\r\n .attr(\"r\", 5)\r\n .attr(\"fill\", function(d){return exportColorScale(d.export_val)})\r\n .style(\"opacity\",1)\r\n\r\n d3.selectAll(\"circle#scatterplot\")\r\n .on(\"mouseover\",function(d,i){\r\n d3.select(this).transition().duration(200).attr(\"fill\",\"#f5c373\").attr(\"r\", 20).style(\"opacity\",\"0.8\");\r\n return tooltip.style(\"hidden\", false);\r\n })\r\n .on(\"mousemove\",function(d){\r\n tooltip.classed(\"hidden\", false)\r\n .style(\"top\", (d3.event.pageY) + \"px\")\r\n .style(\"left\", (d3.event.pageX + 10) + \"px\")\r\n .html(\"Year: \"+d.year+\"</br>Value: $ \"+formatNum(d.export_val)+\"</br>Percent of world trade: \"+d.export_val_pct);\r\n })\r\n .on(\"mouseout\",function(d,i){\r\n d3.select(this).attr(\"fill\", function(d){return exportColorScale(d.export_val)}).transition().duration(200).attr(\"r\",5).style(\"opacity\",\"1\")\r\n tooltip.classed(\"hidden\", true)\r\n })\r\n\r\n // Change legend label\r\n d3.selectAll(\"g#Glegend\").selectAll(\"text.label\").text(function(d){\r\n if (d==\"70G or more\"){\r\n return \"70 Billion or more\"\r\n }\r\n if (d==\"35G to 70G\"){\r\n return \"35 Billion to 70 Billion\"\r\n }\r\n if (d==\"20G to 35G\"){\r\n return \"20 Billion to 35 Billion\"\r\n }\r\n if (d==\"9.0G to 20G\"){\r\n return \"9 Billion to 20 Billion\"\r\n }\r\n if (d==\"4.0G to 9.0G\"){\r\n return \"4 Billion to 9 Billion\"\r\n }\r\n if (d==\"2.0G to 4.0G\"){\r\n return \"2 Billion to 4 Billion\"\r\n }\r\n if (d==\"1.0G to 2.0G\"){\r\n return \"1 Billion to 2 Billion\"\r\n }\r\n if (d==\"1.0M to 1.0G\"){\r\n return \"1 Million to 1 Billion\"\r\n }\r\n if (d==\"Less than 1.0M\"){\r\n return \"Less than 1 Million\"\r\n }\r\n else{\r\n return d\r\n }\r\n })\r\n }\r\n }", "function gotAllData(err) {\n console.log(\"gotAllData()\");\n // report an error, you’d want to do something better than this in production\n if (err) {\n console.log(\"error loading data\");\n console.error(err);\n return;\n }\n // call function to show the data\n showData();\n}", "function output(arr) {\n\tarr = outpfx.concat(arr);\n if (SAVEDATA) psiTurk.recordTrialData(arr);\n if (LOGGING) console.log(arr.join(\" \"));\n}", "function seperateData(data){\n data.forEach(monsterObj => displayMonster(monsterObj))\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 pipe(arrOfFuncs, value) {\n\n}", "function pipe(...fns) {\n const fnArguments = Array(...fns)\n return function(x) {\n let result = null;\n console.log(fns)\n fnArguments.forEach(fn => {\n if(!result) {\n result = fn(x)\n } else {\n result = fn(result)\n }\n console.log(result)\n })\n\n return result\n }\n \n}", "function showDatasetSummary(data, feedbacks) {\n // 2. gather dataset summary\n // deliveries\n var numberDeliveries = data.length;\n var numberPizzasDelivered = data.reduce(function(counter, delivery) {\n return counter + delivery.count;\n }, 0);\n var totalDeliveryTime = data.reduce(function(counter, delivery) {\n return counter + delivery.delivery_time;\n }, 0);\n var averageDeliveryTime = totalDeliveryTime / numberDeliveries;\n var totalSales = data.reduce(function(counter, delivery) {\n return counter + delivery.price;\n }, 0);\n\n // feedback\n var numFeedbacks = feedbacks.length;\n var numFeedbacksByCategory = {\n low: getFeedbacksByQuality(feedbacks, \"low\").length,\n medium: getFeedbacksByQuality(feedbacks, \"medium\").length,\n high: getFeedbacksByQuality(feedbacks, \"high\").length\n };\n\n // 2. show summary stats\n $('#number-deliveries').html(numberDeliveries);\n $('#total-pizzas-delivered').html(numberPizzasDelivered.toFixed(2));\n $('#average-delivery-time').html(averageDeliveryTime.toFixed(2));\n $('#total-sales').html(totalSales.toFixed(2));\n\n $('#total-feedbacks').html(numFeedbacks);\n $('#number-high-feedbacks').html(numFeedbacksByCategory.high);\n $('#number-medium-feedbacks').html(numFeedbacksByCategory.medium);\n $('#number-low-feedbacks').html(numFeedbacksByCategory.low);\n}", "function scatterFilter({layer, x, y, object}) {\n if (object) {\n const temp = deckgl.props.layers[0].props.data;\n const portTemp = deckgl.props.layers[1].props.data;\n\n let output = temp.filter(obj => obj.origin == object.port || obj.destination == object.port);\n let portOutput = portTemp.filter(obj => obj.port == object.port);\n\n plot(output, portOutput);\n analytics(output);\n\n tooltip.style.top = `${y}px`;\n tooltip.style.left = `${x}px`;\n tooltip.innerHTML = `<div><span class=\"key key-port\">Airport</span><span class=\"value\">${object.port}</span></div>`;\n tooltip.innerHTML += `<div><span class=\"key key-port\">Arrivals</span><span class=\"value\">${object.count}</span></div>`;\n tooltip.style.backgroundColor = '#1D1E27';\n tooltip.style.opacity = '1';\n\n //this is the only line of code that updates analytics outside of analytics:\n $(\"location\").innerHTML = object.port;\n } else {\n const newBackup = JSON.parse(JSON.stringify(backup))\n let temp = newBackup.filter(obj => new Date(obj.date) >= new Date(slider.getInfo().left));\n temp = temp.filter(obj => new Date(obj.date) <= new Date(slider.getInfo().right));\n const newPortBackup = createPorts(temp);\n plot(temp, newPortBackup);\n analytics(temp)\n\n tooltip.innerHTML = '';\n tooltip.style.opacity = '0';\n\n //analytics:\n $(\"location\").innerHTML = \"All\";\n }\n}", "function makeCharts() {\n issueChart();\n countChart();\n averageChart();\n}", "function processData(allRows) {\n console.log(allRows);\n \n var data = [];\n var penPos = [];\n var penNeg = [];\n var strPos = [];\n var strNeg = [];\n var neoPos = [];\n var neoNeg = [];\n // all the positive grain stain result MIC levels placed in array\n // all the negative grain stain result MIC levels placed in array\n for (var i = 0; i < allRows.length; i++) {\n var row = allRows[i];\n var x = row['Gram Staining '];\n if (x == 'positive') {\n penPos.push(Math.log(row['Penicilin']));\n strPos.push(Math.log(row['Streptomycin ']));\n neoPos.push(Math.log(row['Neomycin']));\n } else {\n penNeg.push(Math.log(row['Penicilin']));\n strNeg.push(Math.log(row['Streptomycin ']));\n neoNeg.push(Math.log(row['Neomycin']));\n }\n }\n // total amount of pencilin MIC levels (positive and negative)\n var pen = [];\n // total amount of streptomycin MIC levels (positive and negative)\n var str = [];\n // total amount of neomycin MIC levels (positive and negative)\n var neo = [];\n\n for (var i = 0; i < penPos.length; i++) {\n pen.push(penPos[i]);\n }\n for (var i = 0; i < penNeg.length; i++) {\n pen.push(penNeg[i]);\n }\n for (var i = 0; i < strPos.length; i++) {\n str.push(strPos[i]);\n }\n for (var i = 0; i < strNeg.length; i++) {\n str.push(strNeg[i]);\n }\n for (var i = 0; i < neoPos.length; i++) {\n neo.push(neoPos[i]);\n }\n for (var i = 0; i < neoNeg.length; i++) {\n neo.push(neoNeg[i]);\n }\n\n makeBarGraph(penPos, penNeg, strPos, strNeg, neoPos, neoNeg);\n makePlotly(penPos, penNeg, strPos, strNeg, neoPos, neoNeg);\n make3dPlot(pen, str, neo);\n }", "function displayPoints(){\n console.log(pointMap);\n console.log(payerPointLog);\n}", "function newresult() {\n input_data = output\n var p = input_data[0]\n var ract = input_data[1]\n var pro = input_data[2]\n var input = input_data.slice(3, input_data.length)\n // console.log(p)\n\n //Calculate monetary value of pipchange\n // dough = Math.round((dinero * p) * 100)/100\n dough = Math.round((pro * dinero) * 100)/100\n rounded = (Math.round(p * 100000)/100000).toFixed(5)\n\n var up, down\n var sym;\n\n //Format the output accordingly. Make sure right symbols for buying and selling, (buy is postive correlation, sell is negative correlation)\n //e.g. if user sells and eur-usd rate goes down then user made money.\n up = \"glyphicon glyphicon-triangle-top\"\n down = \"glyphicon glyphicon-triangle-bottom\"\n\n \n if (ract == \"Buy\") {\n dinero = Math.round((dinero + dough) * 100)/100\n rolls = dough.toFixed(2)\n if (p >= 0) {\n format = [up, up, 'green']\n sym = ['+', '+']\n }\n else if (p < 0) {\n format = [down, down, 'red']\n sym = ['-', '-']\n }\n }\n else {\n dinero = Math.round((dinero + dough) * 100)/100\n rolls = dough.toFixed(2)\n if (p <= 0) {\n format = [down, up, 'green']\n sym = ['-', '+']\n }\n else if (p > 0) {\n format = [up, down, 'red']\n sym = ['+', '-']\n }\n }\n\n\n //Format time outputs\n var bigben;\n if (input[2] < 10) {\n bigben = `${input[1]}:0${input[2]}`\n }\n else {\n bigben = `${input[1]}:${input[2]}`\n }\n\n //Use of tofixed(x) makes sure the right number of decimals are shown\n coins = dinero.toFixed(2)\n // console.log(ract, rounded, dough)\n \n // output variables to html text\n date_html.text(`Date: ${input[0]}`)\n time_html.text(`Time: ${bigben}`)\n buysell.style('font-weight', 'bold').text(`${ract}`)\n pip.style('color', format[2]).text(`${sym[0]} ${Math.abs(rounded)} `).append('i').style('color', format[2]).attr('class',format[0])\n moolah.style('color', format[2]).text(`${sym[1]}$ ${Math.abs(dough).toFixed(2)} `).append('i').style('color', format[2]).attr('class',format[1])\n\n //create array for table\n all_dict = input.concat([ract, rounded, rolls, coins])\n \n tabelizer()\n}", "function gotAllAngels(err) {\n console.log(\"gotAllAngels()\");\n\n//report an error, you'd want to do something better than this in production \nif (err) {\n console.log(\"error loading data\");\n console.error(err);\n return;\n}\n\n//call functions to log and show the angels\nconsoleLogAngels();\nshowAngels();\n}", "function getResultDetailed(){\r\n\t\r\n\tif (processDone) {\r\n \r\n\t\t for(var key in Obj_Fetch)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tvar temp_var={};\r\n\t\t\t\t\t\ttemp_var.cancertypedetailed=key;\r\n\t\t\t\t\t\ttemp_var.male=Obj_Fetch[key].MALE;\r\n\t\t\t\t\t\ttemp_var.female=Obj_Fetch[key].FEMALE;\r\n\t\t\t\t\t\tfetch_data_array.push(temp_var);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\taddScatterPlotDetailed(fetch_data_array);\r\n\t\t\t\t\t\tconsole.log(fetch_data_array);\r\n\r\n } else {\r\n setTimeout(getResult, 250);\r\n }\r\n }", "function renderAll() {\n chart.each((method, index, arr) => {\n render(method, index, arr);\n });\n drawAllValueNumbers();\n }", "function myOtherrunFunctions(b,c){\r\n console.log(\"I'm another function that will run two other functions.\");\r\n b();\r\n c(); \r\n}", "function showWeather() {\ngiveCity()\npreForecast()\nfutureFore() \n}", "function sink(x,y,z) {}", "function DataView()\n{\ndocument.write(window.datatype + \" was submitted by: \" + window.author + \"<br />\");\nSplitPro(window.datatype);\nSplitMat(window.datatype);\n}", "function show_available_graphs(table_data, data_type, county) {\n \n var skip_labels = ['Record ID', 'View report']\n , skip_labels_table = ['Record ID']\n , headings = []\n , table_headings = []\n , skip_indexes = []\n , too_many = []\n , data_and_msg\n , graph_type;\n //table stuff here \n table_data.cols.forEach(function(col, index) {\n if(skip_labels.indexOf(col.label) < 0) {\n headings.push({label:col.label, index: index});\n // group_on({label:col.label, index: index});\n }\n if (skip_labels_table.indexOf(col.label) < 0){\n table_headings.push(col);\n }\n else {\n skip_indexes.push(index);\n }\n });\n headings.forEach(function(heading) {\n data_and_msg = group_on(heading.label, data_type, headings, table_data.rows);\n \n if(data_and_msg['msg']) {\n too_many.push(data_and_msg['msg']);\n }\n\n });\n var source = find_source(county, data_type, headings, table_data.rows);\n make_table(table_data, table_headings, skip_indexes);\n if(too_many.length > 0) {\n var msg = '<div class=\"dd-graphs\"><p><b>The following fields have too many unique values to reasonably graph:</b></p>' + too_many.join(\"\\n\") + '</div>';\n $('#open-nc-widget').append(msg);\n\n }\n $('.graph-option').click(function() {\n which_graph = $(this).data('which');\n var graph_config = graph_configs[which_graph];\n $('.dd-graphs').each(function(index, el) {\n if($(this).attr('id') !== ('holder-' + which_graph)) {\n $(this).hide('slow');\n }\n });\n $(this).after('<button class=\"btn btn-default graph-show-all\">Back to all graphs</button>');\n $(this).hide();\n $('.graph-show-all').after(' <button class=\"btn btn-default graph-show-code\" style\"margin-left: 5px\">Get code</button>');\n $('.graph-show-code').click(function(e) {\n e.preventDefault();\n var graph_type = graph_config['graph_type'];\n var output_template = '_graph';\n var height = parseInt($('#graph-height').val()) || 'auto';\n var width = parseInt($('#graph-width').val());\n var context = {width: width, height: height, source: source, data: JSON.stringify(graph_config['data']), options: JSON.stringify(graph_config['options']), viz_type: graph_type ,script: 'script'};\n if(graph_type !== 'Table'){\n context['array_to'] = 'arrayTo';\n }\n else {\n context['view'] = JSON.stringify(graph_config.view);\n output_template = '_table';\n \n }\n var code = fill_template('embed_output' + output_template,context);\n var embed_textarea = fill_template('embed_textarea',{});\n $('#' + which_graph).before(embed_textarea);\n $('#embed-code').val(code);\n $('#embed-code').on('click',function() {\n this.select();\n });\n });\n $('.graph-show-all').click( function(e) {\n e.preventDefault();\n if(graph_type !== graph_config['graph_type']) {\n graph_type = graph_config['graph_type'];\n show_graph(graph_config,which_graph);\n }\n $('#embed-code-row, .widget-form, .graph-show-code').remove(); \n $('.dd-graphs').show('slow');\n $(this).remove();\n $('.graph-option').show();\n $('#graph-change-form').remove();\n });\n\n //puts existing values in form\n var form_template = 'graph_widget_form';\n var context = {};\n if(graph_config['graph_type'] === 'Table') {\n form_template = 'table_widget_form';\n context['headings'] = graph_config['headings'];\n }\n var form = fill_template(form_template, context);\n $('#holder-' + which_graph).append(form);\n if(graph_config['graph_type'] === 'LineChart') {\n $('#graph-change-row').remove();\n }\n $('.graph-change-param').each(function(i, el) {\n var param = $(this).data('option');\n var form_type = $(this).attr('type');\n var val;\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = graph_config['options'];\n keys.forEach( function(key) {\n val_obj = val_obj[key];\n });\n val = val_obj;\n }\n else {\n if(param === 'colors') {\n val = graph_config['options'][param][0];\n }\n else {\n val = graph_config['options'][param]; \n }\n }\n if(form_type === 'radio' || form_type === 'checkbox') {\n if($(this).val() === val) {\n $(this).attr('checked','checked');\n }\n \n }\n else {\n $(this).val(val);\n }\n });\n $('.graph-type').click( function() {\n graph_type = $(this).val();\n var temp_config = graph_config;\n graph_config['graph_type'] = graph_type;\n show_graph(graph_config,which_graph);\n });\n //puts form values in option obj\n $('#graph-change-button').click( function(e) {\n e.preventDefault();\n $('.graph-change-param').each( function(i, el) {\n var data_type = $(el).attr('type');\n if(data_type === 'number') {\n val = parseInt($(el).val());\n }\n else if (data_type === 'radio' || data_type === 'checkbox') {\n if($(el).is(':checked')) {\n val = $(el).val();\n }\n }\n else {\n val = $(el).val();\n }\n var param = $(el).data('option');\n if(param === 'hAxis.title' && val !== '' && val && (graph_config['graph_type'] === 'ColumnChart' || graph_config['graph_type'] === 'LineChart')) {\n graph_config['data'][0][1] = val;\n }\n if(param === 'vAxis.title' && val !== '' && val && graph_config['graph_type'] === 'BarChart') {\n graph_config['data'][0][1] = val;\n }\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = {};\n var last = keys.length;\n var first = keys[0];\n for(var i = 1; i < keys.length; i++) {\n val_obj[keys[i]] = val;\n }\n graph_config['options'][first] = val_obj;\n }\n else {\n if(param === 'colors') {\n if(graph_config['options']['colors'][0] !== val) {\n \n graph_config['options']['colors'].unshift(val);\n }\n }\n else {\n graph_config['options'][param] = val; \n }\n }\n \n });\n if(graph_config['graph_type'] === 'Table') {\n var show_cols = [];\n $('.table-fields').each(function(i, el) {\n if($(el).is(':checked')) {\n show_cols.push(parseInt($(el).val()));\n }\n });\n graph_config['view'] = show_cols;\n }\n show_graph(graph_config,which_graph);\n $('#embed-code-row').remove(); \n });\n $('#graph-change-reset').click(function(e) {\n e.preventDefault();\n $('.graph-change-param').each(function(i, el) {\n var param = $(this).data('option');\n var form_type = $(this).attr('type');\n var val;\n if(param.indexOf('.') !== -1) {\n var keys = param.split('.');\n var val_obj = graph_config['options'];\n keys.forEach( function(key) {\n val_obj = val_obj[key];\n });\n val = val_obj;\n }\n else {\n if(param === 'colors') {\n val = graph_config['options'][param][0];\n }\n else {\n val = graph_config['options'][param]; \n }\n }\n if(form_type === 'radio' || form_type === 'checkbox') {\n if($(this).val() === val) {\n $(this).prop('checked',true);\n }\n else {\n $(this).prop('checked', false);\n }\n \n }\n else {\n $(this).val(val);\n }\n if(graph_type !== 'ColumnChart') {\n graph_type = 'ColumnChart';\n show_graph(graph_config,which_graph);\n }\n }); \n });\n });\n }", "function test_utilization_utilization_graphs() {}", "function showData()\n {\n console.log('hello world');\n }", "onOutput () {}", "function display(data1, data2){\n console.log(data1);\n console.log(data2);\n}", "function framework(data,scb,fcb){ //scb and fcb are success and failure call back\n for(let i=2;i*i<data;i++){\n if(data%i==0){\n return fcb();\n }\n }\n return scb();\n}", "harvestAll() {\n this.plotList.forEach((plot, index) => {\n this.harvest(index);\n });\n }", "fa () {\n\t\tfor (let i = 0; i < 3; i++)\n\t\t\tthis.f();\n\t}", "function updateaboveresult() {\naboveresult.innerHTML = currfunction + curroperator + buffer;\n}", "function mostrarEnConsola( numero1, numero2, funcion1, funcion2){\n\n console.log( \"resultado de la suma \"+funcion1(numero1,numero2));\n console.log(\"resultado de la multiplicacion \" + funcion2(numero1, numero2));\n}", "function getWebConversionsFunnelDataMap() {\n return {\n GAReferralPageviewsFunnelValue: {\n metric: 'GAReferralPageviews',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n GAReferralOnsiteSessionsFunnelValue: {\n metric: 'GAReferralOnsiteSessions',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n GAReferralUsersFunnelValue: {\n metric: 'GAReferralUsers',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n conversionVolumeFunnelValue: {\n metric: 'conversionVolume',\n getter: commonGetters.getChannelsSeparatelyGetter('totalValue')\n },\n\n GAReferralPageviewsValue: {\n metric: 'GAReferralPageviews',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n GAReferralPageviewsChangeValue: {\n metric: 'GAReferralPageviews',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n GAReferralPageviewsChangePercent: {\n metric: 'GAReferralPageviews',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent'),\n formatters: [\n dataFormatters.decimalToPercent\n ]\n },\n\n GAReferralOnsiteSessionsValue: {\n metric: 'GAReferralOnsiteSessions',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n GAReferralOnsiteSessionsChangeValue: {\n metric: 'GAReferralOnsiteSessions',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n GAReferralOnsiteSessionsChangePercent: {\n metric: 'GAReferralOnsiteSessions',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent'),\n formatters: [\n dataFormatters.decimalToPercent\n ]\n },\n\n GAReferralUsersValue: {\n metric: 'GAReferralUsers',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n GAReferralUsersChangeValue: {\n metric: 'GAReferralUsers',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n GAReferralUsersChangePercent: {\n metric: 'GAReferralUsers',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent'),\n formatters: [\n dataFormatters.decimalToPercent\n ]\n },\n\n conversionVolumeValue: {\n metric: 'conversionVolume',\n getter: commonGetters.getOnlyFromChannelsGetter('totalValue')\n },\n conversionVolumeChangeValue: {\n metric: 'conversionVolume',\n getter: commonGetters.getOnlyFromChannelsGetter('changeValue')\n },\n conversionVolumeChangePercent: {\n metric: 'conversionVolume',\n getter: commonGetters.getOnlyFromChannelsGetter('changePercent'),\n formatters: [\n dataFormatters.decimalToPercent\n ]\n }\n };\n}", "function main(...fns) {return fns.reduce(pipe)}", "function getAllResult(){\r\n\t\r\n\tif (processDone) {\r\n for(var key in Obj_Fetch)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tvar temp_var={};\r\n\t\t\t\t\t\ttemp_var.cancertype=key;\r\n\t\t\t\t\t\ttemp_var.male=Obj_Fetch[key].MALE;\r\n\t\t\t\t\t\ttemp_var.female=Obj_Fetch[key].FEMALE;\r\n\t\t\t\t\t\tfetch_data_array.push(temp_var);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\taddAllScatterPlot(fetch_data_array);\r\n\t\t\t\t\t\t\r\n } else {\r\n setTimeout(getResult, 250);\r\n }\r\n }", "function _processFunnel(animate) {\n Ti.API.info('Processing Funnel');\n\n Ti.API.info(_eventData);\n\n controllers.funnels._update(_eventData.category, _eventData.funnelIndex);\n }", "function BarrarrCallback(){\n console.log(\"iam taking 3 customer orders and delivared ordeers\");\n}", "function processResults(data, requestStatus, requestId) {\n\t\tconsole.log('data:', data);\n\t}", "function callAll(){\n console.log(arr);\n console.log(average(arr));\n console.log(min(arr));\n console.log(max(arr));\n}", "function rollStats() {\n for (var x = 0; x < 6; x++) {\n statRolls.bind(this)();\n };\n }", "function inner () {\n console.log(a,b,c)\n }", "function output(metrics)\n{\n\tfor (var i in metrics)\n\t{\n\t\tvar out = \"\";\n\t\tvar metric = metrics[i];\n\t\t\n\t\tout += metric.id;\n\t\tout += \"|\";\n\t\tout += metric.value;\n\t\tout += \"|\";\n\t\t\n\t\tconsole.log(out);\n\t}\n}", "function pd(){}", "apply(args) {\n // ... //\n }", "function analyticData(allObjects, callback) {\n allObjects = allObjects.check_data_exist;\n var finalData = {};\n if (allObjects.data === 'DataFromDb') {\n finalData = {\n metricId: allObjects.metricId,\n data: 'DataFromDb',\n queryResults: results,\n channelId: results.metric.channelId\n };\n callback(null, finalData);\n }\n else {\n var apiQuery = {}\n if (allObjects.api === configAuth.googleApiTypes.mcfApi) {\n apiQuery = {\n 'key': configAuth.googleAuth.clientSecret,\n 'ids': 'ga:' + allObjects.object.channelObjectId,\n 'start-date': allObjects.startDate,\n 'end-date': allObjects.endDate,\n 'dimensions': allObjects.dimension,\n 'metrics': allObjects.metricName,\n prettyPrint: true,\n }\n var analytics = googleapis.analytics({\n version: 'v3',\n auth: allObjects.oauth2Client\n }).data.mcf.get;\n callGoogleApi(apiQuery);\n }\n else if (allObjects.api === configAuth.googleApiTypes.youtubeApi) {\n apiQuery = {\n 'access_token': allObjects.oauth2Client.credentials.access_token,\n 'ids': 'channel==' + allObjects.object.channelObjectId,\n 'start-date': allObjects.startDate,\n 'end-date': allObjects.endDate,\n 'dimensions': allObjects.dimension,\n 'metrics': allObjects.metricName,\n prettyPrint: true,\n }\n var analytics = googleapis.youtubeAnalytics({\n version: 'v1',\n auth: allObjects.oauth2Client\n }).reports.query;\n callGoogleApi(apiQuery);\n }\n else {\n apiQuery = {\n 'auth': allObjects.oauth2Client,\n 'ids': 'ga:' + allObjects.object.channelObjectId,\n 'start-date': allObjects.startDate,\n 'end-date': allObjects.endDate,\n 'dimensions': allObjects.dimension,\n 'metrics': allObjects.metricName,\n prettyPrint: true\n }\n var analytics = googleapis.analytics({version: 'v3', auth: oauth2Client}).data.ga.get;\n callGoogleApi(apiQuery);\n }\n /**Method to call the google api\n * @param oauth2Client - set credentials\n */\n var googleResult = [];\n\n function callGoogleApi(apiQuery) {\n analytics(apiQuery, function (err, result) {\n if (err)\n callback(err)\n else {\n if (result.rows != undefined) {\n for (var i = 0; i < result.rows.length; i++) {\n googleResult.push(result.rows[i]);\n }\n }\n else\n googleResult = 'No Data';\n if (result.nextLink != undefined) {\n var splitRequiredQueryData = result.nextLink.split('&');\n if (allObjects.api === configAuth.googleApiTypes.mcfApi) {\n apiQuery = {\n 'key': configAuth.googleAuth.clientSecret,\n 'ids': 'ga:' + allObjects.object.channelObjectId,\n 'start-date': splitRequiredQueryData[3].substr(splitRequiredQueryData[3].indexOf('=') + 1),\n 'end-date': splitRequiredQueryData[4].substr(splitRequiredQueryData[4].indexOf('=') + 1),\n 'start-index': splitRequiredQueryData[5].substr(splitRequiredQueryData[5].indexOf('=') + 1),\n 'dimensions': allObjects.dimension,\n 'metrics': allObjects.metricName,\n prettyPrint: true,\n }\n }\n else if (allObjects.api === configAuth.googleApiTypes.youtubeApi) {\n apiQuery = {\n 'key': configAuth.youTubeAuth.clientSecret,\n 'ids': 'channel==' + allObjects.object.channelObjectId,\n 'start-date': splitRequiredQueryData[3].substr(splitRequiredQueryData[3].indexOf('=') + 1),\n 'end-date': splitRequiredQueryData[4].substr(splitRequiredQueryData[4].indexOf('=') + 1),\n 'start-index': splitRequiredQueryData[5].substr(splitRequiredQueryData[5].indexOf('=') + 1),\n 'dimensions': allObjects.dimension,\n 'metrics': allObjects.metricName,\n prettyPrint: true,\n }\n }\n else {\n apiQuery = {\n 'auth': allObjects.oauth2Client,\n 'ids': 'ga:' + allObjects.object.channelObjectId,\n 'start-date': splitRequiredQueryData[3].substr(splitRequiredQueryData[3].indexOf('=') + 1),\n 'end-date': splitRequiredQueryData[4].substr(splitRequiredQueryData[4].indexOf('=') + 1),\n 'start-index': splitRequiredQueryData[5].substr(splitRequiredQueryData[5].indexOf('=') + 1),\n 'dimensions': allObjects.dimension,\n 'metrics': allObjects.metricName,\n prettyPrint: true\n }\n }\n callGoogleApi(apiQuery);\n }\n else {\n finalData = {\n metricId: allObjects.metricId,\n data: googleResult,\n queryResults: results,\n channelId: results.metric.channelId,\n startDate: allObjects.startDate,\n endDate: allObjects.endDate,\n metric: allObjects.metric\n };\n callback(null, finalData);\n }\n }\n });\n }\n }\n }", "function otherFunct(){\n console.log(\"we are in another funct\");\n console.log(\"do stuff\");\n}", "function link_forward() {\n for (igen=0; igen < ngens-1; igen++) {\n\t if (igen == 0) {\n\t iList1.push(iselect); // This is the number in the comm_id list\n\t nodeList1.push(comm_name[iselect]) // This is the name of the individual nodes \n\t moneyList1.push(0.); \n\t }\n // empty these again\n \tiList2=[];\n\t nodeList2=[];\n\t moneyList2=[];\n \tmakeGen();\n \n // Now group and annotate the individual links\n\t node1_link=[];\n\t node2_link=[];\n\t money_link=[];\n\t tooltip=[];\n\t money_val=[];\n\t tip_str=[];\n\t tooltip_head=[];\n\n\t for (i=0; i < name1_arr.length; i++) {\n\t val1=comm_group[name1_arr[i]];\n\t type1=comm_type[name1_arr[i]];\n\t val2=comm_group[name2_arr[i]];\n\t type2=comm_type[name2_arr[i]];\n if (isLoop(val1,type1,val2,type2) == false) {\n \n if (val1=='PAC') val1='PAC'+igen.toString();\n if (val2=='PAC') val2='PAC'+(igen+1).toString();\n j2=i_comm_name[name2_arr[i]];\n\t\t id=-1;\n\t\t for (j=0; j < node1_link.length; j++) {\n\t\t if ((node1_link[j]==val1) && (node2_link[j]==val2)) id=j;\n\t\t }\n \t\t if (id >=0) {\n\t \t money_link[id]+=money_arr[i];\n\t\t if (money_arr[i] > min_label) {\n\t\t if (money_arr[i] > min_label){\n\t\t money_val[id].push(money_arr[i]);\n\t\t tip_str[id].push('&nbsp;<a onclick=\"doSelected('+j2+')\" href=\"#\">'+name2_arr[i].substring(0,40)+'</a><i> $'+parseInt(money_arr[i]).toLocaleString()+'</i><br>');\n \t\t\t \n\t\t }\n\t\t }\n\t\t \n\t\t } else {\n\t\t node1_link.push(val1);\n\t\t node2_link.push(val2);\n\t\t money_link.push(money_arr[i]);\n\t\t tooltip_head.push('<b>'+val1+'->'+val2);\n\t\t \n \t\t tooltip.push('<div style=\"text-align:left; font-size: 10px; font-family: garamond;\">');\n\t\t money_val.push([money_arr[i]]); \n\t\t tip_str.push(['&nbsp;<a onclick=\"doSelected('+j2+')\" href=\"#\">'+name2_arr[i]+'</a><i> $'+parseInt(money_arr[i]).toLocaleString()+'</i><br>']);\n\t\t }\n\t\t \n\t\t // Do we put the money into a candidate account as well?\n\t\t if (type2 == 'candidates') {\n\t\t name2=name2_arr[i];\n\t\t i2=i_comm_name[name2];\n\t\t k=i_cand_id[comm_cand_id[i2]];\n\t\t myrace=cand_race[k];\n\t\t if (myrace===undefined) myrace='none';\n\t\t if ((myrace.includes('SEN') == false)&&(myrace.includes('PRES')==false)) {\n\t\t if (cand_party[k] == \"DEM\") {\n\t\t if (myrace in dem_money_house) {\n\t\t dem_money_house[myrace]+=money_arr[i];\n\t\t } else {\n\t\t dem_money_house[myrace]=money_arr[i];\n\t\t }\n\t\t \n\t\t } else if (cand_party[k]== \"REP\") {\n\t\t if (myrace in rep_money_house) {\n\t\t rep_money_house[myrace]+=money_arr[i];\n\t\t } else {\n\t\t rep_money_house[myrace]=money_arr[i];\n\t\t }\n\t\t }\n \t\t //console.log(val2,name2,k,cand_name[k],cand_race[k]);\n\t\t }\n\t\t }\n\t\t \n }\n\t }\t \n\t \n\t for (j=0; j < node1_link.length; j++) {\n\t tooltip_head[j]+=' ($'+parseInt(money_link[j]).toLocaleString()+')</b><br>';\n\t \n\t \n\t tmparr=sortWithIndices(money_val[j]);\n\t nk=money_val[j].length;\n\t for (k=0; k < nk; k++) {\n\t k1=tmparr.sortIndices[nk-k-1];\n\t tooltip[j]+=tip_str[j][k1];\n\t }\n\t \n\t \n\t tooltip[j]+=\"</div>\";\n\t data.addRow([node1_link[j],node2_link[j],money_link[j],tooltip_head[j]+tooltip[j]]);\n\t }\n\t iList1=iList2.slice();\n nodeList1=nodeList2.slice();\n \tmoneyList1=moneyList2.slice();\n }\n title_str=comm_name[iselect]+' $'+totalAmt.toLocaleString();\n document.getElementById(\"chart_title\").innerHTML=title_str;\n\n options = {\n\t width: 900,\n\t tooltip: {isHtml: true},\n\t sankey: {\n node: { label: { fontName: 'Garamond',\n fontSize: 14,\n color: '#871b47',\n bold: true } } },\n };\n\n \n // Instantiate and draw our chart, passing in some options.\n chart = new google.visualization.Sankey(document.getElementById('chart_div'));\n chart.draw(data, options);\n \n if (doMap == true) {\n map_allInvisible();\n map_changeColorScheme('red_blue');\n moneymax=0.\n for (key in dem_money_house) {\n money=dem_money_house[key];\n if (key in rep_money_house) {\n money+=rep_money_house[key];\n }\n if (money > moneymax) moneymax=money;\n }\n for (key in rep_money_house) {\n money=rep_money_house[key];\n if (money > moneymax) moneymax=money;\n }\n console.log(moneymax);\n \n for (key in dem_money_house) {\n dmoney=dem_money_house[key];\n if (key in rep_money_house) {\n rmoney=rep_money_house[key];\n } else {\n rmoney=0.\n }\n if (key in map_bounds) { // really should be a function\n wgt=Math.sqrt((dmoney+rmoney)/moneymax);\n val=(dmoney)/(dmoney+rmoney);\n map_setVal(key,val);\n map_setWeight(key,wgt);\n map_changeVisible(key,true);\n }\n }\n for (key in rep_money_house) {\n rmoney=rep_money_house[key];\n if ((key in dem_money_house) == false) {\n if (key in map_bounds) {\n val=0.;\n wgt=Math.sqrt(rmoney/moneymax);\n map_setVal(key,val);\n map_setWeight(key,wgt); \n map_changeVisible(key,true);\n }\n }\n }\n \n }\n \n \n \n}" ]
[ "0.5844929", "0.5689076", "0.55886346", "0.55143803", "0.546116", "0.54594773", "0.54532397", "0.5447825", "0.543722", "0.5424356", "0.5402443", "0.53684336", "0.5353597", "0.5292238", "0.52909845", "0.5274609", "0.5235446", "0.5227721", "0.52252096", "0.52252096", "0.5212302", "0.52014494", "0.51903385", "0.51903385", "0.51800215", "0.51672846", "0.5162382", "0.5134757", "0.5134476", "0.51320297", "0.5122467", "0.5116128", "0.5113357", "0.5109455", "0.5109212", "0.51078594", "0.5103299", "0.50971276", "0.5080005", "0.50505537", "0.50478894", "0.50304276", "0.50161755", "0.5012492", "0.50070965", "0.5002134", "0.49949795", "0.4990138", "0.49799916", "0.49750876", "0.4973908", "0.49736598", "0.49684963", "0.49600136", "0.4959271", "0.4955926", "0.49465442", "0.49451566", "0.49413624", "0.49393004", "0.49298915", "0.4929313", "0.49256808", "0.49176812", "0.49069235", "0.49055022", "0.4904714", "0.4902362", "0.4900993", "0.48965463", "0.48960146", "0.48843083", "0.48810676", "0.48786083", "0.4878077", "0.48662543", "0.48655507", "0.4861344", "0.48585173", "0.4858379", "0.48582152", "0.48574418", "0.48572367", "0.48519832", "0.48504087", "0.4843526", "0.4841749", "0.483917", "0.48374948", "0.48350537", "0.48349363", "0.48286092", "0.4827885", "0.48232698", "0.4822471", "0.4821006", "0.48160636", "0.4812024", "0.48098847", "0.4809264", "0.48063788" ]
0.0
-1
if I run this purchase items outerHeight, & this is not an arrow function this is a function declaration
function purchaseItem(...fns) => fns.reduce(compose) {} // so I have to make sure that I have returned in here this property
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getHeight() {\n return this.$node.innerHeight();\n }", "getHeight(){return this.__height}", "function addItemHeight(element) {\n\t\t//get key dimensions to calculate height\n\t\tlet dimensions = [\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('margin-top')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('margin-bottom')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('padding-top')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('padding-bottom')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('height'))\n\t\t];\n\t\titemHeight += arraySum(dimensions);\n\t}", "function foldedItemHeight() {\n return settings.nav_summaryLines * ITEM_LINE_HEIGHT + FOLDED_ITEM_OUTER_HEIGHT_EXTRAS;\n}", "function oldOuterHeight(element){\r\n //return 100;\r\n return element.height();\r\n}", "get height() {}", "function awardsItemHei() {\n var awardsHei = $(window).height();\n orientHeight = $(window).height();\n orientWidth = $(window).width();\n if (orientWidth>orientHeight) { \n $('.awards_grid .grid__item').css('height', (+awardsHei/2.5)+'px');\n } else {\n $('.awards_grid .grid__item').css('height', (+awardsHei/4)+'px');\n }\n }", "get height() { return 2.5; }", "get height() {\n return this.bottom - this.top;\n }", "get minHeight() {}", "function pluckHeight() {\n return $(this).outerHeight();\n}", "get gridItemHeight() {\n return windowHeight / maxIconsPerCol * this.percent;\n }", "get gridItemHeight() {\n return windowHeight / maxIconsPerCol * this.percent;\n }", "function exponentHeight(){\n return(totalHeight()**2);\n}", "_getItemsHeights(itemIndex) {\n const that = this,\n items = that._items,\n itemsCount = items.length;\n let itemsHeights = [];\n\n if (itemsCount === 0) {\n return;\n }\n\n if (!isNaN(itemIndex) && itemIndex >= 0 && itemIndex < itemsCount) {\n const item = items[itemIndex];\n let height = 0;\n\n if (item.expanded) {\n height = item.$.accordionItemContent.scrollHeight;\n }\n else {\n item.expanded = true;\n height = item.$.accordionItemContent.scrollHeight;\n item.expanded = false;\n }\n\n return (height + 'px');\n }\n\n for (let i = 0; i < itemsCount; i++) {\n const item = items[i];\n let height = 0;\n\n if (item.expanded) {\n height = item.$.accordionItemContent.scrollHeight;\n }\n else {\n item.expanded = true;\n height = item.$.accordionItemContent.scrollHeight;\n item.expanded = false;\n }\n\n itemsHeights.push(height + 'px');\n }\n\n that._heightCalcAfterInitialization = true;\n\n return itemsHeights;\n }", "height() {\n return this.heightHelper(this.root, 0)\n }", "updateInnerHeightDependingOnChilds(){}", "getMinHeight(){return this.__minHeight}", "getMinHeightUnit(){return this.__minHeightUnit}", "getHeight() {\n console.log(this.height);\n }", "get height(): number {\n return this._height(this.root);\n }", "get estimatedHeight() { return -1; }", "function sortByHeight() {}", "get _itemHeight() {\n return this._list.selectedItem.clientHeight;\n }", "function appSalesLines(element, height) {}", "getOuterHeight() {\n return this.getHeight();\n }", "function getSize(itemtpl, itemID, InventoryItem) { // -> Prepares item Width and height returns [sizeX, sizeY]\n let toDo = [itemID];\n let tmpItem = getItem(itemtpl)[1];\n let isFolded = false;\n let isMagazine = false;\n let isGrip = false;\n let isMainBaseHasis = false;\n let isBarrel = false;\n let BxH_diffrence_stock = 0;\n let BxH_diffrence_barrel = 0;\n let outX = tmpItem._props.Width;\n let outY = tmpItem._props.Height;\n let skipThisItems = [\"5448e53e4bdc2d60728b4567\", \"566168634bdc2d144c8b456c\", \"5795f317245977243854e041\"];\n\n // containers big no no\n if (!skipThisItems.includes(tmpItem._parent)) {\n while (true) {\n if (toDo.length === 0) {\n break;\n }\n\n for (let item of InventoryItem) {\n if (item._id === toDo[0]) {\n if (\"upd\" in item) {\n if (\"Foldable\" in item.upd) {\n if (item.upd.Foldable.Folded === true) {\n isFolded = true;\n }\n }\n }\n }\n\n if (item.parentId === toDo[0]) {\n let itm = getItem(item._tpl)[1];\n\n if (item.slotId != \"mod_handguard\") {\n if (item.slotId == \"mod_magazine\") {\n if (\"ExtraSizeDown\" in itm._props && itm._props.ExtraSizeDown > 0) {\n isMagazine = true;\n }\n }\n\n if (item.slotId == \"mod_pistol_grip\" || item.slotId == \"mod_pistolgrip\") {\n isGrip = true;\n }\n\n if (item.slotId == \"mod_stock\") {\n if (\"ExtraSizeDown\" in itm._props && itm._props.ExtraSizeDown > 0) {\n isGrip = true;\n }\n }\n\n if (item.slotId == \"mod_stock\") {\n if (\"ExtraSizeLeft\" in itm._props && itm._props.ExtraSizeLeft > 0) {\n BxH_diffrence_stock = itm._props.ExtraSizeLeft;\n isMainBaseHasis = true;\n }\n }\n\n if (item.slotId == \"mod_barrel\") {\n if (\"ExtraSizeLeft\" in itm._props && itm._props.ExtraSizeLeft > 0) {\n BxH_diffrence_barrel = itm._props.ExtraSizeLeft;\n isBarrel = true;\n }\n }\n\n if (\"ExtraSizeLeft\" in itm._props && itm._props.ExtraSizeLeft > 0) {\n if (item.slotId == \"mod_barrel\" && itm._props.ExtraSizeLeft > 1 || item.slotId != \"mod_barrel\") {\n outX += itm._props.ExtraSizeLeft;\n }\n }\n\n if (\"ExtraSizeRight\" in itm._props && itm._props.ExtraSizeRight > 0) {\n outX += itm._props.ExtraSizeRight;\n }\n\n if (\"ExtraSizeUp\" in itm._props && itm._props.ExtraSizeUp > 0) {\n outY += itm._props.ExtraSizeUp;\n }\n\n if (\"ExtraSizeDown\" in itm._props && itm._props.ExtraSizeDown > 0) {\n outY += itm._props.ExtraSizeDown;\n }\n }\n\n toDo.push(item._id);\n }\n }\n\n toDo.splice(0, 1);\n }\n }\n\n if (isBarrel && isMainBaseHasis) {\n let calculate = Math.abs(BxH_diffrence_stock - BxH_diffrence_barrel);\n calculate = ((BxH_diffrence_stock > BxH_diffrence_barrel) ? BxH_diffrence_stock : BxH_diffrence_barrel) - calculate;\n outX -= calculate;\n }\n\n if (isMagazine && isGrip) {\n outY -= 1;\n }\n\n if (isFolded) {\n outX -= 1;\n }\n\n return [outX, outY];\n}", "get height() { return this._height; }", "function getCurrentHeight() {\n\t\t\treturn (lineHeight * Math.max(1, Math.min(5, items.length))) + 4;\n\t\t}", "get pixelHeight() {\n return this.grid.layout.gridItemHeight;\n }", "height(props, propName, componentName) {\n return dimensionProp(props, propName, componentName);\n }", "innerHeightDependsOnChilds(){return!1}", "height() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "calcHeight() {\n\n const card = document.querySelector('.card');\n const { width } = card.getBoundingClientRect();\n const aspectRatio = 409 / 663;\n const height = Math.min(width, 350) / aspectRatio;\n\n this.setState({ height });\n\n }", "height() {\n return this.heightVisitor(this.root)\n }", "height() {\n return this.root ? this.root.height() : 0;\n }", "function teaserProductGridItemHeight() {\n\tif ($(window).width() > 767) {\n\t setSameElementHeight(\".teaser-product-grid-item-name\");\n\t setSameElementHeight(\".teaser-product-grid-item-message\");\n\t setSameElementHeight(\".teaser-product-grid-item-proposition\");\n\t} else {\n\t\tresetElementHeight(\".teaser-product-grid-item-name\");\n\t resetElementHeight(\".teaser-product-grid-item-message\");\n\t resetElementHeight(\".teaser-product-grid-item-proposition\");\n\t}\n}", "setHeight () {\n if (!this.props.list.length || !this.refs.item0) {\n return;\n }\n\n const node = ReactDom.findDOMNode(this);\n const computedStyle = getComputedStyle(node);\n const itemHeight = ReactDom.findDOMNode(this.refs.item0).offsetHeight;\n const height = ACList.heightAddenums.reduce((heightParts, prop) => {\n return heightParts + parseInt(computedStyle[prop], 10);\n }, itemHeight * this.props.itemsCount);\n\n node.style.maxHeight = height + 'px';\n }", "function GetSizeItem() {\n an.size = {\n 'OuterWidth': M.OuterWidth($anim),\n 'OuterHeight': M.OuterHeight($anim)\n };\n }", "async getBlockHeight() {\n // Add your code here\n let blockCount = await this.bd.getBlocksCount();\n return blockCount -1;\n }", "getBlockHeight() {\n // Add your code here\n return this.chain.length-1;\n }", "getHeight() {\n return this.height;\n }", "getHeight() {\n return this.height;\n }", "getHeight() {\n return this._executeAfterInitialWait(() => this.currently.getHeight());\n }", "get height(){ return this.Canvas.height }", "getMaxHeightUnit(){return this.__maxHeightUnit}", "get Height() { return this.y2 - this.y1; }", "get Height() { return this.y2 - this.y1; }", "updateHeight_() {\n const estScrollHeight = this.items.length > 0 ?\n this.items.length * this.domItemAverageHeight_() :\n 0;\n this.$.container.style.height = estScrollHeight + 'px';\n }", "async getBlockHeight () {\n return await this.getBlockHeightLevel()\n }", "function Ba(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],n=a.node.parentNode;n&&(a.height=n.offsetHeight)}}", "function GetEraBlockHeight(current_window) \r\n\t{\r\n\t\tif (current_window.era_rc != null && current_window.era_rc[\"Height\"] != null) \r\n\t\t{\r\n\t\t\t\treturn GetStringWithQuotes(current_window.era_rc[\"Height\"]);\r\n\t\t} \r\n\t\t\r\n\t\treturn GetStringWithQuotes(500);\r\n\t}", "getHeight() {\n return this._$mountPoint.height();\n }", "function height(param) {\n if (param) {\n return param.h;\n } else {\n return 0;\n }\n }", "getHeight() {\n return this.canvas.height;\n }", "dimension() {\n if (!this.item.width) {\n return '';\n }\n return `${this.item.width}px * ${this.item.height}px`;\n }", "height() {\n return this.win.innerHeight;\n }", "get maxHeight() {}", "getHeight() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.request(\"get_height\", {});\n });\n }", "setHeightUnit(valueNew){let t=e.ValueConverter.toDimensionUnit(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"HeightUnit\")),t!==this.__heightUnit&&(this.__heightUnit=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"HeightUnit\"}),this.__processHeightUnit())}", "function sizerPositions() {\n let images = document.getElementsByTagName(\"image-wrapper\");\n let bottom = 0;\n for (let i = 0; i < images.length; ++i)\n {\n let item = images[i];\n let sizer = getSizer(item);\n let ht = getSizerHeight(sizer);\n alert(ht);\n let top = getTop(item);\n alert(top);\n let bottom = top + ht;\n alert(bottom);\n }\n}", "getBlock(height) {\n // Add your code here\n return JSON.parse(JSON.stringify(this.chain[blockHeight]));\n }", "height(e) {\n this.setState({ height: e.nativeEvent.text }, function () {\n this.bmi();\n });\n\n }", "function getHeight(root) {}", "getHeight() {\n return this.getSize().height;\n }", "function outerHeight(el) {\n var height = el.offsetHeight;\n var style = getComputedStyle(el);\n height += parseInt(style.marginTop) + parseInt(style.marginBottom);\n return height;\n }", "shelfSize()\n {\n return this.values.size * this.values.quantity;\n }", "get height() {\n return this.heightIn;\n }", "get height() {\n return this.heightIn;\n }", "get fundedBlockHeight() {\n let height = 0;\n\n const models = this.paymentsIn\n .filter(payment => {\n const paymentHeight = payment.get('height');\n return typeof paymentHeight === 'number' && paymentHeight > 0;\n })\n .sort((a, b) => (a.get('height') - b.get('height')));\n\n _.every(models, (payment, pIndex) => {\n const transactions = new Transactions(\n models.slice(0, pIndex + 1),\n { paymentCoin: this.paymentCoin }\n );\n if (this.getBalanceRemaining(transactions) <= 0) {\n height = payment.get('height');\n return false;\n }\n\n return true;\n });\n\n return height;\n }", "get fundedBlockHeight() {\n let height = 0;\n\n const models = this.paymentsIn\n .filter(payment => {\n const paymentHeight = payment.get('height');\n return typeof paymentHeight === 'number' && paymentHeight > 0;\n })\n .sort((a, b) => (a.get('height') - b.get('height')));\n\n _.every(models, (payment, pIndex) => {\n if (this.getBalanceRemaining(new Transactions(models.slice(0, pIndex + 1))) <= 0) {\n height = payment.get('height');\n return false;\n }\n\n return true;\n });\n\n return height;\n }", "getClientHeight() {\n return this._node && this._node.clientHeight;\n }", "function weird() {\n height = 50;\n}", "get height() {\n return this._height;\n }", "_getItemHeight() {\n return this._triggerFontSize * SELECT_ITEM_HEIGHT_EM;\n }", "setHeight(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"Height\")),t!==this.__height&&(this.__height=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"Height\"}),this.__processHeight())}", "get halfDrawHeight() {\n return this.drawHeight / 2;\n }", "get height()\n\t{\n\t\tlet height = Math.max(this._height, this.minHeight);\n\n\t\tif (this.tree.theme.hasGridBehavior)\n\t\t{\n\t\t\tlet step = this.tree.theme.gridSize;\n\t\t\theight = Math.ceil(height / step) * step;\n\t\t}\n\n\t\treturn height;\n\t}", "componentDidMount() {\n var thisThoughtNode = ReactDOM.findDOMNode(this);\n var thisThoughtTopic = thisThoughtNode.childNodes[0];\n var thisThoughtItem = thisThoughtNode.childNodes[0].childNodes[0];\n // console.log(thisThoughtItem.style);\n var thisNodeParent = thisThoughtNode.parentNode;\n thisThoughtNode.style.height = (thisNodeParent.childNodes.length > 2 ?\n thisThoughtTopic.clientHeight :\n thisThoughtItem.clientHeight) + 'px';\n }", "function restHeight(params) {\n\tvar usedWidth = 0;\n\n\tvar outerElement = $(params.outerSelector)\n\n\t$.each(params.innerSelectorsArray, function(index, value) {\n\n\t\tusedWidth += (outerElement.find(value)).outerHeight()\n\t})\n\n\treturn (outerElement.height() - usedWidth)\n\n}", "function SetupSizeOnInner() {\n var wInner = isHor ? (op.typeSizeItem == 'max' ? p.wMax : p.wMin) : p.wMax, hInner = !isHor ? (op.typeSizeItem == 'max' ? p.hMax : p.hMin) : p.hMax, styles = {\n 'width': wInner,\n 'height': hInner\n };\n // Add 'margin' to pagInner\n // Remove width/height on pagInner when pagItem at size before\n if (isHor) {\n styles['margin-bottom'] = p.maBottom;\n if (isSizeSelf)\n styles.width = p.wSum;\n }\n else {\n styles['margin-right'] = p.maRight;\n if (isSizeSelf)\n styles.height = p.hSum;\n if (is.pagOutside)\n styles.width = '';\n }\n // Setup style on pagInner\n va.$pagInner.css(styles);\n /**\n * SETUP WIDTH/HEIGHT 'FIT' FOR PAG-ITEM\n * + If item is size 'self' depends on 'p.dirs' is 'wfit' or 'hfit'\n * + If item is not size 'self', must have 'wfit'-'hfit'\n */\n if (!is.pagList) {\n var classes = wfit + ' ' + hfit;\n if (isSizeSelf) {\n classes = isHor ? hfit : wfit;\n }\n // Setup class 'wfit'-'hfit' on pagInner\n va.$pagInner.addClass(classes);\n }\n }", "getMaxHeight(){return this.__maxHeight}", "calcArea(){\n return this._width * this._height;\n }", "get height() {\n\t\treturn this._viewport[3];\n\t}", "gridHeight(x,z,index,col,row) {\n return 0;\n }", "function clickSize() { return width() / 40; }", "function getEstimatedHeight(){\n\t\tvar height = g_carousel.getEstimatedHeight();\n\t\t\n\t\tif(g_objNavWrapper){\n\t\t\tvar navHeight = g_objNavWrapper.height();\n\t\t\theight += navHeight + g_options.theme_navigation_margin;\n\t\t}\n\t\t\n\t\treturn(height);\n\t}", "getElementSize() {\n const that = this;\n return { width: that.elementWidth, height: that.elementHeight };\n }", "function getSizerHeight(elem) {\n let elems = elem.childNodes;\n let ht = 0;\n for (let i = 0; i < elems.length; ++i) {\n let htStr = window.getComputedStyle(elems[i], null).getPropertyValue(\"height\");\n let htStrTrunc = htStr.substr(0, htStr.length - 2);\n ht += parseFloat(htStrTrunc);\n }\n return ht;\n}", "get height() {\n return this._height;\n }", "get height() {\n return this._height;\n }", "get height() {\n return this.m_height;\n }", "setHeight(breed) {\n this.breed = breed;\n }", "get _physicalBottom(){return this._physicalTop+this._physicalSize}", "get height() {\n\t\treturn this._height;\n\t}", "get height() {\n\t\treturn this._height;\n\t}", "function setHeight(obj) {\n $(mainBlock).height(function () {\n return (obj.descriptionHeight + obj.menuListBlock) + 100;\n });\n }", "amt_of(item) { }", "function wH() {\r\n return window.innerHeight;\r\n}", "getBottomUnit(){return this.__bottomUnit}", "function fAnimateHeight (elem, eHeight) {\n //tMx.to (elem, animTym, {css: {height: eHeight}, ease: easePower});\n tMx.to (elem, animTym, {height: (eHeight + \"px\"), ease: easePower});\n }" ]
[ "0.64142865", "0.64012414", "0.62060165", "0.6172117", "0.61672837", "0.614269", "0.60842234", "0.6081568", "0.6071458", "0.60658777", "0.6029858", "0.6028371", "0.6028371", "0.6012281", "0.60063124", "0.59936786", "0.5987718", "0.5986718", "0.5984882", "0.59697115", "0.59660834", "0.5950468", "0.5945891", "0.593055", "0.5920225", "0.5908106", "0.5882447", "0.5871889", "0.584765", "0.5842558", "0.583065", "0.5830121", "0.58018625", "0.5800607", "0.57997257", "0.5780665", "0.5771745", "0.57685167", "0.57559854", "0.5746931", "0.5743807", "0.57396126", "0.57396126", "0.5733103", "0.57316315", "0.57315576", "0.5711497", "0.5711497", "0.570111", "0.56926274", "0.56876564", "0.5658506", "0.56477135", "0.5642509", "0.5635102", "0.56194216", "0.5617587", "0.560664", "0.5598958", "0.5596038", "0.5593936", "0.5592407", "0.559005", "0.5583675", "0.55765903", "0.55753636", "0.5570204", "0.5568666", "0.5568666", "0.5566268", "0.55655056", "0.5564692", "0.5553795", "0.55527496", "0.5549701", "0.554829", "0.55362976", "0.5534691", "0.55330825", "0.55110914", "0.5501094", "0.5498369", "0.54878235", "0.5479098", "0.5468785", "0.54533553", "0.54525554", "0.5450686", "0.54494375", "0.54488313", "0.54488313", "0.5447355", "0.54398036", "0.5435955", "0.54340136", "0.54340136", "0.5411557", "0.5407478", "0.5399409", "0.53986984", "0.5398666" ]
0.0
-1
Kim now has an item in her cart how cool is that I was able to purchase items well I was able to do the first thing add item to cart & I passed on the data to the next functions that were componsing but they just received the user & just passed all the way out like a factory how coll is that! alright. now that we have created this this is a pure function just takes in something & returns something no matter how many times we call it its always to be the same lets apply all the functionality to these ones aswell the first is to apply tax
function applyTaxToItems(user){ return user }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem(...fns)\n\n\n{} // & these spreads functions", "function applyTaxToItems(user){\n const {cart}\n}", "function purchaseItem() {\n return\n}", "function applyTaxToItems(user){\n const {cart} = user;\n}", "function addItemToCart(user, item) {\n\n}", "function buyItem() {\n\n}", "function addItemToCart() {}", "function addItemToCart() {}", "function buyItem(user){\n return user\n}", "function addItemToCart(user, item) {}", "getMarketItems() {\n return [\n {\n action: \"Deposit Gold\",\n cost: 10,\n info: \"Deposits remaining gold in the bank. Gain 1% interest every 5 adventure days.\",\n onBuy: (ns) => {\n ns.message = \"You deposit \" + ns.gold + \" gold into your bank account.\"\n ns.bank += ns.gold;\n ns.gold = 0; \n return ns;\n },\n },\n {\n action: \"Healing Potion\",\n cost: 2 * ((5 * (this.state.potion + 1)) ** 2),\n info: \"Carry +1 Potion that gets spent to prevent defeat and recovers 25% of your Health.\",\n onBuy: (ns) => {\n ns.message = \"You aquire a Healing Potion. It will be used automatically when needed.\"\n ns.potion++;\n return ns;\n },\n },\n {\n action: \"Purchase Sword\",\n cost: ((this.state.sword || 0) + 1) * 50,\n info: \"Grants +1 Sword, which increases damage per round. Upkeep +\" + \n (this.state.sword) * 2 + \".\",\n onBuy: (ns) => {\n ns.message = \"You buy a new armor. Gain +1 Armor.\"\n ns.upkeep += ++ns.armor * 5;\n ns.hp = ns.hpMax += 2;\n return ns;\n },\n },\n {\n action: this.state.armor < 1 ? \"Purchase Armor\" : \"Improve Armor\",\n cost: ((this.state.armor || 0) + 1) * 200,\n info: \"Grants +1 Armor, which prevents some damage per round, and +2 Health. Upkeep +\" + \n ((this.state.armor || 0) + 1) * 5 + \".\",\n onBuy: (ns) => {\n ns.message = \"You buy a new sword. Gain +1 Sword.\"\n ns.upkeep += ns.sword++ * 2;\n return ns;\n },\n },\n {\n action: this.state.mount < 1 ? \"Purchase Mount\" : \"Train Mount\",\n cost: ((this.state.mount || 0) + 1) * 500,\n info: \"Skip rooms with \" + \n (this.state.mount ? this.state.mount + \" encounters or less\" : \"no encounters\") + \n \". Reduced travel time. Upkeep +\" + ((this.state.armor || 0) + 1) * 4 + \".\",\n onBuy: (ns) => {\n ns.message = \"You \" + (ns.mount ? \"train your \" : \"buy a new\") + \" mount.\";\n ns.upkeep += ++ns.mount * 4;\n return ns;\n },\n },\n {\n action: \"Improve Lifestyle\",\n cost: ((this.state.regen * 100) ** 2),\n info: \"Grants +0.5 Regen, and +1 Health per Level.\",\n onBuy: (ns) => {\n ns.message = \"You improve your lifestyle, gain +0.5 Regen and +\" + ns.lv + \" Health\";\n ns.regen += 0.5;\n ns.hpBonus++;\n ns.hpMax += ns.lv;\n return ns;\n }\n },\n ];\n }", "buyItem(item) {\n console.log(\"Buying Item:\", item.name);\n }", "function addItemToCart(user, item) {\n const updateCart =\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n\n })\n}", "function addTax(user){\n let updateCart = user.cart.map(item => {\n return{\n name: item.name,\n price: item.price * 1.03\n } \n });\n return Object.assign({}, user , {cart: updateCart})\n }", "function Cart(){}", "function purchaseItem(...fns) => fns\n\n{} // so what I am going to do is I am going to use reduce", "function getItem(){ \n var itemContainer = this.closest(\"div\"); \n var quantity = itemContainer.querySelector(\".quantity-input\");\n var itemName = itemContainer.querySelector(\".item-name\")\n var totalPrice = itemContainer.querySelector(\".total-price\")\n var newItem = {}; \n inventory.map(function (inventoryItem){\n if(itemName.innerHTML === inventoryItem.name){\n newItem = inventoryItem\n totalPrice.innerHTML = (inventoryItem.price).toFixed(2)\n }\n })\n addItemToCart(newItem, parseInt(quantity.value))\n quantity.value = \"\";\n quantity.placeholder = 1\n}", "function callBackForAddCart2(bool,cartObject,productCategory,productId){\r\n console.log(arguments);\r\n if(bool == true){\r\n let customerName = document.getElementById(\"welcome-user\").innerText;\r\n cartObject.qty++;\r\n cartOperations.add(productCategory,productId,cartObject,customerName.split(\" \")[1]);\r\n }\r\n else{\r\n let customerName = document.getElementById(\"welcome-user\").innerText;\r\n let productObject = {\"id\":productId,\"qty\":1};\r\n cartOperations.add(productCategory,productId,productObject,customerName.split(\" \")[1]);\r\n }\r\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {}\n })\n}", "function addSelectedItemToCart() {\n // TODO: suss out the item picked from the select list\n let selectedItem = event.target.items.value;\n console.log(selectedItem);\n // TODO: get the quantity\n let quantity = event.target.quantity.value;\n // TODO: using those, add one item to the Cart\n \n \n carts.addItem(selectedItem,quantity); \n console.log(carts.items);\n \n}", "function applyTaxToItems(user){}", "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // & act over the data that we receive", "function currentQuantityCart() {\n\n}", "function Item(title,\n price_per_kle,\n kle,\n unit_price,\n unit_volume,\n amount)\n{\n return {\n title: title,\n price_per_kle: price_per_kle,\n kle: kle,\n unit_price: unit_price,\n unit_volume: unit_volume,\n amount: amount\n };\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n }\n })\n}", "function addToCart(item) {\n var newItem = {}; // this object contains the item name and price.\n\n var newItem = {\n itemName: item,\n itemPrice: Math.floor(Math.random()*100)\n }\n //newItem.itemName = item;\n //newItem.itemPrice = Math.floor(Math.random()*100)\n cart.push(newItem); // it was pop(newItem)\n return `${newItem.itemName} has been added to your cart.`\n}", "function getCart() {\n return cart;\n}", "function purchase () {\n // prompting the user what they want and what quantity\n\tinquirer.prompt([\n \t{\n \ttype: \"input\",\n \tname: \"item\",\n \tmessage: \"Which item do you want to purchase? (Please type item ID)\"\n \t}, {\n \tname: \"quantity\",\n \ttype: \"input\",\n \tmessage: \"How many would you like?\"\n // processing customer purchase\n \t}]).then(function(answers) {\n var item = answers.item;\n var quantity = answers.quantity;\n\n // connecting the the database to check for availability and update stock quantity\n connection.query(\"SELECT stock_quantity, price FROM products WHERE id=\" + item, function (err,res) {\n var stockQuantity = res[0].stock_quantity;\n var total = res[0].price * quantity;\n var newStock = stockQuantity - quantity;\n\n // if their quantity exceeds the inventory the order does not go through\n if (newStock < 0){\n console.log(\"Insufficient quantity! Try again.\");\n purchase();\n }\n // if the inventory is available, quantity in the database is updated\n // and the customer is given their total\n else {\n connection.query(\"UPDATE products SET stock_quantity=\" + newStock + \"WHERE item_id=\" + item, function (err,res) {\n });\n console.log(\"Success! Your total is $\" + total);\n }\n\n });\n\t});\n}", "function CartCustomer() {\n\n}", "function itemcart(item)\r\n{\r\n\r\n let citem=sweets.map( i=>{\r\n if(i.name==item)\r\n {\r\n user.cart.push(i);\r\n alert(\"Product is added To The Cart\");\r\n }\r\n })\r\n cartview();\r\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({})\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 applyTaxToItems(user){\n const\n}", "function shoppingCart(userName, address, items)\n {\n this.name = userName;\n this.address = address;\n this.items = items;\n }", "function buyThis(){\n inqurier.prompt([\n {\n message: \"What is the ITEM ID of the PRODUCT you would like to buy?\",\n name: \"id\"\n },\n { \n message: \"How many UNITS would you like to buy?\",\n name: \"purchase\",\n },\n ]).then(function(answer){\n //convert to integers\n var id = parseInt(answer.id);\n var quantity = parseInt(answer.purchase)\n\n //purcahse logic\n\n if (isNaN(answer.id) == true || id <=0 || id > resultArray.length) {\n //error message for invalid number entry \n console.log(\"Error: INVALID ITEM ID\")\n }\n else if (isNan(answer.purcahse) == true || quantity <= 0){\n //error for purchasing zero items\n console.log(\"You must order more than one\")\n }\n else if (quantity > resultArray[id -1].stock_quantity){\n //error for not enough stock \n console.log(\"WE ARE OUT OF THAT\")\n }\n else {\n //for a sucessful order\n purchaes.push(resultArray[id - 1].product_name);\n amounts.push(quantity);\n\n //total of curent order and total order\n var orderCost = quantity * resultArray[id-1].price;\n orderCost = parseFloat(orderCost.toFixed(2));\n total += orderCost;\n total = parseFloat(total.toFixed(2))\n\n sales = resultArray[id - 1].product_sales + orderCost;\n\n console.log(\"You have selected ITEM\" + id + \",\" + resultArray[id - 1].product_name + \".\" )\n console.log(\"This item costs $\" + resultArray[id - 1].price + \" per unit. You have ordered \" + quantity + \" units.\");\n console.log(\"This purchase costs $\" + orderCost + \".\");\n \n //display quantites and ordered as well as cost\n console.log(\"YOU HAVE ORDERED\")\n for (var i = 0; i < purchaes.length; i++){\n console.log(amounts[i] + \"|\" + purchaes[i]);\n }\n console.log(\"mYour total cost is \" + total + \".\");\n\n\t\t\t// query to update the database\n\t\t\tupdate = \"UPDATE products SET stock_quantity = \" + (resultArray[id - 1].stock_quantity - quantity) + \", product_sales = \" + sales + \" WHERE item_id = \" + id;\n\n\t\t\t// updates the database\n\t\t\tconnection.query(update, function (error, results, fields) {\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t};\n });\n keepGoing();\n }\n })\n}", "function buyItem(user){\n amazonHistory.push(user)\n return Object.assign({}, user, { purchases: user.cart })\n}", "function addSelectedItemToCart() {\n // suss out the item picked from the select list\n let product = document.getElementById('items').value;\n let quantity = document.getElementById('quantity').value;\n cart.addItem(product, quantity);\n\n // console.log(newCartItem);\n // console.log(cart);\n\n // get the quantity\n // using those, add one item to the Cart\n}", "function addSelectedItemToCart() { \n var itemsEl = document.getElementById('items').value;\n var quantityEl = document.getElementById('quantity').value;\n cart.addItem(itemsEl, parseInt(quantityEl));\n // console.log(cart.items[0].product);\n // console.log(cart.items[0].quantity); \n}", "async updateCart_Of_User(){\n }", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "function marketBuy () {\n\n}", "function ShoppingBag() {\n this.list = [];\n this.date = new Date();\n this.currentYear = this.date.getFullYear();\n this.addProduct = function (object) {\n if (object.experationDate >= this.currentYear) {\n this.list.push(object);\n }\n };\n /*!!!*/ this.getAveragePrice = function () {\n this.averagePrice = 0;\n /* !!!! da bi radilo this unutar drugog objekta, a da se odnosi na konstruktor, moramo da stavimo dodatno callback-funkciju => */\n this.list.forEach((element, index) => {\n this.averagePrice += this.list[index].price;\n });\n this.averagePrice = this.averagePrice / this.list.length;\n return parseFloat(this.averagePrice.toFixed(3));\n };\n this.getMostExpensive = function () {\n this.mostExpensive = 0;\n this.mostExpensiveProduct;\n this.list.forEach((element, index) => {\n if (this.list[index].price > this.mostExpensive) {\n this.mostExpensive = this.list[index].price;\n this.mostExpensiveProduct = this.list[index].name;\n }\n });\n return this.mostExpensiveProduct + \" \" + this.mostExpensive;\n };\n this.getTotalPrice = function () {\n this.totalPrice = 0;\n this.list.forEach((element, index) => {\n this.totalPrice += this.list[index].price;\n });\n return this.totalPrice;\n };\n }", "function purchase(action = \"\") {\n if (action == \"init\") {\n }\n\n // Prompt the user to enter Product's item_id to review detail of the product:\n inquirer.prompt([\n {\n name: \"ID\",\n type: \"input\",\n message:\n \"Enter the product's item ID to review detail. [Quit with Ctrl+C]\",\n filter: Number,\n validate: function(val) {\n return !isNaN(val);\n }\n },\n {\n name: \"qty\",\n type: \"input\",\n message: \"OK, how many would you like to buy? \",\n filter: Number,\n validate: function(value) {\n if (isNaN(value) == false) {\n return true;\n } else {\n return false;\n }\n }\n }\n ]).then(function(userInput) {\n connection.query(\"SELECT * FROM products WHERE item_id = ?\", [userInput.ID], function(err, inventoryRes) {\n if (err) {\n console.log(\"ERROR: \", err);\n }\n console.log(\"\");\n console.log(\n \"====================\",\n \"\\nPRODUCT DETAIL: \",\n inventoryRes,\n \"\\n====================\"\n );\n console.log(\"\");\n purchaseItem(userInput.ID, userInput.qty);\n });\n });\n // *** This is the end of the function purchase() ***\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n}", "function getCart() {\n return cart\n}", "function buy(){\n \n}", "function shop(){\n inquirer.prompt(customerPrompts).then(function(answer){\n new CartItem(answer.product_id, answer.quantity);\n var query = 'SELECT * FROM products WHERE ?';\n connection.query(query, {id: cart[0].id}, function(err, res){\n if(err) console.log(err);\n if (res.length === 0){\n console.log(\"Please select a valid product\");\n cart = [];\n shop();} \n else {\n console.log(\n 'ID: ' + res[0].id + '\\n' +\n 'Name: ' + res[0].name + '\\n' +\n 'Department: ' + res[0].department + '\\n' +\n 'Price: ' + (res[0].price/100).toFixed(2) + '\\n' +\n 'Quantity: ' + res[0].quantity + '\\n' +\n '---------------'\n );\n if(answer.quantity > Number(res[0].quantity)) {\n console.log(\"\\n Insufficient quantity! \\n ------------- \\n\");\n connection.end();\n } else {\n cost = (answer.quantity * (res[0].price/100)).toFixed(2);\n var newQuantity = Number(res[0].quantity) - answer.quantity\n buyProduct(res[0].id, newQuantity);\n }\n }\n })\n });\n}", "function FurnitureShop() {}", "function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}", "function buy()\n{\n\t//query the databse for all items being sold\n\tconnection.query(\"SELECT * FROM products\", function(err, res)\n\t{\n\t\t\n\t\tif(err) throw err;\n\n\t\t//Prompt the user to input data\n\t\tinquirer.prompt([\n\n\t\t\t{\n\t\t\t\t//Ask for id of the product the user wants to buy\n\t\t\t\tname: \"id\",\n\t\t\t\ttype: \"list\",\n\t\t\t\tchoices: function()\n\t\t\t\t{\n\t\t\t\t\tvar idChoiceArray = [];\n\n\t\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t//push all items_ids into (idChoiceArray) in order to display all ids to choose from\n\t\t\t\t\t\t//NOTE: For rawlist cannot use type(INT) only (string) hence convert int to string by JSON.stringify\n\t\t\t\t\t\tidChoiceArray.push(JSON.stringify(res[i].item_id));\n\t\t\t\t\t}\n\n\t\t\t\t\t//display all item_id's to choose from\n\t\t\t\t\treturn idChoiceArray;\n\t\t\t\t},\n\t\t\t\tmessage: \"Enter the id of the product you want to purchase\"\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t//Ask customer for how many units they'd like to buy\n\t\t\t\ttype: \"input\",\n\t\t\t\tname: \"quantity\",\n\t\t\t\tmessage: \"How many units would you like to buy?\"\n\t\t\t}\n\n\t\t\t]).then(function(answer)\n\t\t\t{\n\t\t\t\t//get the entire item object & store in variable\n\t\t\t\tvar chosenItem;\n\n\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t{\n\t\t\t\t\t//if id == user id choice then store entire object\n\t\t\t\t\tif(res[i].item_id === parseInt(answer.id) )\n\t\t\t\t\t{\n\t\t\t\t\t\tchosenItem = res[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t//call the checkQuantity function & update the table if the quantity entered is sufficient\n\t\t\t\tcheckQuantity(chosenItem, answer, err);\n\n\t\t\t});\n\n\t});\n}", "function addToCart(itemName) {\n var itemObj = {}\n itemObj[itemName] = Math.floor(Math.random() * 100)\n cart.push(itemObj)\n console.log(itemName + \" has been added to your cart.\")\n //console.log(itemObj)\n return cart\n}", "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\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 applyPromotionsCart() {\n for( let i=0; i<cart.length;i++){\n if(cart[i].name=='cooking oil'&cart[i].quantity>=3){\n cart[i].subtotalWithDiscount=cart[i].quantity*10; //afegim l'atribut subtotalWithDiscount per l'oferta a l'oli\n }else if(cart[i].name=='Instant cupcake mixture'&cart[i].quantity>=10){\n cart[i].subtotalWithDiscount=(cart[i].subtotal*2)/3; //afegim l'atribut subtotalWithDiscount per l'oferta a la mescla per pastís\n }else{cart[i].subtotalWithDiscount='No discount'} //afegim l'atribut subtotalWithDiscount sense discount per a la resta de productes \n }\n console.log(cart);\n \n}", "function shoppingCart() {\n let items = [];\n\n let find = function( item ) {\n return items.indexOf( item );\n };\n\n return {\n add: function( item ) {\n if( find( item ) === -1 ) {\n items.push( item );\n }\n },\n remove: function( item ) {\n items.splice( find( item ), 1 );\n },\n show: function() {\n console.log( 'items = ', items );\n }\n }\n}", "function buyItem(user){\n return Object.assign({}, user, { purchases: user.cart })\n}", "function buyItem(user) {\n return {\n ...user,\n purchases: [...user.cart]\n };\n}", "function generate(title, description, colour, value) {\n cart = JSON.parse(sessionStorage.getItem(\"price\"));\n vinylObject = JSON.parse(sessionStorage.getItem(\"object\"));\n discountLock = JSON.parse(sessionStorage.getItem(\"discLock\"));\n let newVinyl = new vinyl(\n title,\n description,\n colour,\n value,\n );\n vinylObject.push(newVinyl)\n let prices = parseInt(value);\n cart.push(prices);\n let total = cart.reduce(function(a, b) {\n return a + b\n }, 0)\n if (deliveryLock[0] !== 1 && deliveryLock[0] !== 2) {\n alert(\"Cart Total: R\" + (total - discountLock));\n $(\".cart\").animate({ height: \"+= 50%\" });\n }\n if (deliveryLock[0] == 1 && total !== 0) {\n alert(\"Cart Total: R\" + (total + 99.99 - discountLock));\n $(\".cart\").animate({ height: \"+= 50%\" });\n }\n if (deliveryLock[0] == 2 && total !== 0) {\n alert(\"Cart Total: R\" + (total + 49.99 - discountLock));\n $(\".cart\").animate({ height: \"+= 50%\" });\n }\n $(\".fas\").css(\"color\", \"#ff5200\");\n\n sessionStorage.setItem(\"price\", JSON.stringify(cart));\n sessionStorage.setItem(\"object\", JSON.stringify(vinylObject));\n sessionStorage.setItem(\"discLock\", JSON.stringify(discountLock));\n}", "function CartObjectConstructor(carid, color) {\n //No need to save all the car's details in local storage, the CarID is enough as ref and allows us to always read car details from MercsMap e.g. price in case the local storage info is outdated\n this.carid = carid,\n this.color = (carid in localStorage) ? JSON.parse(localStorage.getItem(carid)).color : color // check if already chosen from details page.\n this.quantity = (carid in localStorage) ? Number(JSON.parse(localStorage.getItem(carid)).quantity) + 1 : 1 // check if already in cart, coz if user clicks quick-add-to-cart more than once, we add onto existing quantity\n\n // Since the following 4 are set the same for all cart items , check if previous cart items (if any) have anything set and use that, otherwise assign default values \n this.coupontype = (localStorage.length > 0) ? JSON.parse(localStorage.getItem(localStorage.key(0))).coupontype : \"none\"\n this.couponvalue = (localStorage.length > 0) ? 0 : 0 //we just create and initialise with 0, even at future times, coz Sync will soon just give it (back) it's appropriate value from coupon type\n this.delivery = (localStorage.length > 0 && JSON.parse(localStorage.getItem(localStorage.key(0))).delivery != \"Not selected\") ? JSON.parse(localStorage.getItem(localStorage.key(0))).delivery : \"Not selected\"\n this.deliveryoption = (localStorage.length > 0 && JSON.parse(localStorage.getItem(localStorage.key(0))).deliveryoption != \"Not selected\") ? JSON.parse(localStorage.getItem(localStorage.key(0))).deliveryoption : \"Not selected\" // Delivery option details will be added later on shipping page\n this.purchaserdetails = (localStorage.length > 0 && JSON.parse(localStorage.getItem(localStorage.key(0))).purchaserdetails != \"Not provided\") ? JSON.parse(localStorage.getItem(localStorage.key(0))).purchaserdetails : \"Not provided\" // This will be a an object with fullname, phone, email, address, notes \n this.orderrefnumber = \"Pending\"; //generated at the end, at confirmation of order\n this.orderStatus = \"Pending\"; //Will be changed when order is completed and finalised. \n }", "function customerview(){\n db.getAllProducts().then(function(data){\n //console.log(JSON.stringify(data,null,3)); \n //console.log(data[\"products\"]);\n var products = data[\"products\"];\n products.forEach(function(element,index,array){\n // console.log(\"ID: \" + element.item_id + \" Name: \"+ element.productname +\" Price: \"+ element.price);\n var myproduct = Product(element.item_id,element.productname,element.departmentName,element.price,element.stock_quantity);\n var myproductstr = \"Product ID: \"+ myproduct.getId() + \" Product Name : \"+myproduct.getName()+\" Product Price: \"+myproduct.getPrice();\n displayProducts.push(myproductstr);\n }); \n //console.log(displayProducts);\n inquirer.prompt([\n {\n type: \"list\",\n name: \"action\",\n message: \"Below are the available products for sale.Please select the product you want to buy.\",\n choices:displayProducts\n } \n ]).then(function(answers){\n console.log(answers.action);\n inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"enter the name of the product you want to purchase...\" \n },\n {\n type: \"input\",\n name: \"id\",\n message: \"enter the id of the product you want to purchase...\" \n },\n {\n type: \"input\",\n name: \"quantity\",\n message: \"enter the quantity of the product you want to purchase...\" \n }\n \n ]).then(function(answers){\n var totalcost =0;\n var productname = answers.name;\n var id = answers.id;\n var quantity = answers.quantity;\n //check if product requirement can be met or not\n db.getProductByID(id).then(function(data){\n //console.log(data[\"singleproduct\"]); \n //var shoppingCartObj = {};\n var singleproduct = data[\"singleproduct\"];\n var myproduct = Product(singleproduct[0].item_id,singleproduct[0].productname,singleproduct[0].productDepartment,singleproduct[0].price,singleproduct[0].stock_quantity); \n if(myproduct.getQuantity() >= quantity){\n totalcost = parseFloat(myproduct.getPrice()) * parseInt(quantity);\n //create a shopping cart object and push it to shopping cart array\n var shoppingCartObj = {\n \"product name\" : myproduct.getName(),\n \"quantity purchased\": quantity,\n \"amount\" : totalcost\n };\n //var str = JSON.stringify(shoppingCartObj);\n myShoppingCart.push(shoppingCartObj);\n var newproductcount = parseInt(myproduct.getQuantity()) - parseInt(quantity);\n updateproductcount(id,newproductcount);\n userresponse(true,totalcost);\n\n }else{\n userresponse(false,0);\n }\n })\n .catch(function(err){\n console.log(err);\n });\n })\n })\n\n })\n .catch(function(err){\n console.log(err);\n });\n\n }", "function qOne() {\n \n// prompt user\n\n inquirer.prompt({\n name: \"product\",\n type: \"input\",\n message: \"What is the Product ID that you would like to purchase ?\"\n }).then(function(answer) {\n \n var userInput = parseInt(answer.product);\n var checkInput = isNaN(userInput);\n \n// check for valid input\n\n if (checkInput) {\n \n console.log(\" \");\n console.log(\"Sorry that is not a valid Product Id !\");\n console.log(\" \");\n \n qOne();\n \n return;\n \n \n}\n\n// query database\n var query = \"SELECT * FROM products where ID = \" + userInput;\n\n connection.query(query, function(err, res) {\n \n if (err) {\n// log errors\n console.log(err);\n }\n \n// check for no match return\n\n if (res.length < 1) {\n \n console.log(\" \");\n console.log(\"Sorry no product with that ID found !\");\n console.log(\" \");\n \n qOne();\n \n return;\n \n }\n \n qTwo(userInput);\n \n });\n// get user quantities function\n\n function qTwo(userInput) {\n console.log(\" \");\n var invCheck = choice[userInput-1].stock_qty;\n \n if (invCheck < 1) {\n \n console.log(\" \");\n console.log(\"Sorry this item is now out of stock !\");\n console.log(\" \");\n \n return qOne();\n \n }\n \n \n// get user quantity\n\n inquirer.prompt({\n name: \"quan\",\n type: \"input\",\n message: \"How many would you like to purchase ?\"\n }).then(function(answer) { \n \n// validate enough on hand\n\n if (answer.quan > invCheck) {\n \n console.log(\" \");\n console.log(\"Sorry not enough in stock ! Please lower quantity\");\n console.log(\" \");\n \n return qTwo(userInput);\n }\n \n// calculate total sale\n\n var totalSale = choice[userInput-1].price * answer.quan;\n invCheck = invCheck - answer.quan;\n \n \n// display total\n\n console.log(\" \");\n \n console.log(\"Your total is : $\" + totalSale.toFixed(2));\n \n// update database inventory\n \n var query = \"UPDATE products SET stock_qty = \" + invCheck + \" where id = \" + choice[userInput-1].ID;\n\n\n\n connection.query(query, function(err, res) {\n \n if (err) {\n \n// log errors\n\n console.log(err);\n \n }\n \n// message user of remaining inventory\n\n console.log(\" \");\n console.log(\"There are now \" + invCheck + \" left in stock !\");\n \n start();\n });\n \n \n });\n \n }\n \n });\n \n }", "buyItem(req, res) {\n db.items.getById(req.params.id)\n .then((product) => {\n // Product returns an array of 1 item, so need to access that item, and change the buyer of that item to be the current request maker\n db.transactions.updateTransaction(product[0].id, { buyer_id: req.user.user.id })\n .then(() => {\n db.items.sold(Number(req.params.id));\n //Creates a new client with coinbase which allows user to purchase the item from coinbase\n const client = new coinbase.Client({ accessToken: req.user.accessToken, refreshToken: req.user.refreshToken });\n const args = {\n name: `Order for ${product[0].title}`,\n amount: /* (Number(product[0].price))*/ 0.01,\n metadata: {\n customer_id: client.id,\n customer_name: 'test'\n },\n currency: 'USD',\n type: 'order',\n style: 'custom_small',\n success_url: `http://${req.headers.host}/items/${req.params.id}/confirm`,\n cancel_url: `http://${req.headers.host}/items/${req.params.id}`,\n customer_defined_amount: false,\n collect_shipping_address: false,\n description: `Purchasing: ${product[0].title} on BitBargain`\n };\n //Create a checkout button with those args, and sends it back to BB which embeds it in a button\n client.createCheckout(args, (err, checkout) => {\n console.log(err, checkout);\n if (err) {\n res.json(`Error buying ${product[0].title}`);\n }\n res.json(checkout.embed_code);\n });\n });\n });\n }", "function StoreCart() {\n\n\t//get flavor \n\tvar flavor = document.getElementById('flavor').textContent;\n\tflavor = flavor.toLowerCase();\n\t//console.log(flavor);\n\n\t//get glaze selection \n\tvar glaze_list = document.forms[0].value;\n\tvar glaze_choice = document.getElementsByName('glaze');\n\n var glaze;\n\tfor (var i=0; i < (glaze_choice.length); i++) {\n\t\tif (glaze_choice[i].checked) {\n\t\t\tglaze = glaze_choice[i].value;\n\t\t\t//console.log((glaze_choice[i].value));\n\t\t}\n\n\t}\n\n\tvar images = {\n\t\tnone:'images/product1.jpg', \n\t\tstrawberry:'images/strawberry.jpg', \n\t\tchocolate: 'images/choco.jpg', \n\t\tpear:'images/pear.jpg'\n\t};\n\n\t//get corresponding image to glaze\n\tvar img_source = images[glaze];\n\t//console.log(img_source);\n\n\t//get quantity selected\n\tvar qty1 = document.getElementById('qty1').value;\n\tqty1 = parseInt(qty1);\n\t//console.log(qty1);\n\n\t//get price without dollar sign \n\tvar p1 = document.getElementById('price').textContent;\n\tp1 = p1.substring(1);\n\tp1 = parseFloat(p1);\n\ttotal_price = qty1 * p1;\n\t//console.log(p1);\n \n //create new item object for order\n\tvar item = {\n\t\timg_source: img_source,\n\t\tflavor: flavor, \n\t\tglaze: glaze,\n\t\tquantity: qty1,\n\t\tprice: total_price\n\t}\n\n\tvar item_array = [img_source, flavor, glaze, qty1, total_price];\n\n\t//console.log(item);\n\n\tall_items.push(item_array);\n\t//console.log(all_items);\n\n\t//var item_list = \"\";\n\t//item_list += flavor + \" \" + glaze + \" \" + qty1 + \" \" + p1;\n\t//console.log(item_list);\n\n window.localStorage.setItem('item1', JSON.stringify(all_items));\n item1 = window.localStorage.getItem('item1');\n console.log(item1);\n\n}", "function purchaseItem(...fns) => fns.reduce()\n\n{} // & in reduce I am going to pass a callback function", "function applyTaxToItems(user){\n amazonHistory.push(user)\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({}, user, { cart: updatedCart })\n}", "addToCart (productt) {\n checkRepeated(productt) \n added()\n console.log(productt)\n }", "function invokeItemPage(){\n addCart();\n displayCounter();\n addCartForItem('carrot');\n}", "async function getTemplateItemShopping(name,cart,store,item) {\n// let producto = `\n// <div style=\"color:#555555;line-height:120%;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\">\t\n// <div style=\"font-size:12px;line-height:14px;color:#555555;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;text-align:left;\"><p style=\"margin: 0;font-size: 14px;line-height: 17px\">${item.fish.name}</p></div>\t\n// </div>\n// <!--[if mso]></td></tr></table><![endif]-->\n// </div>\n \n// <!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->\n// </div>\n// </div>\n// <!--[if (mso)|(IE)]></td><td align=\"center\" width=\"333\" style=\" width:333px; padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:5px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;\" valign=\"top\"><![endif]-->\n// <div class=\"col num8\" style=\"display: table-cell;vertical-align: top;min-width: 320px;max-width: 328px;\">\n// <div style=\"background-color: transparent; width: 100% !important;\">\n// <!--[if (!mso)&(!IE)]><!--><div style=\"border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:5px; padding-bottom:5px; padding-right: 0px; padding-left: 0px;\"><!--<![endif]-->\n\n \n// <div class=\"\">\n// <!--[if mso]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\"><![endif]-->\n// <div style=\"color:#555555;line-height:120%;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\">\t\n// <div style=\"font-size:12px;line-height:14px;color:#555555;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;text-align:left;\"><p style=\"margin: 0;font-size: 14px;line-height: 17px\">${item.quantity.type + \" - \" + item.quantity.value}</p></div>\t\n// </div>\n// `;\n return new Promise(async function (resolve, reject) {\n let paidDateTime=await formatDates(cart.paidDateTime);\n let header=`<div class=\"\"><!--[if mso]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding-right: 10px; padding-left: 10px; padding-top: 20px; padding-bottom: 20px;\"><![endif]--><div style=\"color:#555555;line-height:120%;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; padding-right: 10px; padding-left: 10px; padding-top: 20px; padding-bottom: 20px;\"><div style=\"font-size:12px;line-height:14px;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;color:#555555;text-align:left;\"><p style=\"margin: 0;font-size: 12px;line-height: 14px\"><span style=\"font-size: 22px; line-height: 26px; color: rgb(51, 51, 51);\"><strong><span style=\"line-height: 26px; font-size: 22px;\">Hey ${name},</span></strong></span></p></div></div><!--[if mso]></td></tr></table><![endif]--></div><!--[if (!mso)&(!IE)]><!--></div><!--<![endif]--></div></div><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div></div></div>`\n let body=`<div style=\"background-color:transparent;\"><div style=\"Margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;\" class=\"block-grid \"><div style=\"border-collapse: collapse;display: table;width: 100%;background-color:transparent;\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"background-color:transparent;\" align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width: 500px;\"><tr class=\"layout-full-width\" style=\"background-color:transparent;\"><![endif]--><!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\" width:500px; padding-right: 0px; padding-left: 0px; padding-top:0px; padding-bottom:0px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;\" valign=\"top\"><![endif]--><div class=\"col num12\" style=\"min-width: 320px;max-width: 500px;display: table-cell;vertical-align: top;\"><div style=\"background-color: transparent; width: 100% !important;\"><!--[if (!mso)&(!IE)]><!--><div style=\"border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:0px; padding-bottom:0px; padding-right: 0px; padding-left: 0px;\"><!--<![endif]--><div class=\"\"><!--[if mso]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\"><![endif]--><div style=\"color:#555555;line-height:150%;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\"><div style=\"font-size:12px;line-height:18px;color:#555555;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;text-align:left;\"><p style=\"margin: 0;font-size: 14px;line-height: 21px\"><span style=\"font-size: 15px; line-height: 22px;\">Thank you for shopping on Marketplace !</span></p><p style=\"margin-top: 20px;font-size: 14px;line-height: 21px\"><span style=\"font-size: 15px; line-height: 22px;\">Your order placed on ${paidDateTime} has been fulfilled by the Seller ${store.owner.firstName} ${store.owner.lastName} and it's now being shipped to Dubai.</span></p><p style=\"margin-top: 20px;font-size: 14px;line-height: 21px\"><span style=\"font-size: 15px; line-height: 22px;\">Your Order Details:</span></p></div></div><!--[if mso]></td></tr></table><![endif]--></div><!--[if (!mso)&(!IE)]><!--></div><!--<![endif]--></div></div><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div></div></div><div style=\"background-color:transparent;\"><div style=\"Margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;\" class=\"block-grid \"><div style=\"border-collapse: collapse;display: table;width: 100%;background-color:transparent;\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"background-color:transparent;\" align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width: 500px;\"><tr class=\"layout-full-width\" style=\"background-color:transparent;\"><![endif]--><!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\" width:500px; padding-right: 0px; padding-left: 0px; padding-top:0px; padding-bottom:0px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;\" valign=\"top\"><![endif]--><div class=\"col num12\" style=\"min-width: 320px;max-width: 500px;display: table-cell;vertical-align: top;\"><div style=\"background-color: transparent; width: 100% !important;\"><!--[if (!mso)&(!IE)]><!--><div style=\"border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:0px; padding-bottom:0px; padding-right: 0px; padding-left: 0px;\"><!--<![endif]--><div class=\"\"><!--[if mso]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\"><![endif]--><div style=\"color:#555555;line-height:150%;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\"><div style=\"font-size:12px;line-height:18px;color:#555555;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;text-align:left;\"><div style=\"font-size: 15px; float: left;width: 40%;\">Order # ${cart.orderNumber}</div><div style=\"font-size: 15px; float: left;width: 60%;padding-left: 5px;box-sizing: border-box; text-align: right;\">Estimated Delivery: <span style=\"color:#9aa84f;font-weight: bold;\">Thursday, Nov 1, 2018</span></div></div></div><div style=\"clear: both;\"></div><!--[if mso]></td></tr></table><![endif]--></div><!--[if (!mso)&(!IE)]><!--></div><!--<![endif]--></div></div><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div></div></div>`;\n let tableStart=`<div style=\"background-color:transparent;\"><div style=\"Margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;\" class=\"block-grid \"><div style=\"border-collapse: collapse;display: table;width: 100%;background-color:transparent;\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"background-color:transparent;\" align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width: 500px;\"><tr class=\"layout-full-width\" style=\"background-color:transparent;\"><![endif]--><!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\" width:500px; padding-right: 0px; padding-left: 0px; padding-top:0px; padding-bottom:0px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;\" valign=\"top\"><![endif]--><div class=\"col num12\" style=\"min-width: 320px;max-width: 500px;display: table-cell;vertical-align: top;\"><div style=\"background-color: transparent; width: 100% !important;\"><!--[if (!mso)&(!IE)]><!--><div style=\"border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:0px; padding-bottom:0px; padding-right: 0px; padding-left: 0px;\"><!--<![endif]--><div class=\"\"><!--[if mso]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\"><![endif]--><div style=\"color:#555555;line-height:150%;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\"><div style=\"font-size:12px;line-height:18px;color:#555555;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;text-align:left;border: 1px solid black;box-sizing: border-box;\">`\n ,tableEnd=`</div></div><div style=\"clear: both;\"></div><!--[if mso]></td></tr></table><![endif]--></div><!--[if (!mso)&(!IE)]><!--></div><!--<![endif]--></div></div><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div></div></div> `\n let itemsTemplate = \"\";\n let img;\n if(item.fish.imagePrimary && item.fish.imagePrimary!=''){\n img=`<img src=\"https://apiseafood.senorcoders.com${item.fish.imagePrimary}\" alt=\"\" style=\"width:100%\" />`\n }\n else{\n img=''\n }\n itemsTemplate=`<div style=\"display: table;height: 100%;flex-wrap: wrap;box-sizing: border-box;padding: 0 0 2px 5px;align-items: center;width:100%\"><div style=\"width: 30%;float: left;box-sizing: border-box;padding-top: 5px; height: 100%\">${img}</div><div style=\"width: 50%;float: left;box-sizing:border-box;padding: 5px; height: 100%\">Shipment 1 of 1 sold by ${store.name}<br /><span style=\"color:blue;font-weight: bold;\">${item.fish.name}</span> <br /> <span style=\"color:black;font-weight: bold;\">QTY - ${item.quantity.value} ${item.quantity.type}</span></div><div style=\"width: 20%;float: left;background: #b9b4b4;box-sizing:border-box;padding: 5px;color:black; text-transform: uppercase;font-size: 14px; height: 100%;align-items: center;border-left: 1px solid black;position:relative;display:table\"><p style=\"position: absolute;top: 50%;transform: translate(0,-50%)\">${item.price.value* item.quantity.value} AED</p></div></div>`\n let shipping=item.shipping,otherTaxes=item.sfsMargin+item.customs+item.uaeTaxes;\n let subtotal=shipping+otherTaxes+(item.price.value*item.quantity.value);\n let taxesHtml=`<div style=\"display: table;height: 100%;flex-wrap: wrap;box-sizing: border-box;padding: 0 0 2px 5px;align-items: center;width: 100%;\"><div style=\"width: 30%;float: left;box-sizing: border-box;padding-top: 5px; height: 100%\"></div><div style=\"width: 50%;float: left;box-sizing:border-box;padding: 5px; height: 100%; font-weight: lighter;\">Shipping Fees</div><div style=\"width: 20%;float: left;background: #b9b4b4;box-sizing:border-box;padding: 5px;color:black; text-transform: uppercase;font-size: 14px; height: 100%;border-left: 1px solid black;\"><span style=\"position: absolute;top: 50%;transform: translate(0,-50%)\">${shipping} AED</span></div></div><div style=\"display: table;height: 100%;flex-wrap: wrap;box-sizing: border-box;padding: 0 0 2px 5px;align-items: center;width: 100%;\"><div style=\"width: 30%;float: left;box-sizing: border-box;padding-top: 5px; height: 100%\"></div><div style=\"width: 50%;float: left;box-sizing:border-box;padding: 5px; height: 100%; font-weight: lighter;\">Taxes and Customs and other Fees </div><div style=\"width: 20%;float: left;background: #b9b4b4;box-sizing:border-box;padding: 5px;color:black; text-transform: uppercase;font-size: 14px; height: 100%;align-items: center;border-left: 1px solid black;\"><span style=\"position: absolute;top: 50%;transform: translate(0,-50%)\">${otherTaxes} AED</span></div></div>`\n let subtotalHtml=`<div style=\"display: table;height: 100%;flex-wrap: wrap;box-sizing: border-box;padding: 0 0 2px 5px;align-items: center;width: 100%;\"><div style=\"width: 30%;float: left;box-sizing: border-box;padding-top: 5px; height: 100%\"></div><div style=\"width: 50%;float: left;box-sizing:border-box;padding: 5px; height: 100%; font-weight: bold;;font-size: 14px\"> Sub Total </div><div style=\"width: 20%;float: left;background: #b9b4b4;box-sizing:border-box;padding: 5px;color:black; text-transform: uppercase;font-size: 14px; height: 100%;border-left: 1px solid black; font-weight: bold;\"><span style=\"position: absolute;top: 50%;transform: translate(0,-50%)\">${subtotal}AED</span></div></div>`\n let prefooter=`<div style=\"background-color:transparent;\"><div style=\"Margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;\" class=\"block-grid \"><div style=\"border-collapse: collapse;display: table;width: 100%;background-color:transparent;\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"background-color:transparent;\" align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width: 500px;\"><tr class=\"layout-full-width\" style=\"background-color:transparent;\"><![endif]--><!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\" width:500px; padding-right: 0px; padding-left: 0px; padding-top:0px; padding-bottom:0px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;\" valign=\"top\"><![endif]--><div class=\"col num12\" style=\"min-width: 320px;max-width: 500px;display: table-cell;vertical-align: top;\"><div style=\"background-color: transparent; width: 100% !important;\"><!--[if (!mso)&(!IE)]><!--><div style=\"border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:0px; padding-bottom:0px; padding-right: 0px; padding-left: 0px;\"><!--<![endif]--><div class=\"\"><!--[if mso]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\"><![endif]--><div style=\"color:#555555;line-height:150%;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif; padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;\"><div style=\"font-size:12px;line-height:18px;color:#555555;font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;text-align:left;\"><p style=\"margin: 0;font-size: 14px;line-height: 21px\"><span style=\"font-size: 15px; line-height: 22px;\">Your Order will be delivered to: <br>Address: ${cart.buyer.dataExtra.Address},<br> City: ${cart.buyer.dataExtra.City},<br> Country: ${cart.buyer.dataExtra.country},<br> zipCode: ${cart.buyer.dataExtra.zipCode}</span></p><p style=\"margin-top: 20px;font-size: 14px;line-height: 21px\"><span style=\"font-size: 15px; line-height: 22px;\">To track and manage your orders, please login into Marketplace Orders page or click on the button below:</span></p></div></div><!--[if mso]></td></tr></table><![endif]--></div><!--[if (!mso)&(!IE)]><!--></div><!--<![endif]--></div></div><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div></div></div>`\n fs.readFile(\"./template_emails/order_shipped_header.html\", \"utf8\", function (err, data) {\n if (err) { return reject(err); }\n fs.readFile(\"./template_emails/order_shipped_footer.html\", \"utf8\", function (err, data2) {\n if (err) { return reject(err); }\n resolve(data + header + body +tableStart+itemsTemplate+taxesHtml+subtotalHtml +tableEnd+prefooter+ data2);\n });\n });\n })\n}", "handleAddItemToCart(item, quantity){\n var buyableItem = new BuyableItem(item, quantity);\n currentCart.push(buyableItem);\n this.setState({cartQuantity : this.calculateCartQuantity(currentCart)})\n localStorage.setItem(\"cart\", JSON.stringify(currentCart));\n this.readFromCart();\n }", "constructor() {\n /**\n * The tax of the product item after adjustments applying.\n * @member {Number} adjusted_tax\n */\n this.adjusted_tax = undefined\n\n /**\n * The base price for the line item, which is the price of the unit before applying\n * adjustments, in the purchase currency. The base price may be net or gross of\n * tax depending on the configured taxation policy.\n * @member {Number} base_price\n */\n this.base_price = undefined\n\n /**\n * The item identifier. Use this to identify an item when updating the item\n * quantity or creating a custom price adjustment for an item.\n * @member {String} item_id\n */\n this.item_id = undefined\n\n /**\n * The text describing the item in more detail.\n * @member {String} item_text\n */\n this.item_text = undefined\n\n /**\n * The price of the line item before applying any adjustments. If the line item is\n * based on net pricing then the net price is returned. If the line item is\n * based on gross pricing then the gross price is returned.\n * @member {Number} price\n */\n this.price = undefined\n\n /**\n * Array of price adjustments. Can be empty.\n * @member {Array.<module:models/PriceAdjustment>} price_adjustments\n */\n this.price_adjustments = undefined\n\n /**\n * The price of the product line item after applying all product-level adjustments.\n * For net pricing the adjusted net price is returned. For gross pricing,\n * the adjusted gross price is returned.\n * @member {Number} price_after_item_discount\n */\n this.price_after_item_discount = undefined\n\n /**\n * The identifier of the shipment to which this item belongs.\n * @member {String} shipment_id\n */\n this.shipment_id = undefined\n\n /**\n * The tax of the product item before adjustments applying.\n * @member {Number} tax\n */\n this.tax = undefined\n\n /**\n * The price used to calculate the tax for this product item.\n * @member {Number} tax_basis\n */\n this.tax_basis = undefined\n\n /**\n * The tax class ID for the product item or null if no tax class ID is associated with the product item.\n * @member {String} tax_class_id\n */\n this.tax_class_id = undefined\n\n /**\n * The tax rate, which is the decimal tax rate to be applied to the product represented by this item.\n * @member {Number} tax_rate\n */\n this.tax_rate = undefined\n }", "function addToOrder() { \r\n\tlet placeorder;\r\n\tlet item = document.getElementById(\"item\").value;\r\n\tlet lettuce = document.getElementById(\"lettuce\");\r\n\tlet meat = document.getElementById(\"meat\");\r\n\tlet cheese = document.getElementById(\"cheese\").value;\r\n\tif (item === \"burger\" && cheese != \"none\") {\r\n\t\tplaceorder = new CheeseBurger(4.49, lettuce, meat, cheese);\r\n\t} else if (item === \"burger\") {\r\n\t\tplaceorder = new Burger(3.99, lettuce, meat, cheese);\r\n\t} else {\r\n\t\tplaceorder = new Sandwich (2.99, lettuce, meat, cheese);\r\n\t}\r\n\torder.add(placeorder);\r\n}", "function askuser()\n {\n// 6. The app should then prompt users with two messages.\n\n// * The first should ask them the ID of the product they would like to buy.\n// * The second message should ask how many units of the product they would like to buy.\n inquirer.prompt([\n {\n type: \"Input\",\n name: \"productname\",\n message: \"what product would you like to buy today?\"\n },\n{\n type: \"Input\",\n name: \"quantity\",\n message: \"How many units would you like to buy today?\" \n}])\n .then (function (userresponse) {\n // 7. Once the customer has placed the order, your application should check if your store has enough of the product to meet the customer's request.\n\n// * If not, the app should log a phrase like `Insufficient quantity!`, and then prevent the order from going through.\n\n// 8. However, if your store _does_ have enough of the product, you should fulfill the customer's order.\n// * This means updating the SQL database to reflect the remaining quantity.\n// * Once the update goes through, show the customer the total cost of their purchase.\n\n// - - -\n// console.log(userresponse);\nconnection.query(\"select * from products where ?\",[{product_name:userresponse.productname}],function(err,productinfo){\n if(err) throw err;\n// console.log(productinfo);\nif(productinfo=== undefined || productinfo.length == 0)\n{\n \n console.log(\"Invalid product ! Please select a valid product from the list above\")\n \n}\n\nelse\n{\nvar orderquantity=parseInt(userresponse.quantity) ;\n// console.log(orderquantity);\n\nvar quantity=parseInt(productinfo[0].stock_quantity);\nconsole.log(nextline+\"Currently Available : \"+quantity);\nvar price=productinfo[0].price;\nconsole.log(nextline+\"Price per unit : $\"+price);\nvar remaining=quantity-orderquantity;\nconsole.log(nextline+\"No. of units remaining : \"+remaining);\nvar totalcost=orderquantity*price;\nconsole.log(\"Total Cost : $\"+totalcost);\n if (orderquantity > quantity) {\n console.log(nextline+\"Sorry your order has been cancelled.Insufficient quantity!\");\n \n }\n else {\n console.log(nextline+\"Your order is being processesed ..................\"+ nextline);\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: remaining\n },\n {\n product_name: userresponse.productname\n }\n ],\n function(error) {\n if (error) throw err;\n console.log(nextline+\"*************************Order placed successfully!************************\"\n +nextline +\"Your total cost is $\"\n +totalcost+nextline);\n \n }\n );\n connection.end();\n }\n }\n \n })\n})\n }", "function GroceryItem(name, amount) \r\n{\r\n\tthis.name = name;\r\n\tthis.amount = amount;\r\n\tthis.purchased = false;\r\n\tthis.id = name + Math.floor((Math.random()*100)+1);\r\n}", "function purchaseItem() {\n\n // Defining query terms to select the item being purchased\n var queryTerms = \"SELECT * FROM products WHERE ?\";\n connection.query(queryTerms, {item_id: itemID}, function(err, results) {\n if (err) throw err;\n\n // Reassigning data into new variables\n quantityOnHand = results[0].stock_quantity;\n totalPrice = (purchaseQuantity * results[0].price).toFixed(2);\n newSales = totalPrice;\n\n // Getting data from the individual record to handle total product sales\n // Sometimes the product sales are recorded as \"null\" in the table, so this is error handling for that.\n if (results[0].product_sales === null) {\n totalSales = 0;\n } else {\n totalSales = (results[0].product_sales).toFixed(2);\n }\n\n // If the item being purchased fits within the inventory...\n if (purchaseQuantity <= quantityOnHand) {\n console.log(\"\\nYou ordered \" + purchaseQuantity + \" \" + results[0].product_name + \"(s).\" +\n \"\\nYour total is $\" + totalPrice + \" + tax.\\n\");\n updateQuantity();\n // Otherwise reroute to the beginning\n } else {\n console.log(\"\\n**** Insufficient quantity on hand. Please try again.\\n\"); \n start(); \n }\n });\n} // End purchaseItem function", "function transaction() {\n\n // Queries the bamazon db and selects all fields from the products table\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n\n // Prompt that will display everything currently in inventory and then asks the use to select the Item ID for the desired product\n inquirer\n .prompt([\n {\n name: \"choice\",\n type: \"rawlist\",\n choices: function () {\n var idArray = [];\n console.log(\"\\n\\n-------------------------------\\n Products Currently for sale\\n-------------------------------\\n\");\n for (var i = 0; i < results.length; i++) {\n console.log(\"==================================================\")\n console.log(\" Item ID: \" + idArray.push(results[i].item_id));\n console.log(\" Product Name: \" + results[i].product_name);\n console.log(\" Category: \" + results[i].department_name);\n console.log(\" Price: $\" + results[i].price);\n console.log(\" Current Stock: \" + results[i].stock_quantity);\n console.log(\"==================================================\\n\")\n }\n return idArray;\n },\n message: \"Enter the Item ID number of the product you would like to buy.\"\n },\n\n // Asks the user the quantity they would like to purchase\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many would you like to buy?\"\n }\n ])\n\n .then(function (answer) {\n\n // Defines variables for the product and it's table values\n var arrayNum = answer.choice - 1;\n var price = round(results[arrayNum].price, 2)\n var total = round(answer.quantity * price, 2)\n var itemID = results[arrayNum].item_id;\n var prodName = results[arrayNum].product_name;\n var quantityToBuy = answer.quantity;\n var stockQuantity = results[arrayNum].stock_quantity;\n\n // Checks to see if there is enough inventory stock to fullfill the user's purchase\n if (quantityToBuy > stockQuantity) {\n console.log(\"Insufficient quantity!\");\n }\n\n else {\n // Variable that holds the updated inventory stock after the purchase\n var updatedQuantity = stockQuantity - quantityToBuy;\n\n // Updates the products table and sets the stock_quantity value to the updated quantity \n // where the item_id is the number the user selected\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedQuantity\n },\n {\n item_id: itemID\n }\n ],\n function (error) {\n if (error) throw err;\n\n // Shows the user what they purchased and the amount.\n console.log(\"\\nItem(s) Purchased!\");\n console.log(\"==================================\\n Item ID: \" + itemID + \"\\n Product: \" + prodName + \"\\n Price: $\" + price + \"\\n Quantity: \"\n + quantityToBuy + \"\\n Total: $\" + total + \"\\n==================================\");\n }\n );\n }\n\n // Closes connection to bamazon db\n connection.end();\n });\n });\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 cart() {\n const productsInCart = [];\n return {\n getProducts: () => {\n return productsInCart.map(item => {\n return {\n name: item.name,\n price: item.price\n };\n });\n },\n addToCart: product => {\n productsInCart.push(product);\n },\n\n totalPrice: () => {\n const totalPrice = productsInCart.reduce((total, item) => {\n total += item.price;\n return total;\n }, 0);\n return totalPrice;\n }\n };\n}", "static async create(req, res) {\n if (!req.params.user_id) {\n return res.error('Invalid id supplied');\n }\n\n try {\n const oldCart = await Cart.findOne({\n user_id: req.params.user_id,\n deleted: false,\n });\n if (oldCart) {\n return res.error('Duplicate item found');\n }\n\n const cart = new Cart({\n user_id: req.params.user_id,\n items: req.body.items,\n });\n const invalid = await CartController._checkProductsAvailInStock(cart);\n if (invalid !== '') {\n return res.error(`Item '${invalid}' is not sufficient in stock`);\n }\n\n await cart.save();\n return res.item_with_products(cart);\n } catch (err) {\n return res.error(err.message);\n }\n }", "function cartItem(sku, name, price, quantity) {\r\n this.sku = sku;\r\n this.name = name;\r\n this.price = price * 1;\r\n this.quantity = quantity * 1;\r\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({}, user, { cart: updatedCart })\n}", "function sellItem(itemName, startPrice, userId )\n\t{\t\n\t\titemName = \"electronics\" ;\t//TEST CODE REMOVE\n\t\tstartPrice = 12;\t\t\t//TEST CODE REMOVE\n\t\tuserId = 1;\t\t\t\t//TEST CODE REMOVE\n\n\t\t// object to post (body)\n\t\tvar item = {\n\t\t\t\"item_name\": itemName,\n\t\t\t\"starting_price\": startPrice,\n\t\t\t\"allUserId\": userId\n\t\t};\n\t\t\n\t\t$.ajax({\n \tmethod: \"POST\",\n \turl: \"/api/forsale\",\n \tdata: item\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\n\t });\n\t}", "function cartItem(detail, name, price, quantity) {\n this.detail = detail;\n this.name = name;\n this.price = price * 1;\n this.quantity = quantity * 1;\n}", "function buyItem(user){\n return Object.assign({}, user, { purchases: })\n}", "addToCart(productData) {\n\n //1. create a productObj object from the data attributes in 'productData' variable\n let productObj = this.createProductObj(productData);\n\n //2. check if the product is already in cart\n let productInCart = this.productAlreadyInCart(productObj.productId);\n\n \n if(productInCart) {\n\n //2.1.) product is IN cart and IN stock \n // productObj.productCurrentCount = ++productInCart.productCurrentCount;\n let success = this.increaseProductCount(productInCart);\n if(!success) {\n console.log(\"Product is out of stock\");\n }\n return true;\n \n } else {\n \n //3.) product not in cart => set its count to 1 \n productObj.productCurrentCount = 1;\n \n //add this new product to cart\n this.addNewProduct(productObj);\n return true;\n }\n\n }", "function addToCart(){\n//the function to add chosen door to a cart\n//and put it to a LOCAL STORAGE\nvar chosenItem = this.getAttribute('data-button-propName'); // chosen item is an unique item, chosen with a button click and added to CARTFORITEMS object\n if(cartForItems[chosenItem] != undefined){\n cartForItems[chosenItem] = cartForItems[chosenItem]+1;\n }else{\n cartForItems[chosenItem] = 1;\n }\n totalPrice += priceCollector[chosenItem].price;\nlocalStorage.setItem('addedToCartItems', JSON.stringify(cartForItems));\nlocalStorage.setItem('addedTotalPrice', JSON.stringify(totalPrice));\nconsole.log(cartForItems[chosenItem]);\nconsole.log(totalPrice);\nshowItemsInCart();\nrenderDiv();\n}", "function purchaseItem() {\n\tinquirer.prompt([{\n\t\tname: \"puchaseItemID\",\n\t\ttype: \"input\",\n\t\tmessage: \"What is the ID Number of the item you'd like to purchase?\",\n\t\tvalidate: function(value) {\n\t\t\tif (value >= 1 && value <= 12) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}, \n\n\t{\n\t\tname: \"purchaseQty\",\n\t\ttype: \"input\",\n\t\tmessage: \"How many of this item would you like to purchase?\",\n\t\tvalidate: function(value) {\n\t\t\tif (value) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\t\t\n\t}]).then(function(response) {\n\t\t// connection.query(\"SELECT * FROM products\", function(err, res) {\n\t\t\t// console.log(res);\n\t\t// });\n\t\torderItem(response);\n\t});\n}", "function addToCart(id) {\n var troba=false;\n if(cart.length==0){\n cart.push(products[id-1]);\n cart[0].quantity=1;\n }\n else if(cart.length>0){\n for(var i=0; i<cart.length; i++){\n if(products[id-1].name==cart[i].name){\n troba=true;}\n if(troba){\n cart[i].quantity++;}\n }\n if(troba==false){\n cart.push(products[id-1]);\n cart[cart.length-1].quantity=1;\n }\n }\n for( let i=0; i<cart.length; i++){\n cart[i].subtotal=cart[i].quantity*cart[i].price;\n }applyPromotionsCart();\n \n}", "function newCartItem(rollImg, rollName, numQty, rollPrice, subtotal){\n this.rollImg=rollImg;\n this.rollName=rollName;\n this.numQty=numQty;\n this.rollPrice=rollPrice;\n this.subtotal=subtotal;\n }", "function CartItem(sku, type,name, slug, mrp, price, quantity, image, category, size, weight) {\r\n // console.log(size);\r\n this.sku = sku;\r\n this.type = type;\r\n this.name = name;\r\n this.slug = slug;\r\n this.image = image;\r\n this.category = category;\r\n this.size = size;\r\n this.mrp = mrp;\r\n this.price = price * 1;\r\n this.quantity = quantity * 1;\r\n this.weight = weight * 1;\r\n this.status = 0;\r\n}", "function productsForSale() {\n // console.log(\"Here are the items in stock: \");\n connection.query(\"SELECT * FROM products\", function(err, response) {\n //if there is an error, console log the error\n if (err) {throw err;\n } else {\n // if no error log all results of the SELECT statement\n console.table(response);\n }\n //calls function that prompts customer request\n likeToBuy();\n });\n}", "purchaseBook() {\n const Purchase = {\n user_email: this.state.myEmail,\n book_id: this.state.bookID,\n quantity: 1 \n };\n API.addPurchase(Purchase)\n .then(() => alert(\"Book Purchased!\"))\n .catch(err => console.log(err));\n }" ]
[ "0.75987434", "0.75987434", "0.75987434", "0.75987434", "0.75987434", "0.75987434", "0.7352021", "0.726937", "0.7176461", "0.7035906", "0.7009222", "0.6938106", "0.68814236", "0.68814236", "0.6756084", "0.67458695", "0.6652405", "0.6566373", "0.6565125", "0.6518857", "0.6499322", "0.6494505", "0.6474367", "0.641735", "0.63961744", "0.63818395", "0.63810205", "0.6351628", "0.6334675", "0.63184243", "0.63130313", "0.6309769", "0.6309129", "0.6309058", "0.6305792", "0.6303196", "0.6291895", "0.6283128", "0.6283017", "0.6272757", "0.62673974", "0.6263938", "0.6261146", "0.62571394", "0.6245214", "0.6240491", "0.62239695", "0.6222015", "0.62205505", "0.6220301", "0.62189406", "0.62146384", "0.62070096", "0.61863416", "0.6184724", "0.61788166", "0.6176842", "0.6171437", "0.6170355", "0.61649776", "0.61613643", "0.61610526", "0.61570317", "0.6144496", "0.61418897", "0.61391765", "0.61303496", "0.6116678", "0.6109869", "0.610279", "0.61000127", "0.60965294", "0.6092114", "0.60819805", "0.60711586", "0.6060228", "0.60550106", "0.6054781", "0.60538614", "0.60478866", "0.6047343", "0.6045286", "0.6043504", "0.604027", "0.60373616", "0.6034523", "0.60277504", "0.6015364", "0.60132533", "0.6010327", "0.5996515", "0.5995513", "0.5992147", "0.5987427", "0.59858376", "0.5983273", "0.5972913", "0.59692335" ]
0.6370175
29
I am going to say const
function applyTaxToItems(user){ const }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Constants() {}", "function Constants() {}", "function exampleConst(){\n\tconst sample = 2\n\tconsole.log(sample)\n\tsample = 10 \n\tconsole.log(sample)\n}", "function _const() {\n return function() {\n this.__init(arguments);\n return this;\n };\n}", "function Const(){ return Identifier.apply(this,arguments) }", "function CONST(){\n const a=100; //cannot be changed\n x=\"abcd\"\n //const x; not allowed**\n document.getElementById('i').innerHTML=x; //dont output anything\n}", "function describeConst(val) {\n return {\n writable: false,\n enumerable: false,\n configurable: false,\n value: val\n };\n}", "function constScope(){\n const thisIsConst = \"blockScoped\"; // the const variable is only accesible within this function scope.\n return \"const variables are\" + \" \" + constScope + \" \" + \"and cannot be redclared nor updated.\";\n}", "get E() { return get_const(0); }", "function constObjects() {\n const name = {\n person: \"reefath\"\n }\n \n name.person = \"tesla\"\n \n return name.person;\n}", "function constant(name) {\n\t\treturn getProperty(CONST, name);\n\t}", "const(nameOrPrefix, rhs, _constant) {\n return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);\n }", "function testconstant(){\n\t//d=\"test1\" error assignment to constant variable\n\tconst d=\"test1\";\n\tconsole.log(d);\n}", "function BaseConstant(value) {\n return {\n type: \"constant\",\n value: () => value\n }\n}", "function CONST(key) {\n return exports.constants[key];\n}", "function Constants() {\n throw new Error('Constants should not be instantiated!');\n}", "function sample() {\r\n var a = 5;\r\n \r\n if (true) {\r\n const a = 10; \r\n console.log(\"var with Const : \"+ a); // Output: var with Const : 10\r\n }\r\n}", "function noConst(x) {\n return x * x;\n}", "function isConstant(schema) {\n return (0, _isArray[\"default\"])(schema[\"enum\"]) && schema[\"enum\"].length === 1 || schema.hasOwnProperty(\"const\");\n}", "function const_(x){ return function(_){ return x } }", "function sample() {\r\n const a = 5;\r\n \r\n if (true) {\r\n let a = 10; \r\n console.log(\"const with let: \" + a); // Output: const with let: 10\r\n }\r\n}", "function foo() {\n const name = 'test';\n}", "function $Const(strConstant)\n{\n\tif (Vixen.Constants[strConstant] == undefined)\n\t{\n\t\tthrow(\"ERROR: constant: '\"+ strConstant +\"' is undefined\");\n\t\treturn;\n\t}\n\t\n\treturn Vixen.Constants[strConstant];\n}", "function ApplicationEditPageConstants() {\n }", "function constant(arg) {\n return function () {\n return arg;\n };\n }", "function local() {\n let localNumber = 4\n const localConst = 5\n console.log(localNumber, localConst)\n}", "function varOrConst() {\n console.log(varone);\n console.log(vartwo);\n\n var varone = 1;\n const vartwo = 2;\n}", "function constant(c) {\n return function() {\n return c;\n };\n }", "function useConst(initialValue) {\n // Use useRef to store the value because it's the least expensive built-in hook that works here\n // (we could also use `const [value] = React.useState(initialValue)` but that's more expensive\n // internally due to reducer handling which we don't need)\n var ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef();\n if (ref.current === undefined) {\n // Box the value in an object so we can tell if it's initialized even if the initializer\n // returns/is undefined\n ref.current = {\n value: typeof initialValue === 'function' ? initialValue() : initialValue,\n };\n }\n return ref.current.value;\n}", "function useConst(initialValue) {\n // Use useRef to store the value because it's the least expensive built-in hook that works here\n // (we could also use `const [value] = React.useState(initialValue)` but that's more expensive\n // internally due to reducer handling which we don't need)\n var ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef();\n if (ref.current === undefined) {\n // Box the value in an object so we can tell if it's initialized even if the initializer\n // returns/is undefined\n ref.current = {\n value: typeof initialValue === 'function' ? initialValue() : initialValue,\n };\n }\n return ref.current.value;\n}", "function $const_set(cref, name, value) {\n var new_const = true;\n\n if (cref == null || cref === '::') cref = _Object;\n\n if (value.$$is_a_module) {\n if (value.$$name == null || value.$$name === nil) value.$$name = name;\n if (value.$$base_module == null) value.$$base_module = cref;\n }\n\n cref.$$const = (cref.$$const || Object.create(null));\n\n if (name in cref.$$const || (\"$$autoload\" in cref && name in cref.$$autoload)) {\n new_const = false;\n }\n\n cref.$$const[name] = value;\n\n // Add a short helper to navigate constants manually.\n // @example\n // Opal.$$.Regexp.$$.IGNORECASE\n cref.$$ = cref.$$const;\n\n Opal.const_cache_version++;\n\n // Expose top level constants onto the Opal object\n if (cref === _Object) Opal[name] = value;\n\n // Name new class directly onto current scope (Opal.Foo.Baz = klass)\n $prop(cref, name, value);\n\n if (new_const && cref.$const_added && !cref.$const_added.$$pristine) {\n cref.$const_added(name);\n }\n\n return value;\n }", "function CONST_EXPR(expr) {\n return expr;\n}", "parseMaybeConst () {\n const constToken = this.getToken();\n if(constToken.type === this.lexerClass.RK_CONST) {\n this.pos++;\n const typeString = this.parseType();\n return this.parseDeclaration(typeString, true);\n } else if(this.isVariableType(constToken)) {\n const typeString = this.parseType();\n return this.parseDeclaration(typeString);\n } else {\n throw SyntaxErrorFactory.token_missing_list(\n [this.lexer.literalNames[this.lexerClass.RK_CONST]].concat(this.getTypeArray()), constToken);\n }\n\n }", "function tp_const_string(constant)\n{\n\tswitch (constant) {\n\t\tcase ROW:\n\t\t\treturn 'row';\n\n\t\tcase COLUMN:\n\t\t\treturn 'column';\n\n\t\tcase TOP:\n\t\t\treturn 'top';\n\n\t\tcase RIGHT:\n\t\t\treturn 'right';\n\n\t\tcase BOTTOM:\n\t\t\treturn 'bottom';\n\n\t\tcase LEFT:\n\t\t\treturn 'left';\n\n\t\tcase TOP_LEFT:\n\t\t\treturn 'top left';\n\n\t\tcase TOP_RIGHT:\n\t\t\treturn 'top right';\n\n\t\tcase BOTTOM_RIGHT:\n\t\t\treturn 'bottom right';\n\n\t\tcase BOTTOM_LEFT:\n\t\t\treturn 'bottom left';\n\t}\n}", "function CONSTANT() {\n var _this = this;\n if (instance) {\n return instance;\n }\n _this = _super.call(this) || this;\n instance = _this;\n return instance;\n }", "function Constants() {\n if (currentToken() == \"constantes\") {\n nextToken();\n if (currentToken() == \"{\") {\n nextToken();\n ConstBody();\n if (currentToken() == \"}\") {\n nextToken();\n return;\n }\n }\n } else {\n let errorMessage = \"Bloco obrigatório de constantes não encontrado\";\n handleError(errorMessage);\n }\n }", "function h() {\n console.log(CONST_VAR);\n}", "function unaFuncion(){\n const unValorConstante = 200;\n console.log(unValorConstante);\n}", "constant(name, value) {\n return this.singleton(name, () => value);\n }", "function returnTwo() {\n return 2; // otherwise it should rather just be a constant.\n}", "function ConstV(val, len) {\n this.val = val;\n this.length = len;\n this.cached = false;\n }", "_constants()\n {\n this.CREATED_AT = CREATED_AT;\n this.UPDATED_AT = UPDATED_AT;\n this.PRIMARY_KEY = PRIMARY_KEY;\n }", "static transient final private protected internal function m40() {}", "function constant(x) {\n return function(y) {\n return x;\n };\n }", "function constant(x) {\n return function(y) {\n return x;\n };\n }", "function constant(a) {\n return function () {\n return a;\n };\n}", "function body2Constant(body){ return Globals.bodyConstants[bIndex(body)]; }", "function constant(value) {\n return new Constant(value)\n}", "static transient private public function m56() {}", "function lol() {\n let person = 'Tom';\n const age = 45;\n var color = 'teal';\n console.log(age);\n}", "isConstant() {\n if (this.type == \"name\" && this.value == \"x\") {\n return false\n }\n if (this.left != undefined && !this.left.isConstant()) {\n return false\n }\n if (this.right != undefined && !this.right.isConstant()) {\n return false\n }\n return true\n }", "function constant(v) {\n return function() {\n return v;\n };\n }", "function replace_const_with_let(src) {\n\t// This is a poor man's version of a parser:\n\t// we want to replace all `const` declarations\n\t// with `let`, in order to be able to __set__ them.\n\t// This method with a regex is not perfect, but works well enough,\n\t// although it doesn't cover one use case: the reassignment of a\n\t// variable that has been declared with `const`.\n\treturn src.replace(matchConst, \"$1let $2\") // replace const with let, while maintaining the column width\n}", "function constant(value) {\n return function() {\n return value;\n };\n }", "function constant(value) {\n return function() {\n return value;\n };\n }", "function constant(value) {\n return function() {\n return value;\n };\n }", "function constant(value) {\n return function() {\n return value;\n };\n }", "function constant(value) {\n return function() {\n return value;\n };\n }", "function constant(value) {\n return function() {\n return value;\n };\n }", "function constant(value) {\n return function() {\n return value;\n };\n }", "function constant(value) {\n return function() {\n return value;\n };\n }", "function constant(value) {\n return function() {\n return value;\n };\n }", "static transient private protected internal function m55() {}", "function getTranslationConstPrefix(extra){return(\"\"+CLOSURE_TRANSLATION_PREFIX+extra).toUpperCase();}", "static transient final private public function m41() {}", "function main(input) {\n const a = input;\n\n // This will throw \"SyntaxError: Missing initializer in const declaration\"\n // const b;\n\n console.log(a);\n}", "static transient final private internal function m43() {}", "static transient final protected public internal function m46() {}", "function constant(value) {\n return function() {\n return value;\n };\n}", "function myfun(){\r\n var b=20;\r\n console.log(a);\r\n console.log(b);\r\n console.log(aa);\r\n const myconst = [4,5,6];\r\n\r\n let ab = \"outside\";\r\n var ac = \"outside\";\r\n if (true){\r\n var c =45;\r\n // const myconst = [8,5,6];\r\n let ab = \"inside\";\r\n var ac = \"inside\"\r\n console.log(myconst);\r\n console.log(c);\r\n console.log(ab);\r\n }\r\n // console.log(myconst);\r\n console.log(ab);\r\n console.log(ac);\r\n}", "getConstMap() {\n return this.cache.getOrAdd('constMap', () => {\n const map = new Map();\n this.enumerateBrsFiles((file) => {\n for (let stmt of file.parser.references.constStatements) {\n const lowerEnumName = stmt.fullName.toLowerCase();\n //only track enums with a defined name (i.e. exclude nameless malformed enums)\n if (lowerEnumName) {\n map.set(lowerEnumName, { item: stmt, file: file });\n }\n }\n });\n return map;\n });\n }", "function freezeObj(){\n \"use strict\";\n const MATH_CONSTANTS={\n PI:3.14\n };\n \n Object.freeze(MATH_CONSTANTS);\n \n try{\n MATH_CONSTANTS.PI=99;\n }catch(ex){\n console.log(ex);\n }\n return MATH_CONSTANTS.PI;\n}", "transient protected internal function m189() {}", "constHandler() {\n\t\tlet constant = this.m_constMenu.value;\n\t\tlet constUnit = this.m_constUnitMenu.value;\n\t\tif(constant != \"\" && constUnit != \"\") {\n\t\t\tlet value = this.CALCULATOR.getConst(constant, constUnit);\n\t\t\tthis.m_constOutput.value = value;\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"constHandler received an empty value\");\n\t\t}\n\t}", "function h() {\r\n const magic = 3;\r\n console.log(magic);\r\n}", "function get_const(n) {\n var t, c, p;\n t = const_tab[n];\n p = BigFloatEnv.prec;\n if (t && t.prec == p) {\n return t.val;\n } else {\n switch(n) {\n case 0: c = Float.exp(1); break;\n case 1: c = Float.log(10); break;\n// case 2: c = Float.log(2); break;\n case 3: c = 1/Float.log(2); break;\n case 4: c = 1/Float.log(10); break;\n// case 5: c = Float.atan(1) * 4; break;\n case 6: c = Float.sqrt(0.5); break;\n case 7: c = Float.sqrt(2); break;\n }\n if (p <= 1024) {\n const_tab[n] = { prec: p, val: c };\n }\n return c;\n }\n }", "function FunctionConst6(name = 'Zonayed Ahmed', age = 21) {\n this.name = name;\n this.age = age;\n}", "function constantobjects() {\n const user = {\n name: \"John\"\n };\n\n console.log(user.name);\n\n // does it work? // yes\n user.name = \"Pete\";\n console.log(user.name);\n}", "function changeToConstFunction(FunctionNode) {\n let template = constFunctionTamplate()[0];\n let y = [...template.declarations];\n y[0].id = FunctionNode.id;\n y[0].init = {\n ...y[0].init,\n id: FunctionNode.id,\n params: FunctionNode.params,\n body: FunctionNode.body,\n };\n let x = {\n ...template,\n declarations: y,\n };\n return x;\n}", "transient final protected internal function m174() {}", "function attrConstant() {\n this.setAttribute(name, value);\n }", "function attrConstant() {\n this.setAttribute(name, value);\n }", "private public function m246() {}", "static transient final private public internal function m42() {}", "function constant(v) {\r\n\t return function() {\r\n\t return v;\r\n\t };\r\n\t}", "rmFaveConst() {\n\t\tthis.m_faves.constant = \"\";\n\t\tthis.m_faves.constUnit = \"\";\n\t\tthis.updateStar(1);\n\t}", "function constant_function() {\n const Stones = {type:\"metamorphic\", name:\"Quartzite\", color:\"white\"};\n Stones.density = \"2.7 g/cm^3\"; //added new property and value\n document.getElementById(\"Constant\").innerHTML = Stones.name + \" is a \" + Stones.type + \" rock. Its color is typically \" + Stones.color + \" and has a density of \" + Stones.density;\n}", "function ConstantSet(overrides){\r\n \"use strict\";\r\n if (overrides) {\r\n ChangeValues(this, overrides);\r\n }\r\n}", "static transient final protected function m44() {}", "transient private internal function m185() {}", "static get INVALID()\n\t{\n\t\treturn 2;\n\t}", "function attrConstant() {\n this.setAttribute(name, value);\n }", "transient final private internal function m170() {}", "function freezeObj() {\n \"use strict\";\n const MATH_CONSTANTS = {\n PI: 3.14\n };\nObject.freeze(MATH_CONSTANTS);\n try {\n MATH_CONSTANTS.PI = 99;\n } catch( ex ) {\n console.log(ex);\n }\n return MATH_CONSTANTS.PI;\n}", "function sayHi() {\n const name = 'max'\n}", "static transient final private protected public internal function m39() {}", "function expIsConst(a) {\n return a.length <= 1;\n}", "function freezeObj() {\n \"use strict\";\n const MATH_CONSTANTS = {\n PI: 3.14\n };\n\n Object.freeze(MATH_CONSTANTS);\n\n try {\n MATH_CONSTANTS.PI = 99;\n } catch (ex) {\n console.log(ex);\n }\n return MATH_CONSTANTS.PI;\n}", "function ConstantPointer(value) {\n this.value = value;\n\n this.get = function () {\n return this.value;\n }\n\n this.set = function (newValue) {\n this.value = newValue;\n }\n}", "beConstantValueOf() {\n this._processArguments(arguments);\n this._printActualForFailure = false;\n\n let passed = true;\n let passDetail, failDetail;\n let errors = {};\n\n let actual = this._actual;\n let expected = this._expected;\n for (let index = 0; index < actual.length; ++index) {\n if (actual[index] !== expected)\n errors[index] = actual[index];\n }\n\n let numberOfErrors = Object.keys(errors).length;\n passed = numberOfErrors === 0;\n\n if (passed) {\n passDetail = '${actual} contains only the constant ${expected}.';\n } else {\n let counter = 0;\n failDetail =\n '${actual}: Expected ${expected} for all values but found ' +\n numberOfErrors + ' unexpected values: ';\n failDetail += '\\n\\tIndex\\tActual';\n for (let errorIndex in errors) {\n failDetail += '\\n\\t[' + errorIndex + ']' +\n '\\t' + errors[errorIndex];\n if (++counter >= this._options.numberOfErrors) {\n failDetail +=\n '\\n\\t...and ' + (numberOfErrors - counter) + ' more errors.';\n break;\n }\n }\n }\n\n return this._assert(passed, passDetail, failDetail);\n }", "function StaticSemantics() {\n }" ]
[ "0.72001326", "0.72001326", "0.6808048", "0.67779756", "0.6746539", "0.6607082", "0.6599955", "0.6508891", "0.6487994", "0.6440341", "0.6327984", "0.62105685", "0.6207223", "0.6132995", "0.60778004", "0.6061794", "0.60166836", "0.59611964", "0.5944361", "0.59070057", "0.5844827", "0.5791785", "0.57721186", "0.5765152", "0.57605976", "0.57498914", "0.5734179", "0.57317066", "0.5721521", "0.5721521", "0.57068294", "0.5669061", "0.5639185", "0.563554", "0.562153", "0.562094", "0.5618767", "0.5592044", "0.55644256", "0.55597484", "0.5551139", "0.55162185", "0.5511272", "0.551095", "0.551095", "0.5510048", "0.54947495", "0.5483593", "0.5481008", "0.54724926", "0.5469575", "0.544771", "0.54452455", "0.54195917", "0.54195917", "0.54195917", "0.54195917", "0.54195917", "0.54195917", "0.54195917", "0.54195917", "0.54195917", "0.5410816", "0.5389775", "0.5385", "0.5374096", "0.5363054", "0.53546274", "0.53314805", "0.5328411", "0.5328363", "0.5326659", "0.5313618", "0.5310814", "0.5309386", "0.5306626", "0.53048915", "0.5299989", "0.52836293", "0.5276702", "0.52741694", "0.52741694", "0.5270396", "0.5267095", "0.526684", "0.5264126", "0.52591544", "0.52534264", "0.5239186", "0.52287984", "0.521761", "0.5212502", "0.52098703", "0.5207624", "0.51988983", "0.5198448", "0.51963115", "0.5184487", "0.51758593", "0.5175136", "0.5167935" ]
0.0
-1
& lets use destructuring here
function applyTaxToItems(user){ const {cart} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function f2(o) { \n\tconst {p1, p2, p3} = o; // name must by same as property in object\n\tconsole.log(p1, p2, p3);\n}", "function mainAdress(adress){\n const {city, state} = adress;\nconst newAddress = {\n city,\n state,\n country: 'United States'\n};\nconsole.log(`${newAddress.city}, ${newAddress.state}, ${newAddress.country}`);\n}", "destructuring() {\n let numbers = [1, 2, 3];\n let [one, two] = numbers;\n console.log(one); // 1\n console.log(two); // 2\n let [first, ...rest] = [1, 2, 3, 4];\n console.log(first); // 1\n console.log(rest); // [2, 3, 4]\n }", "obtain(){}", "function f4(o, t) {\n var a;\n ({a, ...o.rest} = t);\n}", "function t1() {\n function f() {\n return { ...{\n a: 1\n }\n };\n }\n\n f();\n let obj = f();\n console.log(1, obj.a);\n}", "function foo(x) {\n var [a,b] = x;\n print(a,b)\n}", "function functionName() {\n {let one, two;\n one = 1;\n two = 2;\n }\n}", "static foo (a) { return { ...a, b: 2 } }", "function destruct({nome: name}) {\n console.log(\"Name :\", name);\n}", "function f3(t) {\n var a, rest;\n ({a, ...rest} = t);\n}", "function example4() {\n\n var me = {\n name: \"Vlad\",\n surname: \"Argentum\"\n };\n\n function hi(_ref) {\n var _ref$name = _ref.name;\n var name = _ref$name === undefined ? \"Guest\" : _ref$name;\n var _ref$surname = _ref.surname;\n var s = _ref$surname === undefined ? \"Anon\" : _ref$surname;\n\n console.log(\"Hi, \" + name + \" \" + s);\n }\n\n hi({}); //Guest Anon\n hi(me); //Vlad Argentum\n\n //even can call without params\n function hi() {\n var _ref2 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref2$name = _ref2.name;\n var name = _ref2$name === undefined ? \"No\" : _ref2$name;\n var _ref2$surname = _ref2.surname;\n var s = _ref2$surname === undefined ? \"Params\" : _ref2$surname;\n\n console.log(\"Hi, \" + name + \" \" + s);\n }\n hi(); //No Params\n}", "function f5(o) {\n var a, rest;\n ({a, a, ...rest} = o);\n}", "function imprimirEdad(persona)\n{\n // var edad = persona.edad\n var { edad } = persona\n console.log(edad)\n}", "renderInput(name, label, type = \"text\") {\n //use this part to do account destructuring\n const { data, errors } = this.state;\n return (\n <Input\n type={type}\n name={name}\n label={label}\n value={data[name]}\n onChange={this.handleChange}\n error={errors[name]}\n />\n );\n }", "function add() {\n\t\t\tvar _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t\t\t _ref2$x = _ref2.x,\n\t\t\t x = _ref2$x === undefined ? 1 : _ref2$x,\n\t\t\t _ref2$y = _ref2.y,\n\t\t\t y = _ref2$y === undefined ? 2 : _ref2$y;\n\n\t\t\t//the process below run like this:\n\t\t\t//first get arugments ,but in this case ,the aruments is null ,so it gets nothing\n\t\t\t//then destructuring the default,({x = 1, y = 2} = {}),\n\t\t\t//it means let x = 1;let y = 2;\n\t\t\treturn x + y;\n\t\t}", "function get(item) {\n\treturn { ...item };\n}", "function data(tmp =[]){\n var [\n first,\n second,\n third\n ] = tmp;\n}", "function nombreMayusculas (persona) {\n //var nombre = persona.nombre\n var {nombre} = persona\n console.log(nombre)\n}", "getVariables() {\n return {\n link: this.props.link,\n linkTitle: this.props.linkTitle\n }\n }", "function f6({\n x = 10\n} = {}, {\n y\n} = {\n y: 10\n}) {\n console.log(x, y);\n}", "function data13({\n\ta,\n\tb\n} = {}) {\n\tconsole.log(a, b); // 1, 2\n}", "function data13({\n\ta,\n\tb\n} = {}) {\n\tconsole.log(a, b); // 1, 2\n}", "function data14({\n\ta,\n\tb\n} = {}, x) {\n\tconsole.log(a, b, x) // 1 2 50\n}", "getVariables() {\n return {\n id: this.props.id,\n link: this.props.link,\n linkTitle: this.props.linkTitle\n }\n }", "function f1(t) {\n var {...a} = t;\n return a;\n}", "function foo(p1) {\n var t = p1;\n var k = t;\n var z = k;\n var y = z;\n return y;\n}", "function demo3() {\n let pizza = {\n type : 'Hawaiian',\n size : 'Large',\n crust : \"Cheesy\"\n }\n\n // This tells javascript to initialize three variables, pizzaType/pizzaSize/pizzaCrust, with the values from the \"pizza\" object.\n // It knows which values to put in each due to the assignment.\n const {\n type: pizzaType,\n size: pizzaSize,\n crust: pizzaCrust,\n } = pizza;\n console.log(pizzaType);\n console.log(pizzaSize);\n console.log(pizzaCrust);\n}", "function test1() {\n let key = 'z';\n let { [key]: foo } = { z: 'bar' };\n\n console.log('test1() -----------------------------------------------------------');\n console.log(foo); // \"bar\"\n}", "function test(param) {\n param.method, param.nested.p;\n}", "function l(){t={},u=\"\",w=\"\"}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function foo(_a) {\n var x = _a.x;\n console.log(x); // Refer to x directly\n}", "function fn3 (options) {\n const defaultOptions = {a:'1',b:'2'};\n const {a,b} = options ? {\n ...defaultOptions,\n ...options\n }: defaultOptions;\n\n console.log(`3.${++i}) a:${a}, b:${b}\\n`);\n}", "function boo({first=\"10\", second=\"true\"}) {\n\n}", "function returnFirst(...items){\n // resting x # items into array (...items)\n // destructuring items array\n // [firstItem = items[0], blank for items[1], thirdItem = items[2]]\n // if you leave an empty part the destructuring it will pass it's assignment of items[1]\n const [firstItem,,thirdItem] = items; /*change this line to be es6*/\n //firstItem = 1, thirdItem = 3 -- 1+3 =4\n return firstItem + thirdItem\n}", "function show({name , address : {city}, places , ...rest }){ \n console.log(`${name} lives in ${city} and go to these places : ${places}`);\n console.log(`There are more information here : ${rest.valueOf()}`);\n}", "function example2 () {\n\n let sum = (a, b) => a + b\n \n function strParse (strings, ...params) {\n console.log(strings);\n console.log(strings.raw);\n console.log(params);\n }\n\n let a = 'test'\n let b = 13\n\n let s = strParse`Some ${a}\n string with another param ${b}\n and sum of 5 and 4, that is ${sum(5,4)}`\n}", "function address(city,state){\n const my_address = {city,state};\n console.log(my_address);\n}", "function xx(a,b){return\"method\"!==b.kind||!b.ej||\"value\"in b.ej?(ia(),{kind:\"field\",key:Symbol(),oW:\"own\",ej:{},Dj:function(){\"function\"===typeof b.Dj&&(this[b.key]=b.Dj.call(this))},$l:function(c){c.Ca(b.key,a)}}):Object.assign(Object.assign({},b),{$l:function(c){c.Ca(b.key,a)}})}", "function too({ // if object with x and y come in you set up local variables based on those object properties\n x: a,\n y: b\n} = {}) {\n\n}", "function addres(street,city, zipCode ){\n return {\n street,\n city,\n zipCode,\n };\n const myAddr = new Addre('a', 'b', 'c');\n console.log(myAddr);\n}", "function b(a){md=a}", "function b(a){md=a}", "function b(a){md=a}", "function b(a){md=a}", "function b(a){md=a}", "function b(a){md=a}", "function demo2() {\n let pizza = {\n type : 'Hawaiian',\n size : 'Large',\n crust : \"Cheesy\"\n }\n\n // This tells javascript to initialize three variables, type/size/crust, with the values from the \"pizza\" object.\n // It knows which values to put in each due to the names matching directly.\n const { type, size, crust } = pizza;\n console.log(type);\n console.log(size);\n console.log(crust);\n\n const toppings = [\n \"Bacon\",\n \"Pineapple\",\n \"Ham\",\n \"Pepperoni\"\n ];\n\n // This tells javascript to initialize three variables, topping1/2/3, with the first three elements of the toppings array.\n // It will get the elements in order. If we were to add a fourth variable, it would get \"pepperoni\" as a value.\n const [topping1, topping2, topping3] = toppings;\n\n console.log(topping1);\n console.log(topping2);\n console.log(topping3);\n}", "function b(a){le=a}", "function b(a){le=a}", "function b(a){le=a}", "function b(a){le=a}", "function restParamsNArrays()\n{\n //constant, has to be initialized and cant be changed.\n const a = 100;\n\n // a = 50;\n let array = [100, 200, 300, 400, 500];\n let v1, v2, rest;\n\n //destructuring arrays and rest params. \n //rest params collect rest of the paramters in an array.\n [v1, v2,...rest] = array;\n console.log(a, v1, v2, rest);\n\n let v4, v5, rest1;\n [, v5,...rest1] = array;\n console.log(v4, v5, rest);\n\n //destructing objects.\n let car = {id : 400, style: \"convertible\"};\n //let {id, style} = car; //works fine.\n let id, style;\n ({id, style} = car); //needs paranthesis for diff between a code black and destructuring.\n console.log(id, style);\n\n //spread params ...opposite of rest...converts array to parameters.\n let nums = [1, 2, 3, 4, 5];\n testSpread(...nums);\n\n let str = 'abcdef';\n testSpread(...str); //string is iterable and gets converted to array of char on spread.\n\n}", "function addOneDestructure (options) {\n const { x, y } = options;\n return x + y\n}", "function getStuff2() {\r\n\t\t\tvar stuff = [];\r\n\t\t\tfor (i in props) {\r\n\t\t\t\tstuff.push(argsXF[i](arguments[i]));\r\n\t\t\t};\r\n\t\t\treturn stuff;\r\n\t\t}", "function destructuredArray(){\r\n //basic 1 to 1 array variable assignment, you could also declare these values ahead of time\r\n let [a,b,c]=[\"kim\", \"bob\", \"mary\"];\r\n console.log(a);//kim\r\n\r\n // using rest to take on the rest\r\n let [d,e,...more] = [\"like\",\"love\",\"totally\",\"awesome\", \"hope\"];\r\n console.log(more); //[\"totally\",\"awesome\", \"hope\"]\r\n //assigning more values to the rest using what we see below\r\n let [f,g] = more;\r\n console.log(f);// totally;\r\n\r\n let x= [\"George\", \"Mother\", \"Wheezy\"];\r\n let [y,z] = x;\r\n console.log(y);//George\r\n console.log(z);//Mother\r\n\r\n let nope;\r\n let[time=nope, meal=\"second breakfast\"]= [\"morning\"];//this is a default value, it helps if the value set is undefined\r\n console.log(time);//morning\r\n console.log(meal);//second breakfast\r\n}", "function nd(a){this.la={};this.o=a}", "getVariables() {\r\n return {\r\n title: this.props.title,\r\n url: this.props.url\r\n }\r\n }", "function f() {\n ({a = () => {\n let arguments;\n }} = 1);\n\n arguments.x;\n}", "function getParameters(data) {\n\n // Destructuring\n const { limit, offset } = data;\n\n return {\n limit,\n offset\n };\n }", "function foo() {\n return { a:1, b:2, c:3,\n d: {\n e: 4 // 'e' variable assigned to value of 4.\n }\n };\n}", "function foo(a, b, c) {\n return {a, ...b, c};\n}", "function printNames2(age, ...allNames){\n allNames.forEach(name => console.log(name));\n}", "function getPerson() {\n let name = 'John';\n let age = 25;\n\n // return {\n // name: name,\n // age: age\n // };\n // equal to\n // return {name, age}; // only if your property name and value variable are the same\n\n return {\n name,\n age,\n // great: function () {\n // function shorthand\n great () {\n // return \"hello, \" + this.name;\n return `Hello, ${this.name}`;\n }\n };\n}", "function run() {\n var foo = \"Foo\";\n let bar = \"Bar\";\n\n console.log({ foo, bar });\n\n {\n let baz = \"Bazz\";\n console.log(baz);\n console.log({ foo, bar });\n }\n\n console.log({ foo, bar });\n // console.log(baz); // ReferenceError\n\n console.log({ variable, anotherVariable, constant });\n}", "function f28(x) {\n var a = _extends({}, _object_destructuring_empty(x)); // Error\n}", "function assign$1($){for(var k=1;k<arguments.length;k++){var V=arguments[k];for(var z in V)$[z]=V[z]}return $}", "function Book(title, author, pages, read){\n return {title, author, pages, read}\n \n}", "get Alpha2() {}", "function getThird(x){\n y.third = x[2]\nreturn y\n}", "function foo( {name , car, color} ) {\n c(name)\n c(color)\n // c(arguments[0])\n}", "alias(token) {\n return target => token.getValueFor(target);\n }", "function myFunc(...opts) {\n let t = opts[0];\n}", "function Pair$prototype$extract() {\n return this.snd;\n }", "function example2() {\n let alice = 1;\n var carol = 3;\n {\n alice = \"a\";\n carol = \"c\";\n }\n console.log(\"example2 alice\" , alice);\n // output -> a\n console.log(\"example2 carol\" , carol);\n // output -> c\n}", "function foo({name, age}){\n\tconsole.log(`${name} is ${age} years old!`);\n}", "function address(authorinfo) /* (authorinfo : authorinfo) -> string */ {\n return authorinfo.address;\n}", "function greet({name, address}){\n\n // #2 always return a value.\n return `Hello, ${name}!, of ${address}`;\n}", "function Cricket({ batsman, bowler }) {\n //function definition with destrucrued object\n console.log([batsman, bowler]);\n return [batsman, bowler]; //square brackets for evaluating two or more keys\n}", "function t(t,e){for(const n in e)t[n]=e[n];return t}", "function data2() {\n\treturn {a: 1, b: 2, c: 3};\n}", "private public function m246() {}", "function b(a) { od = a }", "function FacObject(street, city, zipcode) {\n return{\n street,\n city,\n zipcode\n };\n \n}", "getFragmentVariables(prevVars, totalCount) {\n return {\n ...prevVars,\n count: totalCount\n };\n }", "function w(){this.a={}}", "tc(result, { args }) {\n result.$title = args[0]\n result.otherSide = args[1] ?? 'Unknown Income/Expense'\n return result\n }", "function g([x, y] = [1, 2], {z: z} = {z: 3}) { \n console.log(x + y + z); \n}", "export() {\n const { filterText, showDeleted, showHidden } = this;\n return { filterText, showDeleted, showHidden };\n }" ]
[ "0.5988406", "0.58500993", "0.57225215", "0.55980784", "0.5548373", "0.53839046", "0.5374687", "0.5350371", "0.53484845", "0.5330931", "0.5321086", "0.52760863", "0.5257265", "0.52461505", "0.5223898", "0.51855624", "0.51765466", "0.5160782", "0.51365715", "0.5130236", "0.51016533", "0.50830126", "0.50830126", "0.5061341", "0.5046425", "0.5030658", "0.50231415", "0.49867353", "0.4976774", "0.49591735", "0.4950826", "0.49438912", "0.49438912", "0.49438912", "0.49438912", "0.49438912", "0.49438912", "0.49438912", "0.49438912", "0.49438912", "0.49438912", "0.49438912", "0.49438912", "0.49390247", "0.49373913", "0.4932899", "0.49319932", "0.49225894", "0.49134845", "0.49046588", "0.48930424", "0.48921534", "0.4889136", "0.48838925", "0.48838925", "0.48838925", "0.48838925", "0.48838925", "0.48838925", "0.48768142", "0.48658848", "0.48658848", "0.48658848", "0.48658848", "0.48649937", "0.48566097", "0.48466143", "0.48360413", "0.4829979", "0.48298168", "0.48202732", "0.4819219", "0.48165268", "0.48094377", "0.48066387", "0.48057488", "0.48035082", "0.47948042", "0.47909996", "0.47877848", "0.4781704", "0.4779831", "0.4779067", "0.47729963", "0.47710806", "0.47648123", "0.4764557", "0.47550762", "0.47507626", "0.47467858", "0.473596", "0.47250396", "0.47246787", "0.47221047", "0.47179773", "0.471594", "0.47091547", "0.47082824", "0.4693274", "0.469022", "0.46880522" ]
0.0
-1
so we dont to use user dot cart all the time lets say user
function applyTaxToItems(user){ const {cart} = user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emptyCart(user) {\n return user\n}", "function loadMyCart() {\n let userId = sessionStorage.getItem('userId');\n marketService.getUser(userId)\n .then((userInfo) => {\n displayMyCart(userInfo);\n }).catch(handleError);\n }", "function disableUmaCart() {\n if (typeof utag_data.product_attribute !== undefined) {\n if (\n \"bookends|wine rack|candleholder|lantern|clock|box|tray|decorative dish\".indexOf(\n utag_data.product_attribute\n ) > -1\n ) {\n var queryUrl =\n \"https://brm-core-0.brsrvr.com/api/v1/core/?account_id=5221&auth_key=o5xlkgn7my5fmr5c&domain_key=livingspaces_com&request_id=fd8d6a02a5764b7995c600e766a38bda&url=%2fbr-checker&_br_uid_2=uid%253D4961390647524%253Av%253D11.8%253Ats%253D1463613117510%253Ahc%253D3145&ptype=other&request_type=search&q=%22\" +\n utag_data.product_id[0] +\n \"%22&start=0&rows=13&search_type=keyword&fl=title,pid,url,price,sale_price,reviews,reviews_count,thumb_image,brand\";\n\n window.$.get(queryUrl, function(data) {\n if (data.response.numFound > 0) {\n if (data.response.docs[0].brand === \"UMA ENTERPRISES, INC\") {\n if (utag_data.site_type === \"desktop\") {\n $(\".page\").prepend(\n \"<style>#product-detail-page-vue .button-group #btnAddToCart, #product-detail-page-vue .button-group .select-wrapper, #product-detail-page-vue .stock-info, #omniinventory{display:none!important} .add-product-to-cart .like-product > a{margin-left:0!important}</style>\"\n );\n $(\"#price-section\").after(\n '<span style=\"display:block; color:#b9170f; font-weight:600; margin-bottom:15px; font-size:14px\"><i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></i>&nbsp;&nbsp;This product is unavailable due to COVID-19 disruptions</span>'\n );\n } else {\n $(\".page\").prepend(\n \"<style>#product-detail-page-vue > form.text-center, #product-detail-page-vue .stock-info, #omniinventory{display:none!important}</style>\"\n );\n $(\"#product-detail-page-vue\").after(\n '<span style=\"display:block; color:#b9170f; font-weight:600; margin-bottom:15px; font-size:13px\"><i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></i>&nbsp;&nbsp;This product is unavailable due to COVID-19 disruptions</span>'\n );\n }\n }\n }\n });\n }\n }\n}", "function emptyCart(user) {\n return Object.assign({}, user, {cart: []})\n}", "async updateCart_Of_User(){\n }", "function emptyCart(user) {\n return Object.assign({}, user)\n}", "function finnishCustomerSession(){\n\n clearCart();\n updateCartTotal();\n\n currentCart = {};\n\n undostack = [];\n redostack = [];\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 updateCart(){if(window.Cart&&window.Cart.updateCart){window.Cart.updateCart();}}", "function loadCart() {\n productsInCart = JSON.parse(sessionStorage.getItem('shoppingCart'));\n }", "function setCartUser() {\n userCart.forEach(\n (item) =>\n !filteredCartUser.filter(\n (cart) =>\n (cart.item.name === item.item.name) &\n (cart.item.size === item.item.size)\n ).length > 0 && filteredCartUser.push(item)\n );\n\n filteredCartUser.forEach((item) =>\n cartNewUser.push(\n userCart.filter(\n (i) =>\n (i.item.name === item.item.name) & (i.item.size === item.item.size)\n )\n )\n );\n }", "function cart(){\n let cart=localStorage.getItem(\"cart\");\n (cart)? showCart(cart) :alert(\"you don't have a cart yet!\")\n }", "function loadCart(){\n cart = JSON.parse(sessionStorage.getItem('revonicCart')); // fetching original object items using JSON parse. \n }", "function addItemToCart(user, item) {\n\n}", "function removeAllProducts() {\n cart = {};\n saveCart();\n showCart();\n}", "function emptyCart (user) {\n\n\tif (user.length == 0) { \n\t\tdocument.getElementById(\"hidden_emptyCart\").innerHTML = \"\";\n\t\treturn;\n\t} else {\n\t\tvar xmlhttp = new XMLHttpRequest();\n\t\txmlhttp.open(\"GET\", \"cartEmpty.php?eu=\" + user, true);\n\t\txmlhttp.send();\n\t}\n\n\twindow.location.replace('shoppingCart.php');\n}", "setupCart()\r\n\t{\r\n\t\tthis.cart = {};\r\n\t\tthis.cart.id = Str.random(10);\r\n\t\tthis.cart.items = [];\r\n\t\tthis.cart.favorites = [];\r\n\t\tCookie.set(this.settings.cookie_name, this.cart, 2);\r\n\t}", "function cleanCart() {\n wecache.remove(CART_KEY);\n}", "function applyTaxToItems(user){\n const {cart}\n}", "function Cart(){}", "function emptyCart(user) {\n return Object.assign({})\n}", "function _emptyCart() {\n _cartItems = [];\n Cookies.remove('cartItemHistory', { path: '/' });\n Cookies.remove('cartCouponHistory', { path: '/' });\n}", "function addToCart(user){\n\tif( typeof(user) == \"undefined\" ){\n\t\tdocument.getElementById(\"login_suggest\").className = \"suggest play\";\n\t\tvar url = window.location.href;\n\t\tvar language = url.substr(url.lastIndexOf('/')+1, 2);\n\t\tif( language != \"en\" || language != \"es\"){\n\t\t\tlanguage =\"en\";\n\t\t}\n\t\tsetTimeout(function(){window.location.href = \"login?locale=\"+language;},3000);\n\t}\n\telse{\n\t\tdocument.getElementById(\"cart_notice\").className = \"cart_notice play\";\n\t\tsetTimeout(function(){document.getElementById(\"cart_notice\").className = \"cart_notice display\";},3000);\n\t}\n}", "function removeItemFromCart(){\n\n}", "function clearCart() {}", "function clearCart() {}", "function clearCart() {}", "function updateMiniCart() {\n if(!cart.items ) {\n cart.items = [];\n }\n }", "function addItemToCart(user, item) {}", "function mParticleUserCart(mpid){\n return {\n /**\n * Adds a cart product to the user cart\n * @method add\n * @param {Object} product the product\n * @param {Boolean} [logEvent] a boolean to log adding of the cart object. If blank, no logging occurs.\n */\n add: function(product, logEvent) {\n var allProducts,\n userProducts,\n arrayCopy;\n\n arrayCopy = Array.isArray(product) ? product.slice() : [product];\n arrayCopy.forEach(function(product) {\n product.Attributes = Helpers.sanitizeAttributes(product.Attributes);\n });\n\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.AddToCart, JSON.stringify(arrayCopy));\n } else {\n mParticle.sessionManager.resetSessionTimer();\n\n\n\n userProducts = Persistence.getUserProductsFromLS(mpid);\n\n userProducts = userProducts.concat(arrayCopy);\n\n if (logEvent === true) {\n Events.logProductActionEvent(Types.ProductActionType.AddToCart, arrayCopy);\n }\n\n var productsForMemory = {};\n productsForMemory[mpid] = {cp: userProducts};\n if (mpid === MP.mpid) {\n Persistence.storeProductsInMemory(productsForMemory, mpid);\n }\n\n if (userProducts.length > mParticle.maxProducts) {\n Helpers.logDebug('The cart contains ' + userProducts.length + ' items. Only mParticle.maxProducts = ' + mParticle.maxProducts + ' can currently be saved in cookies.');\n userProducts = userProducts.slice(0, mParticle.maxProducts);\n }\n\n allProducts = Persistence.getAllUserProductsFromLS();\n allProducts[mpid].cp = userProducts;\n\n Persistence.setCartProducts(allProducts);\n }\n },\n /**\n * Removes a cart product from the current user cart\n * @method remove\n * @param {Object} product the product\n * @param {Boolean} [logEvent] a boolean to log adding of the cart object. If blank, no logging occurs.\n */\n remove: function(product, logEvent) {\n var allProducts,\n userProducts,\n cartIndex = -1,\n cartItem = null;\n\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.RemoveFromCart, JSON.stringify(product));\n } else {\n mParticle.sessionManager.resetSessionTimer();\n\n userProducts = Persistence.getUserProductsFromLS(mpid);\n\n if (userProducts) {\n userProducts.forEach(function(cartProduct, i) {\n if (cartProduct.Sku === product.Sku) {\n cartIndex = i;\n cartItem = cartProduct;\n }\n });\n\n if (cartIndex > -1) {\n userProducts.splice(cartIndex, 1);\n\n if (logEvent === true) {\n Events.logProductActionEvent(Types.ProductActionType.RemoveFromCart, cartItem);\n }\n }\n }\n\n var productsForMemory = {};\n productsForMemory[mpid] = {cp: userProducts};\n if (mpid === MP.mpid) {\n Persistence.storeProductsInMemory(productsForMemory, mpid);\n }\n\n allProducts = Persistence.getAllUserProductsFromLS();\n\n allProducts[mpid].cp = userProducts;\n\n Persistence.setCartProducts(allProducts);\n }\n },\n /**\n * Clears the user's cart\n * @method clear\n */\n clear: function() {\n var allProducts;\n\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.ClearCart);\n } else {\n mParticle.sessionManager.resetSessionTimer();\n allProducts = Persistence.getAllUserProductsFromLS();\n\n if (allProducts && allProducts[mpid] && allProducts[mpid].cp) {\n allProducts[mpid].cp = [];\n\n allProducts[mpid].cp = [];\n if (mpid === MP.mpid) {\n Persistence.storeProductsInMemory(allProducts, mpid);\n }\n\n Persistence.setCartProducts(allProducts);\n }\n }\n },\n /**\n * Returns all cart products\n * @method getCartProducts\n * @return {Array} array of cart products\n */\n getCartProducts: function() {\n return Persistence.getCartProducts(mpid);\n }\n };\n}", "function bypassAnticheat() { // SO THAT YOUR ACCOUNT DOESNT GET BANNED\n \n}", "function addItemToCart(user, item) {\n const updateCart =\n}", "isCartEmpty() {\n //check if user active\n if (this.navService.isUserActive) {\n //check user items\n return !!this.navService.items.length;\n }\n else {\n //check guest cart\n if (JSON.parse(localStorage.getItem('cart')).length !== undefined) {\n return !!JSON.parse(localStorage.getItem('cart')).length;\n }\n }\n }", "function getCart() {\n return cart;\n}", "function trackAddToCart() {\n EventBus.$on(\"productAddedToCart\", function(data) {\n var skuAddedToCart = data.sku;\n if ($.cookie(\"lsf-cartadds\") === undefined) {\n $.cookie(\"lsf-cartadds\", skuAddedToCart, {\n expires: 20 * 365,\n });\n } else if (!$.cookie(\"lsf-cartadds\").includes(skuAddedToCart)) {\n var currentVal = $.cookie(\"lsf-cartadds\");\n var newVal = skuAddedToCart + \",\" + currentVal;\n $.cookie(\"lsf-cartadds\", newVal, {\n expires: 20 * 365,\n });\n }\n });\n}", "function cleanCart1() {\n cartList=[];\n}", "function _hideCart(id) {\n _isCartVisible = false; \n}", "function emptyCart() {\n window.localStorage.removeItem('cart');\n}", "function removeCart(){\n\n}", "function updateCartIcon() {\n\tvar user = sessionStorage.getItem('currentUser');\n\tif(user !== null && JSON.parse(user).cart.length > 0) {\n\t\t$('.glyphicon.glyphicon-shopping-cart')\n\t\t\t.parent().find('#cartCounter').remove();\n\t\t$('.glyphicon.glyphicon-shopping-cart')\n\t\t\t.parent()\n\t\t\t.append($('<div>', {style: 'margin-left: 2px; color: #9E9E9E; display: inline;' ,id: 'cartCounter'})\n\t\t\t\t.append(JSON.parse(user).cart.length));\n\t}\n}", "function removeFromShoppingCart() { \n var uid = $(this).attr(\"roll-del-uid\");\n if (uid) {\n var selector = '[roll-uid=\"' + uid + '\"]';\n var element = document.querySelector(selector);\n if (element) {\n element.parentNode.removeChild(element);\n }\n dataArray = dataArray.filter(x => x.uid !== uid);\n localStorage.setItem(\"dataArray\", JSON.stringify(dataArray));\n }\n }", "function loadCart(){\r\n inames = JSON.parse(sessionStorage.getItem(\"inames\"));\r\n iprice = JSON.parse(sessionStorage.getItem(\"iprice\"));\r\n showCart();\r\n}", "function _showCart() {\n _isCartVisible = true;\n}", "function setCart(){\n\t\tstorage.set({ \n\t\t\titems: 0, \n\t\t\tsubtotal: 0\n\t\t}, function(){\n\t\t\tupdateCart();\n\t\t});\n\t}", "function removeFromCart() {\n\t// if (sessionStorage.cart == null) {\n\t// sessionStorage.cart = '';\n\t// }\n\tvar item = sessionStorage.cart.split(\"'\\'\");\n\tsessionStorage.cart = '';\n\n\tfor (var i = 0; i < item.length - 2; i++) {\n\t\tsessionStorage.cart = sessionStorage.cart + item[i] + \"'\\'\";\n\t}\n}", "get cart(){ return this._cart }", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {}\n })\n}", "function Cart() {\r\n const {\r\n totalCost,\r\n itemCount,\r\n itemNumberString,\r\n routerString,\r\n setRouterString,\r\n setTermsDisplay,\r\n itemList,\r\n anonUser,\r\n setOnCheckout,\r\n accountTitleString,\r\n expressCheckoutOn,\r\n setExpressCheckoutOn,\r\n handleExpressModal,\r\n setUseExpressMode,\r\n useExpressMode,\r\n isLargeScreen,\r\n setSearchString,\r\n setOnProductPage,\r\n setOnHomeScreen,\r\n isPortrait,\r\n isSmallScreen,\r\n } = useContext(Context);\r\n\r\n useEffect(() => {\r\n setSearchString(\"\");\r\n setTermsDisplay(false);\r\n setOnCheckout(false);\r\n setOnHomeScreen(false);\r\n setRouterString(\"cart\");\r\n document.getElementById(\"firebaseui-auth-container\").style.display = \"none\";\r\n // document.getElementById('smallSearch').style.display = \"none\"\r\n // document.getElementById('largeSearch').style.display = \"none\"\r\n setUseExpressMode(false);\r\n setOnProductPage(false);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (firebase.auth().currentUser && !anonUser) {\r\n // user signed in, enable express\r\n\r\n if (\r\n document.getElementById(\"expressCheckout\") !== null &&\r\n document.getElementById(\"expressCheckout\") !== undefined\r\n ) {\r\n document.getElementById(\"expressCheckout\").style.disabled = false;\r\n }\r\n\r\n // (firebase.auth().currentUser && !firebase.auth().currentUser.isAnonymous)\r\n } else {\r\n if (\r\n document.getElementById(\"expressCheckout\") !== null &&\r\n document.getElementById(\"expressCheckout\") !== undefined\r\n ) {\r\n document.getElementById(\"expressCheckout\").style.disabled = true;\r\n }\r\n // disable express\r\n }\r\n }, [expressCheckoutOn]);\r\n // when remove from cart is clicked, subtract 1 from count and price from price\r\n\r\n return (\r\n <div className=\"cart\">\r\n <nav\r\n style={{ marginTop: \"1em\" }}\r\n className=\"darkNav\"\r\n aria-label=\"You are here:\"\r\n role=\"navigation\"\r\n >\r\n <ul class=\"breadcrumbs\">\r\n <li>\r\n <Link to=\"/\">Home</Link>\r\n </li>\r\n <li>\r\n <Link to=\"/shop\">Cart</Link>\r\n </li>\r\n <li>\r\n <span class=\"show-for-sr\">Current: Cart</span>\r\n </li>\r\n </ul>\r\n </nav>\r\n <div\r\n className=\"centered\"\r\n style={{\r\n // \"background-color\": \"black\",\r\n // \"box-shadow\": \"0px 0px 5px white\",\r\n width: \"94%\",\r\n height: \"100%\",\r\n }}\r\n >\r\n <h4\r\n onLoad={() => {\r\n window.scroll(0, 130);\r\n }}\r\n >\r\n Cart\r\n </h4>\r\n {itemList.length === 0 && (\r\n <div\r\n className=\"centered rounded\"\r\n style={{\r\n minHeight: \"30vh\",\r\n }}\r\n >\r\n <div>\r\n <div\r\n className=\"centered\"\r\n style={{\r\n position: \"relative\",\r\n top: `${!isPortrait || !isSmallScreen ? \"100px\" : \"\"}`,\r\n }}\r\n >\r\n <p\r\n className=\"centered\"\r\n style={{\r\n \"background-color\": \"#565759\",\r\n padding: \".25em\",\r\n \"border-radius\": \"13px\",\r\n width: `fit-content`,\r\n position: \"relative\",\r\n whiteSpace: \"nowrap\",\r\n }}\r\n >\r\n Your shopping cart is empty.\r\n </p>\r\n <Link to=\"/shop\">\r\n <button\r\n className=\"button primary glowButtonBlue\"\r\n type=\"button\"\r\n >\r\n Go Shopping\r\n </button>\r\n </Link>\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n <Flexbox\r\n flexDirection={`${isLargeScreen ? \"row\" : \"column\"}`}\r\n className=\"rounded\"\r\n >\r\n <div\r\n className=\"rounded\"\r\n style={{ display: `${isLargeScreen ? \"none\" : \"initial\"}` }}\r\n >\r\n <p className=\"itemCard\">\r\n Cart Total ({itemCount} {itemNumberString}): $\r\n {(totalCost / 100).toFixed(2)}\r\n </p>\r\n {itemList.length > 0 && (\r\n <div className=\"itemCard stickyCheckout\">\r\n <Link to=\"/checkout\">\r\n <button\r\n className=\"userButton button primary\"\r\n style={{\r\n width: `${isLargeScreen ? \"20vw\" : \"30vw\"}`,\r\n margin: \"2em\",\r\n fontSize: \"small\",\r\n \"max-height\": \"3em\",\r\n }}\r\n type=\"button\"\r\n >\r\n Checkout\r\n </button>\r\n </Link>\r\n <Link to=\"/checkout\">\r\n {!expressCheckoutOn ? (\r\n <span\r\n data-tooltip\r\n class=\"has-tip top\"\r\n tabindex=\"2\"\r\n title={`${\r\n !expressCheckoutOn && \"Sign in to use Express Checkout.\"\r\n }`}\r\n >\r\n <button\r\n className=\"userButton button success\"\r\n style={{\r\n width: `${isLargeScreen ? \"20vw\" : \"30vw\"}`,\r\n margin: \"2em\",\r\n marginBottom: `${isLargeScreen ? \"0em\" : \"2em\"}`,\r\n fontSize: \"small\",\r\n \"max-height\": \"3em\",\r\n }}\r\n type=\"button\"\r\n id=\"expressCheckoutTwo\"\r\n disabled={!expressCheckoutOn}\r\n onClick={() => {\r\n handleExpressModal();\r\n setUseExpressMode(true);\r\n }}\r\n >\r\n Express Checkout\r\n </button>\r\n </span>\r\n ) : (\r\n <button\r\n className=\"userButton button success\"\r\n style={{\r\n width: `${isLargeScreen ? \"20vw\" : \"30vw\"}`,\r\n margin: \"2em\",\r\n fontSize: \"small\",\r\n \"max-height\": \"3em\",\r\n }}\r\n type=\"button\"\r\n id=\"expressCheckoutTwo\"\r\n disabled={!expressCheckoutOn}\r\n onClick={() => {\r\n handleExpressModal();\r\n setUseExpressMode(true);\r\n }}\r\n >\r\n Express Checkout\r\n </button>\r\n )}\r\n </Link>\r\n </div>\r\n )}\r\n </div>\r\n <div>\r\n <CartItemList />\r\n </div>\r\n <div className=\"stickyCheckout\">\r\n {itemList.length > 0 && (\r\n <p\r\n style={{\r\n position: `${isLargeScreen ? \"sticky\" : \"relative\"}`,\r\n top: \"35%\",\r\n }}\r\n className=\"stickyCheckout4\"\r\n >\r\n Cart Total ({itemCount} {itemNumberString}): $\r\n {(totalCost / 100).toFixed(2)}\r\n </p>\r\n )}\r\n {itemList.length > 0 && (\r\n <div className=\"itemCard stickyCheckout\">\r\n <Link to=\"/checkout\">\r\n <button\r\n className=\"userButton button primary\"\r\n style={{\r\n width: `${isLargeScreen ? \"20vw\" : \"30vw\"}`,\r\n margin: \"2em\",\r\n fontSize: `${isLargeScreen ? \"medium\" : \"small\"}`,\r\n \"max-height\": \"3em\",\r\n }}\r\n type=\"button\"\r\n >\r\n Checkout\r\n </button>\r\n </Link>\r\n <Link to=\"/checkout\">\r\n {!expressCheckoutOn ? (\r\n <span\r\n data-tooltip\r\n class=\"has-tip top\"\r\n tabindex=\"2\"\r\n title={`${\r\n !expressCheckoutOn && \"Sign in to use Express Checkout.\"\r\n }`}\r\n >\r\n <button\r\n className=\"userButton button success\"\r\n style={{\r\n width: `${isLargeScreen ? \"20vw\" : \"30vw\"}`,\r\n margin: \"2em\",\r\n marginBottom: `${isLargeScreen ? \"0em\" : \"2em\"}`,\r\n marginLeft: \"0em\",\r\n marginRight: \"0em\",\r\n fontSize: \"small\",\r\n \"max-height\": \"3em\",\r\n }}\r\n type=\"button\"\r\n id=\"expressCheckoutTwo\"\r\n disabled={!expressCheckoutOn}\r\n onClick={() => {\r\n handleExpressModal();\r\n setUseExpressMode(true);\r\n }}\r\n >\r\n Express Checkout\r\n </button>\r\n </span>\r\n ) : (\r\n <button\r\n className=\"userButton button success\"\r\n style={{\r\n width: `${isLargeScreen ? \"20vw\" : \"30vw\"}`,\r\n margin: \"2em\",\r\n marginBottom: `${isLargeScreen ? \"0em\" : \"2em\"}`,\r\n fontSize: \"small\",\r\n \"max-height\": \"3em\",\r\n position: `${isLargeScreen ? \"sticky\" : \"relative\"}`,\r\n }}\r\n type=\"button\"\r\n id=\"expressCheckoutTwo\"\r\n disabled={!expressCheckoutOn}\r\n onClick={() => {\r\n handleExpressModal();\r\n setUseExpressMode(true);\r\n }}\r\n >\r\n Express Checkout\r\n </button>\r\n )}\r\n </Link>\r\n </div>\r\n )}\r\n </div>\r\n </Flexbox>\r\n </div>\r\n <br></br>\r\n <nav className=\"darkNav\" aria-label=\"You are here:\" role=\"navigation\">\r\n <ul class=\"breadcrumbs\">\r\n <li>\r\n <Link to=\"/\">Home</Link>\r\n </li>\r\n <li>\r\n <Link to=\"/shop\">Cart</Link>\r\n </li>\r\n <li>\r\n <span class=\"show-for-sr\">Current: Cart</span>\r\n </li>\r\n </ul>\r\n </nav>\r\n </div>\r\n );\r\n\r\n // create express checkout component which uses all the saved info from before.\r\n}", "function addToCartAndStore(id) {\n //if item in storage already dont add again\n let amount = sessionStorage.getItem(id);\n if (amount) {\n changeQuantity(id);\n } else {\n addToCart(id);\n }\n Storage(id);\n}", "function loadCart2(){\r\n inames = JSON.parse(sessionStorage.getItem(\"inames\"));\r\n iprice = JSON.parse(sessionStorage.getItem(\"iprice\"));\r\n displayCart();\r\n}", "function saveCart() { \n localStorage.setItem(\"userCart\", JSON.stringify(cart));\n }", "clearCart( ) {\n localStorage.removeItem( 'cart' );\n }", "function continueShopping() {\n\n}", "function cancelCart() {\n localStorage.removeItem('cartProducts');\n refreshSectionAndCart();\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 checkCart() {\n let cartContent = document.querySelector('.cart-content');\n let cartEmpty = document.querySelector('.cart-empty');\n // Si le shoppingCart est vide, on affiche un bloc \n // qui nous avertira que le panier est vide\n // et si c'est le cas on stop le js de la page\n if (localStorage.getItem('shoppingCart') === null || localStorage.getItem('shoppingCart') === \"\" || localStorage.getItem('shoppingCart') === undefined) {\n cartContent.style.display = \"none\";\n return false;\n } else {\n // Si le shoppingCart contient des produits,\n // alors on affiche les cameras.\n return cartEmpty.style.display = \"none\";\n }\n}", "function getCart() {\n return cart\n}", "function initCartItems() {\n const lsCartItems = JSON.parse(localStorage.getItem(\"cartItems\"));\n if (lsCartItems) {\n setCartItems(lsCartItems);\n }\n }", "function cancelCart() {\n localStorage.removeItem('cartProducts');\n refreshSectionAndCart();\n}", "function addItemToCart() {}", "function addItemToCart() {}", "function buyItem(user) {\n return {\n ...user,\n purchases: [...user.cart]\n };\n}", "function first(){\r\n\r\n if(sessionStorage.getItem(\"items\") == null){\r\n document.getElementById('cart').innerHTML = \"Begin adding items to your order and they will show up here\";\r\n }else{\r\n loadCart2();\r\n }\r\n}", "function updateNumberToCart() {\n let currentUser = sessionStorage.getItem(\"successLogin\") \n let productList = JSON.parse(localStorage.getItem(\"userList\"))\n\n for (let i = 0; i < productList.length; i++) {\n const cart = productList[i].cart\n\n if(currentUser == productList[i].name)\n document.getElementById(\"purchase\").innerText = cart.length\n else {\n document.getElementById(\"purchase\").innerText = null\n }\n } \n}", "function Checkout() {\r\n const [{basket, user}, dispatch] = useStateValue();\r\n\r\n return (\r\n <div className=\"checkout-container\">\r\n <div className=\"checkout\"> \r\n\r\n <div className=\"checkout-top\">\r\n <img className=\"checkout-ad\" alt=\"\"\r\n src=\"https://images-na.ssl-images-amazon.com/images/G/02/UK_CCMP/TM/OCC_Amazon1._CB423492668_.jpg\"\r\n />\r\n\r\n {/* for mob users */}\r\n <div className=\"checkout-subtotal-mob\">\r\n <Subtotal/>\r\n </div>\r\n <div>\r\n <h3 className=\"username\">Hello, {user?.email}</h3> {/*by using '?' it will not error if no user logged-in */}\r\n <h2 className=\"checkout-title\">Your shopping Basket</h2>\r\n\r\n {basket.map(item => {\r\n return <CheckoutProduct\r\n key= {uuidv4()}\r\n id={item.id}\r\n title={item.title}\r\n price={item.price}\r\n rating={item.rating}\r\n image={item.image} \r\n />\r\n })}\r\n\r\n </div>\r\n </div>\r\n\r\n {/* for web users */}\r\n <div className=\"checkout-subtotal-web\">\r\n <Subtotal/>\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n )\r\n}", "function coreFunction () {\n products = [];\n productsFiltered = [];\n getCart();\n if (products !== null) {\n isCartEmpty(false);\n filterProducts();\n createMapWithQuantity();\n fillCart();\n initiateSubmit();\n initiateClearCart();\n } else {\n isCartEmpty(true);\n }\n}", "function User (loggedinuser) {\n this.name = loggedinuser;\n /* Cart to be filled with Item's */\n this.shopCart = [];\n}", "removeAdvert(advert){\n this.total -= advert.price;\n this.cart = this.cart.filter(m => m.name !== advert.name);\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 buyItem(user){\n return Object.assign({}, user, { purchases: user.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}", "function clearCart() {\r\n\r\n}", "function initCart() {\n\t// If there's a cart already in the local storage... (PC)\n\tif (localStorage.cart) {\n\t\t// put the storage into our live array (PC)\n\t\tcartStorageToArray();\n\t\t// update the cart icon badge in the nav bar (PC)\n\t\tupdateCartIcon();\n\t\t// update the shopping cart modal with the existing entries (PC)\n\t\tpopulateCartModal();\n\t}\n}", "componentWillMount() {\n const {\n getOrderInfo,\n orderId,\n clearOrderInfo,\n cart,\n currentUser,\n history\n } = this.props;\n const storedCart = getLocalStorage(\"cart\");\n const accessToken = getLocalStorage(\"access_token\");\n if (\n (isEmpty(omit(cart, \"cart_id\")) &&\n isEmpty(omit(storedCart, \"cart_id\"))) ||\n (isEmpty(currentUser) && isEmpty(accessToken))\n ) {\n toast.info(\"Cart is empty or user not signed in to view this page!\", {\n position: toast.POSITION.TOP_CENTER\n });\n history.push(\"/\");\n } else {\n clearOrderInfo();\n if (orderId) {\n getOrderInfo(orderId);\n }\n }\n }", "function removeFromCartHandler(itemId) {\n\t\tsetUserCart(prev => {\n\t\t\treturn prev.filter(item => item.id !== itemId);\n\t\t});\n\t}", "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n \n}", "function addCookieItem(productId, action){\n console.log('Not logged in..')\n\n if(action == 'add'){\n if(cart[productId] == undefined){\n cart[productId] = {'quantity':1}\n console.log(cart)\n }else{\n cart[productId]['quantity'] += 1\n }\n }\n\n if(action == 'remove'){\n cart[productId]['quantity'] -= 1\n\n if(cart[productId]['quantity'] <= 0){\n console.log('Remove Item')\n delete cart[productId]\n }\n }\n console.log('Cart:',cart)\n document.cookie = 'cart=' + JSON.stringify(cart) + \";domain=;path=/\"\n location.reload()\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 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 updateCart() {\n\n}", "function renderCart() {\r\n loadCart();\r\n clearCart();\r\n showCart();\r\n}", "function purchaseItem() {\n return\n}", "handleRemoveFromCart(e,item) {\n this.setState (state => {\n const cartItems = state.cartItems.filter (elm => elm._id!==item._id)\n localStorage.setItem('cartItem', cartItems)\n return {cartItems};\n });\n }", "show(req, res, next) {\n var cartId = req.params.id;\n var user = req.user;\n Cart.findOne({userid: user._id, _id:cartId}, function(err, cart) {\n if (err) return next(err);\n if (!cart) return perf.ProcessResponse(res).send(401);\n perf.ProcessResponse(res).status(200).json(cart);\n });\n }", "addToCart() {\n const addedItemsId = this.props.cart.addedItems.map(item => item.id);\n const check = addedItemsId.includes(this.props.item.id);\n if (!check) {\n const item = {\n id: this.props.item.id,\n name: this.props.item.ename,\n price: this.props.item.price,\n ingredient: this.props.item.dish_ingradint,\n photo: this.props.item.dishImage_thump,\n availability: this.props.item.active,\n restaurantName: this.props.restaurantItem.restaurantName,\n restaurantId: this.props.restaurantItem.id,\n quantity: 1,\n deliveryCost: this.props.restaurantItem.deliveryCost\n };\n this.props.addItemToCart(item);\n }\n if (check) {\n Alert.alert('', 'this item is already added to cart');\n }\n }", "function emptyCart() {\n if(confirm(\"Voulezvous supprimer tous les produits du panier ?\")) {\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify([]));\n shoppingCartCount();\n populateShoppingCartPage();\n }\n}", "function updateCart(){\n reset();\n cart.forEach(product =>{\n appendProduct(product);\n }); \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 RemoveAllItems(name)\n{\n\tfor (var i in Cart) {\n\t\tif (Cart[i].name === name){\n\t\t\tCart.splice(i, 1);\n\t\t\tbreak;\n\t\n\t\t}\n\t}\t\n\t//update the bubblu number\t\n\tadd();\n\t//display cart\n\tNoDisplay(name);\t\n\t//if the cart is not empty display cost and total items in cart page\n\tif (TotalCount()>0) {\n\tdocument.getElementById('notempty').innerHTML = \"Total Items in Cart \" + TotalCount();\n\tdocument.getElementById('order').innerHTML = \" \";\n\tdocument.getElementById('currentprice').innerHTML = TotalCost();}\n\tSaveCart();\n\n}", "function cartContinue() {\n console.log(history);\n if (user) {\n //lo manda a completar la compra\n } else {\n console.log(\"aqui redirect\");\n history.push(\"/\");\n }\n }", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function addTax(user){\n let updateCart = user.cart.map(item => {\n return{\n name: item.name,\n price: item.price * 1.03\n } \n });\n return Object.assign({}, user , {cart: updateCart})\n }", "function cartNoti() {\n\t\tvar shop_str = localStorage.getItem('shop_list');\n\t\tif (shop_str) {\n\t\t\tvar shop_arr = JSON.parse(shop_str);\n\t\t\tvar count = 0;\n\t\t\t$.each(shop_arr, function(i,v) {\n\t\t\t\tvar qty = v.qty;\n\t\t\t\tcount += qty;\n\t\t\t})\n\n\t\t\t$('.cartnoti').html(count);\n\t\t}\n\t\telse {\n\t\t\t$('.cartnoti').html('');\n\t\t}\n\t}", "loginRequired(productProp , qtyProp){\n const snackbar = {\n active : true,\n text: 'login_reuired'\n }\n this.$store.commit('ui/setSnackbar' , snackbar)\n if(!this.product.hasOptions){\n localStorage.setItem(productProp , this.product.id )\n localStorage.setItem(qtyProp , this.qty )\n }\n\n this.$router.push('/login')\n }", "function buyItem(user){\n amazonHistory.push(user)\n return Object.assign({}, user, { purchases: user.cart })\n}" ]
[ "0.70345634", "0.6765896", "0.63296354", "0.6265118", "0.62382376", "0.6212076", "0.6206064", "0.62034327", "0.61930114", "0.6080757", "0.60781246", "0.60661274", "0.60619086", "0.600053", "0.59872216", "0.5984875", "0.5969234", "0.59520644", "0.59364116", "0.59165204", "0.59071106", "0.5898772", "0.5863914", "0.5863131", "0.586296", "0.586296", "0.586296", "0.5858042", "0.585532", "0.5845317", "0.5841752", "0.57942915", "0.5793265", "0.5782441", "0.57712394", "0.57481915", "0.57377744", "0.57308424", "0.5723103", "0.57222843", "0.5717445", "0.5714399", "0.5713144", "0.5686829", "0.56600845", "0.5659805", "0.5651706", "0.5640502", "0.5637948", "0.56238645", "0.56166625", "0.5616478", "0.561132", "0.55801046", "0.55751497", "0.5565256", "0.5564669", "0.5539601", "0.55346304", "0.55285454", "0.55285454", "0.5525809", "0.55246586", "0.5510329", "0.55071664", "0.55049795", "0.5492088", "0.5488871", "0.5488671", "0.54807186", "0.5477746", "0.54710835", "0.54684585", "0.54672265", "0.5457882", "0.54531884", "0.54530543", "0.54493105", "0.5441631", "0.5438541", "0.54320544", "0.5429262", "0.5426687", "0.5418717", "0.54173684", "0.54118425", "0.5409186", "0.5406078", "0.5404565", "0.5399239", "0.5398075", "0.5398075", "0.5398075", "0.5398075", "0.5398075", "0.5398075", "0.53978443", "0.53968644", "0.5395344", "0.5384545" ]
0.6044435
13
remember cart is an array we are gonna map over this & we are gonna map over each item
function applyTaxToItems(user){ const {cart} = user; const taxRate = 1.3; const updatedCart = cart.map(item => { }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function itemcart(item)\r\n{\r\n\r\n let citem=sweets.map( i=>{\r\n if(i.name==item)\r\n {\r\n user.cart.push(i);\r\n alert(\"Product is added To The Cart\");\r\n }\r\n })\r\n cartview();\r\n}", "function generateCart(){//afegit el paràmetre cartlist a la funció per poder probar-la amb un altre array sense modificar el codi\n let set= new Set(cartList.map( JSON.stringify ))//convertits els objectes a cadena de text per comprobar repetits\n cart = Array.from( set ).map( JSON.parse );//afegim a cart els resultats únics i convertim els strings d'abans a objectes\n \n for( let i=0; i<cart.length;i++){\n cart[i].quantity=0;// reset del camp a 0 per anar sumant els que venen de cartList\n for( let j=0; j<cartList.length; j++ ){\n \n if(cart[i].name==cartList[j].name){\n cart[i].quantity++;\n cart[i].subtotal=(cart[i].quantity*cart[i].price);\n }\n }\n }console.log(cart);\n}", "function cartAdapter() {\n var newArray = [];\n for (let i = 0; i < cart.length; i++) {\n newArray.push(cart[i][0]);\n newArray.push(cart[i][1]);\n }\n return newArray;\n }", "extractCarts () {\n this.layout = this.layout.map((y, idy) => {\n return y.map((x, idx) => {\n // Pop the cart into the cart list with its location\n if (this.cartDirections.indexOf(x) >= 0) {\n this.carts.push({\n x: idx,\n y: idy,\n direction: x,\n lastIntersections: [1, 0] // Assume the first ntersection the cart will turn left\n })\n // Replace the cart on the track with a track segment\n // (Assuming cart initial states aren't on instersections)\n x = (this.cartDirections.indexOf(x) % 2 === 0) ? '|' : '-'\n }\n return x\n })\n })\n }", "function listCart() {\n var cartCopy = [];\n for (var i in cart) {\n var item = cart[i];\n var itemCopy = {};\n for (var p in item) {\n itemCopy[p] = item[p];\n }\n cartCopy.push(itemCopy);\n }\n return cartCopy;\n }", "renderCarts(cart){\n \tif(cart.length>0){\n \t\treturn cart.map(i=><li>{i.name}</li>)\n \t}else{\n \t\treturn <h1>No Items added</h1>\n \t}\n \t\n }", "function setCart() {\n cart.forEach(\n (item) =>\n !filteredCart.filter(\n (cart) => (cart.name === item.name) & (cart.size === item.size)\n ).length > 0 && filteredCart.push(item)\n );\n\n filteredCart.forEach((item) =>\n cartNew.push(\n cart.filter((i) => (i.name === item.name) & (i.size === item.size))\n )\n );\n }", "function listCart(){ \n var cartCopy=[]; \n for(var i in cart){\n var item=cart[i];\n var itemCopy={};\n for(var p in item){\n \titemCopy[p]=item[p]; \n \t \n \t}\n \tcartCopy.push(itemCopy); \n }\t\n \n return cartCopy; \n}", "function updateCart(){\n reset();\n cart.forEach(product =>{\n appendProduct(product);\n }); \n}", "function getCartItems(){\n return cart_items;\n}", "addToCart(index) {\n var product = productList[index];\n var cartCopy = this.state.cart.slice();\n cartCopy[cartCopy.length] = {\n name: product.name,\n price: product.price\n };\n }", "function CartCards({products=[], cart=[], addToCart=f=>f, removeFromCart=f=>f}) {\n // const id = product.id;\n console.log(products)\n\n \n\n\n const productList = products.map((product, key) =>\n <div key={key} className=\"productCard\">\n <CartCard key={key} product={product} cart={cart} addToCart={addToCart} />\n </div> \n \n )\n return (\n <div className=\"CartCards\">\n {productList}\n </div>\n )\n}", "calculateCart(cart) {\n let retArray = []\n cart.forEach( (e) => {\n // \"_.find\" takes in the collection, and condition\n // returns the first thing that meets that condition or null\n let search = _.find(retArray, (p) => { return p.productname == e.productname })\n if(!search) {\n e.quantity = 1\n retArray.push(e)\n } else {\n search.quantity++\n }\n })\n return retArray; // return unique items, with correct quantity in cart\n }", "cartItemsRow() {\n if (this.state.cartItems instanceof Array) {\n var that = this;\n return this\n .state\n .cartItems\n .map(function (item, index) {\n return <CartItems key={index} item={item} removeFromCart={that.removeFromCart}/>;\n });\n }\n }", "function getItemsInCart(){\n\t\t\treturn items;\n\t\t}", "DataTable() {\n if(this.props.auth.isAuthenticated) {\n return this.state.cartItems.map((res, i) => {\n return <CartTable obj={res} key={i} user={this.props.auth.user} auth={this.props.auth.isAuthenticated} />;\n });\n }\n else {\n console.log(this.props.Items);\n return this.props.Items.map((res, i) => {\n return <CartTable obj={res} key={i} user={this.props.auth.user} auth={this.props.auth.isAuthenticated} items={this.props.Items} />;\n });\n }\n }", "function listMealCart() {\n var cartCopy = [];\n for (var i in mealCart) {\n var item = mealCart[i];\n var itemCopy = {};\n for (var p in item) {\n itemCopy[p] = item[p];\n }\n cartCopy.push(itemCopy);\n }\n return cartCopy;\n}", "renderItems() {\n let items = [];\n this.state.cartItems.map((item, i) => {\n items.push(\n <ListItem key={i} style={{ marginLeft: 0 }}>\n <Body style={{ paddingLeft: 10 }}>\n <Text style={{ fontSize: 18 }}>\n {item.Cantidad > 1 ? item.Cantidad + \"x\" : null}\n {item.item.nombreProducto}\n </Text>\n </Body>\n <Right>\n <Text\n style={{\n fontSize: 16,\n fontWeight: \"bold\",\n marginBottom: 10\n }}\n >\n $ {item.item.precioUnidadProducto}\n </Text>\n </Right>\n </ListItem>\n );\n });\n return items;\n }", "get cartItems() {\n //return store.cartItems; //added*\n return JSON.parse(this.storage.getItem(this.CART_KEY));\n }", "function getPriceArray(shoppingCart){\n return shoppingCart.map(item => item.price * item.quantity);\n}", "function setCartUser() {\n userCart.forEach(\n (item) =>\n !filteredCartUser.filter(\n (cart) =>\n (cart.item.name === item.item.name) &\n (cart.item.size === item.item.size)\n ).length > 0 && filteredCartUser.push(item)\n );\n\n filteredCartUser.forEach((item) =>\n cartNewUser.push(\n userCart.filter(\n (i) =>\n (i.item.name === item.item.name) & (i.item.size === item.item.size)\n )\n )\n );\n }", "function showCartItems() {\n const billItemContainer = document.querySelector(\".bill-items\");\n billItemContainer.innerHTML = \"\";\n if (cart.length > 0) {\n const billItem = document.createElement(\"div\");\n billItem.classList = \"bill-item\";\n const itemName = document.createElement(\"h4\");\n itemName.innerHTML = \"Name\";\n const itemQuantity = document.createElement(\"p\");\n itemQuantity.innerHTML = \"Qty\";\n const itemPrice = document.createElement(\"p\");\n itemPrice.innerHTML = \"Price\";\n\n billItem.appendChild(itemName);\n billItem.appendChild(itemQuantity);\n billItem.appendChild(itemPrice);\n\n billItemContainer.appendChild(billItem);\n }\n cart.map((item) => {\n const billItem = document.createElement(\"div\");\n billItem.classList = \"bill-item\";\n\n const itemName = document.createElement(\"h5\");\n itemName.innerHTML = item.name;\n const itemQuantity = document.createElement(\"p\");\n itemQuantity.innerHTML = ` x ${item.quantity}`;\n const itemPrice = document.createElement(\"p\");\n itemPrice.innerHTML = \"₹ \" + item.price;\n\n billItem.appendChild(itemName);\n billItem.appendChild(itemQuantity);\n billItem.appendChild(itemPrice);\n\n billItemContainer.appendChild(billItem);\n });\n}", "function combineCartItems() {\n const getCartItem = localStorage.getItem(\"cart\");\n if (getCartItem) {\n const cartItem = JSON.parse(getCartItem);\n //console.log(cartItem);\n cartLs = [...cartItem];\n }\n}", "addToCart(newItem) {\n let itemExisted = false\n let updatedCart = this.state.cart.map(item => {\n if (newItem === item.sku) {\n itemExisted = true\n return { sku: item.sku, quantity: ++item.quantity }\n } else {\n return item\n }\n })\n if (!itemExisted) {\n updatedCart = [...updatedCart, { sku: newItem, quantity: 1 }]\n }\n this.setState({ cart: updatedCart })\n // Store the cart in the localStorage.\n // localStorage.setItem('stripe_checkout_items', JSON.stringify(updatedCart))\n }", "function getItem(){ \n var itemContainer = this.closest(\"div\"); \n var quantity = itemContainer.querySelector(\".quantity-input\");\n var itemName = itemContainer.querySelector(\".item-name\")\n var totalPrice = itemContainer.querySelector(\".total-price\")\n var newItem = {}; \n inventory.map(function (inventoryItem){\n if(itemName.innerHTML === inventoryItem.name){\n newItem = inventoryItem\n totalPrice.innerHTML = (inventoryItem.price).toFixed(2)\n }\n })\n addItemToCart(newItem, parseInt(quantity.value))\n quantity.value = \"\";\n quantity.placeholder = 1\n}", "cartSaleItems(state){\n return state.cart.filter( item => {\n return (item.head.onSale || item.leftArm.onSale || item.torso.onSale || item.rightArm.onSale || item.base.onSale);\n })\n }", "setCartValues(cart) {\n let tempTotal = 0;\n let itemTotal = 0;\n\n cart.map(item => {\n tempTotal += item.price * item.amount;\n itemTotal += item.amount;\n });\n\n cartTotal.innerText = parseFloat(tempTotal.toFixed(2));\n cartItems.innerText = itemTotal;\n }", "function renderCartItems() {\r\n\t var $cartItemContainer = $('.cart-item-container');\r\n\t $cartItemContainer.empty();\r\n\t var lineItemEmptyTemplate = $('#CartItemTemplate').html();\r\n\t var $cartLineItems = cart.lineItems.map(function (lineItem, index) {\r\n\t return renderCartItem(lineItem);\r\n\t });\r\n\t $cartItemContainer.append($cartLineItems);\r\n\r\n\t setTimeout(function () {\r\n\t $cartItemContainer.find('.js-hidden').removeClass('js-hidden');\r\n\t }, 0)\r\n\t updateTotalCartPricing();\r\n\t }", "product() {\n return this.props.products.map((item, index) => {\n return <ShopCard addToCart={this.props.addToCart} key={index} product={item} />\n })\n }", "function cart() {\n const productsInCart = [];\n return {\n getProducts: () => {\n return productsInCart.map(item => {\n return {\n name: item.name,\n price: item.price\n };\n });\n },\n addToCart: product => {\n productsInCart.push(product);\n },\n\n totalPrice: () => {\n const totalPrice = productsInCart.reduce((total, item) => {\n total += item.price;\n return total;\n }, 0);\n return totalPrice;\n }\n };\n}", "function walkCart (state, fn) {\n state.list.forEach((shopCart,shopIndex) => {\n\t\t// console.log('1walkCart',shopCart,shopIndex)\n shopCart.list.forEach(fn)\n })\n}", "function setItems(product) {\n //Get cartItems in local Storage\n let cartItems = localStorage.getItem('productsInCart');\n //Because of productsInCart now is string but now we want it string to array Json =>\n cartItems = JSON.parse(cartItems);\n //Check cartItems \n if (cartItems != null) {\n //Check product have tag or not =>\n if (cartItems[product.tag] == undefined) {\n //Set cartItem with tag =>\n cartItems = {\n ...cartItems,\n [product.tag]: product\n }\n }\n //=> if cartItem in stock => +1 cart in next time\n cartItems[product.tag].inCart += 1;\n }\n else {\n //=>if not, cart =1 and next time will be +1=> loop if\n product.inCart = 1;\n //=>set cartItems\n cartItems = {\n [product.tag]: product\n }\n }\n //cartItems array to string =>\n localStorage.setItem(\"productsInCart\", JSON.stringify(cartItems));\n}", "function itemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n}", "handleAddToCard (e, products) {\n this.setState(state => {\n const cartItems = state.cartItems;\n let productAlreadyInCart = false;\n cartItems.forEach(item => {\n console.log('dentro de forEach')\n if (item._id === products._id) {\n productAlreadyInCart = true;\n item.count++;\n }\n });\n if (!productAlreadyInCart) {\n console.log('dentro de cartItem push')\n cartItems.push({...products, count: 0});\n }\n localStorage.setItem(\"cartItems\", JSON.stringify(cartItems));\n console.log(this.state.cartItems, \"cart item\")\n return cartItems;\n })\n }", "function applyPromotionsCart() {\n // Apply promotions to each item in the array \"cart\"\n cart.map( (product, index) => {\n if (product.name === 'cooking oil' && product.quantity > 2) {\n cart[index].subtotalWithDiscount = cart[index].quantity * 10;\n } else if (product.name === 'Instant cupcake mixture' && cart[index].quantity > 9) {\n cart[index].subtotalWithDiscount = cart[index].quantity * (cart[index].price * 0.66);\n } else {\n cart[index].subtotalWithDiscount = cart[index].quantity * cart[index].price;\n }\n })\n}", "function viewCart() {\nvar list = [];\nif (cart.length === 0) {\n return 'Your shopping cart is empty.'\n}\nfor (var i = 0; i < cart.length; i++) {\n\n if (cart.length === 1) {\n list.push(`In your cart, you have ${cart[0].itemName} at $${cart[0].itemPrice}.`) \n}\n\n else if (cart.length === 2) {\n list.push(`In your cart, you have ${getCart()[0].itemName} at $${getCart()[0].itemPrice}, and ${getCart()[1].itemName} at $${getCart()[1].itemPrice}.`)\n}\n\nelse{\n list.push(`In your cart, you have ${getCart()[0].itemName} at $${getCart()[0].itemPrice}, ${getCart()[1].itemName} at $${getCart()[1].itemPrice}, and ${getCart()[2].itemName} at $${getCart()[2].itemPrice}.`)\n}\nreturn list;\n}\n}", "function getCart() {\n return cart;\n}", "function addItemToCart(user, items){\n let updateCart = user.cart.concat(items);\n // NOTE: data is userClone = Object.assign({}, user , {cart: updateCart})\n return Object.assign({}, user , {cart: updateCart}) \n }", "setItemsInCart(state, items) {\n state.itemsInCart = items;\n }", "handleAddCart(e, product){\n this.setState(state => {\n const cartItems = state.cartItems;\n let productAlreadyInCart = false;\n cartItems.forEach(item => {\n if(item.id === product.id){\n productAlreadyInCart= true;\n item.count++;\n }\n });\n if(!productAlreadyInCart){\n cartItems.push({...product, count:1});\n }\n localStorage.setItem(\"cartItems\",JSON.stringify(cartItems));\n return cartItems;\n })\n }", "function mapCart(session, formBody) {\n var cart = models.shoppingCart();\n cart.credentialsHash = session.credentialsHash;\n cart.email = session.email;\n cart.purchaseDate = moment().unix();\n cart.purchaseDateDisplay = moment().format('dddd, MMMM Do YYYY, h:mm:ss a');\n cart.items = JSON.parse(formBody.inputCart);\n cart.address.name.first = formBody.inputFirstName;\n cart.address.name.last = formBody.inputLastName;\n cart.address.street1 = formBody.inputAddress1;\n cart.address.street2 = formBody.inputAddress2;\n\n if (!cart.address.street2 || cart.address.street2.length == 0) {\n cart.address.street2 = null;\n }\n\n cart.address.city = formBody.inputCity;\n cart.address.state = formBody.selectState;\n cart.address.zip = formBody.inputZip;\n cart.payment.creditCard.number = 'XXXX-XXXX-XXXX-' + formBody.inputCreditCard.substring(formBody.inputCreditCard.length - 4);\n cart.payment.creditCard.expiration = formBody.inputExpiration;\n cart.payment.creditCard.ccv = formBody.inputCCV;\n\n return cart;\n }", "getCartItems()\r\n\t{\r\n\t\tlet cart = Cookie.get(this.settings.cookie_name);\r\n\r\n\t\treturn (cart) ? cart.items : [];\r\n\t}", "cartProducts() {\n return this.insideCart;\n }", "availableItemsRow() {\n if (this.state.availableItems instanceof Array) {\n var that = this;\n return this\n .state\n .availableItems\n .map(function (item, index) {\n return <AvailableItems key={index} item={item} addToCart={that.addToCart}/>;\n });\n }\n }", "function getCartData() {\n const pizzaFromCartLS = JSON.parse(localStorage.getItem('cart'));\n if (pizzaFromCartLS) {\n pizzaFromCartLS.forEach((pizza, i) => cart[i] = pizza);\n }\n}", "function getCart() {\n return cart\n}", "function viewCart() {\n //console.log(cart)\n var message = \"In your cart, you have\";\n if (cart.length === 0) {\n console.log(\"Your shopping cart is empty.\")\n }\n else if (cart.length === 1) {\n console.log(message + \" \" + Object.keys(cart[0]) + \" at $\" + cart[0][Object.keys(cart[0])] + \".\")\n }\n else if (cart.length >= 2) {\n var items = []\n for (var i = 0; i < cart.length; i++) {\n var itemName = Object.keys(cart[i])\n var price = cart[i][itemName]\n items.push(itemName + \" at $\" + price)\n if (i != cart.length-1) {\n cart.length === 2 ? message += \" \" + items[i] : message += (\" \" + items[i] + \",\")\n }\n else {\n message += (\" and \" + items[i] + \".\")\n }\n }\n console.log(message)\n }\n}", "calculateTotal(price, skuId, qty) {\n let cartListArr = this.props.elcStore.cartList.length ? JSON.parse(this.props.elcStore.cartList) : {};\n if (Object.keys(cartListArr).length && cartListArr[skuId] !== undefined) {\n for (let x in cartListArr) {\n if (x === skuId) {\n cartListArr[skuId] = {qty: cartListArr[skuId].qty + qty};\n }\n }\n } else {\n cartListArr[skuId] = {qty: qty};\n }\n const total = this.state.total + (price * qty);\n const cartList = cartListArr;\n this.props.elcStore.cartListUpdate(total, cartList);\n }", "function addToCart() {\n let cartAr = [];\n for (let i = 0; i < itemsAr.length; i++) {\n itemsAr[i].howMany();\n if (itemsAr[i].quantity > 0) {\n cartAr.push(itemsAr[i]);\n cartAr = Array.from(new Set(cartAr));\n }\n }\n return cartAr;\n}", "function setItems(product){\r\n let cartItems = localStorage.getItem('productsInCart');\r\n cartItems = JSON.parse(cartItems);\r\n //checked if the cartItems is null\r\n if(cartItems != null){\r\n if(cartItems[product.tag] == undefined){\r\n cartItems = {\r\n ...cartItems,\r\n [product.tag]: product\r\n }\r\n }\r\n cartItems[product.tag].inCart += 1; \r\n } else {\r\n product.inCart = 1;\r\n cartItems = {\r\n [product.tag]: product\r\n }\r\n } \r\n product.inCart = 1;\r\n\r\n //json stringify turns object into subjects that can stored on the browser local storage\r\n localStorage.setItem(\"productsInCart\", JSON.stringify (cartItems));\r\n}", "renderActionSection () {\n return this.state.cartList.map((items, i) =>\n <div className=\"cartPackage\">\n <div>Package {i+1}</div>\n <ul>\n <li><span>Items</span> - <span>{items.items}</span></li>\n <li><span>Total weight</span> - <span>{items.tw}</span></li>\n <li><span>Total price</span> - <span>{items.tp}</span></li>\n <li><span>Courier price </span> - <span>{items.cp}</span></li>\n </ul>\n </div>\n )\n }", "function addTax(user){\n let updateCart = user.cart.map(item => {\n return{\n name: item.name,\n price: item.price * 1.03\n } \n });\n return Object.assign({}, user , {cart: updateCart})\n }", "addBoothToCart(product, subitem){\n this.cart.forEach(m => {\n if ( m.booths && m.id == product.id ){\n this.total -= m.price;\n this.cart = this.cart.filter(n => n.id !== m.id);\n }\n if ( m.notify ){\n this.cart = this.cart.filter(n => !n.notify);\n }\n })\n product.booths.booths = true;\n product.booths.quantity++;\n product.booths.name = subitem.name;\n product.booths.price = subitem.price;\n cartitem = Object.assign({}, product.booths);\n this.cart.push(cartitem);\n this.total += cartitem.price;\n }", "addItemToCart(item){\n // check for duplicates\n if(this.cart.hasOwnProperty(item.id)){\n this.cart[item.id].quantity += 1\n localStorage.setItem('cart', JSON.stringify(this.cart))\n }\n else {\n item.index = Object.keys(this.cart).length\n item.quantity = 1\n this.cart[item.id] = item\n localStorage.setItem('cart', JSON.stringify(this.cart))\n }\n return this\n }", "function checkInCart(name) {\n $.map( cart, function( item, index ) {\n if (item.product.name === name) {\n indexInCart = index;\n } else {\n indexInCart = -1\n }\n });\n}", "populateTotalPricing(basketArr = []) {\n return basketArr.map((eachItem) => {\n let totalPrice = eachItem.quantity * (eachItem.product ? eachItem.product.price : eachItem.promotionPrice);\n let originalPrice = null;\n if (eachItem.promotion) {\n originalPrice = totalPrice;\n totalPrice *= 1 - eachItem.promotion.discount / 100;\n }\n\n return {...eachItem, originalPrice, totalPrice};\n })\n }", "function displaycart() {\n let cartItems = localStorage.getItem(\"productsInCart\");\n cartItems = JSON.parse(cartItems);\n console.log(cartItems)\n // for basket total price\n let totalPrice = localStorage.getItem(\"totalPrice\");\n // to display shopping products \n let productsIncart = document.querySelector(\".products\");\n if (cartItems && productsIncart) {\n productsIncart.innerHTML = \"\";\n // getting only product object from cartitems\n let cartItemsArray = Object.values(cartItems);\n console.log(Object.values(cartItems))\n //mapping of each item\n cartItemsArray.map(item => {\n // for each product in cart\n productsIncart.innerHTML += `\n <div class= \"product\">\n <ion-icon class=\"remove-button\" name = \"close-circle\"></ion-icon>\n <img src=\"./img/${item.tag}.jpg\">\n <span>${item.name}</span>\n </div>\n <div class= \"price\"> ${item.price}</div>\n <div class= \"quantity\">\n <ion-icon class = \"increase\" name=\"add-circle-outline\"></ion-icon> \n <span>${item.inCart}</span>\n <ion-icon class = \"decrease\" name=\"remove-circle-outline\"></ion-icon> \n </div>\n <div class= \"total\">\n ${item.inCart * item.price}\n </div>\n `;\n });\n console.log(totalPrice)\n // for basket total in cart.html\n productsIncart.innerHTML += `\n <div class= \"basketTotalContainer\">\n <h4 class= \"basketTotalTitle\"> Basket Total </h4>\n <h4 class= \"basketTotal\"> ${totalPrice}.00</h4> \n </div>\n `;\n }\n changingQuantityOfCartItems();\n RemoveCartItem();\n\n\n}", "function countTotalCart(shoppingCart) {\n let som = 0;\n shoppingCart.map(item => {\n som += item.camera.price\n });\n return som;\n}", "moveToCart(product){\n var newCart= this.state.cart.slice()\n newCart.push(product)\n this.setState({\n cart: newCart,\n })\n}", "ADD_TO_CART(state, product) {\n // Check if cart is empty\n if (Object.keys(state.cart).length != 0) {\n for (const [key, value] of Object.entries(state.cart)) {\n // Check if product already in cart, then change quantity \n if (key === product.reference) {\n product.qty = value.qty + state.qty\n state.cart[key].qty = product.qty\n } else {\n state.cart[product.reference] = product\n }\n }\n } else {\n state.cart[product.reference] = product\n }\n }", "function setCoffeeProducts(items) {\n let cartProduct = localStorage.getItem(\"coffeeInCart\");\n cartProduct = JSON.parse(cartProduct);\n\n if (cartProduct !== null) {\n if (cartProduct[items.name] == undefined) {\n cartProduct = {\n ...cartProduct,\n [items.name]: items\n };\n }\n cartProduct[items.name].insideCart += 1;\n } else {\n items.insideCart = 1;\n cartProduct = {\n [items.name]: items\n };\n }\n\n localStorage.setItem(\"coffeeInCart\", JSON.stringify(cartProduct));\n}", "setCartItem() {\n console.log(this.itemNumber);\n if (this.itemNumber < this.cart.length) {\n this.set('cartItem.name', this.cart[this.itemNumber].name);\n this.set('cartItem.price', this.cart[this.itemNumber].price);\n }\n if (this.itemNumber < this.cart.length && this.cart[this.itemNumber].shippingAddress) {\n this.set('cartItem.giftMessage', this.cart[this.itemNumber].giftMessage);\n this.set('cartItem.shippingAddress', Object.assign({}, this.cart[this.itemNumber].shippingAddress));\n } else {\n console.log(this.itemNumber);\n this.set('cartItem.giftMessage', \"\");\n this.set('cartItem.shippingAddress', {\n firstName: \"\",\n lastName: \"\",\n streetAddress1: \"\",\n streetAddress2: \"\",\n cityName: \"\",\n state: \"\",\n zipCode: \"\",\n recipientNumber: \"\"\n });\n }\n }", "function setItems(products) {\r\n\tlet cartItems = localStorage.getItem('productsInCart');\r\n\tcartItems = JSON.parse(cartItems);\r\n\t\r\n\tif(cartItems != null) {\r\n\t\t\r\n\t\tif(cartItems[products.tag] == undefined){\r\n\t\t\tcartItems = {\r\n\t\t\t\t...cartItems,\r\n\t\t\t[products.tag]: products\r\n\t\t\t}\r\n\t\t}\r\n\t\tcartItems[products.tag].inCart += 1;\r\n\t} else {\r\n\t\tproducts.inCart = 1;\r\n\t\tcartItems = {\r\n\t\t\t[products.tag]: products\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlocalStorage.setItem(\"productsInCart\", JSON.stringify(cartItems));\r\n}", "render() {\n return (\n <main className=\"cart\">\n <div className=\"cart__container\">\n <h3 className=\"cart__title\">Koszyk</h3>\n <div className=\"cart__head\">\n <div className=\"cart__colTitle cart__colTitle--1\">LP</div>\n <div className=\"cart__colTitle cart__colTitle--2\"></div>\n <div className=\"cart__colTitle cart__colTitle--4\">NAZWA</div>\n <div className=\"cart__colTitle cart__colTitle--2\">PLATFORMA</div>\n <div className=\"cart__colTitle cart__colTitle--3\">ILOŚĆ</div>\n <div className=\"cart__colTitle cart__colTitle--2\">CENA/SZT</div>\n <div className=\"cart__colTitle cart__colTitle--2\">SUMA</div>\n <div className=\"cart__colTitle cart__colTitle--2\">USUŃ</div>\n </div>\n <div className=\"cart__items\">{ \n this.props.cartItems.map(item => {\n return <CartItem item={item} \n updateCart = {this.props.updateCart} \n key={item.productId}/>\n })}\n {this.props.cartValue}\n </div>\n </div>\n </main>\n )\n }", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "addToCart(item) {\n // console.log(this.props.art[index])\n this.props.addToCart(item)\n }", "get cart(){ return this._cart }", "function displayCart() {\n let cartItems = localStorage.getItem(\"productsInCart\");\n cartItems = JSON.parse(cartItems);\nconsole.log(cartItems);\nlet cartCost = localStorage.getItem(\"totalCost\");\nlet productContainer = document.querySelector(\".products\");\n\n\nif(cartIems && productContainer){\n productContainer.innerHTML = '';\n\n Object.values(cartItems)\n .map(item=>{productContainer.innerHTML += `<div class=\"product\"> <ion-icon name=\"close-circle\"></ion-icon>\n <img src=\"./images/${item.tag}.jpg\"> \n <span>${item.name}</span></div>`\n\n `<div class = \"price\">$${item.price}.00</div>`\n `<div class = \"quantity\"><ion-ionic class=\"decrease\" name=\"arrow-dropleft-circle\"></ion-icon>\n <span>${item.inCart}</span>\n\n <ion-ionic class=\"increase\" name=\"arrow-dropright-circle\"> </ion-icon></div>`\n `<div class=\"total\"> $${item.inCart * item.price},00 </div>` \n });\n\n productContainer.innerHTML += `<div class=\"basketTotalContanier\">\n <h4 class =\"basketTotalTitle\"> Basket Total </h4>\n <h4 class =\"basketTotal\">$${cartCost}.00 </h4>`;\nconsole.log(productContainer);\n}\n}", "addToCart(item) {\n const nameKey = item.name;\n // If the item that is being added to the cart is already in the cart,\n // we increment the numInCart variable to show that an additional unit\n // is being added\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 this.setState({\n aggregatedItems: currAggregatedItems\n })\n // If it is not already in the cart, we need to add this key-value pair to the \n // aggregatedItems state variable. We do so using the setState function\n } else {\n let currAggregatedItems = this.state.aggregatedItems;\n currAggregatedItems[nameKey] = {\n numInCart: 1,\n price: item.price,\n image: item.image,\n shelf_life: item.shelf_life,\n type: item.type\n\n }\n this.setState({\n aggregatedItems: currAggregatedItems\n })\n }\n }", "function Bill(props) {\n /*let ans = '';\n for (let i in userCart) {\n ans += `${userCart[i]}: ${calculator(userCart[i])}+`\n }\n return ans;*/\n const items = props.items;\n return items.map( (item, index) =>\n <div key={index}>\n <h1>{item}: {products[item].price}</h1>\n {products[item].coupon !== '' ? <h5>{products[item].coupon}</h5> : ''}\n <p>current total price = {calculator(item)}</p>\n </div>\n );\n\n// return listItems;\n}", "subCart(days)\n {\n let subCart = new Cart([], []);\n for (let i = 0; i < this.itemList.length; i++)\n {\n if (this.itemList[i].shipping == days)\n {\n subCart.addItem(this.itemList[i]);\n }\n }\n return subCart();\n }", "function getCart(item) {\n var ss = sessionStorage.getItem(\"cart\")\n if (!ss) ss = \"[]\"\n ss = JSON.parse(ss)\n return ss\n}", "function Cart(items) {\n this.items = items;\n}", "setupCart()\r\n\t{\r\n\t\tthis.cart = {};\r\n\t\tthis.cart.id = Str.random(10);\r\n\t\tthis.cart.items = [];\r\n\t\tthis.cart.favorites = [];\r\n\t\tCookie.set(this.settings.cookie_name, this.cart, 2);\r\n\t}", "function addItemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n return Object.assign({}, )\n}", "addToCart(text, price)\n {\n let count = 1;\n let item = {Name:text, Count:count, Price:price};\n let fl=1;\n for (i = 0; i < cart.length; i++) {\n if(cart[i].Name === text)\n {\n cart[i].Count=cart[i].Count+1;\n cart[i].Price=Number(cart[i].Price)+Number(price);\n fl=0;\n break;\n\n }\n }\n if(fl==1){\n cart.push(item);\n }\n // for(i=0; i<cart.length; i++){\n // console.log(\"item: \"+i+\" is \"+cart[i].Name+\" count \"+cart[i].Count+\" price \"+cart[i].Price); \n // }\n window.alert('Added to cart.');\n this.render();\n }", "addToShoppingCart() {\n\n // units is greater than zero\n if (this.state.units != 0){\n\n // validate stock\n if (this.state.units <= this.state.product.saleFormats[this.state.formatIndex].stock) {\n \n // get shpping cart\n var productsArrayCart = JSON.parse(localStorage.getItem('productsArrayCart'));\n \n // console.log(productsArrayCart);\n if (productsArrayCart == null) {\n productsArrayCart = [];\n };\n \n \n // validate if product with specific format already is in cart\n var productIsInCart = false;\n var formatIsInCart = false;\n var indexProduct = 0;\n productsArrayCart.forEach((product, idx) => {\n // validate if product is in array\n if (product.product.id == this.state.product.id) {\n productIsInCart=true;\n indexProduct= idx;\n\n // validate if format is in array\n if (product.formatIndexList.includes(this.state.formatIndex)) {\n formatIsInCart = true;\n }\n }\n });\n\n // if product is not\n // add product to cart\n if (!productIsInCart) {\n\n // alert(\"Product isn't in cart\");\n\n // add new product\n productsArrayCart.push({\n \"product\": this.state.product,\n \"formatIndexList\": [this.state.formatIndex],\n \"unitsList\": [this.state.units],\n });\n \n // console.log(productsArrayCart);\n \n // save new array\n localStorage.setItem('productsArrayCart', JSON.stringify(productsArrayCart));\n \n // console.log(productsArrayCart);\n \n // console.log(localStorage);\n alert(\"Producto agregado al carrito de compra\");\n \n // redirect\n this.props.history.push('/store/' + this.props.match.params.store_id);\n }\n\n // if product is in cart but no format\n // add format to product cart\n else if (productIsInCart & !formatIsInCart) {\n\n // alert(\"Product is in cart but format is not\");\n\n // add format index to list\n var formatIndexList = productsArrayCart[indexProduct][\"formatIndexList\"];\n formatIndexList.push(this.state.formatIndex);\n\n // add units\n var unitsList = productsArrayCart[indexProduct][\"unitsList\"];\n unitsList.push(this.state.units);\n\n // update item on product cart array\n productsArrayCart[indexProduct][\"formatIndexList\"] = formatIndexList\n productsArrayCart[indexProduct][\"unitsList\"] = unitsList;\n\n // save new array\n localStorage.setItem('productsArrayCart', JSON.stringify(productsArrayCart));\n\n // console.log(productsArrayCart);\n\n // console.log(localStorage);\n alert(\"Producto agregado al carrito de compra\");\n\n // redirect\n this.props.history.push('/store/' + this.props.match.params.store_id);\n\n\n }\n\n // if product and format is in cart\n else if (productIsInCart & formatIsInCart) {\n\n // get index of format index\n const indexFormatIndex = productsArrayCart[indexProduct][\"formatIndexList\"].indexOf(this.state.formatIndex);\n\n // get product format stock\n const productFormatStock = this.state.product.saleFormats[this.state.formatIndex].stock;\n\n // get products availables (dif between stock and units )\n const availableProducts = productFormatStock - productsArrayCart[indexProduct][\"unitsList\"][indexFormatIndex]\n\n // if it can add all units, so add to the cart\n if (this.state.units <= availableProducts) {\n\n\n // alert(\"product is in car and can add these units\");\n\n // add units to element in units array\n productsArrayCart[indexProduct][\"unitsList\"][indexFormatIndex] = productsArrayCart[indexProduct][\"unitsList\"][indexFormatIndex] + this.state.units;\n\n // save new array\n localStorage.setItem('productsArrayCart', JSON.stringify(productsArrayCart));\n\n // console.log(productsArrayCart);\n\n // console.log(localStorage);\n alert(\"Producto agregado al carrito de compra\");\n\n // redirect\n this.props.history.push('/store/' + this.props.match.params.store_id);\n\n \n }\n \n else if (availableProducts == 0) {\n // alert(\"product is in car but cann't add more units\");\n\n alert(\"Ya has agregado el máximo de unidades de este formato. Revisa tu carrito de compra para confirmar\");\n }\n // else, alert message with differecen available\n else {\n // alert(\"product is in cart but cann't add that number of units\");\n alert(\"Solo puedes agregar hasta \" + availableProducts + \" unidades de este formato\");\n };\n\n }\n\n }\n \n else{\n alert(\"Sólo puedes ordenar \" + this.state.product.saleFormats[this.state.formatIndex].stock + \" unidades de este formato\");\n };\n }\n \n else {\n alert(\"Debes elegir al menos una unidad de este producto\");\n };\n\n }", "function displayCartData() {\n var productsFromLS = getItemFromLocalStorage('productsCart');\n var allProducts = getItemFromLocalStorage('products');\n let array = [];\n\n array = allProducts.filter((p) => {\n for (let prod of productsFromLS) {\n if (p.id == prod.id) {\n p.quantity = prod.quantity;\n return true;\n }\n }\n });\n // console.log(array);\n\n $('#products-header').html(`\n <div class=\"col-12 mt-5\">\n <div class=\"row\">\n <div class=\"col-3 border text-center\">\n <h3>Product</h3>\n </div>\n <div class=\"col-3 border text-center\">\n <h3>Price</h3>\n </div>\n <div class=\"col-3 border text-center\">\n <h3>Quantity</h3>\n </div>\n <div class=\"col-3 border text-center\">\n <h3>Equals</h3>\n </div>\n\n </div>\n</div>\n `);\n\n printCartItems(array);\n}", "function displayCart() {\n let cartItems = JSON.parse(localStorage.getItem('inCart')) || [];\n console.log(cartItems)\n let items = document.getElementsByClassName(\"items\")\n console.log(items)\n if (cartItems && items) {\n items.innerHTML = '';\n Object.values(cartItems).map(item => {\n let newItem = \n `<div class=\"item\"> \n <img class=\"item-img\" src=\"${item.img}\"> \n <p class=\"item-roll\"> ${item.name} ${item.glaze}</p>\n <p class=\"item-price\"> $${item.price}.00 </p>\n <p class=\"item-quantity\">${item.qt } </p>\n <button class=\"remove\" ${onclick=removeItem()}>REMOVE</button>\n </div>`\n items.innerHTML += newItem\n console.log(items.innerHTML)\n })\n let total = '<div class = \"totalPrice\"> ${item.price}.00 </div> ' \n }\n}", "function renderCart(cartItems) {\n let cartContainer = document.querySelector(\"#cart\");\n cartContainer.innerHTML = \"\";\n if (cartItems.length > 0) {\n \n cartItems.map((cartItem) => {\n cartContainer.innerHTML += `\n <div class = \"products\"> \n <div class=\"image-div\">\n <img src=\"${cartItem.image}\" class = \"product-image\">\n </div>\n <div class=\"cart-content\">\n <div class = \"product-content\"> \n \n <h4 class = \"product-title\"> ${cartItem.product_name}</h4>\n <p class = \"product-description\"> ${cartItem.brand}</p>\n <p class = \"product-price\">R${cartItem.price} </p>\n </div>\n\n <div class=\"cart-btns\">\n <button class =\"revome_cart\" onclick=\"removeItem(${cartItem.prod_id})\">Remove item</button>\n <button class=\"checkout-button\" onlcick=\"\">Checkout</button>\n </div>\n\n <div class=\"container\">\n\t\t\t\t <input type=\"button\" onclick=\"decrementValue()\" value=\"-\" />\n\t\t\t\t <input type=\"text\" name=\"quantity\" value=\"1\" maxlength=\"2\" max=\"10\" size=\"1\" id=\"number\" />\n\t\t\t\t <input type=\"button\" onclick=\"incrementValue()\" value=\"+\" />\n\t\t\t\t </div>\n </div>\n \n \n \n \n \n </div>\n\t\t\t \n\t\t \n\n `;\n });\n let totalPrice = cartItems.reduce((total, item) => total + item.price, 0);\n cartContainer.innerHTML += `<h3> Your total is: ${totalPrice} </h3>`;\n } else {\n cartContainer.innerHTML = \"<h2> No items in cart</h2>\";\n }\n}", "function populateCart() {\n if (cartData != []) {\n for (let i = 0; i < cartData.length; i++) {\n buildCartItem(cartData[i], cartData[i].product_id);\n // check that cartData is not empty - swap this to build function\n // // check for instances of first product\n // if (cartData[i].product_id === \"PR1\") {\n // product1Count++;\n // // make sure it only gets built on the first instance, otherwise update\n // if (product1Count === 1) {\n // buildCartItem(cartData[i], 1);\n // product1Price = cartData[i].price;\n // console.log(product1Price);\n // } else if (product1Count > 1) {\n // updateCartQuantity(cartData[i].product_id, product1Count);\n // }\n // } else if (cartData[i].product_id === \"PR2\") {\n // product2Count++;\n // if (product2Count === 1) {\n // buildCartItem(cartData[i], 2);\n // product2Price = cartData[i].price;\n // console.log(product2Price);\n // } else if (product2Count > 1) {\n // updateCartQuantity(cartData[i].product_id, product2Count);\n // }\n // } else if (cartData[i].product_id === \"PR3\") {\n // product3Count++;\n // if (product3Count === 1) {\n // buildCartItem(cartData[i], 3);\n // product3Price = cartData[i].price;\n // console.log(product3Price);\n // } else if (product3Count > 1) {\n // updateCartQuantity(cartData[i].product_id, product3Count);\n // }\n // }\n }\n }\n calculateTotal(cartData);\n // console.log(product1Count, product2Count, product3Count);\n}", "function addToCarts(id){\r\n if(!data[id].itemInCart){\r\n cartList = [...cartList,data[id]];\r\n addItem();\r\n\r\n alert('item add to your cart');\r\n }\r\n else{\r\n alert('Your item is already there');\r\n }\r\n data[id].itemInCart = true;\r\n}", "function buyItem(user) {\n return {\n ...user,\n purchases: [...user.cart]\n };\n}", "function mapearCartas(nPares) {\r\n mapa = [];\r\n // adiciona pares de cartas em ordem no vetor\r\n for (i=1; i<=nPares; i++){\r\n for (j=0; j<2; j++){\r\n mapa.push(i)\r\n }\r\n }\r\n embaralhar(mapa)\r\n}", "function setItems(products) {\r\n let cartItems = localStorage.getItem('productsInCart')\r\n\r\n cartItems = JSON.parse(cartItems);\r\n\r\n\r\n if (cartItems != null) {\r\n if (cartItems[products.tag] == undefined) {\r\n cartItems = {\r\n ...cartItems,\r\n [products.tag]: products\r\n }\r\n }\r\n cartItems[products.tag].inCart += 1;\r\n } else {\r\n products.inCart = 1;\r\n\r\n cartItems = {\r\n [products.tag]: products\r\n }\r\n }\r\n localStorage.setItem(\"productsInCart\", JSON.stringify(cartItems));\r\n}", "handleQuantityChange({ product, qty }){\n let cartItems = this.state.cart.map(item => {\n if(item.id === product.id){\n item.qty = qty;\n }\n return item;\n });\n //filter out items with 0 qty\n let remainingItems = cartItems.filter(p => p.qty > 0);\n this.setState({\n cart: remainingItems\n });\n }", "addItemsToCart() {\n\n Model.addItemsToCart(this.currentItems);\n }", "function items(details) {\n // TODO: Sync details for items;\n\n return $cart.items;\n }", "getProductItems(data) {\n const items = [];\n for (let i = 0; i < data.products.length; i += 1) {\n const p = data.products[i];\n items.push({ id: p.aonr, price: p.priceData.total, quantity: p.quantity });\n }\n return items;\n }", "function update_local_cart(case_option,cart,ops=null){\r\n switch(case_option) {\r\n case 1:\r\n cart.push(ops)\r\n break;\r\n case 2:\r\n \r\n for (let i = 0; i < cart.length; i++) {\r\n const element = cart[i];\r\n if(element['item'] == ops.item){\r\n cart.splice(i, 1);\r\n // element['qty'] = 0\r\n }\r\n }\r\n break;\r\n case 3:\r\n for (let i = 0; i < cart.length; i++) {\r\n const element = cart[i];\r\n if(element['item']==ops.item){\r\n element['qty'] = parseFloat(ops.qty)\r\n }\r\n }\r\n break; \r\n default:\r\n \r\n }\r\n \r\n \r\n return cart\r\n \r\n }", "function updateMiniCart() {\n if(!cart.items ) {\n cart.items = [];\n }\n }", "function setCartItems(item){\n let cartItems = localStorage.getItem('cartProducts');\n cartItems = JSON.parse(cartItems);\n\n//If no items in cart, set cartItems as the product just added.\n if(cartItems == null){\n item.numInCart = 1;\n cartItems = {\n [item.itemName] : item\n }\n }else {\n // get the previous items from local storage and all others\n if(cartItems[item.itemName] == undefined){\n cartItems = {\n ...cartItems,\n [item.itemName]: item\n }\n }\n cartItems[item.itemName].numInCart += 1;\n }\n\n//set new products in cart.\n localStorage.setItem(\"cartProducts\", JSON.stringify(cartItems));\n\n //update cart\n getCart();\n}", "function addCart() {\n\n let sameItems = stylishStorage.cart.list.filter( el => \n el.id === details_product_id.textContent &&\n el.color.code === currentColor && \n el.size === currentSize); \n\n if (sameItems.length > 0){\n stylishStorage.cart.list.forEach( item => {\n if ( item.id === details_product_id.textContent &&\n item.color.code === currentColor &&\n item.size === currentSize ){\n item.qty = quantity_count_value.textContent;\n }\n })\n \n }else{\n newItem ={\n id: details_product_id.textContent,\n name: details_product_name.textContent,\n main_image: main_img,\n price: product_price,\n color: {\n name: currentColorName,\n code: currentColor\n },\n size: currentSize,\n qty: quantity_count_value.textContent,\n stock: stock_qty\n }\n\n stylishStorage.cart.list.push(newItem);\n }\n\n localStorage.setItem('cart', JSON.stringify(stylishStorage.cart));\n}", "getCartsFromMap() { // loops rows of map to find carts - done once only\n // also edits the map - updates data under the carts\n // edits should be done only to map to be drawn only once\n for (let j = 0; j < this.map.length; j++) { // y\n for (let i = 0; i < this.map[j].length; i++) { // x\n if (this.map[j].charAt(i) === '>') {\n this.updateMapUnderCart(i,j, this.originalMap);\n this.addCart('>', [i, j]);\n } else if (this.map[j].charAt(i) === '<') { \n this.addCart('<', [i, j]);\n this.updateMapUnderCart(i,j, this.originalMap);\n } else if (this.map[j].charAt(i) === '^') {\n this.addCart('^', [i, j]);\n this.updateMapUnderCart(i,j, this.originalMap);\n } else if (this.map[j].charAt(i) === 'v') {\n this.addCart('v', [i, j]);\n this.updateMapUnderCart(i,j, this.originalMap);\n } \n }\n }\n }", "function storingCartItem() {\n \n /**\n * TODO: Create Product Object\n */\n let cartItem = product;\n cartItem.quantity = 1;\n cartItem.lensOption = updatePersonalizedFeatures();\n\n /**\n * TODO: Get \"cartItems\" value \n */\n let cartItems = JSON.parse(localStorage.getItem('cartItems'));\n\n\n /**\n * TODO: Update \"cartItems\" value with new Product Object (Push to the Array)\n */\n cartItems.push(cartItem);\n localStorage.setItem('cartItems', JSON.stringify(cartItems));\n\n // update cart badge\n let cartItemsQuantity = document.getElementById('cartItemQuantity');\n cartItemsQuantity.style.display = \"inline-block\";\n updateCartBadge();\n \n /**\n * TODO: Further \"Add to cart\" stuff....\n */\n //goToCartPage();\n \n console.log(cartItems);\n\n}", "function initCartItems() {\n const lsCartItems = JSON.parse(localStorage.getItem(\"cartItems\"));\n if (lsCartItems) {\n setCartItems(lsCartItems);\n }\n }", "function addCart(id) {\n //info productos\n let data = localStorage.getItem(\"products\");\n let cart = JSON.parse(data);\n let inCart = [...cart];\n modalContainer.innerHTML = \"\";\n modal();\n //info cart\n\n inCart.map((e) => {\n if (id === e.id) {\n console.log(\"stock producto\", e.stock);\n\n //SI NO HAY STOCK\n if (e.stock === 0) {\n console.log(\"no hay stock\");\n return;\n }\n //SI HAY STOCK\n if (e.stock >= 1) {\n //RESTAR 1 AL STOCK\n e.stock = e.stock - 1;\n let actualStock = e.stock - 1;\n //GUARDAR EN LOCAL STORAGE\n localStorage.setItem(\"products\", JSON.stringify(inCart));\n\n if (localStorage.getItem(\"newProducts\")) {\n sumQuantity(id, actualStock, e);\n }\n\n console.log(\"old\", inCart);\n\n containerProducts.innerHTML = \"\";\n showProduct(cart);\n exist = false;\n }\n }\n });\n}", "function updateCartItems(ItemName, quantity, OneOrHalf) {\n for (var i = 0; i < 8; i++) {\n if (QuantityFromIceCream[i].brand == ItemName) {\n if (OneOrHalf == 1) {\n QuantityFromIceCream[i].Onekg = quantity;\n } else {\n QuantityFromIceCream[i].Halfkg = quantity;\n }\n }\n }\n var JSONreadyUsers = JSON.stringify(QuantityFromIceCream);\n updateShoppingCart();\n}", "function Cart(items) {\n\tthis.items = items;\n}", "render() {\n \n // Mengirm redirect jika pass dan user bukan dapat 1\n if (this.state.redirect && this.state.kiriman === \"berhasil\") {\n return <Redirect to='/cart'/>\n }\n\n \n if(cookies.get(\"login\") >= 1){\n\n // looping pertama yang tidak menemukan login\n var data = this.state.allview.map((item, index) => {\n var id = item.id_product;\n var nama_product = item.nama_product;\n var price = item.price;\n var quantity = item.quantity;\n var condition = item.nama_condition;\n var description = item.description;\n // var product_images = item.product_images;\n var classribon = item.class;\n var nama_category = item.nama_category\n return <div key={index}>\n {/* <!-- Hero Section--> */}\n <section className=\"hero hero-page gray-bg padding-small\">\n <div className=\"container\">\n <div className=\"row d-flex\">\n <div className=\"col-lg-9 order-2 order-lg-1\">\n <h1 key={index}>{nama_product}</h1>\n </div>\n <div className=\"col-lg-3 text-right order-1 order-lg-2\">\n <ul className=\"breadcrumb justify-content-lg-end\">\n <li className=\"breadcrumb-item\"><Link to=\"/\">Home</Link></li>\n <li className=\"breadcrumb-item\"><Link to=\"/category\">Shop</Link></li>\n <li className=\"breadcrumb-item active\" key={index}>{nama_product}</li>\n </ul>\n </div>\n </div>\n </div>\n </section>\n {/* <!-- End bagian atas --> */}\n \n <section className=\"product-details\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"product-images col-lg-6\">\n <div className={classribon}>{condition}</div>\n <div id=\"carouselExampleIndicators\" className=\"carousel slide\" data-ride=\"carousel\">\n <ol className=\"carousel-indicators\">\n <li data-target=\"#carouselExampleIndicators\" data-slide-to=\"0\" className=\"active\"></li>\n <li data-target=\"#carouselExampleIndicators\" data-slide-to=\"1\"></li>\n <li data-target=\"#carouselExampleIndicators\" data-slide-to=\"2\"></li>\n </ol>\n \n <div className=\"carousel-inner\">\n <div className=\"carousel-item active\">\n <img className=\"d-block w-80\" style={{background:\"#f5f5f5\", width:\"400px\", height:\"400px\"}} \n src={`http://localhost:3002/image/${this.state.picture_1}`} alt=\"First slide\"/>\n </div>\n <div className=\"carousel-item\">\n <img className=\"d-block w-80\" style={{background:\"#f5f5f5\", width:\"400px\", height:\"400px\"}} \n src={`http://localhost:3002/image/${this.state.picture_2}`} alt=\"Second slide\"/>\n </div>\n <div className=\"carousel-item\">\n <img className=\"d-block w-80\" style={{background:\"#f5f5f5\", width:\"400px\", height:\"400px\"}} \n src={`http://localhost:3002/image/${this.state.picture_3}`} alt=\"Third slide\"/>\n </div>\n </div>\n <a className=\"carousel-control-prev\" href=\"#carouselExampleIndicators\" role=\"button\" data-slide=\"prev\">\n <span className=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\n <span className=\"sr-only\">Previous</span>\n </a>\n <a className=\"carousel-control-next\" href=\"#carouselExampleIndicators\" role=\"button\" data-slide=\"next\">\n <span className=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\n <span className=\"sr-only\">Next</span>\n </a>\n </div>\n \n </div>\n <div className=\"details col-lg-6\">\n <div className=\"d-flex align-items-center justify-content-between flex-column flex-sm-row\">\n <h3> {nama_product} </h3>\n </div>\n <ul className=\"price list-inline no-margin\">\n <li className=\"list-inline-item current\">Product price = ${price}</li>\n <input hidden ref=\"price\" type=\"text\" defaultValue={price}/>\n {/* <li className=\"list-inline-item original\">$88.00</li> */}\n </ul>\n <p> {description}</p>\n <ul className=\"price list-inline no-margin\">\n <li className=\"list-inline-item current\">Quantity = {quantity}</li>\n </ul>\n <div className=\"d-flex align-items-center justify-content-center justify-content-lg-start\">\n <div className=\"quantity d-flex align-items-center\">\n <p>Quantity you want to buy: </p> &nbsp;\n <input min=\"0\" max={quantity} ref=\"quantity\" type=\"number\" style={{width:\"65px\", border:\"1px solid black\"}} defaultValue=\"1\"/>\n </div>\n </div>\n <ul className=\"CTAs list-inline\">\n <li className=\"list-inline-item\">\n <button onClick={()=>{this.Tombolditel(this.refs,id);}} to=\"/cart\" className=\"btn btn-template wide\"> \n <i className=\"fas fa-shopping-cart\"></i>Add to Cart</button></li>\n </ul>\n </div>\n </div>\n </div>\n </section>\n <section className=\"product-description no-padding\">\n \n \n {/* <!-- Penjelasan Dari description --> */}\n <div className=\"container\">\n <ul role=\"tablist\" className=\"nav nav-tabs\">\n <li className=\"nav-item\"><a data-toggle=\"tab\" href=\"#description\" role=\"tab\" className=\"nav-link active\">Description</a></li>\n <li className=\"nav-item\"><a data-toggle=\"tab\" href=\"#additional-information\" role=\"tab\" className=\"nav-link\">Additional Information</a></li>\n </ul>\n <div className=\"tab-content\">\n <div id=\"description\" role=\"tabpanel\" className=\"tab-pane active\">\n <p> {description} </p>\n </div>\n \n {/* <!-- Penjelasan Materialnya --> */}\n <div id=\"additional-information\" role=\"tabpanel\" className=\"tab-pane\">\n <ul className=\"list-unstyled additional-information\">\n <li className=\"d-flex justify-content-between\"><strong>Condition:</strong><span>{condition}</span></li>\n <li className=\"d-flex justify-content-between\"><strong>Category:</strong><span>{nama_category}</span></li>\n </ul>\n </div>\n </div>\n </div>\n \n {/* <!-- Share Icon --> */}\n <div className=\"container-fluid\">\n <div className=\"share-product gray-bg d-flex align-items-center justify-content-center flex-column flex-md-row\"><strong className=\"text-uppercase\">Share this on</strong>\n <ul className=\"list-inline text-center\">\n <li className=\"list-inline-item\"><a target=\"_blank\" title=\"twitter\">\n <i className=\"fab fa-twitter\"></i></a></li>\n <li className=\"list-inline-item\"><a target=\"_blank\" title=\"facebook\">\n <i className=\"fab fa-facebook\"></i></a></li>\n <li className=\"list-inline-item\"><a target=\"_blank\" title=\"instagram\">\n <i className=\"fab fa-instagram\"></i></a></li>\n <li className=\"list-inline-item\"><a target=\"_blank\" title=\"pinterest\">\n <i className=\"fab fa-pinterest\"></i></a></li>\n <li className=\"list-inline-item\"><a target=\"_blank\" title=\"vimeo\">\n <i className=\"fab fa-vimeo\"></i></a></li>\n </ul>\n </div>\n </div>\n </section>\n \n </div>\n })\n\n }\n else {\n // looping pertama yang tidak menemukan login\n data = this.state.allview.map((item, index) => {\n // var id = item.id_product;\n var nama_product = item.nama_product;\n var price = item.price;\n var quantity = item.quantity;\n var condition = item.nama_condition;\n var description = item.description;\n // var product_images = item.product_images;\n var classribon = item.class;\n var nama_category = item.nama_category\n return <div key={index}>\n {/* <!-- Hero Section--> */}\n <section className=\"hero hero-page gray-bg padding-small\">\n <div className=\"container\">\n <div className=\"row d-flex\">\n <div className=\"col-lg-9 order-2 order-lg-1\">\n <h1 key={index}>{nama_product}</h1>\n </div>\n <div className=\"col-lg-3 text-right order-1 order-lg-2\">\n <ul className=\"breadcrumb justify-content-lg-end\">\n <li className=\"breadcrumb-item\"><Link to=\"/\">Home</Link></li>\n <li className=\"breadcrumb-item\"><Link to=\"/category\">Shop</Link></li>\n <li className=\"breadcrumb-item active\" key={index}>{nama_product}</li>\n </ul>\n </div>\n </div>\n </div>\n </section>\n{/* <!-- End bagian atas --> */}\n\n <section className=\"product-details\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"product-images col-lg-6\">\n <div className={classribon}>{condition}</div>\n <div id=\"carouselExampleIndicators\" className=\"carousel slide\" data-ride=\"carousel\">\n <ol className=\"carousel-indicators\">\n <li data-target=\"#carouselExampleIndicators\" data-slide-to=\"0\" className=\"active\"></li>\n <li data-target=\"#carouselExampleIndicators\" data-slide-to=\"1\"></li>\n <li data-target=\"#carouselExampleIndicators\" data-slide-to=\"2\"></li>\n </ol>\n \n <div className=\"carousel-inner\">\n <div className=\"carousel-item active\">\n <img className=\"d-block w-80\" style={{background:\"#f5f5f5\", width:\"400px\", height:\"400px\"}} \n src={`http://localhost:3002/image/${this.state.picture_1}`} alt=\"First slide\"/>\n </div>\n <div className=\"carousel-item\">\n <img className=\"d-block w-80\" style={{background:\"#f5f5f5\", width:\"400px\", height:\"400px\"}} \n src={`http://localhost:3002/image/${this.state.picture_2}`} alt=\"Second slide\"/>\n </div>\n <div className=\"carousel-item\">\n <img className=\"d-block w-80\" style={{background:\"#f5f5f5\", width:\"400px\", height:\"400px\"}} \n src={`http://localhost:3002/image/${this.state.picture_3}`} alt=\"Third slide\"/>\n </div>\n </div>\n <a className=\"carousel-control-prev\" href=\"#carouselExampleIndicators\" role=\"button\" data-slide=\"prev\">\n <span className=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\n <span className=\"sr-only\">Previous</span>\n </a>\n <a className=\"carousel-control-next\" href=\"#carouselExampleIndicators\" role=\"button\" data-slide=\"next\">\n <span className=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\n <span className=\"sr-only\">Next</span>\n </a>\n </div>\n\n </div>\n <div className=\"details col-lg-6\">\n <div className=\"d-flex align-items-center justify-content-between flex-column flex-sm-row\">\n <h3> {nama_product} </h3>\n </div>\n <ul className=\"price list-inline no-margin\">\n <li className=\"list-inline-item current\">Product price = ${price}</li>\n <input hidden ref=\"price\" type=\"text\" defaultValue={price}/>\n {/* <li className=\"list-inline-item original\">$88.00</li> */}\n </ul>\n <p> {description}</p>\n <ul className=\"price list-inline no-margin\">\n <li className=\"list-inline-item current\">Quantity = {quantity}</li>\n </ul>\n <div className=\"d-flex align-items-center justify-content-center justify-content-lg-start\">\n <div className=\"quantity d-flex align-items-center\">\n <p>Quantity you want to buy: </p> &nbsp;\n <input min=\"0\" max={quantity} ref=\"quantity\" type=\"number\" style={{width:\"65px\", border:\"1px solid black\"}} defaultValue=\"1\"/>\n </div>\n </div>\n <ul className=\"CTAs list-inline\">\n <li className=\"list-inline-item\"><Link to=\"/customerlogin\" className=\"btn btn-template wide\"> \n <i className=\"fas fa-shopping-cart\"></i>Add to Cart</Link></li>\n </ul>\n </div>\n </div>\n </div>\n </section>\n <section className=\"product-description no-padding\">\n \n \n{/* <!-- Penjelasan Dari description --> */}\n <div className=\"container\">\n <ul role=\"tablist\" className=\"nav nav-tabs\">\n <li className=\"nav-item\"><a data-toggle=\"tab\" href=\"#description\" role=\"tab\" className=\"nav-link active\">Description</a></li>\n <li className=\"nav-item\"><a data-toggle=\"tab\" href=\"#additional-information\" role=\"tab\" className=\"nav-link\">Additional Information</a></li>\n </ul>\n <div className=\"tab-content\">\n <div id=\"description\" role=\"tabpanel\" className=\"tab-pane active\">\n <p> {description} </p>\n </div>\n\n {/* <!-- Penjelasan Materialnya --> */}\n <div id=\"additional-information\" role=\"tabpanel\" className=\"tab-pane\">\n <ul className=\"list-unstyled additional-information\">\n <li className=\"d-flex justify-content-between\"><strong>Condition:</strong><span>{condition}</span></li>\n <li className=\"d-flex justify-content-between\"><strong>Category:</strong><span>{nama_category}</span></li>\n </ul>\n </div>\n </div>\n </div>\n\n{/* <!-- Share Icon --> */}\n <div className=\"container-fluid\">\n <div className=\"share-product gray-bg d-flex align-items-center justify-content-center flex-column flex-md-row\"><strong className=\"text-uppercase\">Share this on</strong>\n <ul className=\"list-inline text-center\">\n <li className=\"list-inline-item\"><a target=\"_blank\" title=\"twitter\">\n <i className=\"fab fa-twitter\"></i></a></li>\n <li className=\"list-inline-item\"><a target=\"_blank\" title=\"facebook\">\n <i className=\"fab fa-facebook\"></i></a></li>\n <li className=\"list-inline-item\"><a target=\"_blank\" title=\"instagram\">\n <i className=\"fab fa-instagram\"></i></a></li>\n <li className=\"list-inline-item\"><a target=\"_blank\" title=\"pinterest\">\n <i className=\"fab fa-pinterest\"></i></a></li>\n <li className=\"list-inline-item\"><a target=\"_blank\" title=\"vimeo\">\n <i className=\"fab fa-vimeo\"></i></a></li>\n </ul>\n </div>\n </div>\n </section>\n\n</div>\n })\n \n }\n \n\n\n var data2 = this.state.hasil.map((item, index) => {\n var id = item.id_product;\n var nama_product = item.nama_product;\n\n return <Link key={index} onClick={()=>{this.cari(id);}} to='/detail' ><i> {nama_product}</i></Link>\n })\n\n\n return (\n <div>\n {/* Awal dari navbar */}\n <header className=\"header\">\n <div className=\"top-bar\">\n <div className=\"container-fluid\">\n <div className=\"row d-flex align-items-center\">\n <div className=\"col-lg-6 hidden-lg-down text-col\">\n <ul className=\"list-inline\">\n <li className=\"list-inline-item\"><i className=\"fas fa-phone iconcolor\"></i>020-800-456-747</li>\n <li className=\"list-inline-item\">Free shipping on orders over $300</li>\n </ul>\n </div>\n {/* <!-- Bagian usernya --> */}\n <div className=\"col-lg-6 d-flex justify-content-end\">\n <ul className=\"list-inline\">\n <li className=\"list-inline-item\"><Link to=\"/customerorder\"><i className=\"fa fa-box\"></i>shipping</Link></li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n\n\n {/* <!-- Awal navbar --> */}\n <div className=\"navbar navbar-expand-sm navbar-light bg-light\">\n <div className=\"container\">\n <Link className=\"navbar-brand home\" to=\"/\">\n <img alt=\"logoImg\" src={\"img/burunglogo.png\"} />\n </Link>\n <button className=\"navbar-toggler\" data-toggle=\"collapse\" data-target=\"#navbarNav\">\n <span className=\"navbar-toggler-icon\"></span></button>\n\n <div className=\"collapse navbar-collapse\" id=\"navbarNav\">\n <ul className=\"navbar-nav mx-auto\">\n\n <LinkContainer className=\"nav-item\" to=\"/\">\n <NavItem className=\"nav-link\">HOME</NavItem>\n </LinkContainer>\n\n <LinkContainer className=\"nav-item\" to=\"/category\">\n <NavItem className=\"nav-link\">SHOP</NavItem>\n </LinkContainer>\n\n <LinkContainer className=\"nav-item\" to=\"/about\">\n <NavItem className=\"nav-link\">ABOUT</NavItem>\n </LinkContainer>\n\n <LinkContainer className=\"nav-item\" to=\"/blog\">\n <NavItem className=\"nav-link\">BLOG</NavItem>\n </LinkContainer>\n\n <LinkContainer className=\"nav-item\" to=\"/contact\">\n <NavItem className=\"nav-link\">CONTACT</NavItem>\n </LinkContainer>\n </ul>\n\n &nbsp;<form className=\"navbar-form navbar-right\">\n <div className=\"input-group\">\n\n <input type=\"text\" \n className=\"form-control col-sm-1 col-md-10\" \n placeholder=\"input somthing to search\"\n id=\"searchbar\" data-toggle=\"dropdown\" aria-haspopup=\"true\"\n defaultValue={this.state.masuk}\n onInput={this.onSeriesInputChange}\n /> &nbsp;\n\n <button className=\"btn btn-primary\" id=\"searchbtn\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <i className=\"fa fa-search\"></i>\n </button>\n\n <div aria-labelledby=\"searchbar\" className=\"dropdown-menu\">\n \n {/* Awal dari looping */}\n {data2}\n {/* Akhir dari looping */}\n\n </div>\n </div>\n </form>\n \n \n <div aria-labelledby=\"searchbtn\" className=\"dropdown-menu\">\n <div className=\"dropdown-item cart-product\">\n \n </div>\n </div>\n\n \n <div className=\"right-col d-flex align-items-lg-center flex-column flex-lg-row\">\n {/* <!-- User Not Logged - link to login page--> */}\n <div className=\"user col-sm-1 col-md-3\">\n\n {/* awal logic */}\n\n {cookies.get(\"login\") >= 1 ?\n <Link id=\"userdetails\" to=\"/customerorders\" className=\"user-link\">\n <i className=\"fas fa-user\"> </i>\n <span className=\"d-md-none text-col\"> &nbsp; {cookies.get('username')}</span>\n </Link> :\n <Link id=\"userdetails\" to=\"/customerlogin\" className=\"user-link\">\n <i className=\"fas fa-user\"> </i>\n </Link>}\n\n </div>\n {/* <!-- Cart Dropdown--> */}\n <Link className=\"col-md-8\" id=\"cartdetails\" to=\"/cart\">\n <i className=\"fa fa-shopping-cart\"></i>\n </Link>\n </div>\n </div>\n </div>\n </div>\n <div />\n </header>\n {/* akhir dari navbar */}\n {data}\n\n {/* Di comment dl tar di bikin lebih lengkap */}\n {/* <Similaritems/> */}\n\n <Footer/>\n\n </div>\n );\n }" ]
[ "0.7206258", "0.70412815", "0.6930295", "0.6882032", "0.67385983", "0.66993916", "0.66955453", "0.66868323", "0.6671819", "0.6638757", "0.65444815", "0.6534553", "0.65077096", "0.64698344", "0.6447866", "0.64461434", "0.6439311", "0.6429244", "0.64244807", "0.6372611", "0.63720405", "0.6344579", "0.63312197", "0.63181794", "0.6300984", "0.6300625", "0.6299222", "0.62974894", "0.62955546", "0.6290768", "0.62895733", "0.62692785", "0.62493366", "0.62393576", "0.6229752", "0.62223", "0.61984354", "0.618692", "0.61776024", "0.6158546", "0.6157685", "0.6149956", "0.6131689", "0.6120867", "0.61034864", "0.61010164", "0.60850215", "0.6083945", "0.6083744", "0.6077178", "0.60769206", "0.60733426", "0.6067535", "0.6063833", "0.6047688", "0.6045908", "0.60392725", "0.60384005", "0.6037946", "0.60362464", "0.6034894", "0.60240495", "0.6011138", "0.5981144", "0.59712505", "0.59672165", "0.5966018", "0.59605265", "0.5958563", "0.59389186", "0.5936518", "0.59253085", "0.59232193", "0.59183496", "0.5917467", "0.5917006", "0.59162724", "0.5915948", "0.5915286", "0.58974075", "0.58971506", "0.58902746", "0.58878946", "0.5881836", "0.58818275", "0.58742493", "0.5874136", "0.58656925", "0.58611923", "0.58587664", "0.58561724", "0.5851795", "0.5849848", "0.58390045", "0.5833409", "0.5826586", "0.5826529", "0.5826296", "0.58254623", "0.5821284" ]
0.60296583
61
& we are going to return a new object
function applyTaxToItems(user){ const {cart} = user; const taxRate = 1.3; const updatedCart = cart.map(item => { return {} }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function NewObj(){}", "function NewObj() {}", "function newObject() { return {}; }", "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 createAnother(original){\n var clone = object(original); //create a new object by calling a function\n clone.sayHi = function(){ //augment the object in some way\n alert(\"hi\");\n };\n return clone; //return the object\n}", "copy()\n\t{\n\t\treturn this.constructor.createNewInstance(this);\n\t}", "function createAnother(original) { // 1\n\t \t\t\t\tvar clone = object(original); // 2 \n\t \t\t\t\tclone.sayHi = function() {\t\t\t// 3\n\t \t\t\t\t\treturn \"hello world\";\n\t \t\t\t\t};\n\t \t\t\t\treturn clone;\t\t\t\t\t\t\t// 4\n\t \t\t\t}", "function NewObject() {\n\t// returns an object\n}", "_copy () {\n return new this.constructor()\n }", "_copy () {\n return new this.constructor()\n }", "create() {\n return this.new();\n }", "function createObj(a, b)\n{\n //var newObject = {}; // Not needed ctor function\n this.a = a; //newObject.a = a;\n this.b = b; //newObject.b = b;\n //return newObject; // Not needed for ctor function\n}", "clone() {\n return new this.constructor(this);\n }", "clone() {\n\t\tlet data = JSON.parse(JSON.stringify(this.Serialize()));\n\t\treturn new this.constructor(data);\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}", "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }", "function mynew(fn,args){\n var obj =new Object()\n obj.__proto__ = fn.prototype\n var result = fn.apply(obj)\n return typeof result =='Object'?reslut:obj\n}", "constructor() {\n copy(this, create());\n }", "function jsNewObject() {\n var obj = {};\n return obj;\n}", "function returnNewNinja() {\n return {};\n}", "function makePerson(name, age) {\r\n\t// add code here\r\n\tlet personObj = Object.create(null);\r\n personObj.name = name;\r\n personObj.age = age;\r\n \r\n return personObj;\r\n\r\n}", "function newPerson(name) {\n return {\n name: name\n };\n }", "function new1(func){\n let obj = Object.create(func.prototype);\n let k = func.call(obj);\n if (typeof k === 'object'){\n return k\n }else {\n return obj;\n }\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 instantiatePlainObject() {\n\t return {};\n\t }", "function instantiatePlainObject() {\n\t return {};\n\t }", "function instantiatePlainObject() {\n\t return {};\n\t }", "obtain(){}", "function newDeck(){\n var deck = new Deck();\n return deck;\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\": \"suport@goparties.com\",\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 newAnimObject() {\n\t\t\t\t\t\t\t\t\t\tvar a = new Object();\n\t\t\t\t\t\t\t\t\t\ta.x=0;\n\t\t\t\t\t\t\t\t\t\ta.y=0;\n\t\t\t\t\t\t\t\t\t\ta.rotationX = 0;\n\t\t\t\t\t\t\t\t\t\ta.rotationY = 0;\n\t\t\t\t\t\t\t\t\t\ta.rotationZ = 0;\n\t\t\t\t\t\t\t\t\t\ta.scale = 1;\n\t\t\t\t\t\t\t\t\t\ta.scaleX = 1;\n\t\t\t\t\t\t\t\t\t\ta.scaleY = 1;\n\t\t\t\t\t\t\t\t\t\ta.skewX = 0;\n\t\t\t\t\t\t\t\t\t\ta.skewY = 0;\n\t\t\t\t\t\t\t\t\t\ta.opacity=0;\n\t\t\t\t\t\t\t\t\t\ta.transformOrigin = \"center, center\";\n\t\t\t\t\t\t\t\t\t\ta.transformPerspective = 400;\n\t\t\t\t\t\t\t\t\t\ta.rotation = 0;\n\t\t\t\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\t\t\t}", "function newAnimObject() {\n\t\t\t\t\t\t\t\t\t\tvar a = new Object();\n\t\t\t\t\t\t\t\t\t\ta.x=0;\n\t\t\t\t\t\t\t\t\t\ta.y=0;\n\t\t\t\t\t\t\t\t\t\ta.rotationX = 0;\n\t\t\t\t\t\t\t\t\t\ta.rotationY = 0;\n\t\t\t\t\t\t\t\t\t\ta.rotationZ = 0;\n\t\t\t\t\t\t\t\t\t\ta.scale = 1;\n\t\t\t\t\t\t\t\t\t\ta.scaleX = 1;\n\t\t\t\t\t\t\t\t\t\ta.scaleY = 1;\n\t\t\t\t\t\t\t\t\t\ta.skewX = 0;\n\t\t\t\t\t\t\t\t\t\ta.skewY = 0;\n\t\t\t\t\t\t\t\t\t\ta.opacity=0;\n\t\t\t\t\t\t\t\t\t\ta.transformOrigin = \"center, center\";\n\t\t\t\t\t\t\t\t\t\ta.transformPerspective = 400;\n\t\t\t\t\t\t\t\t\t\ta.rotation = 0;\n\t\t\t\t\t\t\t\t\t\treturn a;\n\t\t\t\t\t\t\t\t\t}", "create() {}", "create() {}", "function createObject(makeNewItem, makeNewPrice) {\n\tthis.name = makeNewItem;\n\tthis.price = makeNewPrice;\n\treturn {name, price};\n}", "function instantiatePlainObject() {\n return {};\n }", "clone() {\n let dupe = new this.constructor();\n dupe.reset(this);\n return dupe;\n }", "create() {\n\t}", "function new2() {\n const constructor = arguments[0];\n const args = [].slice.call(arguments, 1);\n const obj = new Object();\n obj.__proto__ = constructor.prototype;\n const ret = constructor.apply(obj, [...args]);\n if (ret && (typeof ret === 'object' || typeof ret === 'function')) {\n return ret;\n }\n return obj;\n}", "function makeObj() {\n return {\n propA: 10,\n propB: 20,\n };\n}", "constructur() {}", "static create () {}", "function createPerson()\n{ \n var person = new Object();\n person.name = \"siri\";\n person.age =\"28\";\n person.designation=\"trainer\";\n person.Phno = 9998788667;\n return person;\n}", "function getPerson(name, age){\n let newPerson = {\n name: name,\n age: age\n };\n return newPerson;\n}", "create () {}", "create () {}", "function makeCat() {\n VCAT = new Catgirl();\n return VCAT;\n}", "newModel(arg) {\n const Model = this.Model;\n return new Model(arg);\n }", "newModel(arg) {\n const Model = this.Model;\n return new Model(arg);\n }", "function create() {\n return new Response();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function construct() { }", "static create( data ) {\n\t\tlet obj = new ( this )();\n\t\tfor( var key in data ) {\n\t\t\tif( data.hasOwnProperty( key ) ) {\n\t\t\t\tobj[key] = data[key];\n\t\t\t}\n\t\t}\n\t\treturn obj.save();\n\t}", "function createAnother(original){\n var clone = Object.create(original)\n clone.sayHi = function(){\n console.log(\"hi\")\n }\n return clone\n}", "new_pose(){ return new Pose( this ); }", "function obj() { return this; }", "function newInvoices() {\n return {\n foo: 130,\n bar: 250\n };\n}", "function ExampleNew(attrs) {\n this.one = attrs.one;\n this.two = attrs.two;\n this.three = attrs.three;\n console.log(this); // 'new' binds 'this' in ExampleNew function to obj1 and obj2 objects\n}", "function DUPairFactory() {\n}", "function Book2 (name){\n if (!(this instanceof Book)) {\n\n // this constructor was called without \"new\"\n return new Book(name); \n }\n}", "static create(params) {\n return {type: `${this.prefix}${this.name}`, _instance: new this(params)}; //eslint-disable-line\n }", "newInstance() {\r\n\t\t\t\t\tvar base, ref1;\r\n\t\t\t\t\tbase = ((ref1 = this.variable) != null ? ref1.base : void 0) || this.variable;\r\n\t\t\t\t\tif (base instanceof Call && !base.isNew) {\r\n\t\t\t\t\t\tbase.newInstance();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.isNew = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.needsUpdatedStartLocation = true;\r\n\t\t\t\t\treturn this;\r\n\t\t\t\t}", "mapElementNewInstance(Element, elementParameters) {\n return new Element(elementParameters);\n }", "InitNew() {\n\n }", "function newObject(object) {\n switch (object) {\n case 'sketch':\n create(\"canvas\");\n break;\n case 'photo':\n create('img');\n break;\n case 'title':\n create('p');\n break;\n case 'grid':\n grid.openGridSettings();\n break;\n }\n}", "function userCreater(name,score){\n\t//let newUser = objects.create()\n\tlet newUser = Object.create(userFunctions);\n\tnewUser.name = name;\n\tnewUser.score = score;\n\treturn newUser;\n}", "function personFromPersonStore(name, age) {\r\n \r\n // Store in a variable a new person object, passing in the above greet functionality\r\n\tlet createPerson = Object.create(personStore);\r\n \r\n // Add name & age properties on the person object\r\n createPerson.name = name;\r\n createPerson.age = age;\r\n\r\n // Return object\r\n\treturn createPerson;\r\n}", "function hzNew(callee) {\n\t\tconst seqExp = hzCall(callee);\n\t\tseqExp.expressions[0].argument.callee.property.name = \"new\";\n\t\treturn seqExp;\n\t}", "function myNewFunc() {\n return {};\n}", "function createNew(newObj) {\n\t// convert data to day.month.year format\n\tvar date = new Date(newObj.date_create).toLocaleDateString();\n\tvar imgPath = newObj.image || 'img/stub_img.jpg';\n\t/*jshint multistr: true */\n\tvar newNew = $('<div class=\"block\">\\\n\t \t\t<div class=\"imageDiv\" style=\"background-image: url(' + imgPath + ')\"></div>\\\n\t\t\t<article>\\\n\t\t\t\t<h3 class=\"link\"><a href=\"news/' + newObj.id + '\">' + newObj.title + '</a></h3>\\\n\t\t\t\t<p class=\"shortText\">' + newObj.description+ '</p>\\\n\t\t\t\t<p class=\"date\">' + date + '</p>\\\n\t\t\t</article></div>');\n\treturn newNew;\n}", "function makeObj() {\n\tif (arguments.length % 2 != 0) {\n\t\targuments[arguments.length] = \"\";\n\t\t}\n\tfor ( var i = 0; i < arguments.length; i += 2 ) {\n\t\tthis[arguments[i]] = arguments[i + 1] ;\n \t}\n\treturn this;\n\t}", "getProductLink (state) {\n let objConstructor = this.objConstructors[state];\n if (objConstructor) return new objConstructor();\n }", "function createNew(fn) {\n let obj = {};\n obj.__proto__ = fn.prototype;\n let result = fn.apply(obj, [...arguments].slice(1));\n if (result) {\n return result\n } else {\n return obj\n }\n}", "function factory1() {\r\n return Object.assign({}, obj2)\r\n}", "function Constructor() {\n return { someKey: \"some value\" };\n }", "function create(obj) {\n return Object.create(obj || null);\n}", "Clone() {\n\n }", "Clone() {\n\n }", "Clone() {\n\n }", "Clone() {\n\n }", "function Obj()\r\n{\r\n return {\r\n name: 'hamza',\r\n lastName : 'mubeen'\r\n }\r\n}", "function createPerson(name, age) {\n return {\n \"name\": name,\n \"age\": age\n }; \n}", "function factory() {}", "function factory() {}", "copy({ type = this.type, value = this.value } = {}) {\n const { id, lbp, rules, unknown, ignored } = this;\n return new this.constructor(id, {\n lbp,\n rules,\n unknown,\n ignored,\n type,\n value,\n original: this,\n });\n }", "function makeAnObj(nameData, ageData){\n\tvar myObj = {\n\t\tname: nameData,\n\t\tage: ageData\n\t};\n\treturn myObj;\n}", "function _construct()\n\t\t{;\n\t\t}", "function createPiece(team) {\n piece = new Object();\n piece.team = team;\n piece.isKing = false;\n return piece;\n}", "static getNewProperties() {\n return {};\n }", "function createObject() {\n var className= $.trim($className.val());\n var dbName = $.trim($dbName.val());\n if (className == null || className.length == 0 || dbName == null || dbName.length == 0) {\n alert(\"ERROR:\\nPlease list a Class Name and a Database Name\");\n return;\n }\n\n var num = getInt($container.attr(\"data-num\"));\n num++;\n $container.attr(\"data-num\", num);\n var $newObject = $container.find(\".object:last-child\").clone(true, true);\n\n $newObject.find(\".object-table\").attr(\"data-rows\", \"1\");\n $newObject.find(\".sel-ai-class\").attr(\"data-id\", num);\n $newObject.find(\".sel-pk-class\").attr(\"data-id\", num);\n \n $newObject.attr({\"data-num\": num, \"data-static\": \"0\"});\n \n \n $container.prepend($newObject);\n }", "function or(){this.__data__=new Ut}", "static create() {\nreturn this.from_xyzw(0, 0, 0, 1);\n}", "clone() {\n return Object.assign(Object.create(this), this)\n }", "duplicate() {\n return new BaseDataClass(Object.assign(Object.assign({}, this), { id: null, email: null }));\n }", "function newGame() {\n\treturn new Game();\n}", "function personFromConstructor(name, age) {\r\n \r\n // Create a new person using the new keyword, calling the PersonConstructor function above\r\n\tlet person = new PersonConstructor;\r\n \r\n // Assign name & age properties to object\r\n person.name = name;\r\n person.age = age;\r\n \r\n // Return new person\r\n return person;\r\n\r\n}", "function clone1(obj) {\r\n var newObj = obj;\r\n return newObj;\r\n}", "function returnObject(a) {\n return {// The object\n val: a\n };\n}" ]
[ "0.7310951", "0.713915", "0.702999", "0.6956048", "0.6931777", "0.6877507", "0.6777336", "0.6723244", "0.6694841", "0.6694841", "0.6655465", "0.66028637", "0.65494555", "0.6480717", "0.6468077", "0.64094704", "0.6392973", "0.63875777", "0.6386137", "0.63171905", "0.63083583", "0.6304194", "0.62935287", "0.62905514", "0.6261694", "0.6261694", "0.6261694", "0.6260511", "0.62575704", "0.6250522", "0.62440616", "0.62440616", "0.62376475", "0.62376475", "0.62284815", "0.621937", "0.6218417", "0.61953783", "0.6189774", "0.6177846", "0.61768955", "0.6167803", "0.61529696", "0.6145294", "0.6093694", "0.6093694", "0.6087635", "0.6077039", "0.6077039", "0.6075277", "0.60614145", "0.60614145", "0.60614145", "0.60614145", "0.6058077", "0.604231", "0.60339206", "0.6027012", "0.60200846", "0.6018177", "0.5997449", "0.5995089", "0.5992306", "0.59918046", "0.5983792", "0.5968217", "0.59335554", "0.5925704", "0.592502", "0.59246886", "0.59218526", "0.59186053", "0.5913398", "0.59121764", "0.5909145", "0.59038377", "0.58998734", "0.5899191", "0.5895937", "0.5891779", "0.5891779", "0.5891779", "0.5891779", "0.58902913", "0.58692753", "0.58692044", "0.58692044", "0.5861008", "0.585716", "0.58418316", "0.58370894", "0.5827564", "0.58274245", "0.58174765", "0.58167034", "0.5812555", "0.58102065", "0.5805313", "0.5804614", "0.58023244", "0.58023196" ]
0.0
-1
that contains well the name that is item dot name
function applyTaxToItems(user){ const {cart} = user; const taxRate = 1.3; const updatedCart = cart.map(item => { return { name: item.name, } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "itemToName(item) {\n return item.template.full_name;\n }", "getName() {\r\n return this.getNameNodes().map(n => n.getText()).join(\".\");\r\n }", "function ItemName(obj) { this.obj = obj; }", "function item_info(item) {\n return parent.G.items[item.name];\n}", "static displayName(item) {\n if (!item) {\n return '';\n }\n switch (item.type) {\n case ItemType.item:\n return this.getItem(item.id).displayName;\n case ItemType.underground:\n return this.getUndergroundItem(item.id).displayName;\n case ItemType.berry:\n return `${BerryType[this.getBerry(item.id)]} Berry`;\n case ItemType.gem:\n return `${PokemonType[this.getGem(item.id)]} Gem`;\n }\n }", "function find_item_name(obj, key) {\n if (obj.ItemAliases == undefined) return key;\n let k = 0;\n let name = \"\";\n let aliases = obj.ItemAliases.split(\";\");\n aliases.forEach( function(alias) {\n if (alias.length > k) {\n k = alias.length;\n name = alias;\n };\n });\n return name;\n}", "function GetItemTypeForListName(name) {\n return \"SP.Data.\" + name.charAt(0).toUpperCase() + name.split(\" \").join(\"\").slice(1) + \"ListItem\";\n}", "getName(item) {\n return item.product_name.length > 66 ? `${item.product_name.slice(0, 66)}...` : item.product_name;\n }", "function getListItemName(listItem)\r\n{\r\n\treturn listItem.name;\r\n}", "get name() {\n return this.catalogItemObj.itemData.name;\n }", "function Item(name) {\n var splitName = name.split('.')[0];\n this.name = splitName;\n this.filepath = 'img/' + name ;\n this.numberOfTimesShown = 0;\n this.numberOfTimesClicked = 0;\n}", "function getItemName(itemId) {\n\tif (WMSkyItem[itemId]) {\n\t\treturn WMSkyItem[itemId];\n\t}\n\telse {\n\t\treturn \"Unknown Item\";\n\t}\n}", "function getNameTypeItemInfo(element, newItem) {\n let itemWrap = $(element).find('div.clearfix.info-wrap > div.item-cont > div.item-wrap').get()[0];\n let spanWrap = $(itemWrap).find('span.info-msg > div.m-bottom10 > span.bold').get()[0];\n let name = $(spanWrap).text();\n if (name.indexOf('The') == 0) {name = name.slice(4);}\n\n let infoMsg = $(itemWrap).find('span.info-msg > div.m-bottom10').get()[0];\n let type = $(infoMsg).text();\n\n // May be 'are a' or 'is a', search both\n let at = type.indexOf('are a ');\n if (at == -1) {at = type.indexOf('is a ');}\n let end = type.indexOf('Weapon.');\n if (end == -1) {end = type.indexOf('.');}\n if (end < 0) {end = 0;}\n if (at >= 0) {type = type.slice(at+6, end-1);}\n\n newItem.name = name;\n newItem.type = type;\n }", "function getNameTypeItemInfo(element, newItem) {\n let itemWrap = $(element).find('div.clearfix.info-wrap > div.item-cont > div.item-wrap').get()[0];\n let spanWrap = $(itemWrap).find('span.info-msg > div.m-bottom10 > span.bold').get()[0];\n let name = $(spanWrap).text();\n if (name.indexOf('The') == 0) {name = name.slice(4);}\n\n let infoMsg = $(itemWrap).find('span.info-msg > div.m-bottom10').get()[0];\n let type = $(infoMsg).text();\n\n // May be 'are a' or 'is a', search both\n let at = type.indexOf('are a ');\n if (at == -1) {at = type.indexOf('is a ');}\n let end = type.indexOf('Weapon.');\n if (end == -1) {end = type.indexOf('.');}\n if (end < 0) {end = 0;}\n if (at >= 0) {type = type.slice(at+6, end-1);}\n\n newItem.name = name;\n newItem.type = type;\n }", "parse (item) {\n\t\tif (item.type && item.type.indexOf('Trading Card') !== -1) {\n\t\t\treturn (item.tags[1].internal_name).slice(4)\n\t\t} else return\n }", "function generateItemNames() {\n for (let item of itemList) {\n itemNames.push(item.name);\n }\n}", "function parser(item,image){\n\treturn image.replace('.jpg', '').replace('_', ' ').replace('-', ' ') + ' ' + item.name.toUpperCase();\n}", "function getItemPrefix() {\n\t\t\tvar prefix;\n\t\t\t\n\t\t\tif(args.tag === \"ol\") {\n\t\t\t\tprefix = \" \" + num + \". \";\n\t\t\t\tnum = num + 1;\n\t\t\t} else {\n\t\t\t\tprefix = \" \" + bullet + \" \";\n\t\t\t}\n\t\t\t\n\t\t\treturn prefix;\n\t\t}", "function myName() {\n return myName.eunice;\n }", "get name() {\r\n return this.i.bs;\r\n }", "function getGameName(data) {\n $('#hYourGame').html('Your game (' + data.items.item[0].name[0]['$'].value + ')');\n}", "function getName() { return name; }", "getDisplayName(name) {\n let splitted = name.split(\"__\");\n if (splitted.length == 2) {\n return splitted[1];\n }\n return name;\n }", "enterDotted_as_names(ctx) {\n\t}", "getListName() {}", "function getName(elem){return elem.name;}", "get name() {\n return this.i.bs;\n }", "function getTitle(item){\n return item.title;\n \n}", "enterDotted_as_name(ctx) {\n\t}", "getName() {\n return this.steamInventoryItemResponse.market_hash_name;\n }", "function normal_name(d) {\n let inst_name = d.name.replace(/_/g, ' ').split('#')[0];\n if (inst_name.length > params.labels.max_label_char) {\n inst_name = inst_name.substring(0, params.labels.max_label_char) + '..';\n }\n return inst_name;\n }", "function myName() {\n return myName.juvenal;\n}", "function getName(rowIndex, item) {\n if (item) {\n return {\n \"name\": this.grid.store.getValue(item, \"name\") ||\n localeStrings.UNNAMED,\n \"id\": this.grid.store.getValue(item, \"id\")\n };\n }\n}", "getName() {\n return _name.get(this);\n }", "function getName() {\n\treturn name;\n}", "getName() {}", "function myName() {\n return myName.darius;\n}", "function subtypeName() {\n return containsSuffix() ? name.split('+')[0] : name;\n }", "getName () {\n\t\treturn this.name;\n\t}", "function nameFollowUp(data){\n return data.name;\n }", "onShowItemNames () {\n this.pvc.isShowNames = !this.pvc.isShowNames\n this.ctrl.isPvDimsTickle = !this.ctrl.isPvDimsTickle\n }", "get itemLabel() {\r\n return this.i.itemLabel;\r\n }", "function myName() {\n return myName.serena;\n}", "function getName(elem) {\n return elem.name;\n }", "function CT_item(_Class, Name) {\n this._Class = _Class;\n if (Name === undefined)\n this.Name = [];\n else\n this.Name = [Name];\n}", "function CT_item(_Class, Name) {\n this._Class = _Class;\n if (Name === undefined)\n this.Name = [];\n else\n this.Name = [Name];\n}", "addNames(s) {\n var scope = this;\n s.split('-').forEach((dash) => {\n scope.names[dash] = s;\n dash.split('.').forEach((dot) => {\n scope.names[dot] = s;\n });\n });\n }", "getName() {\n return this.brand + \" \" + this.type;\n }", "get name() {return this._name;}", "function showData(item) {\nvar string='';\nvar group = item;\n //Every object is an array\n for (i=0; i < group.length; i++) {\n string = string + 'Name: ' +group[i].name + ' ' + 'Noisy: ' + group[i].noisy + ' ' + 'FightsWith: ' +group[i].fights_with + '<br>'\n }\n //Every array can be accessed by name?\n return string;\n}", "function myName() {\n return myName.josh\n}", "function myName() {\n return myName.Lea;\n\n}", "static getName(entity) {\n return entity.name;\n }", "getDisplayName() {}", "get namedItems() {\n this.updateCache();\n return this.childrenByName;\n }", "function getName(elm){\n return elm.markupTag.name.toString();\n}", "getItem(item) {\n\t\treturn this.getString(this.itemNames, item);\n\n\t}", "function checkName(item)\r\n{\r\n return item.name !== \"\"\r\n}", "function addItemsByName(c){\n c.itemsByName = {};\n c.items.forEach(function(item){\n c.itemsByName[item.name] = item;\n });\n}", "function _processName(pfx, eltDescName) {\n\t if (pfx === undefined || pfx === null) {\n\t pfx = EMPTY;\n\t }\n\t if (eltDescName === undefined || eltDescName === null) {\n\t return pfx;\n\t }\n\t if (pfx === EMPTY) {\n\t return eltDescName;\n\t }\n\t return pfx + '.' + eltDescName;\n\t}", "get name() {}", "get name() {}", "get name() {}", "get name() {}", "get name() {}", "get name() {}", "get name() {}", "get name() {}", "function getCleanName(item) {\n let id = ( item.tagName == null || item.tagName == 'undefined' ) ? item : item.id;\n return id.replace('Ajax', '').trim();\n }", "getName() {\n\t\treturn this.name;\n\t}", "get name() {\n return this._data.name;\n }", "get name() {\n return this._data.name;\n }", "get assetNames() {}", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "getName() {\r\n return this.getNameNode().getText();\r\n }", "function nameMinusTree() {\n return containsTree() ? name.split('.')[1] : name.split('.')[0];\n }", "additionalNametags(self) { return []; }", "function hc_namednodemapgetnameditem() {\n var success;\n var doc;\n var elementList;\n var testEmployee;\n var attributes;\n var domesticAttr;\n var attrName;\n doc = load(\"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n testEmployee = elementList.item(1);\n attributes = testEmployee.attributes;\n\n domesticAttr = attributes.getNamedItem(\"title\");\n attrName = domesticAttr.nodeName;\n\n assertEqualsAutoCase(\"attribute\", \"nodeName\",\"title\",attrName);\n \n}", "get name() : string {\n return this._formatStr(this._bitField.getString(43,162));\n }", "function sameItemName()\n {\n items.each(function() {\n var name = $(this).data(\"name\").toString();\n\n var sameItemId = container.find(\"[data-name='\" + name + \"']\");\n\n if(sameItemId.length > 1) {\n console.error(\"There are items with the same name: \" + name);\n console.log(sameItemId);\n }\n });\n }", "get name() {\r\n\t\treturn this._name;\r\n\t}", "getName() {\r\n return this.name;\r\n }", "resolveNamable(itemName, itemList){\n let findItem = function(evaluatedItem){\n if(evaluatedItem && evaluatedItem.name){\n var name = evaluateName(evaluatedItem.name, itemName)\n if(evaluatedItem.name === name){\n return evaluatedItem\n }\n } else {\n console.error(`You\\'re trying to evaluate a non-namable object, check that the property name on all your objects is a Name class in `)\n console.error(evaluatedItem)\n }\n return false\n }\n let item = itemList.find(findItem)\n return item\n }", "function itemNameGenerator() {\n var storage = [\n \"Slow Cooker Coq au Vin\",\n \"Golden Beet & Beet Greens Pasta\",\n \"Meatballs with onion gravy\",\n \"Beef Curry\",\n \"Super Mom Stir Fry\",\n \"Almond-Thyme-Crusted Mahi Mahi\",\n \"Contest-Winning Parmesan\",\n \"Creamy Baked Risotto\",\n \"Chicken Cacciatore\",\n \"Bird's Nest Egg Salad\",\n \"Tofu Kabobs with Barbecue Sauce\",\n \"Grilled Chicken, and Quinoa Salad\",\n \"Grilled Pork Chops\",\n \"One Pot Garlic Butter Chicken\",\n \"Instant Pot Turkey Chili\",\n \"Chicken Fajita Burgers\",\n \"Fruit Salad\",\n \"Chicken Grilled Cheese Sandwich\",\n \"Steak Sandwiches\",\n \"Coconut & tamarind chicken curry\",\n \"Smoked Salmon Carbonara\",\n \"Pan-Seared Cod\",\n \"Guinea fowl tagine\",\n \"Kale Pesto Avocado Grilled Cheese\",\n \"Mexican Chicken Taco Skillet\",\n \"Skinnified Pork Burrito\",\n \"Calamari\",\n \"Bang-Bang Shrimp\",\n \"Chicken Fajita Casserole\",\n \"The TJ Hooker Pizza\",\n \"Seared Scallops\",\n \"Spinach Burrata Omelet\",\n \"Roasted Macaroni and Cheese\",\n \"Chicken and Corn Chowder\",\n \"Mediterranean Crab\",\n \"Creamy chicken & mango curry\",\n \"Grilled chicken\",\n \"Homemade Creamy Chicken Soup\",\n \"Flattened Chicken\",\n \"Skirt Steak With Arugula Salad\",\n \"Healthy Chicken Burgers\",\n \"Stir-Fried Udon Noodles\",\n \"Pan-seared Salmon\",\n \"Penne and Vegetable Casserole\",\n \"Grilled Watermelon Salad\",\n \"Slow Cooker Chicken Soup\",\n \"Creamy Chile Chicken Enchiladas\",\n \"Caprese Mac and Cheese\",\n \"Oven Baked Chicken Tacos\",\n \"Thai Peanut Chicken\"\n ];\n return storage[Math.floor(storage.length * Math.random())];\n}", "function myName() {\n return myName.mark;\n}", "get name() {\n return pkg.name;\n }", "name() {\n return this.data.name;\n }", "function getItemText(item){return item&&$scope.itemText?$scope.itemText(getItemAsNameVal(item)):null;}", "getName() {\n return `${this.name}`;\n }", "function myName() {\n return myName.kurt;\n}", "get name() {\n return _name.get(this);\n }", "function getName(elem) {\n return elem.name;\n}", "get name() {\n\t return this._name;\n\t }", "function getName(elem) {\n return elem.name;\n}" ]
[ "0.6854586", "0.6663962", "0.6496458", "0.64875036", "0.6444733", "0.640706", "0.6358315", "0.63048553", "0.6275277", "0.6255061", "0.62208897", "0.62053066", "0.61827654", "0.61827654", "0.6065856", "0.6053934", "0.6019581", "0.5999365", "0.5999189", "0.59629166", "0.59464604", "0.59214216", "0.5906313", "0.58937603", "0.58678573", "0.5866858", "0.58602244", "0.58233446", "0.5821863", "0.5817297", "0.5805952", "0.57994187", "0.5799309", "0.5749514", "0.57493436", "0.5718482", "0.5716388", "0.57014126", "0.5699414", "0.5693245", "0.5690245", "0.568899", "0.5665081", "0.56616884", "0.56524897", "0.56524897", "0.5638934", "0.56377876", "0.5631881", "0.5628371", "0.5622555", "0.5609975", "0.5608519", "0.5606949", "0.56035036", "0.5593525", "0.55929196", "0.5587674", "0.55848986", "0.5574575", "0.5570667", "0.5570667", "0.5570667", "0.5570667", "0.5570667", "0.5570667", "0.5570667", "0.5570667", "0.5561737", "0.55615515", "0.5558922", "0.5558922", "0.5557523", "0.55563486", "0.55563486", "0.55563486", "0.55563486", "0.55563486", "0.55563486", "0.55563486", "0.55563486", "0.554578", "0.5541357", "0.55395454", "0.5537541", "0.5532379", "0.55293417", "0.5519871", "0.55150545", "0.55104446", "0.5510335", "0.5501432", "0.54981375", "0.5495253", "0.548981", "0.5488448", "0.5479141", "0.54679054", "0.54564583", "0.5446245", "0.5446117" ]
0.0
-1
so nothing has changed there but the price is going to be different item dot price multiply by the tax rate
function applyTaxToItems(user){ const {cart} = user; const taxRate = 1.3; const updatedCart = cart.map(item => { return { name: item.name, price: item.price*taxRate } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "priceWithTax() {\n return Number(this.price) * 1.05;\n }", "function updatePrice() {\n var sum = 0;\n for(var i = 0; i < $scope.currentItems.length; i++) {\n sum += $scope.currentItems[i].price;\n }\n\n $scope.totalCost = sum + (sum * taxRate);\n $scope.totalCost = Math.floor($scope.totalCost);\n console.log($scope.totalCost);\n }", "function add_tax_to_price_onscreen(tax) {\n let price_id = get_price_div();\n let price = get_price()\n let p = document.getElementById(price_id);\n p.innerText = \"$\" + (price * (1 + tax)).toFixed(2) + \" with tax\";\n console.log(\"price adjusted.\");\n}", "function costWithTax(item) {\n return parseFloat( item.price + taxForItem(item) );\n }", "function updatePrice(rate, quantity) {\n totalPrice += rate * quantity;\n console.log(totalPrice);\n updateDomPrice();\n }", "function applySalesTax(taxRate, price) {\n return price + price * taxRate;\n}", "function taxed(price) {\nconsole.log(window.tax_rate);\nreturn price * (1 + window.tax_rate);\n}", "get subtotal_ex_tax() {\n let sub = 0.0;\n self.items.map((i) => {\n sub += i.price * i.quantity;\n return sub;\n });\n return sub.toFixed(2);\n }", "get subtotal_ex_tax() {\n let sub = 0.0;\n self.items.map((i) => {\n sub += i.price * i.quantity;\n return sub;\n });\n return sub.toFixed(2);\n }", "function calculatePrice() {\n\t\tArray.from(pricingWrapper.find('.pricing-item')).forEach(function (pricingItem) {\n\t\t\tlet totalComponentPrice = 0;\n\t\t\tlet totalPackagingPrice = 0;\n\t\t\tlet totalSurchargePrice = 0;\n\t\t\tconst insurance = formatter.getNumberValue($(pricingItem).find('.input-insurance-price').val() || 0);\n\n\t\t\t/*\n\t\t\tArray.from($(pricingItem).find('.input-component-price-original')).forEach(function (inputComponentPrice) {\n\t\t\t\tconst componentPriceOriginal = formatter.getNumberValue($(inputComponentPrice).val() || 0);\n\t\t\t\tconst componentDurationPercent = $(inputComponentPrice).closest('.row-component').find('.input-duration-percent').val();\n\t\t\t\tconst componentPrice = componentPriceOriginal + (componentDurationPercent / 100 * componentPriceOriginal);\n\t\t\t\t$(inputComponentPrice).closest('.row-component').find('.input-component-price').val(formatter.setNumberValue(componentPrice, 'Rp. '));\n\t\t\t});\n\t\t\t */\n\n\t\t\tArray.from($(pricingItem).find('.input-component-price')).forEach(function (inputComponentPrice) {\n\t\t\t\tconst componentPrice = formatter.getNumberValue($(inputComponentPrice).val() || 0);\n\t\t\t\ttotalComponentPrice += formatter.getNumberValue($(inputComponentPrice).val() || 0);\n\t\t\t});\n\t\t\tArray.from($(pricingItem).find('.input-packaging-price')).forEach(function (inputPackagingPrice) {\n\t\t\t\ttotalPackagingPrice += formatter.getNumberValue($(inputPackagingPrice).val() || 0);\n\t\t\t});\n\t\t\tArray.from($(pricingItem).find('.input-surcharge-price')).forEach(function (inputSurchargePrice) {\n\t\t\t\ttotalSurchargePrice += formatter.getNumberValue($(inputSurchargePrice).val() || 0);\n\t\t\t});\n\t\t\tconst totalPurchase = totalComponentPrice + totalPackagingPrice + totalSurchargePrice + insurance;\n\t\t\tconst totalSellBeforeTax = totalPurchase + (margin / 100 * totalPurchase);\n\n\t\t\tlet tax = 0;\n\t\t\tif (selectIncomeTax.val() === '1') {\n\t\t\t\ttax = 0.02 * totalSellBeforeTax;\n\t\t\t}\n\t\t\tconst totalSellAfterTax = totalSellBeforeTax + tax;\n\n\t\t\t$(pricingItem).find('.label-purchase-amount').text(formatter.setNumberValue(totalPurchase, 'Rp. '));\n\t\t\t$(pricingItem).find('.label-sell-before-tax').text('(' + formatter.setNumberValue(margin) + '%) ' + formatter.setNumberValue(totalSellBeforeTax, 'Rp. '));\n\t\t\t$(pricingItem).find('.label-sell-after-tax').text(formatter.setNumberValue(totalSellAfterTax, 'Rp. '));\n\n\t\t});\n\t}", "getTotalWithTax() {\n \n // total individual items from getPriceWithTax\n let totWithTax = 0;\n this.items.forEach((net) => {\n totWithTax += net.getPriceWithTax();\n });\n return totWithTax;\n }", "get salesTax() {\n return parseFloat(\n (super.getSalesTax() + this.itemPrice() * IMPORT_DUTY).toFixed(2)\n );\n }", "function taxCalculator(itemPrice){\n\n return parseInt((itemPrice * 0.085).toFixed(2));\n \n}", "function update_price() {\n var row = $(this).parents('.item-row');\n var cost = row.find('.rate').val();\n var qty = row.find('.qty').val();\n //console.log(row,cost,qty)\n // console.log(row.find('.price'))\n row.find('.price').val(Number(qty) * Number(cost));\n subTot.textContent = \"Sub Total: \" + summing();\n tot.textContent=\"Total: \"+summing()*1.5;\n\n }", "function updatePrice(e) {\n var parentID = $(e).parents(\"div.item\").attr(\"id\");\n \n var baseCost = parseFloat($('#' + parentID + ' span.painting.price').attr(\"data-price\"));;\n var quantity = $('#' + parentID + ' input[name^=quantity]').val();\n var frameCost = parseFloat($('#' + parentID + ' select[name^=frame] option:selected').attr(\"data-price\"));\n var glassCost = parseFloat($('#' + parentID + ' select[name^=glass] option:selected').attr(\"data-price\"));\n var mattID = $('#' + parentID + ' select[name^=matt]').val();\n\n $(\"#\" + parentID + \" span.price\").html(calcItemPrice(baseCost, quantity, frameCost, glassCost, mattID));\n }", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n\n })\n}", "function calculatePrice() {\n const firstClassCount = getBooking(\"firstClass\");\n const economyCount = getBooking(\"economy\");\n const subTotalPricing = firstClassCount * 150 + economyCount * 100;\n document.getElementById(\"subtotal\").innerText = \"$\" + subTotalPricing;\n\n const tax = Math.round(subTotalPricing * 0.1);\n document.getElementById(\"tax\").innerText = \"$\" + tax;\n\n const total = subTotalPricing + tax;\n document.getElementById(\"total\").innerText = \"$\" + total;\n}", "function updatePrices() {\n}", "function totalPriceUpdate() {\n var subTotal = currentPrice.reduce((a, b) => a + b, 0);\n var tax = (subTotal * 15) / 100;\n var total = subTotal + tax;\n document.getElementById(\"sub-total\").innerText = subTotal;\n document.getElementById(\"tax\").innerText = tax;\n document.getElementById(\"total\").innerText = total;\n}", "function updatePrice(productprice) {\n const subTotal = document.getElementById(\"sub-total\");\n const taxAmount = document.getElementById(\"tax-amount\");\n const totalPrice = document.getElementById(\"total-price\");\n\n subTotal.innerText = parseInt(document.getElementById(\"phone-price\").innerText) + parseInt(document.getElementById(\"case-price\").innerText);\n taxAmount.innerText = ((subTotal.innerText) * 0.1).toFixed(3);\n totalPrice.innerText = parseInt(subTotal.innerText) + parseFloat(taxAmount.innerText);\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {}\n })\n}", "function calculateSalesTax(price, taxRate = 0.15){\n\treturn price*taxRate;\n}", "function updatePrice() {\n var distance = getRoutesData().reduce(function(pv, cv) {return pv + cv.distance; }, 0);\n // taxi for very short distance has constant min price\n var businessDistance = (distance > getMinDistance()) ? distance : getMinDistance();\n var price = getTaxiPricePerKm() * businessDistance;\n $('#price').val(price.toFixed(2) + \" UAH\");\n}", "function priceCheck (title, listPrice, taxRate) {\n let salesTax = listPrice * taxRate;\n let total = listPrice + salesTax;\n console.log(title + ' costs $' + total + '.');\n}", "function update_total() {\n var total = 0;\n var taxrate =$('#tax_rate').find(':selected').data('rate');\n //var totalamount = 0;\n $('.item_total').each(function(i) {\n item_total = $(this).html().replace(\"$\", \"\");\n if (!isNaN(item_total))\n total += Number(item_total);\n });\n\n subtotal = parseFloat(total);\n\n taxtotal = parseFloat(subtotal * taxrate / 100);\n\n total = roundNumber(subtotal + taxtotal, 2);\n\n $('span.subtotal').html(roundNumber(subtotal, 2));\n $('.subtotal').val(roundNumber(subtotal, 2));\n \n $('#taxtotal').html(roundNumber(taxtotal, 2));\n \n $('#invoice_total_tax').val(taxtotal);\n \n $('#total').html(total);\n $('.total').val(total);\n\n update_balance();\n}", "updatePrice(){\n if( this.price > 0 ){\n this.price -= 1;\n }\n\n this.sellIn -= 1;\n\n if( this.sellIn < 0 ){\n if( this.price > 0 ) this.price -= 1;\n }\n }", "function lowerCurrentPrice( response ){\n $deletedItemTotalCost = parseInt( $('#times'+response).html() ) * parseFloat( $('#price'+response).html() );\n render();\n }", "function changeAmount(){\n updateCurrentCost();\n updateAmortization();\n updateTotalCookPerSecChain();\n}", "function update_price() {\n var row = $(this).parents('.line-item');\n var kolicina = parseFloat(row.find('.kolicina>input').val());\n var cena = parseFloat(row.find('.cena>input').val());\n var popust = parseFloat(row.find('.popust>input').val());\n var davek = parseFloat(row.find('.davek>input').val());\n popust = (100-popust)/100;\n davek = (100 + davek)/100;\n skupaj = cena*kolicina*popust*davek;\n row.find('.skupaj').html(skupaj.toFixed(2));\n //update_total();\n}", "function update_form_product_price(item){\n const form_product = findParentElementByClass(item, 'product-form').getElementsByTagName('form')[0];\n let spam_price = form_product.getElementsByClassName(\"product-form-price\")[0];\n let price = getProductFormPrice(form_product);\n\n spam_price.innerHTML = price.toFixed(2);\n}", "get price() {\n const {\n priceMoney\n } = this.defaultVariation.itemVariationData;\n // item price money can be undefined, then we default to 0.00\n return priceMoney ? `${(parseInt(priceMoney.amount)/100).toFixed(2)}` : 0.00;\n }", "calculPricePni(){\n this.panierPrice = 0;\n for (let product of this.list_panier) {\n var price = product.fields.price*product.quantit;\n this.panierPrice = this.panierPrice+price;\n }\n //on arrondi le price au deuxieme chiffre apres la virgule\n this.panierPrice = this.panierPrice.toFixed(2);\n }", "function add_price(attr_price) {\n lumise.cart.price.attr = attr_price;\n if(lumise.cart.price.color == 0) return;\n var origin_price = lumise.cart.price.base + lumise.cart.price.attr + lumise.cart.price.color;\n var total_price = lumise.cart.price.base * lumise.cart.price.attr * lumise.cart.price.color;\n\t\tvar extra_price = total_price - origin_price;\n lumise.cart.price.extra.values = [{ price: extra_price }];\n\n var vat_price = total_price * 0.2;\n lumise.cart.price.vat = vat_price;\n var vat_ele = $('#vat_price');\n if(vat_ele.length == 0) {\n vat_ele = '<span id=\"vat_price\">' + vat_price.toFixed(2) + '</span><span> (VAT)</span>';\n $(vat_ele).appendTo($('#lumise-navigations ul[data-block=\"right\"]>li:first-child'));\n } else {\n vat_ele.text(vat_price.toFixed(2));\n }\n lumise.cart.calc();\n lumise.render.cart_change();\n lumise.actions.do('cart-changed', true);\n // lumise.cart.display();\n // console.log(lumise.cart.price);\n }", "function updatePrice(oldPrice) {\n return Math.floor(oldPrice * 1.25);\n}", "function applyTaxToItem(user) {\n const {cart} = user\n const taxRate = 0.1\n const updatedCart = cart.map(item => ({\n ...item,\n price: item.price * (1+taxRate)\n }))\n return Object.assign({}, user, {cart: updatedCart});\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n }\n })\n}", "constructor() {\n /**\n * The tax of the product item after adjustments applying.\n * @member {Number} adjusted_tax\n */\n this.adjusted_tax = undefined\n\n /**\n * The base price for the line item, which is the price of the unit before applying\n * adjustments, in the purchase currency. The base price may be net or gross of\n * tax depending on the configured taxation policy.\n * @member {Number} base_price\n */\n this.base_price = undefined\n\n /**\n * The item identifier. Use this to identify an item when updating the item\n * quantity or creating a custom price adjustment for an item.\n * @member {String} item_id\n */\n this.item_id = undefined\n\n /**\n * The text describing the item in more detail.\n * @member {String} item_text\n */\n this.item_text = undefined\n\n /**\n * The price of the line item before applying any adjustments. If the line item is\n * based on net pricing then the net price is returned. If the line item is\n * based on gross pricing then the gross price is returned.\n * @member {Number} price\n */\n this.price = undefined\n\n /**\n * Array of price adjustments. Can be empty.\n * @member {Array.<module:models/PriceAdjustment>} price_adjustments\n */\n this.price_adjustments = undefined\n\n /**\n * The price of the product line item after applying all product-level adjustments.\n * For net pricing the adjusted net price is returned. For gross pricing,\n * the adjusted gross price is returned.\n * @member {Number} price_after_item_discount\n */\n this.price_after_item_discount = undefined\n\n /**\n * The identifier of the shipment to which this item belongs.\n * @member {String} shipment_id\n */\n this.shipment_id = undefined\n\n /**\n * The tax of the product item before adjustments applying.\n * @member {Number} tax\n */\n this.tax = undefined\n\n /**\n * The price used to calculate the tax for this product item.\n * @member {Number} tax_basis\n */\n this.tax_basis = undefined\n\n /**\n * The tax class ID for the product item or null if no tax class ID is associated with the product item.\n * @member {String} tax_class_id\n */\n this.tax_class_id = undefined\n\n /**\n * The tax rate, which is the decimal tax rate to be applied to the product represented by this item.\n * @member {Number} tax_rate\n */\n this.tax_rate = undefined\n }", "function calcItemPrice(baseCost, quantity, frameCost, glassCost, mattID) {\n var cost = (baseCost + frameCost + glassCost) * quantity;\n if(mattID != 35) { cost += (10 * quantity);}\n return formatMoney(cost);\n }", "function updateVariantPrice(variant) {\r\n\t $('#buy-button-1 .variant-price').text('$' + variant.price);\r\n\t }", "calculateTotal() {\n let products = this.state.invoiceItems;\n let total = 0;\n products.forEach((el) => {\n total += el.price * el.quantity\n });\n\n if (this.state.discount) {\n total *= (100 - this.state.discount) / 100;\n }\n\n this.setState({\n total: (total).toFixed(2)\n }, this.updateInvoiceAPI);\n }", "function calculateTax(amount) {\n return amount * 0.10;\n}", "function addTax() {\n var tax = $(\"#newTaxSale\").val();\n\n var totalPrice = $(\"#newSaleTotal\").attr(\"totalSale\");\n\n var taxPrice = Number((totalPrice * tax) / 100);\n\n var totalwithTax = Number(taxPrice) + Number(totalPrice);\n\n $(\"#newSaleTotal\").val(totalwithTax);\n\n $(\"#saleTotal\").val(totalwithTax);\n\n $(\"#newTaxPrice\").val(taxPrice);\n\n $(\"#newNetPrice\").val(totalPrice);\n}", "function sumExtraCoveragePrice(){\n quotes.forEach(quote => {\n var newPrice = unformatNumber(quote.price) + \n unformatNumber(quote.extraCoveragePrice);\n quote.price = formatMoney(newPrice);\n });\n}", "price() {\n return this.bid / this.capacity;\n }", "function updateDomPrice() {\n dom.sPrice.innerHTML = totalPrice - deliveryCharges;\n\n dom.tPrice.innerHTML = totalPrice === deliveryCharges ? 0 : totalPrice;\n }", "function taxCalculator(itemPrice) {\n\n var tax = itemPrice * .085;\n var taxedFixedToTwoDecimalPlaces = tax.toFixed(2);\n var taxnumber = parseInt(taxedFixedToTwoDecimalPlaces);\n\n return taxedFixedToTwoDecimalPlaces\n\n}", "function updateprice(){\n\n}", "function pricing() {\n var _old = $('.old_price');\n var _max = $('.max_coupons');\n var _newp = $('.new_price');\n var _basic = $('.basic_discount');\n var _actual = $('.actual_discount');\n\n var old_price = parseInt(_old.val() || 0);\n var max = parseInt(_max.val() || 0);\n var new_price = parseInt(_newp.val() || 0);\n var discount = parseInt(_basic.val() || 0);\n\n var margin = 20\n\n $(_newp).bind(\"change keyup input\", function () {\n var _input = parseInt($(this).val() || 0);\n var old_price = parseInt(_old.val() || 0);\n console.log(old_price);\n\n if (_input >= old_price) {\n //Dont allow passage\n console.log('Discounted price cant be higher');\n }\n\n var diff = Math.round(((old_price - _input) * 100) / old_price);\n\n var actual = Math.round(diff - (diff * 0.2));\n\n $(_basic).val(diff);\n $(_actual).val(actual);\n });\n\n $(_basic).bind(\"change keyup input\", function () {\n var _input = parseInt($(this).val() || 0);\n var old_price = parseInt(_old.val() || 0);\n\n var diff = Math.round(old_price - ((_input / 100) * old_price));\n\n var actual = Math.round(_input - (_input * 0.2));\n\n $(_newp).val(diff);\n $(_actual).val(actual);\n });\n\n// $(_actual).bind(\"change keyup input\", function () {\n// var _input = parseInt($(this).val() || 0);\n// var old_price = parseInt(_old.val() || 0);\n//\n// var diff = Math.round(old_price - ((_input / 100) * old_price));\n//\n// $(_newp).val(diff);\n// });\n }", "_getPrice(){\n return this._stuffing.price+ this._size.price;\n }", "updatePriceFromPricing () {\n this.config.display.amount = this.pricing.totalNow;\n this.config.display.currency = this.pricing.currencyCode;\n }", "viewedItemPrice(state) {\n let variationPrice =\n state.selectedViewedItemVariation.item_variation_data.price_money\n .amount;\n // calculate modifiers price\n let modifiersPrice = 0;\n let modifiersPriceCents = state.viewedItemSelectedModifiers.reduce(\n (total, option) => total + option.price_money.amount,\n 0\n );\n if (modifiersPriceCents) {\n modifiersPrice = modifiersPriceCents;\n }\n return (\n ((variationPrice + modifiersPrice) * state.viewedItemSelectedQuantity) /\n 100\n ).toFixed(2);\n }", "function addTax(goods, taxPct){\n return goods + (goods * (taxPct/100));\n}", "function updateWithNewTax(newTax = 0.15)\n{\n window.data.tax = newTax;\n for (let callback of window.data.taxCallbacks) { callback(); }\n}", "function changeVal(el) {\n\tvar qt = parseFloat(el.parent().children(\".qt\").html());\n\tvar price = parseFloat(el.parent().children(\".price\").html());\n\tvar eq = Math.round(price * qt * 100) / 100;\n\tel.parent().children(\".full-price\").html( eq + \"₪\" );\n\n\tchangeTotal(); \n}", "function calculateTax (amount){\n return amount * TAX;\n}", "function changeTotalPrice(itemName, itemPriceTemp) {\n\tvar newTotal = 0.00;\n\tvar itemPrice = 0.00;\n\titemPrice += parseFloat(itemPriceTemp);\n\tvar oldPrice = document.getElementById(\"totalPrice\").innerHTML;\n\tnewTotal += parseFloat(oldPrice.substr(1, oldPrice.length));\n\tnewTotal += itemPrice;\n\tdocument.getElementById(\"totalPrice\").innerHTML = \"$\" + newTotal;\n}", "getPrice(){\n var currentPrice = 1.50;\n var companyProfit = .1;\n\n this.suggestedPrice = ((this.getLocationFactor() - this.getRateHistory() + this.getGallonFactor() + companyProfit) \n * currentPrice);\n this.suggestedPrice = currentPrice + this.suggestedPrice;\n return this.suggestedPrice;\n }", "discountTotal(price){\n let reducedPrice = this.percentage*price;\n return (price - reducedPrice);\n }", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({})\n}", "_updatePrice(price, optionalSku) {\n let innerHTML = '';\n if (!price.range) {\n if (price.discounted) {\n innerHTML += `<span class=\"regularPrice\">${this._formatter.formatPrice({\n value: price.regularPrice,\n currency: price.currency\n })}</span>\n <span class=\"discountedPrice\">${this._formatter.formatPrice({\n value: price.finalPrice,\n currency: price.currency\n })}</span>\n <span class=\"you-save\">You save ${this._formatter.formatPrice({\n value: price.discountAmount,\n currency: price.currency\n })} (${price.discountPercent}%)</span>`;\n } else {\n innerHTML += `<span>${this._formatter.formatPrice({\n value: price.regularPrice,\n currency: price.currency\n })}</span>`;\n }\n } else {\n if (price.discounted) {\n innerHTML += `<span class=\"regularPrice\">${this._formatter.formatPrice({\n value: price.regularPrice,\n currency: price.currency\n })} - ${this._formatter.formatPrice({ value: price.regularPriceMax, currency: price.currency })}</span>\n <span class=\"discountedPrice\">${this._formatter.formatPrice({\n value: price.finalPrice,\n currency: price.currency\n })} - ${this._formatter.formatPrice({\n value: price.finalPriceMax,\n currency: price.currency\n })}</span>\n <span class=\"you-save\">You save ${this._formatter.formatPrice({\n value: price.discountAmount,\n currency: price.currency\n })} (${price.discountPercent}%)</span>`;\n } else {\n innerHTML += `<span>${this._formatter.formatPrice({\n value: price.regularPrice,\n currency: price.currency\n })} - ${this._formatter.formatPrice({\n value: price.regularPriceMax,\n currency: price.currency\n })}</span>`;\n }\n }\n\n let sku = optionalSku || this._state.sku;\n this._element.querySelector(Product.selectors.price + `[data-product-sku=\"${sku}\"]`).innerHTML = innerHTML;\n }", "function checkout(item1, item2, coupon) {\n var subtotal = item1 + item2;\n var couponAmount = subtotal * coupon;\n var total = subtotal - couponAmount;\n var taxRate = total * 0.095;\n var total = total + taxRate;\n total = total.toFixed(2);\n return total;\n //return total;\n //console.log(\"Total amount due is \" + total);\n //return total;\n}", "function calculateSalesTax(salesTax) {\n return salesTax = (20 / 100) * price\n}", "function taxCalculator(itemPrice) {\n var tax = itemPrice * .085;\n var taxedFixedToTwoDecimalPlaces = tax.toFixed(2);\n var taxNumber = parseInt(taxedFixedToTwoDecimalPlaces);\n\n return taxedFixedToTwoDecimalPlaces;\n}", "function updateAdjustedEstimate() {\n // Recalculate the estimate data\n $scope.selectedEstimate = $scope.truckCost * (1 + $scope.markupIncrements[$scope.selectedIndex]);\n }", "function updateTruckCost() {\n // Recalculate the truck cost estimate\n $scope.truckCost = $scope.baseEstimate * $scope.truckCostIncrements[$scope.truckCostIndex];\n }", "function applyTaxToItems(user){\n amazonHistory.push(user)\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({}, user, { cart: updatedCart })\n}", "function updatePrices() {\n clickUpgrades['shovel'].price = clickUpgrades['shovel'].newprice;\n clickUpgrades['excavator'].price = clickUpgrades['excavator'].newprice;\n autoUpgrades['jackhammer'].price = autoUpgrades['jackhammer'].newprice;\n autoUpgrades['wheelbarrow'].price = autoUpgrades['wheelbarrow'].newprice;\n\n}", "function totalCost(e) {\n let quantity = e.target\n quantity_parent = quantity.parentElement.parentElement\n price_field = quantity_parent.getElementsByClassName('item-price')[0]\n total_field = quantity_parent.getElementsByClassName('total-price')[0]\n price_field_content = price_field.innerText.replace('€', '')\n total_field.children[0].innerText = '€' + quantity.value * price_field_content\n grandTotal()\n if (isNaN(quantity.value) || quantity.value <= 0) {\n quantity.value = 1\n }\n\n}", "updateEtherPrice() {\n this.$store.dispatch('updateEtherPrice');\n axios.get(`${this.conversionURL}/?q=USD_PHP&compact=ultra&apiKey=${process.env.MIX_CURRENCY_CONVERSION_API}`)\n .then(res=> this.fee.php.rate = this.$store.state.prices.etherInUsd * res.data.USD_PHP);\n axios.get(`${this.conversionURL}/?q=USD_EUR&compact=ultra&apiKey=${process.env.MIX_CURRENCY_CONVERSION_API}`)\n .then(res=> this.fee.euro.rate = this.$store.state.prices.etherInUsd * res.data.USD_EUR);\n this.fee.usd.rate = this.$store.state.prices.etherInUsd;\n }", "function recalculate() {\n var extendedPriceTotal = 0;\n var shippingTotal = 0;\n var $itemDetailLines = $('.item-detail-line');\n $itemDetailLines.each(function () {\n var itemExtendedPrice = parseFloat($(this).find('.item-extended-price').text().slice(1)) || 0;\n var itemShipping = parseFloat($(this).find('.item-shipping').text().slice(1)) || 0;\n var itemTotalPrice = parseFloat($(this).find('.item-total-price').text().slice(1)) || 0;\n\n extendedPriceTotal += itemExtendedPrice;\n shippingTotal += itemShipping;\n });\n\n $('.item-detail-total .item-extended-price').text('$' + extendedPriceTotal.toFixed(2));\n $('.item-detail-total .item-shipping').text('$' + shippingTotal.toFixed(2));\n $('.item-detail-total .item-total-price').text('$' + (extendedPriceTotal + shippingTotal).toFixed(2));\n}", "function updateTotalCartPricing() {\r\n\t $('.cart .pricing').text(formatAsMoney(cart.subtotal));\r\n\t }", "function CheckBasePrice(group_id, group_item_count, group_item_serial, group_count, aftertax, pricetrans_variable){\r\n\tvar tax = '';\r\n\t\r\n\tif(aftertax=='1'){\r\n\t\t \ttax = 'at_';\r\n\t\t }else if(aftertax=='0'){\r\n\t\t \ttax = 'bt_';\r\n\t\t }\r\n\t var tax_rate = parseFloat(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_tax_rate\").value);\r\n\tvar item_qty = parseFloat(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_qty\").value);\r\n \r\n \r\n if(pricetrans_variable=='1')\r\n\t{\r\n\tvar base_price =parseFloat(document.getElementById(\"txt_at_\"+group_count+\"_\"+group_item_serial+\"_price\").value);\r\n}\r\nelse{\r\n\tvar base_price = parseFloat(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_baseprice\").value);\r\n}\r\n// var base_price = parseFloat(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_baseprice\").value);\r\n\tvar net_price = parseFloat(document.getElementById(\"div_\"+tax+group_count+\"_\"+group_item_serial+\"_netprice\").value);\r\n var base_disc = parseInt(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_basedisc\").value);\r\n\tvar disc = CheckNumeric(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_disc\").value);\r\n\tvar emp_quote_discountupdate = document.getElementById(\"emp_quote_discountupdate\").value;\r\n\tvar emp_quote_priceupdate = document.getElementById(\"emp_quote_priceupdate\").value;\r\n\tif(emp_quote_discountupdate=='1'){\r\n\t\t\tif(eval(base_price)<eval(disc)){\r\n\t\t\t\tdocument.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_disc\").value = parseInt(base_price);\r\n\t\t\t}\r\n\t\t}else if(emp_quote_discountupdate=='0'){\r\n\t\t\tif(eval(base_disc)<eval(disc)){\r\n\t\t\t\tdocument.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_disc\").value = base_disc;\r\n\t\t\t}\r\n\t\t}\r\n\t\tdisc = CheckNumeric(document.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_disc\").value);\r\n\t\tdocument.getElementById(\"div_\"+tax+group_count+\"_\"+group_item_serial+\"_total\").innerHTML = CheckNumeric(((((base_price - disc)*tax_rate/100)+(base_price - disc)))*item_qty).toFixed(2);\r\n\t\tif(aftertax=='0'){\r\n\t\t\tdocument.getElementById(\"txt_\"+tax+group_count+\"_\"+group_item_serial+\"_totalwod\").value = CheckNumeric((((base_price*tax_rate/100)+base_price))*item_qty).toFixed(2);\r\n\t\t}\r\n\t\tdocument.getElementById(\"div_\"+tax+group_count+\"_\"+group_item_serial+\"_amount\").value = CheckNumeric(((((base_price - disc)*tax_rate/100)+(base_price - disc)))*item_qty).toFixed(2);\r\n\t\tif(aftertax=='0'){\r\n\t\t\tdocument.getElementById(\"div_\"+tax+group_count+\"_\"+group_item_serial+\"_amountwod\").value = CheckNumeric((((base_price*tax_rate/100)+base_price))*item_qty).toFixed(2);\r\n\t\t}\r\n\t\tGroupValue(group_id, group_item_count, group_count, aftertax);\r\n\t\tCalculateTotal(aftertax);\r\n}", "function updateCosts(){\n var quantity = new Number($(\"#quantity\").val());\n var discount = new Number($(\"#discount\").val());\n var applygst = new Number ($(\"#applygst\").val());\n var listprice = new Number($(\"#listprice\").val());\n var currcode = new String($(\"#currency\").val());\n var exchangerate = new Number($(\"#currency_rate_\"+currcode).val());\n var gst_on=false;\n\n var rrp = new Number(listprice*exchangerate);\n var ecost = rrp;\n if ( 100-discount != 100 ) { //Prevent rounding issues if no discount\n ecost = new Number(Math.floor(rrp * (100 - discount )) / 100);\n }\n var total = new Number( ecost * quantity);\n $(\"#rrp\").val(rrp.toFixed(2));\n $(\"#ecost\").val(ecost.toFixed(2));\n $(\"#total\").val(total.toFixed(2));\n $(\"listprice\").val(listprice.toFixed(2));\n\n return true;\n}", "function displayOrder(order, updatePrice) {\n //versobe console\n //console.log('---- Displaying order...');\n\n jQuery('#order-items_grid table tbody').empty();\n var itemNumber = parseFloat(0);\n var subtotal = parseFloat(0);\n var subtotalInclTax = parseFloat(0);\n var totalTax = parseFloat(0);\n\n //retrieve tax\n var tax = parseFloat(0);\n\n jQuery.each(order, function (i, orderItem) {\n //calc\n orderItem.subtotal = orderItem.price * orderItem.qty;\n\n ////console.log(orderItem);\n if (orderItem.type == 'giftcard')\n orderItem.subtotalInclTax = orderItem.subtotal;\n else\n orderItem.subtotalInclTax = orderItem.priceInclTax * orderItem.qty;\n\n var orderOption = '';\n var edit_price = '';\n var change_qty = '';\n var out_stock = '';\n var is_qty_decimal = '';\n\n var limit = jQuery('#is_user_limited').val();\n if (limit == 0) edit_price = 'edit_price';\n else edit_price = '';\n var class_item = orderItem.class_item;\n var config_change = orderItem.config_change;\n\n if (orderItem.options.length > 0) {\n jQuery.each(orderItem.options, function (i, option) {\n var optionName = option.name.replace('[', '][');\n optionName = optionName.lastIndexOf(']') == (optionName.length - 1) ? optionName : optionName + ']';\n orderOption += '<input type=\"hidden\" name=\"item[' + orderItem.id + '][' + optionName + '\" value=\"' + option.value + '\">';\n //optionInput+='<span class=\"option-title\">'+option.optionTitle+': </span><span class=\"option-name\">'+option.qty+'x '+option.title+'</span></li>';\n if (!!option.value && option.value in productData) {\n var product_id = option.value;\n var product = productData[product_id];\n if (product.qty <= 0 && product.type == 'simple') {\n orderItem.out_stock = 1;\n }\n }\n });\n config_change = \"config_change item_config item_config-id\";\n class_item = \"config item_config item_config-id\";\n if (orderItem.type == 'grouped')\n change_qty = 'grouped';\n }\n\n if (orderItem.type == 'configurable' && orderItem.child_product_id != null) {\n /** XPOS-1888: sometime do NOT display \"Out of Stock\" properly\n * 07/04/2015\n */\n orderItem.out_stock = 0;\n var product_id = orderItem.child_product_id;\n var product = productData[product_id];\n if (!!product && product.qty <= 0 && product.type == 'simple') {\n orderItem.out_stock = 1;\n }\n }\n\n\n if (orderItem.out_stock == 1) {\n var out_stock = '<h6 style=\"height: 15px; line-height: 15px; padding-top:5px; color: red; font-size:.8em\">Out of Stock</h6>';\n }\n if (orderItem.is_qty_decimal == 1) {\n is_qty_decimal = 'qty_decimal';\n }\n //orderOption+='</ul>';\n var tempOrderItem = {};\n if (orderItem.qty == 0) {\n tempOrderItem.style = 'style=\"display:none\"';\n }\n tempOrderItem.id = orderItem.id;\n tempOrderItem.child_product_id = orderItem.child_product_id;\n tempOrderItem.baseId = orderItem.baseId;\n tempOrderItem.name = orderItem.name;\n //issue XPOS-1783\n tempOrderItem.sku = orderItem.sku;\n tempOrderItem.option = orderOption;\n tempOrderItem.qty = orderItem.qty;\n tempOrderItem.tax = orderItem.tax;\n tempOrderItem.subtotal = formatCurrency(orderItem.subtotal, priceFormat);\n tempOrderItem.class_item = class_item;\n tempOrderItem.price_name = orderItem.price_name;\n tempOrderItem.config_change = config_change;\n tempOrderItem.edit_price = edit_price;\n tempOrderItem.change_qty = change_qty;\n tempOrderItem.out_stock = out_stock;\n tempOrderItem.is_qty_decimal = is_qty_decimal;\n tempOrderItem.isNotChangePrice = 0;\n if (orderItem.type == 'bundle') {\n tempOrderItem.isNotChangePrice = 1;\n }\n if (displayTaxInSubtotal) {\n tempOrderItem.subtotal = formatCurrency(orderItem.subtotalInclTax, priceFormat);\n } else {\n tempOrderItem.subtotal = formatCurrency(orderItem.subtotal, priceFormat);\n }\n\n var orderItemOutput = '';\n if (onFlyDiscount) {\n if (jQuery(\"#price_includes_tax\").val() == 1) {\n tempOrderItem.price = orderItem.priceInclTax;\n } else {\n tempOrderItem.price = orderItem.price;\n }\n if (!!orderItem.custom_price) {\n tempOrderItem.price = orderItem.custom_price;\n }\n if (displayTaxInShoppingCart) {\n tempOrderItem.price_display = formatCurrency(orderItem.priceInclTax, priceFormat);\n } else {\n tempOrderItem.price_display = formatCurrency(orderItem.price, priceFormat);\n }\n if (priceFormat.decimalSymbol == ',' && tempOrderItem.price.toString().indexOf(',') !== -1) {\n tempOrderItem.price = formatCurrency(parseFloat(tempOrderItem.price.toString().replace(',', '.')), priceFormat);\n }\n orderItemOutput = nano(orderTemplate, tempOrderItem);\n } else {\n if (displayTaxInShoppingCart) {\n tempOrderItem.price = formatCurrency(orderItem.priceInclTax, priceFormat);\n } else {\n tempOrderItem.price = formatCurrency(orderItem.price, priceFormat);\n }\n\n orderItemOutput = nano(noDiscountTemplate, tempOrderItem);\n }\n\n /** XPOS-2006\n *\n */\n /*\n if (orderItem.type == 'bundle' && !!orderItem.bundle_children) {\n if (orderItem.qty > 0) {\n var _html = '';\n orderItem.bundle_children.forEach(function(_value, _index) {\n _value = parseInt(_value);\n _childProduct = productData[_index];\n\n _html += '<tr>';\n _html += '<td><div class=\"item-first\"><h5>'+_childProduct.name + '</h5><h6 class=\"sku-text\">' +_childProduct.sku+ '</h6></div></td>';\n _html += '<td class=\"qty align-center\">' + _value + '</td>';\n _html += '<td></td>';\n _html += '<td class=\"price align-right\"><input value=\"'+ _childProduct.price +'\" disabled=\"disabled\" /></td>';\n _html += '</tr>';\n\n });\n orderItemOutput += _html;\n }\n }\n */\n\n\n jQuery('#order-items_grid table tbody').append(orderItemOutput);\n if (tempOrderItem.isNotChangePrice == 1) {\n //console.log('bundle id = ' + tempOrderItem.id);\n var PriceIdBundle = 'item-display-price-' + tempOrderItem.id;\n //console.log('id bundle price = \"' + PriceIdBundle+'\"');\n disableElementById(PriceIdBundle);\n }\n itemNumber += parseFloat(orderItem.qty);\n subtotal += parseFloat(orderItem.subtotal);\n subtotalInclTax += parseFloat(orderItem.subtotalInclTax);\n if (orderItem.qty > 0) {\n totalTax += parseFloat(orderItem.tax * 0.01 * orderItem.price * orderItem.qty);\n }\n });\n\n //var tax = subtotalInclTax - subtotal;\n var tax = totalTax;\n jQuery('#item_count_value').text(itemNumber);\n if (updatePrice) {\n if (displayTaxInSubtotal) {\n jQuery('#subtotal_value').text(formatCurrency(subtotalInclTax.toFixed(2), priceFormat));\n } else {\n jQuery('#subtotal_value').text(formatCurrency(subtotal.toFixed(2), priceFormat));\n }\n if (isNumber(tax)) {\n jQuery('#tax_value').text(formatCurrency(tax, priceFormat));\n } else {\n totalTax = 0;\n jQuery('#tax_value').text(formatCurrency(tax, priceFormat));\n }\n\n if (subtotalInclTax == 0) {\n removeDiscount();\n }\n\n var discount = Math.abs(jQuery('#discount_value').val());\n // if(displayTaxInGrandTotal)\n var grandTotal = subtotalInclTax > discount ? subtotalInclTax - discount : 0;\n // else grandTotal = subtotal - discount;\n jQuery('#grandtotal').text(formatCurrency(grandTotal.toFixed(2), priceFormat));\n jQuery('#grand_before').val(formatCurrency(grandTotal.toFixed(2), priceFormat));\n jQuery('#cash-in').val(grandTotal.toFixed(2));\n }\n setTimeout(function () {\n jQuery('#items_area').getNiceScroll().doScrollPos(0, 100000);\n }, 500);\n jQuery('#items_area').getNiceScroll().doScrollPos(0, 100000);\n\n function removeDiscount() {\n jQuery('#discount_value').val(0);\n jQuery('#order_discount').val(0);\n jQuery('#discount_change').val(1);\n }\n}", "constructor(oldCart) {\n this.taxRate = 0.1;\n this.items = oldCart.items || [];\n this.quantity = oldCart.quantity || 0;\n this.tax = oldCart.tax || 0.0;\n this.subTotal = oldCart.subTotal || 0.0;\n this.total = oldCart.total || 0.0;\n\n this.updatePricesAndQuantity();\n }", "totalItemPrice(item) {\n if(undefined === item.price || undefined === item.quantity){\n return 0;\n }\n return item.price * item.quantity;\n }", "function applyTaxToItems(user){}", "function updateCostAndPrice() {\n $(\"#totalCostCalculated\").text(Math.round(totalCostCalculated * Math.pow(10, 2)) / Math.pow(10, 2));\n $(\"#sellingPriceAtSpan\").text($(\"#profitMarginInput\").val());\n $(\"#sellingPrice\").text((Math.round(sellingPrice * Math.pow(10, 2)) / Math.pow(10, 2)));\n alert('recalculated via updateCostAndPrice method');\n }", "function updateCost(e) {\n if (this.checked) {\n if (this.id == \"checkboxTaxi\") {\n totalAmount += parseFloat(this.value);\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n } else {\n totalAmount += parseFloat(this.value) * dayAmount;\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n }\n } else {\n if (this.id == \"checkboxTaxi\") {\n totalAmount -= parseFloat(this.value);\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n } else {\n totalAmount -= parseFloat(this.value) * dayAmount;\n showPrice.textContent = `Total Price: ${totalAmount} ${currency}`;\n showPrice.setAttribute(\"value\", `${totalAmount}`);\n price = totalAmount;\n }\n }\n }", "function price2(){\nfor(var i=0; i<rentals.length;i++)\n{\n\nfor(var j=0; j<cars.length;j++)\n {\n if (rentals.carId==cars.id)\n {\n\n var days = getRentDays(rentals[i].pickupDate,rentals[i].returnDate);\n\n\n if (days == 1 ) //nothing changes\n {\n rentals[i].price= rentals[i].getRentDays(rentals[i].pickupDate,rentals[i].returnDate) * cars[j].pricePerDay\n + rentals[i].distance * cars[j].pricePerKm;\n }\n \n if (days > 1 && days <3) //price per day decreases by 10% after 1 day\n //(days + 1) because the 1st day =0\n {\n rentals[i].price= (days +1) * (cars[j].pricePerDay * 0.9)\n + rentals[i].distance * cars[j].pricePerKm;\n }\n\n if (days >4 && days <10) //price per day decreases by 30% after 4 days\n //(days + 1) because the 1st day =0\n {\n rentals[i].price= (days +1) * (cars[j].pricePerDay * 0.7)\n + rentals[i].distance * cars[j].pricePerKm;\n }\n\n if (days >10) //price per day decreases by 50% after 10 days\n //(days + 1) because the 1st day =0\n {\n rentals[i].price= (days +1) * (cars[j].pricePerDay * 0.5)\n + rentals[i].distance * cars[j].pricePerKm;\n }\n\n }\n }\n}\n\n}", "getPrice(_originalPrice) {\r\n var x = this.elapsed / 30000;\r\n var y = Math.sin(x);\r\n var range = _originalPrice / 4;\r\n var delta = range * y;\r\n return _originalPrice + delta;\r\n }", "function updateprice(qid) {\t\n\n var rqid = qid.split('_');\n rid = rqid[0];\n id = rqid[0]+rqid[1];\n\t\n var oldqty = $('#oldqty'+id).val();\n var newqty = $('#qty'+id).val();\n\t\n var numprice = $('#item_price'+id).html().replace('$', '');\t\t\t\t\n var numsubtotal = $('#subtotal'+rid).html().replace('$', ''); \n var numtotal = $('#total'+rid).html().replace('$', ''); \t\n\n // get new amount\n var qty2 = + Number(newqty - oldqty);\n var numprice2 = Math.abs(qty2) * numprice;\n\t\t\t\n // minus / plus amount\n if (oldqty < newqty) {\n newSubtotal = Number(numsubtotal) + Number(numprice2);\t\t\n newTotal = Number(numtotal) + Number(numprice2); \t\n } else {\n newSubtotal = Number(numsubtotal) - Number(numprice2);\t\t\n newTotal = Number(numtotal) - Number(numprice2);\t\n }\n\n newSubtotal = newSubtotal.toFixed(2);\n newTotal = newTotal.toFixed(2);\n\t\n $('#subtotal'+rid).html('$' + newSubtotal );\t\n $('#total'+rid).html( '$' + newTotal );\n $('#oldqty'+id).val(newqty);\n \t\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({}, user, { cart: updatedCart })\n}", "updateCosts() {\n let subtotal = 0;\n let total_bill = 0;\n let discount_value = 0;\n let voucher = this.voucher;\n this.products.forEach((product) => {\n subtotal += product.price * product.amount;\n });\n let delivery_costs = 4.00;\n if (subtotal != 0) {\n total_bill = subtotal + delivery_costs;\n discount_value = this.discount * total_bill;\n total_bill -= discount_value;\n total_bill -= voucher;\n } else {\n voucher = 0;\n }\n document.getElementById('current-discount').innerHTML = (this.discount * 100) + '%';\n document.getElementById('costs-subtotal').innerHTML = subtotal.toFixed(2) + '€';\n document.getElementById('costs-delivery').innerHTML = delivery_costs.toFixed(2) + '€';\n document.getElementById('costs-discount').innerHTML = discount_value.toFixed(2) + '€';\n if (voucher != 0) {\n document.getElementById('costs-voucher').innerHTML = '-' + voucher.toFixed(2) + '€';\n } else {\n document.getElementById('costs-voucher').innerHTML = voucher.toFixed(2) + '€';\n }\n document.getElementById('costs-total').innerHTML = total_bill.toFixed(2) + '€';\n }", "function invoice_calculate_gst_amount_on_qty_rate_change(element, amt)\n{\n \n cal_invoice_level_amts();\n\n /*var disc_type = element.closest(\"tr\").next().find(\".invoice_discount_section .custom-a11yselect-menu .custom-a11yselect-selected\").attr(\"data-val\");\n var disc_rate = element.closest(\"tr\").next().find(\".invoice_rate\").val();\n var selected_gst_type = element.closest('tr').next().next().find(\".invoice_GST_section .custom-a11yselect-btn .custom-a11yselect-text\").text();\n var selected_tax = element.closest('tr').next().next().find('.invoice_rate_data .custom-a11yselect-menu .custom-a11yselect-selected').attr(\"data-val\");\n var split_tax = selected_tax / 2;\n var cal_disc_amt = 0;\n if(amt!=\"\"){\n if(disc_rate!=\"\")\n {\n if(disc_type == 'Percentage'){\n cal_disc_amt = (disc_rate/100) * amt;\n if(selected_gst_type != \"Select Type\"){\n var new_cal_amt = amt - cal_disc_amt;\n if(selected_gst_type == 'IGST'){\n var new_cal = (selected_tax * new_cal_amt)/100;\n }\n if(selected_gst_type == 'CGST'){\n var new_cal = (split_tax * new_cal_amt)/100;\n }\n element.closest(\"tr\").next().next().find(\".invoice_main_amount\").text(\"\");\n element.closest(\"tr\").next().next().find(\".invoice_main_amount\").text(\"₹ \"+new_cal.toFixed(2));\n element.closest(\"tr\").next().next().next().find(\".invoice_main_amount\").text(\"\");\n element.closest(\"tr\").next().next().next().find(\".invoice_main_amount\").text(\"₹ \"+new_cal.toFixed(2));\n }\n element.closest(\"tr\").next().find(\".invoice_main_amount\").text(\"\");\n element.closest(\"tr\").next().find(\".invoice_main_amount\").text(\"₹ \"+cal_disc_amt.toFixed(2));\n }\n if(disc_type == 'Amount'){\n cal_disc_amt = parseInt(amt) - parseInt(disc_rate);\n if(selected_gst_type != \"Select Type\"){\n if(selected_gst_type == 'IGST'){\n var new_cal = (selected_tax * cal_disc_amt)/100; \n }\n if(selected_gst_type == 'CGST'){\n var new_cal = (split_tax * cal_disc_amt)/100;\n }\n element.closest(\"tr\").next().next().find(\".invoice_main_amount\").text(\"₹ \"+new_cal.toFixed(2));\n element.closest(\"tr\").next().next().next().find(\".invoice_main_amount\").text(\"₹ \"+new_cal.toFixed(2));\n }\n element.closest(\"tr\").next().find(\".invoice_main_amount\").text(\"₹ \"+disc_rate+\".00\");\n }\n element.closest(\"tr\").next().find(\".invoice_main_amount\").append(\"<input type='hidden' name='invoice_calculated_discount[]' class='invoice_calculated_discount' value='\"+cal_disc_amt+\"'>\");\n }\n else{\n var a=$(\"#invoice_Calculate_discounts .Invoice_Percentage \").closest(\".invoice_discount_section\").find(\".custom-a11yselect-btn .custom-a11yselect-text\").text();\n var selected_gst_type = $(\"#invoice_Calculate_discounts .Invoice_Percentage\").closest('tr').next().find(\".invoice_GST_section .custom-a11yselect-btn .custom-a11yselect-text\").text();\n var selected_tax = $(\"#invoice_Calculate_discounts .Invoice_Percentage \").closest('tr').next().find('.invoice_rate_data .custom-a11yselect-menu .custom-a11yselect-selected').attr(\"data-val\");\n var split_tax = selected_tax / 2;\n var total_val=$(\"#total_invoice_value\").val();\n var cur_rate_val=$(\"#invoice_disc_amt\").val();\n var calculated_val = 0;\n \n if(a==\"Percentage\")\n {\n calculated_val = (cur_rate_val/100) * total_val;\n if(selected_gst_type != \"Select Type\"){\n var new_cal_amt = total_val - calculated_val;\n if(selected_gst_type == 'IGST'){\n var new_cal = (selected_tax * new_cal_amt)/100;\n }\n if(selected_gst_type == 'CGST'){\n var new_cal = (split_tax * new_cal_amt)/100;\n }\n $(\"#invoice_Calculate_discounts .Invoice_Percentage\").closest(\"tr\").next().find(\".invoice_main_amount\").text(\"₹ \"+new_cal.toFixed(2));\n $(\"#invoice_Calculate_discounts .Invoice_Percentage\").closest(\"tr\").next().next().find(\".invoice_main_amount\").text(\"₹ \"+new_cal.toFixed(2));\n }\n }\n if(a==\"Amount\")\n {\n calculated_val = total_val - cur_rate_val;\n if(selected_gst_type != \"Select Type\"){\n if(selected_gst_type == 'IGST'){\n var new_cal = (selected_tax * calculated_val)/100; \n }\n if(selected_gst_type == 'CGST'){\n var new_cal = (split_tax * calculated_val)/100;\n }\n $(\"#invoice_Calculate_discounts .Invoice_Percentage\").closest(\"tr\").next().find(\".invoice_main_amount\").text(\"₹ \"+new_cal.toFixed(2));\n $(\"#invoice_Calculate_discounts .Invoice_Percentage\").closest(\"tr\").next().next().find(\".invoice_main_amount\").text(\"₹ \"+new_cal.toFixed(2));\n }\n }\n $(\"#invoice_Calculate_discounts .Invoice_Percentage\").closest(\"tr\").find(\"#invoice_calculated_disc_amt\").val(calculated_val);\n calculated_val = calculated_val.toFixed(2);\n $(\"#invoice_Calculate_discounts .Invoice_Percentage\").closest(\"tr\").find(\".invoice_main_amount\").text(\"\");\n $(\"#invoice_Calculate_discounts .Invoice_Percentage\").closest(\"tr\").find(\".invoice_main_amount\").text(\"₹ \"+calculated_val);\n //$(\"#Calculate_discounts .Invoice_Percentage\").closest(\"tr\").find(\".estimate_remove_discount\").css(\"display\",\"inline-block\");\n }\n }\n else{\n element.closest('tr').next().find(\".invoice_item_igst_amount, .invoice_item_cgst_amount, .invoice_item_sgst_amount\").val(0);\n element.closest('tr').next().find(\".invoice_main_amount\").text(\"\");\n element.closest('tr').next().find(\".invoice_main_amount\").text(\"₹ 0000.00\");\n element.closest(\"tr\").next().next().find(\".invoice_main_amount\").text(\"\");\n element.closest(\"tr\").next().next().find(\".invoice_main_amount\").text(\"₹ 0000.00\");\n element.closest(\"tr\").next().next().next().find(\".invoice_main_amount\").text(\"\");\n element.closest(\"tr\").next().next().next().find(\".invoice_main_amount\").text(\"₹ 0000.00\");\n }*/\n}", "function calculatePrice() {\n var parentRow = event.target.parentNode.parentNode;\n var parentRowId = parentRow.getAttribute(\"id\");\n var itemRate = getElement(\"#rate\" + parentRowId).value;\n var itemQty = event.target.value;\n var itemPrice = itemRate * itemQty;\n getElement(\"#amt\" + parentRowId).value = itemPrice;\n totalAmount();\n}", "function updateTotal() {\n let memoryCost = parseFloat(getElement(\"memory-price\").innerText);\n let storageCost = parseFloat(getElement(\"storage-price\").innerText);\n let deliveryCost = parseFloat(getElement(\"delivery-price\").innerText);\n let total = 1299 + memoryCost + storageCost + deliveryCost; /* total price sum */\n getElement(\"total-price\").innerText = total;\n getElement(\"grand-total-price\").innerText = total;\n}", "function price1(rentals)\n{\n for (var i = 0; i < rentals.length; i++) // Browze the table rentals\n {\n var time = getDays(rentals[i].pickupDate, rentals[i].returnDate); // time is the number of days of the renting\n\n rentals[i].price = (time * getPricePerDay(rentals[i].carId)) + (rentals[i].distance * getPricePerKm(rentals[i].carId));\n }\n}", "function calculateTaxesDue(price) {\n return (Number(price) / 10)\n}", "function calcLineItem(element,taxCalcMethod) {\r\n\r\n\t\t// first, we need to evaluate how/if tax will be calculated\r\n\t\tvar taxRateSelection = $('select[name=\"taxRateID\"]').val();\r\n\r\n\t\t/*\r\n\t\t\ttax setup for select to choose tax rate:\r\n\t\t\t-1 means that item is not taxable\r\n\t\t\t0 means that we are using a custom rate\r\n\t\t\tanything above 0 means it is the actula tax rate (1.25, 2.25, etc...)\r\n\t\t*/\r\n\r\n\t\tif (taxRateSelection == 0) {\r\n\t\t\t//custom rate, allow user to enter rate\r\n\t\t\t$('input[name=\"taxRate\"]').prop('readonly',false);\r\n\t\t} else if (taxRateSelection == -1) {\r\n\t\t\t// not taxable, reset\r\n\t\t\t$('input[name=\"taxRate\"]').prop('readonly',true);\r\n\t\t\t$('input[name=\"taxRate\"]').val('0.00');\r\n\t\t} else {\r\n\t\t\t// using a preset tax rate\r\n\t\t\tvar currTaxRate = $('select[name=\"taxRateID\"] option:selected').attr('data-taxRate');\r\n\t\t\tcurrTaxRate = parseFloat(currTaxRate).toFixed(3);\r\n\t\t\t$('input[name=\"taxRate\"]').prop('readonly',true);\r\n\t\t\t$('input[name=\"taxRate\"]').val(currTaxRate);\r\n\t\t}\r\n\r\n\r\n\t\t//GET QUANTITY\r\n\t\tif ( $(element).closest('#calculate-wrapper').find('.quantityInput').val() == '' || isNaN( $(element).closest('#calculate-wrapper').find('.quantityInput').val() ) ) {\r\n\t\t\tvar quantity = 0;\r\n\t\t} else {\r\n\t\t\tvar quantity = $(element).closest('#calculate-wrapper').find('.quantityInput').val();\r\n\t\t}\r\n\r\n\t\t//GET COST\r\n\t\tif ( $(element).closest('#calculate-wrapper').find('.costInput').val() == '' || isNaN( $(element).closest('#calculate-wrapper').find('.costInput').val() ) ) {\r\n\t\t\tvar cost = 0;\r\n\t\t} else {\r\n\t\t\tvar cost = $(element).closest('#calculate-wrapper').find('.costInput').val();\r\n\t\t}\r\n\r\n\t\t//GET MARKUP\r\n\t\tif ( $(element).closest('#calculate-wrapper').find('.markupInput').val() == '' || isNaN( $(element).closest('#calculate-wrapper').find('.markupInput').val() ) ) {\r\n\t\t\tvar markup = 0;\r\n\t\t} else {\r\n\t\t\tvar markup = $(element).closest('#calculate-wrapper').find('.markupInput').val()/100;\r\n\t\t}\r\n\r\n\t\t//GET SALES TAX\r\n\t\tif ( $(element).closest('#calculate-wrapper').find('.taxRateInput').val() == '' || isNaN( $(element).closest('#calculate-wrapper').find('.taxRateInput').val() ) ) {\r\n\t\t\tvar salesTax = 0;\r\n\t\t} else {\r\n\t\t\tvar salesTax = $(element).closest('#calculate-wrapper').find('.taxRateInput').val()/100;\r\n\t\t}\r\n\r\n\t\t//CALCULATE SUBTOTAL\r\n\t\tvar itemAmount = quantity * cost;\r\n\t\t$(element).closest('#calculate-wrapper').find('.calcItemAmount').html(itemAmount.toFixed(2));\r\n\r\n\t\t//CALCULATE ITEM TOTAL & SHOW MARKUP\r\n\t\tif (markup == 0 && salesTax == 0) {\r\n\t\t\tvar itemTotal = itemAmount;\r\n\t\t\t$(element).closest('#calculate-wrapper').find('.markupAmount').html('0.00');\r\n\t\t\t$(element).closest('#calculate-wrapper').find('.salesTaxAmount').html('0.00');\r\n\t\t} else if (markup != 0 && salesTax != 0) {\r\n\t\t\t\tvar markupAmount = itemAmount * markup;\r\n\t\t\t\t// swap tax calculation methods\r\n\t\t\t\tif (taxCalcMethod == 'before') {\r\n\t\t\t\t\tvar salesTaxAmount = itemAmount * salesTax;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar salesTaxAmount = (itemAmount + markupAmount) * salesTax;\r\n\t\t\t\t}\r\n\t\t\t\tvar itemTotal = itemAmount + markupAmount + salesTaxAmount;\r\n\t\t\t\t$(element).closest('#calculate-wrapper').find('.markupAmount').html(markupAmount.toFixed(2));\r\n\t\t\t\t$(element).closest('#calculate-wrapper').find('.salesTaxAmount').html((Math.round( salesTaxAmount * 100 ) / 100).toFixed(2));\r\n\t\t} else if (markup != 0 && salesTax == 0) {\r\n\t\t\t\tvar markupAmount = itemAmount * markup;\r\n\t\t\t\tvar itemTotal = itemAmount + markupAmount;\r\n\t\t\t\t$(element).closest('#calculate-wrapper').find('.markupAmount').html(markupAmount.toFixed(2));\r\n\t\t\t\t$(element).closest('#calculate-wrapper').find('.salesTaxAmount').html('0.00');\r\n\t\t} else if (markup == 0 && salesTax != 0) {\r\n\t\t\t\tvar salesTaxAmount = itemAmount * salesTax;\r\n\t\t\t\tvar itemTotal = itemAmount + salesTaxAmount;\r\n\t\t\t\t$(element).closest('#calculate-wrapper').find('.salesTaxAmount').html(salesTaxAmount.toFixed(2));\r\n\t\t\t\t$(element).closest('#calculate-wrapper').find('.markupAmount').html('0.00');\r\n\t\t}\r\n\r\n\t\t//DISPLAY ITEM TOTAL\r\n\t\t$(element).closest('#calculate-wrapper').find('.calcItemTotal').html(itemTotal.toFixed(2));\r\n\r\n\t}", "function updateInvoice() {\n var total = 0, cells, price, i;\n $(\"#item-details tr\").each( function(index, element) {\n cells = $(element).children().toArray();\n price = parseFloat($(cells[1]).text()) * parseFloat($(cells[2]).text());\n total += price;\n if (!isNaN(price)) {\n $(cells[3]).text(price);\n } else {\n $(cells[3]).text(0);\n }\n });\n if (!isNaN(total)) {\n $(\"#total-price\").text(total);\n }\n }", "function totalTaxCost(){\n\t\t\n\t\treturn totalPrice * taxPercentage;\n\t} // End totalTaxCost.", "function totale(price) {\n tot += price;\n }", "function calculPrice () {\n for (var i = 0; i < deliveries.length; i++) {\n for (var j = 0; j < truckers.length; j++) {\n if (deliveries[i].truckerId == truckers[j].id) {\n var pricePerKm = truckers[j].pricePerKm;\n var pricePerVolume = truckers[j].pricePerVolume;\n break;\n }\n }\n deliveries[i].price = deliveries[i].distance * pricePerKm + deliveries[i].volume * pricePerVolume * decreazingPrice(deliveries[i].volume);\n }\n}", "changePrice() {\n var parts = this.precio.toFixed(2).toString().split(\".\");\n var result = parts[0].replace(/\\B(?=(\\d{3})+(?=$))/g, \".\") + (parts[1] ? \",\" + parts[1] : \"\");\n return `$${result}`;\n }", "function _setTotalPrices(){\n \t\n \tconsole.log(\"---- _setTotalPrices INICIAL: \",$scope.local.priceAffiliate.perpersonPVPAgency);\n\n \t// ********************************************************\n \t// si es un tailormade, el importe total, viene en la quote\n \t// ******************************************************** \t \t\n \tif($scope.quote.code!==undefined){\n \t\t// ***********\n \t\t// 1) importes\n \t\t// ***********\n \t\t\n \t\t// 1.1) importes totales\n \t\t$scope.local.priceAffiliate.totalNetAgency = $scope.quote.amount.exchange.value;\n \t\t$scope.local.priceAffiliate.totalPVPAgency = $scope.quote.pvpAffiliate.exchange.value;\n \t\t\t\n \t\t$scope.local.priceAffiliate.a40NetAgency = $scope.local.priceAffiliate.totalNetAgency*$scope.local.firstPayPercent/100; \t\t\n \t$scope.local.priceAffiliate.a40PVPAgency = $scope.local.priceAffiliate.totalPVPAgency*$scope.local.firstPayPercent/100;\n \t\t\n $scope.local.priceAffiliate.dayNetAgency = Math.round(($scope.local.priceAffiliate.totalNetAgency/$scope.local.days)/$scope.local.pax.number);\n $scope.local.priceAffiliate.dayPVPAgency = Math.round(($scope.local.priceAffiliate.totalPVPAgency/$scope.local.days)/$scope.local.pax.number);\n \t\n \t\t// 1.2) importe neto DMC (total y divisa) \n $scope.booking.netPrice.value = $scope.quote.netPrice.value; \n \t\t$scope.booking.netPrice.currency = $scope.quote.netPrice.currency;\n \t\t$scope.booking.netPrice.exchange.value = $scope.quote.netPrice.exchange.value; \n \t\t$scope.booking.netPrice.exchange.currency = $scope.quote.netPrice.exchange.currency;\n \n // 1.3) importe neto agencia y divisa\n \t\t$scope.booking.amount.value = $scope.quote.amount.value;\n \t$scope.booking.amount.currency = $scope.quote.amount.currency;\n \t$scope.booking.amount.exchange.value = $scope.local.priceAffiliate.totalNetAgency;\n \t$scope.booking.amount.exchange.currency = $scope.quote.amount.exchange.currency;\n \t\n \t// 1.4) importe pvp affiliado\n \t$scope.booking.pvpAffiliate = {\t\t \t\t\t\n \t\t\t\"value\":0,\n \t\t\t\"currency\" : $scope.quote.amount.currency,\n \t\t\t\"exchange\" :{\n \t\t\t\t\"value\": $scope.local.priceAffiliate.totalPVPAgency,\n \t\t\t\t\"currency\": $scope.local.currency\n \t\t\t}\n \t\t};\t \n \t\t\n \t\t\t\n // ********************************************************************************************\t\n \t// 2) Desglose y porcentaje a pagar (40 o 100) (ya no, el desglose se muestra siempre del 100%)\n \t// ********************************************************************************************\n\t \tvar priceDetail = {};\n\t \t\t \t\n\t \t// si tiene un importe seleccionado (15% /100%)\n \t\tif ($scope.local.aumontSelected){\n\t\t\t\t$scope.booking.payStatus = [ \n\t\t\t\t\t{\n\t\t\t\t\t \"payment\" : $scope.local.aumontSelected,\n\t\t\t\t\t \"nextPaymentDate\" : $scope.local.datePayEnd\n\t\t\t\t\t}\n\t\t \t\t ];\n\t\t\t\t\n\t\t\t\t// si es un tailormade de grupos\n\t\t\t\tif($scope.query.group != null){\t\t\t\t\t\t\t\t\t\t\n\t\t \t\t$scope.local.toPay = $scope.local.priceAffiliate.totalPVPAgency;\n\t\t \t\tpriceDetail = {\n\t\t\t\t\t\t'fee': $scope.quote.fees.groups,\n\t\t\t\t\t\t'feeunit': $scope.feeunit,\n\t\t\t\t\t\t'price': {\n\t\t\t\t\t\t\t'net' : $scope.local.priceAffiliate.totalNetAgency,\n\t\t\t\t\t \t'pvp' : $scope.local.priceAffiliate.totalPVPAgency,\n\t\t\t\t\t \t'currency' : $scope.local.currency\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// si es un tailormade normal\n\t\t\t\telse{\t\t\t\t\t\t\t\t\t\t\n\t\t \t\t$scope.local.toPay = $scope.local.priceAffiliate.totalPVPAgency;\n\t\t \t\tpriceDetail = {\n\t\t\t\t\t\t'fee': $scope.quote.fees.tailormade,\n\t\t\t\t\t\t'feeunit': $scope.feeunit,\n\t\t\t\t\t\t'price': {\n\t\t\t\t\t\t\t'net' : $scope.local.priceAffiliate.totalNetAgency,\n\t\t\t\t\t \t'pvp' : $scope.local.priceAffiliate.totalPVPAgency,\n\t\t\t\t\t \t'currency' : $scope.local.currency\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} \t\t\n\n \t\t\n\t\t\t// actualizar el desglose\t \t\t\n \t\t$scope.priceDetail = priceDetail;\t\n \t\t\n \t\t// si es una booking de una quote, cargo los fees de la quote en la session\n \t\t$scope.local.affiliate.fees = $scope.quote.fees;\n \t\t\n \t\t$scope.booking.toConfirm = false;\n \t\t$scope.toConfirm = false;\n\t\t\t$scope.readyToPay = false;\t\t\t\n \t}\n \t\n\n \t\t\n \t\n \t\n \t// *******************************************************************************\n \t// si es un $scope.producto carga, el precio total viene por la distribucion seleccionada\n \t// *******************************************************************************\n \telse{\n\n\t \t//*********************************************************************************\n\t \t// si es afiliado, recalculo los totales porque seran netos agencias, a pvp agencias\n\t \t// OJO el precio si es afiliado ya esta en pvp agencia\n\t \t//*********************************************************************************\n\t \tif($scope.load.affiliate && $scope.load.affiliate==true){\n\t \t\t\n\t \t\t\t \t\t\n\t \t\t\n\t \t\t$scope.booking.priceperperson = angular.copy($scope.local.priceAffiliate.perpersonNetAgency);\n\t \t\t\t \t\t\n\t\t \t$scope.toConfirm = false;\n\t\t \t$scope.local.priceAffiliate.totalNetAgency = 0;\n\t\t \t$scope.local.priceAffiliate.totalPVPAgency = 0;\t\t \t\n\t\t \t\n\t\t \t\n\t\t \tconsole.log(\"$scope.local.priceAffiliate.perpersonPVPAgenc: \",$scope.local.priceAffiliate.perpersonPVPAgency);\n\t\t \t//doble\n\t\t \tif ($scope.local.pax.double){\t\t \t\t\n\t\t \t\t//neto agencia\n\t\t \t\tif ($scope.local.priceAffiliate.perpersonNetAgency.double){\n\t\t \t\t\t$scope.local.priceAffiliate.totalNetAgency = $scope.local.priceAffiliate.perpersonNetAgency.double * $scope.local.pax.double;\n\t\t \t\t} \n\t\t \t\telse {\n\t\t \t\t\t$scope.toConfirm = true;\n\t\t \t\t}\n\t\t \t\t//pvp agencia\n\t\t \t\tif ($scope.local.priceAffiliate.perpersonPVPAgency.double){\n\t\t \t\t\t$scope.local.priceAffiliate.totalPVPAgency = $scope.local.priceAffiliate.perpersonPVPAgency.double * $scope.local.pax.double;\n\t\t \t\t} \n\t\t \t\telse {\n\t\t \t\t\t$scope.toConfirm = true;\n\t\t \t\t}\n\t\t \t}\n\t\t \t\n\t\t \t//simple\n\t\t \tif ($scope.local.pax.single){\n\t\t \t\t\t\t \t\t\n\t\t \t\t//neto agencia\n\t\t \t\tif ($scope.local.priceAffiliate.perpersonNetAgency.single){\t\t \t\t\n\t\t \t\t\t$scope.local.priceAffiliate.totalNetAgency += $scope.local.priceAffiliate.perpersonNetAgency.single * $scope.local.pax.single;\n\t\t \t\t} else{\n\t\t \t\t\t$scope.toConfirm = true;\n\t\t \t\t}\n\t\t \t\t//pvp agencia\n\t\t \t\tif ($scope.local.priceAffiliate.perpersonPVPAgency.single){\t\t \t\t\t\n\t\t \t\t\t$scope.local.priceAffiliate.totalPVPAgency += $scope.local.priceAffiliate.perpersonPVPAgency.single * $scope.local.pax.single;\n\t\t \t\t} else{\n\t\t \t\t\t$scope.toConfirm = true;\n\t\t \t\t}\n\t\t \t}\n\t\t \t//triple\n\t\t \tif ($scope.local.pax.triple){\t\t \t\t\n\t\t \t\t// neto agencia\n\t\t \t\tif ($scope.local.priceAffiliate.perpersonNetAgency.triple){\n\t\t \t\t\t$scope.local.priceAffiliate.totalNetAgency += $scope.local.priceAffiliate.perpersonNetAgency.triple * $scope.local.pax.triple;\n\t\t \t\t} else {\n\t\t \t\t\t$scope.toConfirm = true;\n\t\t \t\t}\n\t\t \t\t// pvp agencia\n\t\t \t\tif ($scope.local.priceAffiliate.perpersonPVPAgency.triple){\n\t\t \t\t\t$scope.local.priceAffiliate.totalPVPAgency += $scope.local.priceAffiliate.perpersonPVPAgency.triple * $scope.local.pax.triple;\n\t\t \t\t} else {\n\t\t \t\t\t$scope.toConfirm = true;\n\t\t \t\t}\n\t\t \t}\n\t\t \n\t\t \t//precio del primer pago\n\t\t \t$scope.local.priceAffiliate.a40NetAgency = $scope.local.priceAffiliate.totalNetAgency * $scope.local.firstPayPercent/100;\n\t\t \t$scope.local.priceAffiliate.a40PVPAgency = $scope.local.priceAffiliate.totalPVPAgency * $scope.local.firstPayPercent/100;\n\t\t \t\n\t\t \t// precio dia\n\t\t \t$scope.local.priceAffiliate.dayNetAgency = Math.round(($scope.local.priceAffiliate.totalNetAgency / $scope.local.days) / $scope.local.pax.number);\n\t\t \t$scope.local.priceAffiliate.dayPVPAgency = Math.round(($scope.local.priceAffiliate.totalPVPAgency / $scope.local.days) / $scope.local.pax.number);\n\t\t\n\t\t \t//en el total de la booking guardaremos el neto agencia, dejando vacio el neto y comision (se rellenaran en la api)\n\t\t \t$scope.booking.amount.exchange.value = $scope.local.priceAffiliate.totalNetAgency;\n\t\t \t\n\t\t \t// setear el total pvpaffiliado\n\t\t \t$scope.booking.pvpAffiliate = {\t\t \t\t\t\n \t\t\t\t\"value\":0,\n \t\t\t\t\"currency\" : $scope.product.dmc.currency,\n \t\t\t\t\"exchange\" :{\n \t\t\t\t\t\"value\": $scope.local.priceAffiliate.totalPVPAgency,\n \t\t\t\t\t\"currency\": $scope.local.currency\n \t\t\t\t}\n \t\t\t};\t \t\t\t\n\t\t \t\n\t\t\t\t\n\t\t \tvar priceDetail = {};\t\t\n\n\t\t \t\n\t\t \t// setear el porcentaje de pago y total a pagar\n\t\t \tif ($scope.local.aumontSelected){\n\t\t\t\t\t$scope.booking.payStatus = [ \n\t\t\t\t\t\t{\n\t\t\t\t\t\t \"payment\" : $scope.local.aumontSelected,\n\t\t\t\t\t\t \"nextPaymentDate\" : $scope.local.datePayEnd\n\t\t\t\t\t\t}\n\t\t\t \t\t ];\n\t\t\t\t\t\n\n\t\t \t\t$scope.local.toPay = $scope.local.priceAffiliate.totalPVPAgency;\t\t \t\t\n\t\t \t\tpriceDetail = {\n\t\t\t\t\t\t'fee': $scope.local.affiliate.fees.unique,\n\t\t\t\t\t\t'feeunit': $scope.feeunit,\n\t\t\t\t\t\t'price': {\n\t\t\t\t\t\t\t'net' : $scope.local.priceAffiliate.totalNetAgency,\n\t\t\t\t\t \t'pvp' : Math.round($scope.local.priceAffiliate.totalPVPAgency),\n\t\t\t\t\t \t'currency' : $scope.local.currency\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\t \t\t\n\t\t\t\t// actualizar el desglose\t \t\t\n\t \t\t$scope.priceDetail = priceDetail;\n\t \t}\n\t \t\n\t \t// **************\n\t \t// es un traveler\n\t \t// **************\n\t \telse{\n\t \t\t$scope.booking.priceperperson = angular.copy($scope.local.price.perperson);\n\t\t \t$scope.toConfirm = false;\n\t\t \t$scope.local.price.total = 0;\n\t\t \tif (debug)\n\t\t \t\t$log.log ('$scope.local.price. ',$scope.local.price);\n\t\t \tif ($scope.local.pax.double){\n\t\t \t\tif ($scope.local.price.perperson.double){\n\t\t \t\t\t$scope.local.price.total = $scope.local.price.perperson.double*$scope.local.pax.double;\n\t\t \t\t} else {\n\t\t \t\t\t$scope.toConfirm = true;\n\t\t \t\t}\n\t\t \t}\n\t\t \tif ($scope.local.pax.single){ \t\t\n\t\t \t\tif ($scope.local.price.perperson.single){\n\t\t \t\t\t$scope.local.price.total = $scope.local.price.total+($scope.local.price.perperson.single*$scope.local.pax.single);\n\t\t \t\t} else{\n\t\t \t\t\t$scope.toConfirm = true;\n\t\t \t\t}\n\t\t \t}\n\t\t \tif ($scope.local.pax.triple){\n\t\t \t\tif ($scope.local.price.perperson.triple){\n\t\t \t\t\t$scope.local.price.total = $scope.local.price.total+($scope.local.price.perperson.triple*$scope.local.pax.triple);\n\t\t \t\t} else {\n\t\t \t\t\t$scope.toConfirm = true;\n\t\t \t\t}\n\t\t \t}\n\t\t \t$scope.local.price.a40 = $scope.local.price.total*$scope.local.firstPayPercent/100;\n\t\t\n\t\t \t$scope.local.price.day = Math.round(($scope.local.price.total/$scope.local.days)/$scope.local.pax.number);\n\t\t\n\t\t \t$scope.booking.amount.exchange.value = $scope.local.price.total;\n\t\t\t\t\n\t\t\t\t$scope.booking.netPrice.exchange.value = $scope.local.price.total-($scope.local.price.total * ($scope.booking.comission/100));\n\t\t\n\t\t \tif ($scope.local.aumontSelected){\n\t\t\t\t\t$scope.booking.payStatus = [ \n\t\t\t\t\t\t{\n\t\t\t\t\t\t \"payment\" : $scope.local.aumontSelected,\n\t\t\t\t\t\t \"nextPaymentDate\" : $scope.local.datePayEnd\n\t\t\t\t\t\t}\n\t\t\t \t\t ];\n\t\t\t \t\tif($scope.local.aumontSelected == 100){\n\t\t\t \t\t$scope.local.toPay = $scope.local.price.total;\n\t\t\t \t} else{\n\t\t\t \t\t$scope.local.toPay = $scope.local.price.a40;\n\t\t\t \t}\n\t\t\t\t}\n\t \t}\n\t \t\n\t \t\n//\t \t// ********************************************************************************************************************************************\n// \t// si es una booking de un presupuesto, compruebo que el importe actual del producto no supere al del presupuesto, si es asi muestro una alerta\n// \t// ********************************************************************************************************************************************\n// \t\tif($scope.budget != null && $scope.budget.idBooking != null){\n// \t\t\tconsole.log(\"--- pvp calendario: \",$scope.booking.pvpAffiliate.exchange.value);\n// \t\t\tconsole.log(\"--- pvp presupuesto: \",$scope.budget.pvpAffiliate.exchange.value);\n// \t\t\t\n// \t\t\tif($scope.booking.pvpAffiliate.exchange.value != $scope.budget.pvpAffiliate.exchange.value ){\n// \t\t\t\ttoaster.pop('warning', 'El programa ha sufrido alguna modificación desde la fecha en que generaste el presupuesto.', 'Por favor revisa los detalles del mismo de nuevo.',6000);\n// \t\t\t}\n// \t\t\t\n// \t\t\t\n//// \t\t\t $scope.openNotify = function () {\n//// \t var dialog = ngDialog.open({\n//// \t template:\n//// \t '<p>You can do whatever you want when I close, however that happens.</p>' +\n//// \t '<div class=\"ngdialog-buttons\"><button type=\"button\" class=\"ngdialog-button ngdialog-button-primary\" ng-click=\"closeThisDialog(1)\">Close Me</button></div>',\n//// \t plain: true\n//// \t });\n//// \t dialog.closePromise.then(function (data) {\n//// \t console.log('ngDialog closed' + (data.value === 1 ? ' using the button' : '') + ' and notified by promise: ' + data.id);\n//// \t });\n//// \t };\n// \t\t} \t\n \t\t\n\t \t\n\t\t\t$scope.booking.toConfirm = $scope.toConfirm;\n\t\t\t$scope.booking.amount.exchange.currency = $scope.local.currency;\n\t\t\t$scope.booking.netPrice.exchange.currency = $scope.local.currency;\n\t\t\t\n\t\t\t$scope.readyToPay = false;\t\t\t\n\t\t\t\n \t}\n\t}", "function itemSum(amountId,rateId,itemId,qtyId,discountAmountId,taxAmountId,sharedSumClass,overallSumId,foreignCurrId,defaultCurrPage,ratePage,taxSharedClass,discountSharedClass,totalTax,totalDiscount,vendorCustId,postDateId,taxPerctId,discountPerctId){\n\n emptyOneTimeTaxDiscount(overallSumId);\n \n if(event.target.id == qtyId){\n\n //BEGINING\n var pickedVal = $('#'+itemId).val();\n\n\n if(pickedVal != ''){\n $.ajax({\n url: ratePage+'?itemId='+pickedVal\n }).done(function(data){\n var result = data.rate;\n var qty = $('#'+qtyId);\n var qtyVal = qty.val();\n var rateGet = $('#'+rateId);\n\n //rateGet.val(result*qtyVal);\n\n var amount = $('#'+amountId);\n //var rate = data.rate;\n var rate = rateGet.val();\n\n var item = $('#'+itemId).val();\n var discount = $('#'+discountAmountId);\n var tax = $('#'+taxAmountId);\n var discountPerct = $('#'+discountPerctId);\n var taxPerct = $('#'+taxPerctId);\n\n var qtyVal = (qty.val() != '') ? qty.val() : 0;\n var real_amount = qtyVal*rate;\n\n var discountVal = (discount.val() != '') ? discount.val() : 0;\n var discountPerctVal = (discountPerct.val() != '') ?(discountPerct.val()/100)*real_amount : 0;\n var discountA = (discountPerct.val() != '') ? discountPerctVal : discountVal ;\n var taxVal = (tax.val() != '') ? tax.val() : 0;\n var amountToTax = real_amount - discountA;\n var taxPerctVal = (taxPerct.val() != '') ? (taxPerct.val()/100)*amountToTax : 0;\n var taxA = (taxPerct.val() == '') ? taxVal: taxPerctVal ;\n discount.val(decPoints(discountA,2));\n tax.val(decPoints(taxA,2));\n\n\n\n var new_amount = (parseFloat(real_amount)-discountA) + parseFloat(taxA);\n amount.val(decPoints(new_amount,2));\n var sumToArray = classToArray(sharedSumClass);\n var sumArray = sumArrayItems(sumToArray);\n $('#'+overallSumId).val(decPoints(sumArray,2));\n\n //ALWAYS GET SUM OF ALL TAXES AND ALLOWANCES AND DISPLAY THEIR AMOUNTS IN TOTAL DISCOUNTS AND TAXES\n var totalDiscountGet = $('#'+totalDiscount);\n var totalTaxGet = $('#'+totalTax);\n var sumToArrayTax = classToArray(taxSharedClass);\n var sumArrayTax = sumArrayItems(sumToArrayTax);\n var sumToArrayDiscount = classToArray(discountSharedClass);\n var sumArrayDiscount = sumArrayItems(sumToArrayDiscount);\n totalDiscountGet.val(decPoints(sumArrayDiscount,2));\n totalTaxGet.val(decPoints(sumArrayTax,2));\n exclTax(overallSumId,totalTax,'excl_'+overallSumId);\n convertToDefaultCurr(foreignCurrId,overallSumId,defaultCurrPage,vendorCustId,postDateId)\n\n });\n }else{\n swal(\"Warning!\", 'Please Select an item and enter quantity to continue', \"warning\");\n $('#'+itemId).val('')\n }\n \n //END\n\n }else{\n\n //BEGINING\n var amount = $('#'+amountId);\n var rateGet = $('#'+rateId);\n var rate = rateGet.val();\n var item = $('#'+itemId).val();\n var discount = $('#'+discountAmountId);\n var discountPerct = $('#'+discountPerctId);\n var tax = $('#'+taxAmountId);\n var taxPerct = $('#'+taxPerctId);\n var qty = $('#'+qtyId);\n\n var qtyVal = (qty.val() != '') ? qty.val() : 0;\n var real_amount = qtyVal*rate;\n\n var discountVal = (discount.val() != '') ? discount.val() : 0;\n var discountPerctVal = (discountPerct.val() != '') ?(discountPerct.val()/100)*real_amount : 0;\n var discountA = (discountPerct.val() == '') ? discountVal: discountPerctVal ;\n var taxVal = (tax.val() != '') ? tax.val() : 0;\n var amountToTax = real_amount - discountA;\n var taxPerctVal = (taxPerct.val() != '') ? (taxPerct.val()/100)*amountToTax : 0;\n var taxA = (taxPerct.val() == '') ? taxVal: taxPerctVal ;\n discount.val(decPoints(discountA,2));\n tax.val(decPoints(taxA,2));\n \n\n if(rate != '' && item != ''){\n //var real_amount = (event.target.id == qtyId) ? rate : qtyVal*rate;\n var new_amount = (real_amount-discountA)+parseFloat(taxA);\n amount.val(decPoints(new_amount,2));\n var sumToArray = classToArray(sharedSumClass);\n var sumArray = sumArrayItems(sumToArray);\n $('#'+overallSumId).val(decPoints(sumArray,2));\n\n //ALWAYS GET SUM OF ALL TAXES AND ALLOWANCES AND DISPLAY THEIR AMOUNTS IN TOTAL DISCOUNTS AND TAXES\n var totalDiscountGet = $('#'+totalDiscount);\n var totalTaxGet = $('#'+totalTax);\n var sumToArrayTax = classToArray(taxSharedClass);\n var sumArrayTax = sumArrayItems(sumToArrayTax);\n var sumToArrayDiscount = classToArray(discountSharedClass);\n var sumArrayDiscount = sumArrayItems(sumToArrayDiscount);\n totalDiscountGet.val(decPoints(sumArrayDiscount,2));\n totalTaxGet.val(decPoints(sumArrayTax,2));\n exclTax(overallSumId,totalTax,'excl_'+overallSumId);\n convertToDefaultCurr(foreignCurrId,overallSumId,defaultCurrPage,vendorCustId,postDateId);\n\n }else{\n swal(\"Warning!\", 'Please Select an item and enter quantity to continue', \"warning\");\n }\n // END\n\n }\n\n }", "function updateCurrentPrice(){\r\n shoppingCart.currentPrice = 0;\r\n\r\n // We iterate over shopping cart object keys in order to calculate the current price\r\n Object.keys(shoppingCart).forEach((key) => {\r\n if(key !== 'currentPrice'){\r\n shoppingCart.currentPrice += shoppingCart[key].quantity * shoppingCart[key].price;\r\n }\r\n });\r\n\r\n // We update the value on the HTML and prevent float comma\r\n document.querySelector('.current-price').innerHTML = Math.round(shoppingCart.currentPrice * 100 + Number.EPSILON ) / 100;\r\n}", "function price2(rentals)\n{\n for (var i = 0; i < rentals.length; i++)\n {\n var time = getDays(rentals[i].pickupDate, rentals[i].returnDate);\n\n if (time < 1)\n {\n rentals[i].price = (time * getPricePerDay(rentals[i].carId)) + (rentals[i].distance * getPricePerKm(rentals[i].carId));\n }\n if (time >= 1 && time < 4)\n {\n rentals[i].price = (time * getPricePerDay(rentals[i].carId) * 0.9) + (rentals[i].distance * getPricePerKm(rentals[i].carId));\n }\n if (time >= 4 && time < 10)\n {\n rentals[i].price = (time * getPricePerDay(rentals[i].carId) * 0.7) + (rentals[i].distance * getPricePerKm(rentals[i].carId));\n }\n if (time >= 10)\n {\n rentals[i].price = (time * getPricePerDay(rentals[i].carId) * 0.5) + (rentals[i].distance * getPricePerKm(rentals[i].carId));\n }\n }\n}", "function applyDiscountPrice() {\n rentals.forEach(element => {\n var returnDate = new Date(element.returnDate);\n var pickup = new Date(element.pickupDate)\n var duration = parseInt(dayDiff(pickup, returnDate)) + 1;\n if (duration <= 1)\n element.price *= 1\n else if (duration > 1 && duration <= 4)\n element.price *= 0.9\n else if (duration > 4 && duration <= 10)\n element.price *= 0.7\n else\n element.price *= 0.5\n });\n}" ]
[ "0.7855273", "0.7843759", "0.73156786", "0.7306113", "0.72632635", "0.72504747", "0.71966815", "0.71951973", "0.71951973", "0.7086096", "0.70790136", "0.69795007", "0.69440544", "0.69350934", "0.69294333", "0.6925785", "0.6900987", "0.68869215", "0.68861145", "0.68541396", "0.6840941", "0.6834077", "0.6833612", "0.680839", "0.6799287", "0.6783582", "0.6748348", "0.6739443", "0.6733757", "0.67050296", "0.669568", "0.6667666", "0.66646755", "0.66429967", "0.66421247", "0.6633738", "0.6631198", "0.6625226", "0.66165847", "0.6614658", "0.6612747", "0.65937537", "0.659351", "0.6592562", "0.6580949", "0.65750164", "0.6571985", "0.6569848", "0.65650684", "0.65519357", "0.6538949", "0.65274966", "0.6525043", "0.65141493", "0.6510144", "0.6502269", "0.6498269", "0.6498088", "0.6491908", "0.6491438", "0.6484779", "0.64735234", "0.6473312", "0.6460776", "0.6456002", "0.64556545", "0.6449802", "0.64494956", "0.644814", "0.6447239", "0.64429307", "0.64386886", "0.6437756", "0.6432169", "0.64286464", "0.64272714", "0.64250004", "0.64239544", "0.64026505", "0.6399043", "0.6394048", "0.63929355", "0.63829005", "0.63796526", "0.6368673", "0.6367513", "0.6364916", "0.635276", "0.63512284", "0.63479507", "0.634574", "0.63390696", "0.6336937", "0.63362074", "0.63290644", "0.6328236", "0.63276374", "0.63272005", "0.6326772", "0.6321899" ]
0.6752837
26
so finally at the end of them all we can just return object dot assign
function applyTaxToItems(user){ const {cart} = user; const taxRate = 1.3; const updatedCart = cart.map(item => { return { name: item.name, price: item.price*taxRate } }) return Object.assign({}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obj(objec){\nreturn objec;\n}", "function ontoAnObject() {\n const array = [1, 2, 3, 4, 5, 6];\n const object = {};\n // refactor the lines below\n // object.one = array[0];\n // object.two = array[1];\n // object.three = array[2];\n // object.rest = array.slice(3);\n // YOUR CODE STARTS HERE\n [object.one, object.two, object.three, ...object.rest] = array;\n console.group(\"ontoAnObject();\");\n console.log(\"return object; \");\n return object;\n}", "function $o(){return $o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$o.apply(this,arguments)}", "function obj() { return this; }", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n console.log(merged);\n return merged;\n}", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n console.log(merged);\n return merged;\n}", "function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}", "function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}", "static _assignValue(path, value, object) {\n object = object || ApplicationState._state;\n\n const nodes = ApplicationState.walk(path);\n\n for (let index = 0; index < nodes.length; index++) {\n const node = nodes[index];\n switch (node.type) {\n case 'object':\n if (typeof object[node.name] === 'undefined') {\n object[node.name] = {};\n }\n object = object[node.name];\n break;\n case 'array':\n if (typeof object[node.name] === 'undefined') {\n object[node.name] = [];\n }\n object = object[node.name];\n break;\n case 'leaf':\n return object[node.name] = value;\n break;\n }\n }\n\n throw Error(\"We should have returned after setting the value.\");\n }", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n return merged;\n}", "function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}", "function foo() {\n return { a:1, b:2, c:3,\n d: {\n e: 4 // 'e' variable assigned to value of 4.\n }\n };\n}", "objd(obj) {\n\n return toObject(obj);\n }", "function foo() {\n return { a:1, b:2, c:3};\n}", "function foo() {\n return { a:1, b:2, c:3};\n}", "function constObjects() {\n const name = {\n person: \"reefath\"\n }\n \n name.person = \"tesla\"\n \n return name.person;\n}", "function returnObject(a) {\n return {// The object\n val: a\n };\n}", "function Obj(){ return Literal.apply(this,arguments) }", "function oc(){return oc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oc.apply(this,arguments)}", "function mC(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "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 Rn(){return Rn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Rn.apply(this,arguments)}", "export() {\n const obj = {\n key: this.key,\n i: this.i,\n d: this.d,\n strings: []\n }\n\n for (let i = 0; i < this.strings.length; i++) {\n let string = []\n for (let j = 0; j < this.strings[i].length; j++) {\n let note = Object.assign({}, this.strings[i][j])\n\n string.push(note)\n }\n\n obj.strings.push(string)\n }\n\n return obj\n }", "function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}", "function o(){return(o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}", "get object() {\n\n }", "function toObject(Ye){if(null==Ye)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(Ye)}", "function va(t){if(null==t)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}", "function setIn(obj,path,value){var res=clone(obj);// this keeps inheritance when obj is a class\nvar resVal=res;var i=0;var pathArray=toPath(path);for(;i<pathArray.length-1;i++){var currentPath=pathArray[i];var currentObj=getIn(obj,pathArray.slice(0,i+1));if(currentObj&&(isObject$2(currentObj)||Array.isArray(currentObj))){resVal=resVal[currentPath]=clone(currentObj);}else {var nextPath=pathArray[i+1];resVal=resVal[currentPath]=isInteger(nextPath)&&Number(nextPath)>=0?[]:{};}}// Return original object if new value is the same as current\nif((i===0?obj:resVal)[pathArray[i]]===value){return obj;}if(value===undefined){delete resVal[pathArray[i]];}else {resVal[pathArray[i]]=value;}// If the path array has a single element, the loop did not run.\n// Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\nif(i===0&&value===undefined){delete res[pathArray[i]];}return res;}", "function manipulationBareObj( value ) {\n\treturn value;\n}", "function Y(){var e=a();return this.copyTo(e),e}", "function factory1() {\r\n return Object.assign({}, obj2)\r\n}", "function X(){return(X=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}", "function Obj()\r\n{\r\n return {\r\n name: 'hamza',\r\n lastName : 'mubeen'\r\n }\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 }", "fromObj(noodle, obj, noodleExp = noodle.expr.defaultNoodle(noodle, obj)) {\n return noodle.expr.new(\n noodle, //noodle\n function (noodle, obj) { //func\n return obj;\n },\n [],\n obj, //ans\n noodleExp, //noodleExp\n noodle.expr.done //state\n );\n }", "function t(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function t(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function s(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "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 an(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function makeObj() {\n return {\n propA: 10,\n propB: 20,\n };\n}", "function o1() {\n try {\nfor(var o2 = 0; o2 < o0.length; o2++){\n var o3 = o0[o2];\n try {\no3[0] = {};\n}catch(e){}\n }\n}catch(e){}\n}", "function _assign () {\n\t var args = [].slice.call(arguments).filter(function (i) { return i })\n\t var dest = args.shift()\n\t args.forEach(function (src) {\n\t Object.keys(src).forEach(function (key) {\n\t dest[key] = src[key]\n\t })\n\t })\n\t\n\t return dest\n\t}", "function _assign () {\n\t var args = [].slice.call(arguments).filter(function (i) { return i })\n\t var dest = args.shift()\n\t args.forEach(function (src) {\n\t Object.keys(src).forEach(function (key) {\n\t dest[key] = src[key]\n\t })\n\t })\n\t\n\t return dest\n\t}", "function v37() {\n function v11() {\n function a() {\n }\n function v6() {\n a.prototype = this;\n var c = new a;\n return c\n }\n var v203 = {extend:v6};\n return v203\n }\n var ret = {};\n ret.A = v11();\n ret.B = ret.A.extend();\n return ret;\n}", "function test(o0)\n{\n try {\no621.o630 = 1;\n}catch(e){}\n}", "function a(){return(a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}", "function assign$1($){for(var k=1;k<arguments.length;k++){var V=arguments[k];for(var z in V)$[z]=V[z]}return $}", "function dc(){return dc=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},dc.apply(this,arguments)}", "function returnNewNinja() {\n return {};\n}", "function E(){return(E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}", "function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e}).apply(this,arguments)}", "function pr(n){if(n===null||n===undefined)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(n)}", "function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}", "function Jr(){return Jr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jr.apply(this,arguments)}", "obtain(){}", "function objectAssign(obj1,obj2){\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n}", "function a$c(r,s)\n{\n this.a$a = r;\n this.a$b = s; \n return this;\n}", "function a$c(r,s)\n{\n this.a$a = r;\n this.a$b = s; \n return this;\n}", "static foo (a) { return { ...a, b: 2 } }", "function fnc_get_obj_assign (ia_columns, ia_values) {\n\tvar obj = {};\n\t//var pa_results = [];\n\t\n\t//obj = {};\n\tfor (var b = 0; b < ia_columns.length; b++) {\n\t\tObject.assign(obj, {[$.trim(ia_columns[b])]: $.trim(ia_values[b])});\n\t}\n\n\t//ia_insert.push(obj);\n\t//console.log(ia_insert);\n\t//console.log(obj);\n\t\n\treturn obj;\n}", "function a ()\n{\n\treturn\n\t{\n\t\tname:\"Ellie\"\n\t};\n}", "function assign(path, obj, root) {\n var levels = path.split('.');\n var objName = levels.splice(levels.length - 1, 1)[0];\n var pkg = levels.join('.');\n var pkgObj = null;\n\n // Default to the module's global root.\n root = root || global;\n\n pkgObj = definePkg(pkg, root);\n pkgObj[objName] = obj;\n\n cache[path] = obj;\n\n return obj;\n }", "function Obj() {}", "function ce(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "copy() {\n return Object.assign(Object.create(this), JSON.parse(JSON.stringify(this)))\n }", "set(index, object) {\n return object;\n }", "function cumpleanosClonandoObjeto(persona){\n return {\n ...persona,\n edad: persona.edad += 1\n }\n}", "function goo() {\n return {\n a: 1,\n b: 2,\n c: 3\n }\n}", "function A(){return(A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}", "function createAnother(original){\n var clone = object(original); //create a new object by calling a function\n clone.sayHi = function(){ //augment the object in some way\n alert(\"hi\");\n };\n return clone; //return the object\n}", "evalOrSetObjectOnScope(item, newValue) {\n\t\tlet $currentScope = '';\n\t\tlet objOnScope = '';\n\t\tlet value = '';\n\t\t// The following is to allow set the model itself\n\t\tlet lastLabel = '';\n\t\tlet lastObject = '';\n\n\t\tlet count = 0;\n\t\tfor (const obj of item.parameters) {\n\t\t\tlet label = '';\n\t\t\tif (obj.syntax === 'function') {\n\t\t\t\tlabel = obj.label;\n\t\t\t} else if (obj.syntax === 'dictNode'){\n\t\t\t\tlabel = this.recursiveEval(obj.parameters);\n\t\t\t} else {\n\t\t\t\tif (obj.syntax !== 'anonymousFunc') {\n\t\t\t\t\tconsole.log('NOT FUNCTION or DICTNODE!', obj);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (count === 0) {\n\t\t\t\t$currentScope = this.getObjScope(label);\n\t\t\t\tlastObject = $currentScope;\n\t\t\t\tcount = 1;\n\t\t\t} else if ($currentScope === '') {\n\t\t\t\treturn undefined;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Build the dict object\n\t\t\tif (obj.syntax !== 'anonymousFunc') {\n\t\t\t\tif (objOnScope === '' && $currentScope) {\n\t\t\t\t\t// first node of dict\n\t\t\t\t\tobjOnScope = $currentScope[label];\n\t\t\t\t} else {\n\t\t\t\t\tif (!objOnScope) {\n\t\t\t\t\t\treturn objOnScope;\n\t\t\t\t\t}\n\t\t\t\t\t// other nodes of dict\n\t\t\t\t\tobjOnScope = objOnScope[label];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (obj.syntax === 'function' || obj.syntax === 'anonymousFunc') {\n\t\t\t\tconst args = [];\n\t\t\t\tfor (const param of obj.parameters[0].expression_nodes) {\n\t\t\t\t\targs.push(this.recursiveEval([{expression_nodes: [param]}]));\n\t\t\t\t}\n\t\t\t\t// This allow call multiple anonymous functions\n\t\t\t\tvalue = objOnScope.apply($currentScope || null, args);\n\t\t\t\tobjOnScope = value;\n\t\t\t}\n\t\t\tlastLabel = label;\n\t\t\tif (typeof objOnScope === 'object') {\n\t\t\t\tlastObject = objOnScope;\n\t\t\t}\n\t\t}\n\t\tif (objOnScope !== '') {\n\t\t\tvalue = objOnScope;\n\t\t\tobjOnScope = '';\n\t\t}\n\t\t// Change/set the model on scope\n\t\tif (newValue !== undefined) {\n\t\t\tlastObject[lastLabel] = newValue;\n\t\t}\n\t\treturn value;\n\t}", "function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},i.apply(this,arguments)}", "function Zh(a){a.e||(a.e=new Xh);return a.e}", "function i(){return i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i.apply(this,arguments)}", "function Person3(name, age, job) {\n\n // create the object to return\n var o = new Object();\n\n o.age = age; // notice no this, assign to object\n o.job = job; // notice no this,assign to object\n\n // attach methods\n o.sayName = function() {\n }\n return name; // notice no this, assign to object\n\n // return object\n return o;\n}", "function objectAssign(target, source) {\n for (var i = 0, keys = Object.keys(source); i < keys.length; i++) {\n target[keys[i]] = source[keys[i]];\n }\n return target;\n }", "function xc(){return xc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xc.apply(this,arguments)}", "function g(o) {\n return {a : o, b: 42, c: o};\n}", "function ct(t){if(null==t)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}", "function pv(){return pv=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},pv.apply(this,arguments)}", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=void 0}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function t(e){if(null===e||e===void 0)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function dAssign222(result, curr) {\n\t//console.log(arr)\n\tconsole.log(Reflect.ownKeys(curr).length)\n\t/*for (let i=0; i<Object.keys(curr).length; i++) {\n\t\tresult[Object.keys(curr)[i]] = curr[Object.keys(curr)[i]]\n\t}\t*/\t\n\tReflect.ownKeys(curr).forEach()\n\tconsole.log(Reflect.ownKeys(curr))\n\t//console.log(result)\n\treturn result\n}", "function t(e){if(null===e||void 0===e)throw new TypeError('Object.assign cannot be called with null or undefined');return Object(e)}", "function foo1() {\n\treturn {\n\t\tbar: \"hello\"\n\t};\n}", "chain (_) {\n return this \n }", "function x(){this.a={}}", "function x(){this.a={}}", "function x(){this.a={}}", "function foo1()\n{\n return {\n bar: \"hello\"\n };\n}", "function foo1()\n{\n return {\n bar: \"hello\"\n };\n}" ]
[ "0.6088852", "0.60120404", "0.5883428", "0.5862965", "0.58536214", "0.58536214", "0.5761726", "0.57505476", "0.57468826", "0.57223874", "0.5696513", "0.56879425", "0.56760484", "0.5672575", "0.5672575", "0.5669267", "0.5667347", "0.5663948", "0.5661943", "0.56537354", "0.5623139", "0.56129944", "0.56065273", "0.5592921", "0.5577964", "0.55729645", "0.5572328", "0.55384636", "0.55205387", "0.55139154", "0.55093074", "0.5501342", "0.55010307", "0.54878014", "0.54800475", "0.54800206", "0.5466249", "0.5466249", "0.5465349", "0.54608834", "0.54294175", "0.5425698", "0.5422527", "0.54124665", "0.54124665", "0.5373242", "0.5370556", "0.53554356", "0.5350456", "0.5347323", "0.53471816", "0.5347161", "0.53470975", "0.5342243", "0.5341489", "0.5334527", "0.5333816", "0.5328214", "0.53270346", "0.53270346", "0.5324226", "0.5315541", "0.53124017", "0.5310727", "0.53042525", "0.5301227", "0.52964693", "0.52774554", "0.5271394", "0.52705485", "0.5269434", "0.526551", "0.52654624", "0.5256613", "0.5253647", "0.5251449", "0.5249586", "0.5243525", "0.52433074", "0.5241708", "0.5238167", "0.5237163", "0.5236552", "0.52360654", "0.52360654", "0.52360654", "0.52360654", "0.52360654", "0.52360654", "0.52360654", "0.52360654", "0.52360654", "0.5233449", "0.5226582", "0.52152264", "0.5211178", "0.52074766", "0.52074766", "0.52074766", "0.5203876", "0.5203876" ]
0.0
-1
rememeber we wanna return return the user but a new copy of the user with the updated information that has the cart updated cart
function applyTaxToItems(user){ const {cart} = user; const taxRate = 1.3; const updatedCart = cart.map(item => { return { name: item.name, price: item.price*taxRate } }) return Object.assign({}, user, { cart: updatedCart }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async updateCart_Of_User(){\n }", "function addItemToCart(user, items){\n let updateCart = user.cart.concat(items);\n // NOTE: data is userClone = Object.assign({}, user , {cart: updateCart})\n return Object.assign({}, user , {cart: updateCart}) \n }", "function addItemToCart(user, item){\n // DON'T PLAY WITH THE EXISTING USER OBJECT ALWAYS CREATE A NEW OBJECT ... NO SIDE EFFECTS ....\n const updatedCart = user.cart.concat(item);\n return Object.assign({}, user, { cart: updatedCart });\n}", "function addTax(user){\n let updateCart = user.cart.map(item => {\n return{\n name: item.name,\n price: item.price * 1.03\n } \n });\n return Object.assign({}, user , {cart: updateCart})\n }", "function setCartUser() {\n userCart.forEach(\n (item) =>\n !filteredCartUser.filter(\n (cart) =>\n (cart.item.name === item.item.name) &\n (cart.item.size === item.item.size)\n ).length > 0 && filteredCartUser.push(item)\n );\n\n filteredCartUser.forEach((item) =>\n cartNewUser.push(\n userCart.filter(\n (i) =>\n (i.item.name === item.item.name) & (i.item.size === item.item.size)\n )\n )\n );\n }", "function buyItem(user){\n return Object.assign({}, user, { purchases: user.cart })\n}", "function addItemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n return Object.assign({}, )\n}", "function addItemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n return Object.assign()\n}", "function buyItem(user) {\n return {\n ...user,\n purchases: [...user.cart]\n };\n}", "function addItemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n return Object.assign({}, user, { cart: updateCart })\n}", "function addItemToCart(user, item) {\n const updatedCart = user.cart.concat(item)\n return Object.assign({}, user, {cart : updatedCart})\n}", "function buyItem(user){\n amazonHistory.push(user)\n return Object.assign({}, user, { purchases: user.cart })\n}", "function addItemToCart(user, item) {\n amazonHistory.push(user)\n const updateCart = user.cart.concat(item)\n return Object.assign({}, user, { cart: updateCart })\n}", "function buyItem(user){\n return Object.assign({}, user, )\n}", "function emptyCart(user) {\n return Object.assign({}, user)\n}", "function itemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n}", "function _updateMoney(userPurchase) {\n // var usersList = _getUsers();\n // for (var i = 0; i < usersList.length; i++) {\n // if (usersList[i].id == userPurchase.id) {\n // usersList[i] = userPurchase;\n // }\n // }\n // localStorage.setItem('lsUsersList', JSON.stringify(usersList));\n return $http.put('http://localhost:3000/api/update_money', userPurchase);\n }", "function buyItem(user){\n return Object.assign({}, user, { purchases: })\n}", "function emptyCart(user) {\n return Object.assign({}, user, {cart: []})\n}", "function addItemToCart(user, item) {\n const updateCart =\n}", "saveUser(data) {\n const addr = Blockchain.transaction.from;\n data.addr = addr;\n const fields = ['username', 'photoUrl', 'phone', 'email', 'alipay', 'password', 'name'];\n\n let user = this.users.get(addr);\n if (user) {\n // Update user\n fields.forEach(f => {\n if (!_isEmpty(data, f)) {\n user[f] = data[f];\n }\n });\n } else {\n // Create user\n user = new User(data);\n }\n this.users.set(addr, user);\n\n return user;\n }", "function updateUserObj(toClone){\n for(var i in loginObj.user){\n delete loginObj.user[i];\n }\n for(i in toClone){\n loginObj.user[i] = toClone[i];\n }\n }", "static async update(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 // check if we have enough items in stock\n // we are only comparing *updated* cart items\n const diff = { items: [] };\n _.each(req.body.items, (item) => {\n const cartItem = _.find(cart.items, { sku: item.sku });\n if (cartItem && parseInt(cartItem.count, 10) !== parseInt(item.count, 10)) {\n diff.items.push(item);\n }\n });\n const invalid = await CartController._checkProductsAvailInStock(diff);\n if (invalid !== '') {\n return res.error(`Item '${invalid}' is not sufficient in stock`);\n }\n\n // update cart\n delete req.body._id; // eslint-disable-line no-underscore-dangle\n const updated = _.assign(cart, req.body);\n\n await updated.save();\n return res.item_with_products(updated);\n } catch (err) {\n return res.error(err.message);\n }\n }", "function addItem() {\n const userItem = [].concat(user);\n console.log(\"user item\", userItem);\n // if (item) {\n // user.cart.push(item);\n // console.log(user.cart[0]);\n // }\n return userItem;\n}", "function getUser() {\n if (promisedUser.data.success) {\n $scope.user = promisedUser.data.user;\n $window.sessionStorage.setItem('currentUser', JSON.stringify($scope.user));\n }\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 purchaseItem(user, item) {\n return Object.assign({}, user, {purchases: item})\n}", "async function getCartProd(req, res) {\n console.log(req.user);\n let products = await cartModel.getCart(req.user.id);\n res.status(201);\n res.json({\n message: 'Here are your cart products',\n cart: products,\n });\n}", "update(req, res) {\n let user = new User();\n user.id = req.body.id;\n user.username = req.body.username;\n user.password = req.body.password;\n user.rolename = req.body.rolename;\n user.restaurant_id = req.body.restaurant_id;\n\n return this.userdao.update(user)\n .then(this.common.editSuccess(res))\n .catch(this.common.serverError(res));\n }", "static handleProfileUpdate(newUserData) {\n let data = this.currentUserValue;\n\n if (newUserData.name) {\n data.user.name = newUserData.name;\n }\n\n if (newUserData.email) {\n data.user.email = newUserData.email;\n }\n\n _currentUserSubject.next(data);\n }", "updateDateInStorage(updateDate) {\n return this._model._storage.getItem('user').then((user) => {\n\n user.updateDate = updateDate;\n return this.updateUserInStorage(user, false)\n })\n }", "function buyItem(user){\n return Object.assign({}, )\n}", "function _update_user_from_api(data) {\n user.uuid = data.uuid;\n user.icon = data.user_icon;\n user.name = data.user_name;\n user.email = data.user_email;\n user.fullname = data.user_fullname;\n user.signature = data.user_signature;\n user.updatetime = data.updatetime;\n user.is_online = true;\n \n if (yvSys.in_mobile_app()) {\n user.device_uuid = data.mobile_device_uuid;\n } else {\n user.device_uuid = data.browser_device_uuid;\n }\n \n return user;\n }", "function emptyCart(user) {\n return user\n}", "mergeUserDataWithCurrentState(stateChange) {\n return Object.assign(this.props.user, stateChange);\n }", "async createCart_Of_User(req, res, next){\n // try {\n // const {userId} = req.value.params\n // // tạo mới 1 hóa đơn \n // const newHoaDon = new hoaDon(req.body)\n // // lấy thông tin user sở hữu cái hóa đơn đó.\n // const user = await User.findById(userId)\n\n // // gán cái hóa đơn đó cho thằng user đã lấy id\n // newHoaDon.user = user \n\n // // Save hóa đơn đó lại \n // await newHoaDon.save()\n\n // // đẩy cái id hóa đơn đó vào cho thằng user.\n // user.hoaDon.push(newHoaDon._id)\n // // sau khi push giá trị mới vào thì ta phải lưu lại cho nó\n // await user.save()\n // return res.json(newHoaDon)\n\n // } catch (error) {\n // next(error)\n // }\n }", "addProduct(product) {\n let productClone = JSON.parse(JSON.stringify(product));\n\n // Check if product exists in shopping cart already\n let productInCart = this.products.find((p) => {\n return p.id == product.id;\n });\n\n if (productInCart) {\n // Just refresh amount\n productInCart.amount = productInCart.amount + productClone.amount;\n } else {\n // Regulary add selected product to cart\n shoppingCart.products.push(productClone);\n }\n }", "toJSON() {\n let userData = this.get() //.get built into get hte user we are working with\n delete userData.password //this removes the password so when we are passing around user info that the pw isnt a parto f that user object that gets passed between the backend and frontend..but does not remove it from the database\n return userData\n }", "updateUser() {\n let updatedUser = {};\n\n Object.keys(this.props.data.user).map(i => {\n if (this.state[i] === \"\" || this.state[i] === undefined) {\n return (updatedUser[i] = this.props.data.user[i]);\n } else {\n return (updatedUser[i] = this.state[i]);\n }\n });\n\n let {\n first_name,\n last_name,\n bio,\n username,\n github_url,\n linkedin_url,\n portfolio_url,\n website_url,\n twitter_url,\n blog_url\n } = updatedUser;\n\n this.props\n .mutate({\n variables: {\n first_name,\n last_name,\n username,\n github_url,\n bio,\n linkedin_url,\n portfolio_url,\n website_url,\n twitter_url,\n blog_url\n }\n })\n .then(({ data }) => {\n // console.log(data);\n // Leaving here for reference.\n })\n .catch(err => {\n console.error(err);\n });\n }", "function _update_user_from_login(data) {\n user.app = data.app;\n user.uuid = data.uuid;\n user.icon = data.user_icon;\n user.name = data.user_name;\n user.email = data.user_email;\n user.fullname = data.user_fullname;\n user.signature = data.user_signature;\n user.updatetime = data.updatetime;\n user.is_online = true;\n user.status = data.service_user_status || yvConstants.USER_STATUS.READY;\n \n if (yvSys.in_mobile_app()) {\n user.device_uuid = data.mobile_device_uuid;\n } else {\n user.device_uuid = data.browser_device_uuid;\n }\n \n user.show_badge = !!data.user_show_badge;\n user.is_distributor_user = !!data.is_distributor_user;\n user.mute_notification = !!data.user_mute_notification;\n user.silence_notification = !!data.user_silence_notification;\n user.mute_other_mobile_device = !!data.user_mute_other_mobile_device;\n \n return user;\n }", "getNewData(){\n\t\tconst id = this.state.user.id;\n\n\t\taxios.get(url + `api/user/${id}`).then(response=> {\n\t\t\tthis.setState({\n\t\t\t\tuser: response.data,\n\t\t\t}); \n\t\t})\n\t\t.catch(error=> {\n\t\t\tthis.setState({err:true});\n\t\t})\n\t\t\n\t}", "function updateCart(){\n reset();\n cart.forEach(product =>{\n appendProduct(product);\n }); \n}", "function update(req, res, next) {\r\n\r\n // console.log( 'USER IS ', req.user ); // eslint-disable-line no-console\r\n\r\n // clone the data from the request user ...\r\n const user = Object.assign({}, req.user);\r\n\r\n // copy the passed in data into a local object\r\n const data = Object.assign({}, req.body.user);\r\n\r\n // clean up some of he stuff\r\n delete user._id;\r\n\r\n // if ( user._id === data._id ) {\r\n // Allowed to do this ....\r\n // }\r\n\r\n // get the email address\r\n\r\n res.json(user);\r\n\r\n // NEED A CHECK in MIDDLEWARE .....\r\n // const id = req.user._id;\r\n\r\n // Users.findOne({ _id:id }, (err,user) => {\r\n // if (err) {\r\n // next(err);\r\n // }\r\n // res.json(user);\r\n // });\r\n }", "function User (loggedinuser) {\n this.name = loggedinuser;\n /* Cart to be filled with Item's */\n this.shopCart = [];\n}", "function getCart() {\n return cart;\n}", "async update (user) {\n let res = await Http.put('/api/users', { user })\n this.currentUser = new User(res.data.user)\n return this.currentUser\n }", "refreshUser(state, payload)\n { \n state.user = {...state.user,...payload}; \n }", "static async create(req, res) {\n if (!req.params.user_id) {\n return res.error('Invalid id supplied');\n }\n\n try {\n const oldCart = await Cart.findOne({\n user_id: req.params.user_id,\n deleted: false,\n });\n if (oldCart) {\n return res.error('Duplicate item found');\n }\n\n const cart = new Cart({\n user_id: req.params.user_id,\n items: req.body.items,\n });\n const invalid = await CartController._checkProductsAvailInStock(cart);\n if (invalid !== '') {\n return res.error(`Item '${invalid}' is not sufficient in stock`);\n }\n\n await cart.save();\n return res.item_with_products(cart);\n } catch (err) {\n return res.error(err.message);\n }\n }", "updateById(id, modifiedUser) {\n const posicionEncontrado = indexOfPorId(id)\n if (posicionEncontrado != -1) {\n users[posicionEncontrado].username = modifiedUser.username;\n }\n return posicionEncontrado != -1 ? users[posicionEncontrado] : undefined;\n }", "function applyTaxToItems(user){\n const {cart} = user;\n}", "function applyTaxToItems(user){\n amazonHistory.push(user)\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({}, user, { cart: updatedCart })\n}", "addToCart(index) {\n var product = productList[index];\n var cartCopy = this.state.cart.slice();\n cartCopy[cartCopy.length] = {\n name: product.name,\n price: product.price\n };\n }", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({})\n}", "addToCart(product) {\n // prvo trazim postoji li vec ovaj atikal na listi\n const cartProductIndex = this.cart.items.findIndex((cp) => {\n return cp.productId.toString() === product._id.toString();\n });\n console.log('cartProductIndex='.red, cartProductIndex);\n let newQuantity = 1;\n const updatedCartItems = [...this.cart.items];\n console.log(updatedCartItems);\n \n\n // ako je pronasao zapis..\n if (cartProductIndex >= 0) {\n newQuantity = this.cart.items[cartProductIndex].quantity + 1;\n updatedCartItems[cartProductIndex].quantity = newQuantity;\n } else {\n // prvi zapis\n updatedCartItems.push({\n productId: new mongodb.ObjectId(product._id),\n quantity: newQuantity,\n });\n }\n\n const updatedCart = {\n items: updatedCartItems,\n };\n // const updatedCart = {\n // items: [{...product, quantity:1 }],\n // };\n\n const db = getDb();\n return db\n .collection('users')\n .updateOne(\n { _id: new mongodb.ObjectId(this._id) },\n { $set: { cart: updatedCart } }\n );\n }", "async beforeUpdate(updatedUserData) {\n updatedUserData.password = await bcrypt.hash(updatedUserData.password, 10);\n return updatedUserDatal\n }", "update(req, res) {\n\n return User\n .findById(req.params.id, {})\n .then(user => {\n\n if (!user) {\n\n return res.status(404).send({\n message: 'User Not Found',\n });\n }\n\n return user\n .update({\n id: req.body.id || user.id,\n confirmed: user.confirmed,\n first_name: req.body.first_name || user.first_name,\n last_name: req.body.last_name || user.last_name,\n organizer_alias: req.body.organizer_alias || user.organizer_alias,\n age: req.body.age || user.age,\n gender: req.body.gender || user.gender,\n password: user.password,\n profile_pic: null,\n phone_number: req.phone_number || user.phone_number\n })\n .then(() => res.status(200).send(user)) // Send back the updated user\n .catch((error) => res.status(400).send(error));\n })\n .catch((error) => res.status(400).send(error));\n }", "function emptyCart(user) {\n return Object.assign({})\n}", "async function addToCart(root, {\n productId\n}, context) {\n console.log('ADDING TO CART!!'); // 1 query the current user and see if signed in\n\n const sesh = context.session;\n\n if (!sesh.itemId) {\n throw new Error('You must be logged in to do this');\n } // 2 query the current users cart\n\n\n const allCartItems = await context.lists.CartItem.findMany({\n where: {\n user: {\n id: sesh.itemId\n },\n product: {\n id: productId\n }\n },\n resolveFields: 'id,quantity' // what you want back\n\n });\n const [existingCartItem] = allCartItems; // destructures first item in array of allCartItems\n // 3 see if item being added is already in cart\n\n if (existingCartItem) {\n console.log(`there are already ${existingCartItem.quantity}, increment by 1`); // 4 if it is increment by 1\n\n return await context.lists.CartItem.updateOne({\n id: existingCartItem.id,\n data: {\n quantity: existingCartItem.quantity + 1\n }\n });\n } // 5 if it isnt create new cart item\n\n\n return await context.lists.CartItem.createOne({\n data: {\n product: {\n connect: {\n id: productId\n }\n },\n user: {\n connect: {\n id: sesh.itemId\n }\n }\n }\n });\n}", "async fetchUser () {\n const user = await getJSON('/api/user')\n if (!this.checkResponse(user)) return\n this.user = user\n this.assets = user.assets\n this.exchanges = user.exchanges\n this.walletMap = {}\n for (const [assetID, asset] of Object.entries(user.assets)) {\n if (asset.wallet) {\n this.walletMap[assetID] = asset.wallet\n }\n }\n this.updateMenuItemsDisplay()\n return user\n }", "function buyItem(user){\n return Object.assign()\n}", "updateUserDetails() {\n if (!activeUser()) return;\n $(conversations_area).find(`[data-user-id=\"${activeUser().id}\"] .sb-name,.sb-top > a`).html(activeUser().get('full_name'));\n $(conversations_area).find('.sb-user-details .sb-profile').setProfile();\n SBProfile.populate(activeUser(), $(conversations_area).find('.sb-profile-list'));\n }", "addOrder() {\n const db = getDb();\n return this.getCart()\n .then(products => {\n const order = {\n // needs a snapshot of product, not reference\n // i.e. when price of product change, it should remain same in orders page\n items: products,\n user: {\n _id: new ObjId(this._id),\n name: this.name\n }\n };\n return db.collection(\"orders\").insertOne(order);\n })\n .then(result => {\n // clear cart\n this.cart = { items: [] };\n return db\n .collection(\"users\")\n .updateOne(\n { _id: new ObjId(this._id) },\n { $set: { cart: { items: [] } } }\n );\n });\n }", "function updateUser() {\n let current_user = result;\n /*Added conditional in case the request body doesnt send all the users information, in the case of a info not being given it sends the same info that was already in the db*/\n let changed_user = {\n user_id: req.params.id,\n username: req.body.username !== undefined ? req.body.username : current_user[0].username,\n password: req.body.password !== undefined ? hash : current_user[0].password,\n full_name: req.body.full_name !== undefined ? req.body.full_name : current_user[0].full_name,\n email: req.body.email !== undefined ? req.body.email : current_user[0].email,\n phone: req.body.phone !== undefined ? req.body.phone : current_user[0].phone,\n delivery_address: req.body.delivery_address !== undefined ? req.body.delivery_address : current_user[0].delivery_address,\n is_admin: current_user[0].is_admin\n };\n let sql = `UPDATE users SET username = :username, password = :password, full_name = :full_name, email = :email, phone = :phone, delivery_address = :delivery_address, is_admin = :is_admin\n WHERE user_id = :user_id`;\n sequelize.query(sql, {\n replacements: changed_user\n }).then(result => {\n delete changed_user.password;\n res.status(200).json(changed_user);\n }).catch((err) => {\n res.status(500).json(\n {\n \"error\":\n {\n \"status\": \"500\",\n \"message\": \"Internal Server Error: \" + err\n }\n }\n )\n })\n }", "mutateUser (state, payload) {\n let userToUpdate = state.registeredUsers.find(user => user.id === payload.id)\n let userIndex = state.registeredUsers.indexOf(userToUpdate)\n state.registeredUsers[userIndex] = payload\n }", "function updateUser(){\n // use save instead of update to trigger 'save' event for password hashing\n\t\nconsole.log('REQUEST IS ', req.body)\n\tif (!user.termsAccepted_v1) user.termsAccepted_v1 = false;\n user.set(req.body);\n user.save(function(err, user){\n \n // Uniqueness and Save Validations\n \n if (err && err.code == 11001){\n var duplicatedAttribute = err.err.split(\"$\")[1].split(\"_\")[0];\n req.flash('error', \"That \" + duplicatedAttribute + \" is already in use.\");\n return res.redirect('/account');\n }\n if(err) return next(err);\n \n // User updated successfully, redirecting\n \n req.flash('success', \"Account updated successfully.\");\n return res.redirect('/account');\n });\n }", "async beforeUpdate(updatedUserData) {\n updatedUserData.password = await bcrypt.hash(updatedUserData.password, 10);\n return updatedUserData;\n }", "function editUserInfo(user){\n fetch(`https://students-3d096.firebaseio.com/${user.id}.json`, {\n method:\"PUT\",\n headers: {\n \"Content-type\": \"application/json\"\n }, \n body: JSON.stringify(user)\n })\n .then(res => res.json())\n .then(data => {\n debugger \n users = users.map(user => {\n if(user.id == data.id) user = data;\n return user;\n })\n showUsersInfo(users);\n isAdd = true;\n currentId = null;\n })\n}", "cargarUsuario({ item }) {\n let cargarusuario = this.lista_usuario.find(\n usuario => usuario.id == item.id\n );\n this.enEdicion = true;\n this.usuario = Object.assign({}, cargarusuario);\n this.saveLocalStorage();\n\n }", "function addItemToCart(user, item) {\n\n}", "function getCurrentUserData(){\n\n ApiCalls.getCurrentUser()\n .then((res) => {\n //console.log(\"current\" ,res.data);\n setCurrentUser(res.data);\n }\n ) \n}", "function updateUser() {\n var username = $('#usernameFld').val();\n var password = $('#passwordFld').val();\n var firstName = $('#firstNameFld').val();\n var lastName = $('#lastNameFld').val();\n var role = $('#roleFld').val();\n var user = new User(username,password,firstName,lastName,role,null,null,null);\n userService\n .updateUser(currentUserID,user)\n .then(findAllUsers)\n .then(emptyUserForm);\n\n }", "function getCart() {\n return cart\n}", "async updateUser(id, updatedUser) {\n id = idCheck(id);\n const userCollection = await users();\n const currentUser = await this.getUserById(id);\n const updatedUserData = { profile: {} };\n\n if (updatedUser.newPassword) {\n if (typeof updatedUser.newPassword != \"string\") throw \"The new hash must be a string.\";\n updatedUserData.hashedPassword = updatedUser.newPassword;\n } else {\n updatedUserData.hashedPassword = currentUser.hashedPassword;\n }\n\n if (updatedUser.newName) {\n if (typeof updatedUser.newName != \"string\") throw \"The new name must be a string.\";\n updatedUserData.profile._id = currentUser.profile._id;\n updatedUserData.profile.name = updatedUser.newName;\n updatedUserData.profile.prevSearches = currentUser.profile.prevSearches;\n updatedUserData.profile.likes = currentUser.profile.likes;\n updatedUserData.profile.dislikes = currentUser.profile.dislikes;\n } else {\n updatedUserData.profile._id = currentUser.profile._id;\n updatedUserData.profile.name = currentUser.profile.name;\n updatedUserData.profile.prevSearches = currentUser.profile.prevSearches;\n updatedUserData.profile.likes = currentUser.profile.likes;\n updatedUserData.profile.dislikes = currentUser.profile.dislikes;\n }\n\n let updateCommand = {\n $set: updatedUserData\n };\n const query = {\n _id: currentUser._id\n };\n\n const updatedInfo = await userCollection.updateOne(query, updateCommand);\n\n if (updatedInfo.modifiedCount === 0) {\n console.log(\"No changes were made.\");\n }\n\n return await this.getUserById(id);\n }", "function addItemToCart(user, item) {}", "updateUser({ params, body }, res) {\n User.findOneAndUpdate({ id: params.id }, body, { new: true })\n .then((dbUserData) => {\n if (!dbUserData) {\n res.status(404).json({ message: \"No user found with this id!\" });\n return;\n }\n res.json(dbPizzaData);\n })\n .catch((err) => res.status(400).json(err));\n }", "addToCart({commit}, product) {\n api.addToCart(product.id)\n .then((response) => {\n console.log(response)\n })\n }", "saveDataAsUser() {\n let checkUp = this.props.usersList.filter(user => {\n if (this.state.username === user.username) {\n return true;\n }\n return false;\n })\n if (checkUp && checkUp.length > 0) {\n alert('User with wanted username already exist.')\n } else if (this.state.username === '' || this.state.password === '') {\n alert('Input fields cannot be empty')\n } else {\n this.props.changeDataPutRequest(this.props.loggedUser.id, { ...this.props.loggedUser, username: this.state.username, password: this.state.password });\n this.props.changePageStateToList();\n }\n }", "updateProfile(state) {\n axios.get('api/account/profile').then(({ data }) => {\n state.commit('storeUser', data.user);\n })\n }", "editAccountName(request, response) {\n const loggedInUser = accounts.getCurrentUser(request);\n loggedInUser.name = request.body.name;\n memberStore.editUser(loggedInUser);\n response.redirect(\"/viewAccountDetails\");\n }", "changeProfileEmail(email) {\n if (this.state.user.email !== email){\n //patch user email\n fetch('http://localhost:443/user?'+'email='+email,{\n method: \"PATCH\",\n headers: {\n Authorization: 'Bearer ' + this.props.token\n }\n })\n .then(res => res.json())\n .then(res => {\n //update frontend version of user\n let data = this.state.user;\n data.email = email;\n let memb = this.state.members\n memb[memb.indexOf(this.state.user)] = data\n this.setState({user:data, members:memb})\n })\n }\n }", "function updateCurrentUserProfile() {\n\n\n Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.platformRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT ACCOUNT roles! Role will indicate what editing capabilites are available.\n\n Debug.trace(\"Profile refreshed!\");\n Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "updateUser(req, res) {\n UserModel.findByIdAndUpdate(req.params.id, { rol: req.body.rol })\n .then(() => {\n return UserModel.find();\n })\n .then((user) => res.status(200).send(user))\n .catch((err) => res.send(err));\n }", "edit({ email, name, password, image }) {\n let details = { email, name, password, image };\n for (const key in details)\n if (details[key]) {\n currentUser[key] = details[key];\n }\n callFuture(updateUserListeners);\n }", "async doUserUpdate () {\n\t\tconst now = Date.now();\n\t\tconst op = {\n\t\t\t$set: {\n\t\t\t\tisRegistered: true,\n\t\t\t\tmodifiedAt: now,\n\t\t\t\tregisteredAt: now,\n\t\t\t\t\"preferences.acceptedTOS\": true\n\t\t\t}, \n\t\t\t$unset: {\n\t\t\t\tconfirmationCode: true,\n\t\t\t\tconfirmationAttempts: true,\n\t\t\t\tconfirmationCodeExpiresAt: true,\n\t\t\t\t'accessTokens.conf': true,\n\t\t\t\tinviteCode: true,\n\t\t\t\tneedsAutoReinvites: true,\n\t\t\t\tautoReinviteInfo: true\n\t\t\t}\n\t\t};\n\n\t\tif (this.passwordHash) {\n\t\t\top.$set.passwordHash = this.passwordHash;\n\t\t}\n\n\t\t['email', 'username', 'fullName', 'timeZone'].forEach(attribute => {\n\t\t\tif (this.data[attribute]) {\n\t\t\t\top.$set[attribute] = this.data[attribute];\n\t\t\t}\n\t\t});\n\t\tif (this.data.email) {\n\t\t\top.$set.searchableEmail = this.data.email.toLowerCase();\n\t\t}\n\n\t\tif ((this.user.get('teamIds') || []).length > 0) {\n\t\t\tif (!this.user.get('joinMethod')) {\n\t\t\t\top.$set.joinMethod = 'Added to Team';\t// for tracking\n\t\t\t}\n\t\t\tif (!this.user.get('primaryReferral')) {\n\t\t\t\top.$set.primaryReferral = 'internal';\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!this.user.get('originTeamId') &&\n\t\t\t\tthis.teamCreator && \n\t\t\t\tthis.teamCreator.get('originTeamId')\n\t\t\t) {\n\t\t\t\top.$set.originTeamId = this.teamCreator.get('originTeamId');\n\t\t\t}\n\t\t}\n\n\t\tthis.request.transforms.userUpdate = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.request.data.users,\n\t\t\tid: this.user.id\n\t\t}).save(op);\n\t}", "function update(req, res) {\n // find one user by id, update it based on request body,\n // and send it back as JSON\n}", "function cachedUser() {\n return cachedUserInfo;\n}", "static updateUser(req, res) {\n try {\n const userId = parseInt(req.params.userId, 10);\n //const email = req.query.email || '';\n const userFound = UserHelper.findUserById(userId);// || UserHelper.findUserByEmail(email);\n if (!userFound) {\n return res.status(404).json({\n status: 404,\n success: 'false',\n error: 'User not found',\n });\n }\n\n for (const [key, value] of Object.entries(req.body)) {\n userFound[key] = value;\n }\n return res.status(200).json({\n status: 200,\n success: 'true',\n message: 'User updated successfully',\n data: userFound.getUserData() || userFound,\n });\n } catch (error) {\n // return res.status(500).json({\n // status: 500,\n // success: 'false',\n // error: 'Something went wrong',\n // });\n }\n }", "async editList(req,res){\n const {id} = req.params;\n const response = await user.findById(req.userId);\n if(response.userType === 'comum'){ \n const response = await GitUserList.findByIdAndUpdate(id,req.body,{new: true});\n res.json(response);\n }\n else{\n res.status(400).json({error: 'User does not have permission'});\n }\n }", "editStudentInfo(editedStudentInfo) {\n studentsFullList.forEach(student => {\n if (editedStudentInfo.name == student.name) {\n student.classId = editedStudentInfo.classId;\n student.email = editedStudentInfo.email;\n student.phone = editedStudentInfo.phone;\n return student;\n } else {\n console.log('No such student');\n }\n })\n return {\n editedStudentInfo,\n studentsFullList\n };\n }", "function save(user) {\n service._currentUser = user;\n return user;\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}", "userProfile(user) {\n let response = {\n status: 200,\n data: {\n id: user.id,\n first_name: user.first_name,\n last_name: user.last_name,\n email: user.email,\n address: user.address\n }\n }\n return response;\n }", "handleUpdateUserProfile(props) {\n const response = props.updateUserProfile.response;\n if (response !== this.props.updateUserProfile.response) {\n if (\n Object.keys(response).length > 0 &&\n response.status &&\n response.status === 200\n ) {\n toastr.success(\n response.message || this.props.locale.user.profile.update.success\n );\n // Update the global variable with current state\n // to display the updated value in profile\n profileState = this.state;\n // Update the customer logo\n if (\n this.props.auth.isCustomerAdmin() &&\n this.props.auth.getLogo() !== this.state.fields.logo\n ) {\n this.props.auth.updateLogo(this.state.fields.logo);\n }\n let authorizedUserDetails = JSON.parse(\n ls.getItem(\"authorizedUserDetails\")\n );\n authorizedUserDetails.profilePicture = this.state.fields.profilePicture;\n ls.setItem(\n \"authorizedUserDetails\",\n JSON.stringify(authorizedUserDetails)\n );\n let fields = this.props.auth.authUser;\n fields = _.set(\n fields,\n \"profilePicture\",\n this.state.fields.profilePicture\n );\n // this.toggleModal();\n window.location.reload();\n } else if (\n !props.updateUserProfile.isFetching &&\n props.updateUserProfile.isError\n ) {\n toastr.error(\n response.message || this.props.locale.user.profile.update.error\n );\n }\n }\n }", "function updateUser(userFound,reqBody) {\n var userIndex = userDbStub.lastIndexOf(userFound);\n \n if (reqBody) {\n \n for (var params in reqBody) {\n // we avoid to insert non existing property and avoid the modification of the id and password that it's forbbiden\n if( params && params !== '' && userFound[params] !== undefined && params !== 'id' && params !== 'password' ) {\n \n userFound[params] = reqBody[params];\n }\n } \n userDbStub[userIndex] = userFound; \n }\n return userFound;\n}", "function updateCurrentUserProfile() {\n\n Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.platformRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT ACCOUNT roles!\n\n Debug.trace(\"Profile refreshed!\");\n Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "function getLoggedUserInfo(update){\n var _deferred = $q.defer();\n if ( _cached.userInfo && !update ) {\n _deferred.resolve(_cached.userInfo);\n } else {\n services.getUserId()\n .then(function(user_id){\n var _url = '/api/GetMePhysicianV1';\n return services.get(_url, {}, true);\n }, function(err){\n _deferred.reject(err);\n }).then(function(userInfo){\n _cached.userInfo = userInfo;\n _deferred.resolve(_cached.userInfo);\n }, function(err){\n _deferred.reject(err);\n }); \n }\n return _deferred.promise; \n }", "_handleSave () {\n let password = this.state.userData[1].value;\n let name = this.state.userData[2].value;\n let email = this.state.userData[3].value;\n let homeCurrency = this.state.userData[4].value;\n let userData = {\n userName: this.state.userData[0].value,\n password: password !== this.state.originalUserData[1].value ? password : null,\n name: name !== this.state.originalUserData[2].value ? name : null,\n email: email !== this.state.originalUserData[3].value ? email : null,\n homeCurrency: homeCurrency !== this.state.originalUserData[4].value ? homeCurrency : null,\n };\n this.props.dispatch(putUser(userData));\n }", "async function userUpdate(req, res, next) {\n const userId = req.params.id\n try {\n const userToUpdate = await User.findById(userId)\n if (!userToUpdate) throw new Error(notFound)\n\n\n if (!userToUpdate.equals(req.currentUser._id)) throw new Error(unauthorized)\n\n Object.assign(userToUpdate, req.body)\n await userToUpdate.save()\n\n res.status(202).json(userToUpdate)\n } catch (err) {\n next(err)\n }\n}", "function buyItem(user){\n return user\n}", "changeProfileName(firstname,lastname) {\n let queryString = ''\n if (this.state.user.firstName !== firstname) {\n queryString+= 'firstName='+firstname\n }\n if (this.state.user.lastName !== lastname) {\n if (queryString !== '') {queryString+='&'}\n queryString += 'lastName='+lastname\n }\n //patch user firstname and lastname\n fetch('http://localhost:443/user?'+queryString,{\n method: \"PATCH\",\n headers: {\n Authorization: 'Bearer ' + this.props.token\n }\n })\n .then(res => res.json())\n .then(res => {\n //update frontend version of user\n let data = this.state.user;\n data.firstName = firstname;\n data.lastName = lastname;\n let memb = this.state.members\n memb[memb.indexOf(this.state.user)] = data\n this.setState({user:data, members:memb})\n })\n //hit backend instead\n }" ]
[ "0.6933249", "0.69314843", "0.6841272", "0.6698418", "0.6649481", "0.66314226", "0.660621", "0.6581117", "0.6560843", "0.65342116", "0.6522401", "0.64837945", "0.6393923", "0.6348072", "0.6317977", "0.62365687", "0.6174833", "0.61374587", "0.6127107", "0.6120284", "0.60980016", "0.6094214", "0.6063694", "0.60492074", "0.59615475", "0.5957895", "0.5897848", "0.5893308", "0.58927685", "0.5874333", "0.5871229", "0.5866913", "0.58654493", "0.58652747", "0.5854112", "0.58455205", "0.58254623", "0.5821519", "0.5808695", "0.5806946", "0.57951915", "0.5783357", "0.57826835", "0.576992", "0.57685435", "0.57638925", "0.576236", "0.5757449", "0.57511175", "0.5746598", "0.5739972", "0.5732271", "0.57306266", "0.57270855", "0.5725528", "0.5723957", "0.57195103", "0.57167506", "0.57162744", "0.5715609", "0.57119316", "0.5708581", "0.5707984", "0.5704333", "0.5698621", "0.5694945", "0.5690809", "0.56724715", "0.5666846", "0.5652262", "0.56399363", "0.5631604", "0.5624581", "0.5617655", "0.56170946", "0.56166834", "0.5613876", "0.56104827", "0.56039554", "0.56002086", "0.5594556", "0.5590614", "0.5585805", "0.5579368", "0.55654514", "0.5562496", "0.5559783", "0.5559667", "0.5557816", "0.55553", "0.5555071", "0.55462164", "0.554407", "0.5543024", "0.55399936", "0.55374813", "0.553336", "0.5525643", "0.5525121", "0.55222297" ]
0.57899916
41
because we apply the tax rate from two hundred to two hundred & sixty oh boy this tax is really killing us alright lets keep going with buy item so in here we wanna move the cart item to the purchases
function buyItem(user){ return user }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n\n })\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {}\n })\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n }\n })\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n}", "function applyTaxToItems(user){\n amazonHistory.push(user)\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({}, user, { cart: updatedCart })\n}", "function applyTaxToItems(user){\n const {cart}\n}", "function applyTaxToItems(user){\n const {cart} = user;\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({})\n}", "function applyTaxToItem(user) {\n const {cart} = user\n const taxRate = 0.1\n const updatedCart = cart.map(item => ({\n ...item,\n price: item.price * (1+taxRate)\n }))\n return Object.assign({}, user, {cart: updatedCart});\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({}, user, { cart: updatedCart })\n}", "function applyPromotionsCart() {\n for( let i=0; i<cart.length;i++){\n if(cart[i].name=='cooking oil'&cart[i].quantity>=3){\n cart[i].subtotalWithDiscount=cart[i].quantity*10; //afegim l'atribut subtotalWithDiscount per l'oferta a l'oli\n }else if(cart[i].name=='Instant cupcake mixture'&cart[i].quantity>=10){\n cart[i].subtotalWithDiscount=(cart[i].subtotal*2)/3; //afegim l'atribut subtotalWithDiscount per l'oferta a la mescla per pastís\n }else{cart[i].subtotalWithDiscount='No discount'} //afegim l'atribut subtotalWithDiscount sense discount per a la resta de productes \n }\n console.log(cart);\n \n}", "function checkout(item1, item2, coupon) {\n var subtotal = item1 + item2;\n var couponAmount = subtotal * coupon;\n var total = subtotal - couponAmount;\n var taxRate = total * 0.095;\n var total = total + taxRate;\n total = total.toFixed(2);\n return total;\n //return total;\n //console.log(\"Total amount due is \" + total);\n //return total;\n}", "cartPlusOne(product) {\r\n product.quantity = product.quantity + 1;\r\n }", "function applyPromotionsCart(productName, discount, num,){\n for( let i=0; i<cart.length;i++){\n if(cart[i].name==productName&cart[i].quantity>=num){\n cart[i].subtotalWithDiscount=cart[i].subtotal-(cart[i].subtotal*discount)/100;\n }else{cart[i].subtotalWithDiscount='No discount'}\n }\n}", "function applyPromotionsCart() {\n // Apply promotions to each item in the array \"cart\"\n for (var i = 0; i < cart.length; i++){\n if (cart[i].name === 'cooking oil'){\n if(cart[i].quantity > 3){\n cart[i].subtotalWithDiscount = 10 * cart[i].quantity;\n }\n }else if( cart[i].name === 'Instant cupcake mixture'){\n if(cart[i].quantity > 10){\n cart[i].subtotalWithDiscount = cart[i].subtotal * 2 / 3; \n }\n }\n }\n}", "function applyTaxToItems(user){}", "function updateQuantity(item, type) {\n let indx = cart.findIndex((x) => x.name == item.name);\n let qty = qtyBtn.textContent;\n\n if (type == \"dec\") {\n if (qty > 0) {\n qty--;\n qtyBtn.textContent = qty;\n if (indx != -1) {\n cart[indx].quantity = qty;\n } else {\n let billObj = {\n name: item.name,\n price: item.price,\n quantity: qty,\n category: item.category\n };\n cart.push(billObj);\n }\n }\n if (qty == 0) {\n cart = cart.filter((item) => item.quantity != 0);\n }\n }\n\n if (type == \"inc\") {\n if (qty < 10) {\n qty++;\n qtyBtn.textContent = qty;\n if (indx != -1) {\n cart[indx].quantity = qty;\n } else {\n let billObj = {\n name: item.name,\n price: item.price,\n quantity: qty,\n category: item.category\n };\n cart.push(billObj);\n }\n }\n }\n\n updateBill();\n showCartItems();\n }", "function addTax(user){\n let updateCart = user.cart.map(item => {\n return{\n name: item.name,\n price: item.price * 1.03\n } \n });\n return Object.assign({}, user , {cart: updateCart})\n }", "function quanitityToCart(product) {\n let value = parseInt($(\"#amountOfBeer\").val());\n let isProductInCart = 0;\n for (let i = 0; i < cart.length; i++) {\n if (product.id === cart[i].id) {\n cart[i].inCart += value;\n isProductInCart++;\n }\n }\n if (isProductInCart == 0) {\n product.inCart = value;\n cart.push(product);\n }\n saveToLS();\n renderCart();\n}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function updateBill(amount, quantity) {\n const payBtn = document.querySelector(\".btn-pay\");\n const subTotal = document.querySelector(\".bill-sub-total\");\n const tax = document.querySelector(\".bill-taxes\");\n const discount = document.querySelector(\".bill-discount\");\n\n let total = cart.reduce((prevBill, curr) => {\n let currItemTotal = Number(curr.price) * Number(curr.quantity);\n prevBill += currItemTotal;\n prevBill.toFixed(2);\n return prevBill;\n }, 0);\n\n subTotal.innerHTML = `₹ ${total}`;\n let currTax = (total * 0.28).toFixed(2);\n tax.innerHTML = `₹ ${currTax}`;\n discount.innerHTML = `₹ ${0.0}`;\n\n let finalAmount = total + Number(currTax);\n payBtn.innerHTML = `Pay ₹ ${finalAmount.toFixed(2)}`;\n}", "function addItemToCart() {}", "function addItemToCart() {}", "function updatePrice() {\n var sum = 0;\n for(var i = 0; i < $scope.currentItems.length; i++) {\n sum += $scope.currentItems[i].price;\n }\n\n $scope.totalCost = sum + (sum * taxRate);\n $scope.totalCost = Math.floor($scope.totalCost);\n console.log($scope.totalCost);\n }", "addBoothToCart(product, subitem){\n this.cart.forEach(m => {\n if ( m.booths && m.id == product.id ){\n this.total -= m.price;\n this.cart = this.cart.filter(n => n.id !== m.id);\n }\n if ( m.notify ){\n this.cart = this.cart.filter(n => !n.notify);\n }\n })\n product.booths.booths = true;\n product.booths.quantity++;\n product.booths.name = subitem.name;\n product.booths.price = subitem.price;\n cartitem = Object.assign({}, product.booths);\n this.cart.push(cartitem);\n this.total += cartitem.price;\n }", "function handleShipping() {\n\n if (prices.subtotal > 0){\n\n let weight = 0\n\n for (var item of cart) {\n console.log(item);\n weight = weight + item.quantity\n }\n\n setPrices({...prices, weight: weight })\n let current_shipping = 0\n\n\n if (prices.subtotal > 400) {\n\n setPrices({...prices, \n shipping: current_shipping, \n total: (prices.subtotal + current_shipping) - prices.discount\n })\n\n } else {\n\n if (weight <= 10){\n current_shipping = 30\n setPrices({...prices, \n shipping: current_shipping, \n total: (prices.subtotal + current_shipping) - prices.discount\n })\n\n } else {\n current_shipping = 30 + Math.floor((weight -10) /5) * 7\n setPrices({...prices, \n shipping: current_shipping, \n total: (prices.subtotal + current_shipping) - prices.discount\n })\n }\n }\n\n }\n }", "function applyPromotionsCart() {\n // Apply promotions to each item in the array \"cart\"\n cart.map( (product, index) => {\n if (product.name === 'cooking oil' && product.quantity > 2) {\n cart[index].subtotalWithDiscount = cart[index].quantity * 10;\n } else if (product.name === 'Instant cupcake mixture' && cart[index].quantity > 9) {\n cart[index].subtotalWithDiscount = cart[index].quantity * (cart[index].price * 0.66);\n } else {\n cart[index].subtotalWithDiscount = cart[index].quantity * cart[index].price;\n }\n })\n}", "function changeQuantity(itemId, change) {\n let cartItem = localStorage.getItem('cartItems');\n if (cartItem) {\n let cartItemArray = JSON.parse(cartItem);\n let productIndex = cartItemArray.findIndex(item => {\n return item.id === itemId;\n });\n if (change === 'add') {\n cartItemArray[productIndex].quantity += 1;\n } else {\n if (cartItemArray[productIndex].quantity > 1) {\n cartItemArray[productIndex].quantity -= 1;\n }\n }\n cartItemArray[productIndex].discount = calculateDiscounts(cartItemArray[productIndex].quantity);\n let total = cartItemArray[productIndex].price * cartItemArray[productIndex].quantity;\n cartItemArray[productIndex].total = parseFloat(total.toFixed(2));\n let discountedTotal = total - cartItemArray[productIndex].discount;\n cartItemArray[productIndex].discountedTotal = parseFloat(discountedTotal.toFixed(2));\n localStorage.setItem('cartItems', JSON.stringify(cartItemArray));\n sendItemsToCartUI(cartItemArray);\n grandTotals(cartItemArray);\n }\n\n}", "function bill(products, tax) {\n let total = 0\n for (let i = 0; i < products.length; i++) {\n total += products[i] + products[i] * tax\n }\n return total\n}", "processTransaction(product) {\n product.quantity--\n vm.totalMoney += product.price\n vm.currentTransaction -= product.price\n }", "function applySalesTax(taxRate, price) {\n return price + price * taxRate;\n}", "function ex7(){\n // return\n\n let discount = totalShoppingCart * 0.2 \n totalShoppingCartFriday = totalShoppingCart - discount\n }", "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 buyUpdate(id, quantity) {\n var isDupicate = false;\n\n //checks to see if the item is already in the cart\n for (var i in cart) {\n\n if (cart[i].id == id) {\n //if the item is already in the cart, it adds the quantity of the purchase to the quantity already in the cart\n cart[i].quantity += parseInt(quantity);\n isDupicate = true;\n\n //removes the quantity from the amount in stock\n for (var j in stock) {\n if (cart[i].id == stock[j].ItemID) {\n stock[j].StockQuantity -= quantity;\n }\n }\n }\n }\n\n //if not already in the cart\n if (!isDupicate) {\n\n //find the id in the stock array\n for (var k in stock) {\n if (stock[k].ItemID == id) {\n //push the item to the cart\n cart.push({\n id: id,\n name: stock[k].ProductName,\n quantity: parseInt(quantity),\n price: stock[k].Price\n });\n //subtract the user quantity wanted from the quantity in stock\n stock[k].StockQuantity -= quantity;\n }\n }\n }\n\n //display the updated stock\n displayStock();\n //display the shopping cart\n shoppingCart();\n //prompt the user to continue shopping or checkout\n promptOptions();\n}", "constructor(oldCart) {\n this.taxRate = 0.1;\n this.items = oldCart.items || [];\n this.quantity = oldCart.quantity || 0;\n this.tax = oldCart.tax || 0.0;\n this.subTotal = oldCart.subTotal || 0.0;\n this.total = oldCart.total || 0.0;\n\n this.updatePricesAndQuantity();\n }", "checkout(Inventory) {\n let total = 0;\n this.items.forEach(i => {\n let [ sku, name, quantity, price ] = Inventory.get(i[0]);\n console.log(`${name} ${i[1]} x ${price} = ${i[1] * price}`);\n total += i[1] * price;\n\n // update Inventory state\n Inventory.items = Inventory.items.map(item => {\n if (item[0] === sku) {\n item[2] -= i[1];\n }\n return item;\n });\n });\n console.log(\"---------------------------\");\n console.log(`TOTAL: ${total}`);\n console.log(\"---------------------------\\n\");\n\n this.items = [];\n }", "function updatecart() {\r\n //initialize the total variable with 0 (if we don't initialize it our cart will show NaN since it has no value at all)\r\n var total = 0\r\n //we get the value from the quantity input box and we check if it the user gave an input <= than 0 or not given an input at all. If this happened then >>\r\n // we set the value to 1 (there is no point in having a negative or zero or undefined quantity... it will also cause trouble in calculating the total price)\r\n var input = event.target\r\n if (input.value <= 0 || input.value == NaN) {\r\n input.value = 1\r\n }\r\n //cartitem_all gets the element of our shopping cart containing all cart items\r\n var cartitem_all = document.getElementsByClassName('cart-items')[0]\r\n // rows11 gets a list of all the cart rows where each row is a package we have in our shopping cart with all its data \r\n var rows11 = cartitem_all.getElementsByClassName('cart-row')\r\n // we create a loop that goes through every package in our cart (if existing) and executes the commands in {}\r\n for (var i = 0; i < rows11.length; i++) {\r\n // in cartRow we save the package element that we are processing in each time the loop runs\r\n var cartRow = rows11[i]\r\n // we get the price of that package and save it into \"priceElement\"\r\n var priceElement = cartRow.getElementsByClassName('cart-price')[0]\r\n // we get the quantity of that package and save it into \"quantityElement\" NOTE: Here we use [1] since when creating the element we have used the class >>\r\n // \"cart-quantity-input\" 2 times one for styling. So we need to call the 2nd one which is having the actual value\r\n var quantityElement = cartRow.getElementsByClassName('cart-quantity-input')[1]\r\n // we change the type of \"price\" from string to float so we can use it in a math equation. HOWEVER >>\r\n // Before doing so we replace the euro sign with nothing (we remove it) from our variable since we want only the number that makes sense for math equations\r\n var price = parseFloat(priceElement.innerText.replace('€', ''))\r\n // we get the value part of the quantityElement since it is the one containing the number value and we save it in \"quantity\"\r\n var quantity = quantityElement.value\r\n // this is an obvious math equation to calculate the total price. Note that we +total at the beginning since this is in a loop running for each package in the cart\r\n total = total + (price * quantity)\r\n }\r\n // we use the Math.round to avoid having numbers with too many decimals coming from a multiplication. We set them to be with only 2 decimals rounded which >>\r\n // make sense when talking about money\r\n total = Math.round(total * 100) / 100\r\n // we get the \"cart-total-price\" element and we write inside it the euro sign and the number which is rounded to 2 decimals to be displayed in out total price section\r\n document.getElementsByClassName('cart-total-price')[0].innerText = '€' + total\r\n}", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "function addToCart(id) {\n var troba=false;\n if(cart.length==0){\n cart.push(products[id-1]);\n cart[0].quantity=1;\n }\n else if(cart.length>0){\n for(var i=0; i<cart.length; i++){\n if(products[id-1].name==cart[i].name){\n troba=true;}\n if(troba){\n cart[i].quantity++;}\n }\n if(troba==false){\n cart.push(products[id-1]);\n cart[cart.length-1].quantity=1;\n }\n }\n for( let i=0; i<cart.length; i++){\n cart[i].subtotal=cart[i].quantity*cart[i].price;\n }applyPromotionsCart();\n \n}", "function updateCart(productId, quantity, discount) {\n //var newquantity = document.getElementById(\"item_\" + productId).value;\n var newquantity = parseInt(quantity);\n var newdiscount = parseInt(discount);\n if (newquantity > -1) {\n if (newquantity < 1) {\n //Nếu cập nhật số lượng < 1 thì coi như là xóa sản phẩm khỏi cart\n deleteFromCart(productId, newquantity, discount);\n DeleteDetail(productId);\n } else {\n var current_cart = readCookie('quick_shopping_cart');\n var newCart = current_cart.split('$$');\n for (i = 0; i < newCart.length; i++) {\n var str = newCart[i].split(\"#\");\n if (str[0] == productId)\n str[1] = newquantity;\n newCart[i] = str.join(\"#\");\n }\n var newC = newCart.join(\"$$\");\n createCookie('quick_shopping_cart', newC, 1);\n }\n }\n checkPId(productId);\n if (newdiscount > -1) {\n var current_cart = readCookie('quick_shopping_cart');\n var newCart = current_cart.split('$$');\n for (i = 0; i < newCart.length; i++) {\n var str = newCart[i].split(\"#\");\n if (str[0] == productId)\n str[2] = newdiscount;\n newCart[i] = str.join(\"#\");\n }\n var newC = newCart.join(\"$$\");\n createCookie('quick_shopping_cart', newC, 1);\n }\n}", "function AddCartItem() {\r\n\tvar disc = 0.00;\r\n\tvar configitems_total = 0;\r\n\tvar ledger_id = 0;\r\n\tvar vouchertype_id = document.getElementById(\"txt_vouchertype_id\").value;\r\n\tvar config_inventory_current_stock = CheckNumeric(document .getElementById(\"txt_config_inventory_current_stock\").value);\r\n\tvar location_id = CheckNumeric(document.getElementById(\"txt_location_id\").value);\r\n\tif(location_id==0){\r\n\t\tlocation_id = CheckNumeric(document.getElementById(\"dr_location_id\").value);\r\n\t}\r\n\tvar branch_id = CheckNumeric(document.getElementById(\"txt_branch_id\").value);\r\n\tvar status = document.getElementById(\"txt_status\").value; var cart_session_id = CheckNumeric(document .getElementById(\"txt_session_id\").value);\r\n\tvar cart_voucher_id = CheckNumeric(document .getElementById(\"txt_voucher_id\").value);\r\n\tvar cart_uom_id = CheckNumeric(document.getElementById('uom_id').value);\r\n\tvar cart_uom_ratio = document.getElementById('uom_ratio').value;\r\n\tvar disc_type = CheckNumeric(document .getElementById('txt_item_price_disc_type').value);\r\n\tvar cart_boxtype_size = document.getElementById(\"txt_boxtype_size\").value;\r\n\tvar cart_vouchertype_id = CheckNumeric(document .getElementById(\"txt_vouchertype_id\").value);\r\n\tvar price_sales_customer_id = CheckNumeric(document .getElementById(\"txt_item_price_sales_customer_id\").value);\r\n\tvar price_discount1_customer_id = CheckNumeric(document .getElementById(\"txt_item_price_discount1_customer_id\").value);\r\n\tvar tax_rate1 = parseFloat(CheckNumeric(document .getElementById(\"txt_item_price_tax_rate1\").value));\r\n\tvar tax_customer_id1 = CheckNumeric(document .getElementById(\"txt_item_price_tax_customer_id1\").value);\r\n\tvar tax_id1 = CheckNumeric(document .getElementById(\"txt_item_price_tax_id1\").value);\r\n\tvar tax_rate2 = parseFloat(CheckNumeric(document .getElementById(\"txt_item_price_tax_rate2\").value));\r\n\tvar tax_customer_id2 = CheckNumeric(document .getElementById(\"txt_item_price_tax_customer_id2\").value);\r\n\tvar tax_id2 = CheckNumeric(document .getElementById(\"txt_item_price_tax_id2\").value);\r\n\tvar tax_rate3 = parseFloat(CheckNumeric(document .getElementById(\"txt_item_price_tax_rate3\").value));\r\n\tvar tax_customer_id3 = CheckNumeric(document .getElementById(\"txt_item_price_tax_customer_id3\").value);\r\n\tvar tax_id3 = CheckNumeric(document .getElementById(\"txt_item_price_tax_id3\").value);\r\n\tvar price_tax2_after_tax1 = CheckNumeric(document .getElementById('txt_price_tax2_after_tax1').value);\r\n\t// alert(\"price_tax2_after_tax1===\"+price_tax2_after_tax1);\r\n\tvar price_tax3_after_tax2 = CheckNumeric(document .getElementById('txt_price_tax3_after_tax2').value);\r\n\tvar cart_item_id = CheckNumeric(document.getElementById(\"txt_item_id\").value);\r\n//\tvar stock_qty = parseInt(document.getElementById(\"txt_stock_qty\").value);\r\n\tvar stock_qty =0;\r\n\tvar cart_alt_qty = CheckNumeric(document.getElementById('txt_item_qty').value);\r\n\tif (cart_alt_qty == 0 || cart_alt_qty == '' || cart_alt_qty == null || isNaN(cart_alt_qty) == true) {\r\n\t\tcart_alt_qty = 1;\r\n\t}\r\n\tvar cart_price = parseFloat(CheckNumeric(document .getElementById('txt_item_price').value));\r\n\tcart_price = CheckNumeric(cart_price / (cart_uom_ratio));\r\n\tvar cart_netprice = CheckNumeric(cart_price * cart_alt_qty * cart_uom_ratio);\r\n\tvar serial = 0;\r\n\tvar batch = 0;\r\n\tvar optioncount = 0;\r\n\r\n\t// From so, delnote To delnote, sales return\r\n\tvar voucher_so_id = CheckNumeric(document .getElementById(\"txt_voucher_so_id\").value);\r\n\tvar voucher_delnote_id = CheckNumeric(document .getElementById(\"txt_voucher_delnote_id\").value);\r\n\tvar disc_amt = parseFloat(CheckNumeric(document .getElementById('txt_item_price_dic').value));\r\n\tvar disc_per = parseFloat(CheckNumeric(document .getElementById('txt_item_price_disc_percent_add').value));\r\n\r\n\tif (disc_type == 1) {\r\n\t\tdisc = parseFloat(CheckNumeric(document .getElementById('txt_item_price_disc').value));\r\n\t\tdisc = CheckNumeric(disc / (cart_uom_ratio));\r\n\t} else {\r\n\t\tvar discpercent = parseFloat(CheckNumeric(document .getElementById('txt_item_price_disc_percent_add').value));\r\n\r\n\t\tdisc = (eval(cart_price) * (eval(discpercent) / 100));\r\n\t\t// disc = CheckNumeric(disc/(cart_uom_ratio));\r\n\r\n\t}\r\n\tcart_item_serial = '';\r\n\tcart_item_batch = 0;\r\n\tvar item_ticket_dept_id = 0;\r\n\t// Final Data To Be Sent\r\n\t// alert(\"discpercent===\"+discpercent);\r\n\tshowHintFootable('../accounting/invoice-details.jsp?'\r\n\t\t\t+'cart_session_id=' + cart_session_id\r\n\t\t\t+ '&cart_voucher_id=' + cart_voucher_id\r\n\t\t\t+ '&cart_discpercent=' + disc_per \r\n\t\t\t+ '&cart_boxtype_size=' + cart_boxtype_size \r\n\t\t\t+ '&config_inventory_current_stock=' + config_inventory_current_stock\r\n\t\t\t+ '&branch_id=' + branch_id \r\n\t\t\t+ '&location_id=' + location_id \r\n\t\t\t+ '&status=' + status \r\n\t\t\t+ '&cart_vouchertype_id=' + cart_vouchertype_id \r\n\t\t\t+ '&price_sales_customer_id=' + price_sales_customer_id \r\n\t\t\t+ '&cart_uom_id=' + cart_uom_id \r\n\t\t\t+ '&cart_uom_ratio=' + cart_uom_ratio \r\n\t\t\t+ '&disc=' + disc \r\n\t\t\t+ '&price_discount1_customer_id=' + price_discount1_customer_id \r\n\t\t\t+ '&cart_item_serial=' + cart_item_serial \r\n\t\t\t+ '&cart_item_batch=' + cart_item_batch \r\n\t\t\t+ '&tax_rate1=' + tax_rate1 \r\n\t\t\t+ '&tax_rate2=' + tax_rate2 \r\n\t\t\t+ '&tax_rate3=' + tax_rate3 \r\n\t\t\t+ '&tax_id1=' + tax_id1 \r\n\t\t\t+ '&tax_id2=' + tax_id2 \r\n\t\t\t+ '&tax_id3=' + tax_id3 \r\n\t\t\t+ '&tax_customer_id1=' + tax_customer_id1 \r\n\t\t\t+ '&tax_customer_id2=' + tax_customer_id2 \r\n\t\t\t+ '&tax_customer_id3=' + tax_customer_id3 \r\n\t\t\t+ '&cart_item_id=' + cart_item_id \r\n\t\t\t+ '&item_ticket_dept_id=' + item_ticket_dept_id \r\n\t\t\t+ '&cart_alt_qty=' + cart_alt_qty \r\n\t\t\t+ '&cart_price=' + cart_price \r\n\t\t\t+ '&cart_netprice=' + cart_netprice \r\n\t\t\t+ '&configitems_total=' + configitems_total \r\n\t\t\t+ '&voucher_so_id=' + voucher_so_id \r\n\t\t\t+ '&voucher_delnote_id=' + voucher_delnote_id \r\n\t\t\t+ '&price_tax2_after_tax1=' + price_tax2_after_tax1 \r\n\t\t\t+ '&price_tax3_after_tax2=' + price_tax3_after_tax2 \r\n\t\t\t+ '&ledger_id=' + ledger_id \r\n\t\t\t+ '&rowcount=yes&add_cartitem=yes&stock_qty=' + stock_qty, 'invoice_details');\r\n\t// IF Item is Configured with Sub-Items\r\n\t// if(optioncount==1){\r\n\t// setTimeout('AddConfiguredItems()',200);\r\n\t// }\r\n\tdocument.getElementById(\"txt_search\").value = \"\";\r\n\tdocument.getElementById(\"txt_search\").focus();\r\n//\tdocument.getElementById(\"getItemDetails\").style.display = 'none';\r\n\tdocument.getElementById(\"itemdetails\").style.display = 'none';\r\n//\tdocument.getElementById(\"searchitem\").style.display = 'none';\r\n\tdocument.getElementById(\"hint_search_item\").style.display = 'none';\r\n\t// }else{\r\n\t// alert(\"Maximum Item Qty in Stock is \"+stock_qty+\", can't add more than\r\n\t// this!\");\r\n\t// }\r\n}", "function addItemToCart(e) {\n e.preventDefault();\n const { target } = e;\n if (target.classList.value !== \"product-box__btn\") {\n return;\n }\n const priceObj = target.parentNode.firstElementChild;\n const price = parseInt(priceObj.innerText);\n const qtyObj = priceObj.nextElementSibling.firstElementChild;\n // Regular expr.\n const re = /\\d+/gm;\n //input validation\n if (!re.test(qtyObj.value) || qtyObj.value <= 0) {\n alert(\"В поле введены некорректные данные!\");\n return false;\n }\n const qty = parseInt(qtyObj.value);\n qtyObj.value = \"\";\n cart.update(qty, price);\n}", "function cart_qty_change(e, itemId, isAdd) {\n\n let cartItems = localStorage.getItem('productsInCart');\n cartItems = JSON.parse(cartItems);\n\n if (cartItems) {\n\n let prd_qty;\n let prd_sum = $(e).parent().parent().next().children();\n\n if (isAdd) prd_qty = $(e).prev();\n else prd_qty = $(e).next();\n\n let qty = Number(prd_qty.val());\n\n if (qty > 1 && isAdd == false) {\n qty -= 1;\n prd_qty.attr('value', qty);\n total = Number(cartItems[itemId]['price']) * qty;\n prd_sum.html('&#8377; ' + total);\n cartItems[itemId]['qty'] -= 1;\n localStorage.setItem(\"productsInCart\", JSON.stringify(cartItems));\n alter_totalCost(cartItems[itemId]['price'], isAdd = false);\n }\n else if (qty >= 1 && isAdd == true) {\n qty += 1;\n prd_qty.attr('value', qty);\n total = Number(cartItems[itemId]['price']) * qty;\n prd_sum.html('&#8377; ' + total);\n cartItems[itemId]['qty'] += 1;\n localStorage.setItem(\"productsInCart\", JSON.stringify(cartItems));\n alter_totalCost(cartItems[itemId]['price'], isAdd = true);\n }\n\n }\n}", "calculateTotal(price, skuId, qty) {\n let cartListArr = this.props.elcStore.cartList.length ? JSON.parse(this.props.elcStore.cartList) : {};\n if (Object.keys(cartListArr).length && cartListArr[skuId] !== undefined) {\n for (let x in cartListArr) {\n if (x === skuId) {\n cartListArr[skuId] = {qty: cartListArr[skuId].qty + qty};\n }\n }\n } else {\n cartListArr[skuId] = {qty: qty};\n }\n const total = this.state.total + (price * qty);\n const cartList = cartListArr;\n this.props.elcStore.cartListUpdate(total, cartList);\n }", "function updateCartTotal(){\n let cartItemContainer = document.querySelectorAll(\"#shoppingReminder\")[0];\n let cartRows = cartItemContainer.querySelectorAll(\"#shoppingRow\");\n let subTotal = 0 ;\n for (let i = 0 ; i<cartRows.length; i++){\n let cartRow = cartRows[i];\n let productPrice = cartRow.querySelectorAll(\".productPrice\")[0];\n let price = parseFloat(productPrice.innerText.replace('€',\"\"));\n let subTotalCount = document.querySelector(\"#subtotalcount\");\n subTotal += price;\n subTotalCount.innerHTML = subTotal +\"€\";\n }\n let totalCount = document.querySelector(\"#totalcount\");\n let delivery = document.querySelector(\"#deliverycost\")\n let deliveryCost =0 ;\n if(deliveryCost == 0 || null){\n delivery.innerHTML = \"Offerte\";\n }else{\n delivery.innerHTML = deliveryCost + \"€\";\n }\n totalCount.innerHTML = (subTotal + deliveryCost) + \"€\"; \n}", "function costWithTax(item) {\n return parseFloat( item.price + taxForItem(item) );\n }", "function changeQuantity(element) {\n current_value = $(element).val();\n product_id = $(element).data('id');\n \n let total_price = 0;\n if (current_value <= 0) {\n current_value = $(element).val(1)\n alert('Invalid Quamtity value');\n }\n \n products[product_id] = current_value;\n localStorage.setItem('cart', JSON.stringify(products));\n \n for(var key in price_per_item) {\n total_price += getPricePerProductQuantity(key, price_per_item[key])\n }\n $('#total_price').text(total_price);\n }", "function applyTaxToItems(user){\n return user\n}", "function applyTaxToItems(user){\n return user\n}", "function applyTaxToItems(user){\n return user\n}", "function addProductToShoppingCart(index) {\r\n let getLocalStorageData = localStorage.getItem(\"groceryListItem\");\r\n groceryListItem = JSON.parse(getLocalStorageData);\r\n const found = groceryListItem.splice(index,1);\r\n\r\n let getLocalStoragee = localStorage.getItem(\"shoppingCartListItem\");\r\n if(getLocalStoragee == null) {\r\n shoppingCartListItem = [];\r\n } else {\r\n shoppingCartListItem = JSON.parse(getLocalStoragee);\r\n }\r\n let x, y;\r\n Object.values(found).forEach(s => {\r\n x = s.name;});\r\n Object.values(found).forEach(s => {\r\n y = s.price;});\r\n let temp = {\r\n id: Date.now(),\r\n name: x,\r\n price: y\r\n };\r\n shoppingCartListItem.unshift(temp);\r\n localStorage.setItem(\"shoppingCartListItem\", JSON.stringify(shoppingCartListItem));\r\n showShoppingCartList();\r\n}", "ADD_TO_CART(state, product) {\n // Check if cart is empty\n if (Object.keys(state.cart).length != 0) {\n for (const [key, value] of Object.entries(state.cart)) {\n // Check if product already in cart, then change quantity \n if (key === product.reference) {\n product.qty = value.qty + state.qty\n state.cart[key].qty = product.qty\n } else {\n state.cart[product.reference] = product\n }\n }\n } else {\n state.cart[product.reference] = product\n }\n }", "function updateQuantity() {\n let prod = this.closest(\".cart-item\");\n let prod_cost = prod.children[2].innerText.slice(1);\n prod.children[4].innerText = `$${Number(prod_cost)*this.value}`\n\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 == prod.children[1].innerText) {\n z[k].quantity = this.value;\n }\n arr.push(z[k]);\n }\n localStorage.setItem(\"CartItem\", JSON.stringify(arr));\n}", "constructor() {\n /**\n * The tax of the product item after adjustments applying.\n * @member {Number} adjusted_tax\n */\n this.adjusted_tax = undefined\n\n /**\n * The base price for the line item, which is the price of the unit before applying\n * adjustments, in the purchase currency. The base price may be net or gross of\n * tax depending on the configured taxation policy.\n * @member {Number} base_price\n */\n this.base_price = undefined\n\n /**\n * The item identifier. Use this to identify an item when updating the item\n * quantity or creating a custom price adjustment for an item.\n * @member {String} item_id\n */\n this.item_id = undefined\n\n /**\n * The text describing the item in more detail.\n * @member {String} item_text\n */\n this.item_text = undefined\n\n /**\n * The price of the line item before applying any adjustments. If the line item is\n * based on net pricing then the net price is returned. If the line item is\n * based on gross pricing then the gross price is returned.\n * @member {Number} price\n */\n this.price = undefined\n\n /**\n * Array of price adjustments. Can be empty.\n * @member {Array.<module:models/PriceAdjustment>} price_adjustments\n */\n this.price_adjustments = undefined\n\n /**\n * The price of the product line item after applying all product-level adjustments.\n * For net pricing the adjusted net price is returned. For gross pricing,\n * the adjusted gross price is returned.\n * @member {Number} price_after_item_discount\n */\n this.price_after_item_discount = undefined\n\n /**\n * The identifier of the shipment to which this item belongs.\n * @member {String} shipment_id\n */\n this.shipment_id = undefined\n\n /**\n * The tax of the product item before adjustments applying.\n * @member {Number} tax\n */\n this.tax = undefined\n\n /**\n * The price used to calculate the tax for this product item.\n * @member {Number} tax_basis\n */\n this.tax_basis = undefined\n\n /**\n * The tax class ID for the product item or null if no tax class ID is associated with the product item.\n * @member {String} tax_class_id\n */\n this.tax_class_id = undefined\n\n /**\n * The tax rate, which is the decimal tax rate to be applied to the product represented by this item.\n * @member {Number} tax_rate\n */\n this.tax_rate = undefined\n }", "function UpdateCart(quantityChanged, target, type, idx) {\n var cartContainer = document.getElementsByClassName('products')[0];\n var allproducts = cartContainer.getElementsByClassName('product');\n var totalprice = 0;\n for (var i = 0; i < allproducts.length; i++) {\n var CartProduct = allproducts[i];\n var price1kgProduct = CartProduct.getElementsByClassName('product-price-1kg')[0];\n var quantity1kgProduct = CartProduct.getElementsByClassName('product-quantity-1kg-input')[0];\n var price1kgNumber = parseFloat(price1kgProduct.innerText.replace('$ - 1KG', ''));\n var quantity1kg = quantity1kgProduct.value;\n var priceHalfkgProduct = CartProduct.getElementsByClassName('product-price-Halfkg')[0];\n var quantityHalfkgProduct = CartProduct.getElementsByClassName('product-quantity-Halfkg-input')[0];\n var priceHalfkgNumber = parseFloat(priceHalfkgProduct.innerText.replace('$ - 0.5KG', ''));\n var quantityHalfkg = quantityHalfkgProduct.value;\n totalprice = totalprice + (price1kgNumber * quantity1kg) + (priceHalfkgNumber * quantityHalfkg);\n }\n totalprice = Math.round(totalprice * 100) / 100\n document.getElementsByClassName('cartTotaPrice')[0].innerText = updateTotalPriceData() + '$';\n sessionStorage.setItem('CartTotalPrice', totalprice);\n if (quantityChanged) {\n console.log(target);\n QuantityFromIceCream[idx][type] = +target.value;\n updateShoppingCart();\n }\n //()\n\n}", "function currentQuantityCart() {\n\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 change_quantity_in_cart(itemid,mode){\n if(mode==1){\n cart_info[itemid].cart_item.quantity+=1;\n cart_info[itemid].cart_div.find(\".cart-item-quantity\")[0].value=cart_info[itemid].cart_item.quantity;\n }else if(mode==0){\n $(cart_info[itemid].cart_div).remove();\n delete cart_info[itemid]; \n }else if(mode==-1){\n if(cart_info[itemid].cart_item.quantity==1){\n return;\n }\n cart_info[itemid].cart_item.quantity-=1;\n cart_info[itemid].cart_div.find(\".cart-item-quantity\")[0].value=cart_info[itemid].cart_item.quantity;\n }\n \n}", "function addItemToCart(user, item) {}", "function resToCartClicked(e){\n const button = e.target;\n const item = button.closest(\".detalle__compra\");\n const itemPrecio = Number(item.querySelector(\".precio\").textContent.replace(\"$\",\"\"));\n const itemProdId = Number(item.querySelector(\".idProdCarrito\").textContent);\n const precios = item.querySelector(\"#precios\");\n const cantidad = item.querySelector(\"#cantidad\");\n itemCantidad= Number(cantidad.value)-1;\n if(cantidad.value >= 1 & nuevasub > 0){\n cantidad.value = itemCantidad;\n }\n if(itemCantidad >= 0){\n sumaItem(itemProdId,itemCantidad);\n nuevasub = nuevasub - itemPrecio;\n precios.innerHTML = `<p>\n $${cantidad.value * itemPrecio}\n </p>`\n \n subTotal.innerHTML = `<h3>Subtotal</h3>\n <p>$${nuevasub}</p>`\n total.innerHTML = `<h2>Total</h2>\n <p>$${nuevasub}</p>`\n };\n}", "function repositionStoreItems() {\n if (collectItems.storeItems[4].owned == 0) { buyGeneralItem6.setHidden(true); buyGeneralItem7.setHidden(true); }\n else { buyGeneralItem6.setHidden(false); buyGeneralItem7.setHidden(false); }\n //move pick\n if (collectItems.storeItems[2].owned == 1) { item3y = 0; }\n else { item3y = 65; }\n //move Press\n if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 1) { item4y = 0; }\n else if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 0) { item4y = 65; }\n else if (collectItems.storeItems[2].owned == 0 && collectItems.storeItems[3].owned == 1) { item4y = 65; }\n else { item4y = 130; }\n\n //move Bottles and barrels\n if (collectItems.storeItems[4].owned == 1) { buyGeneralItem4.setHidden(true); buyGeneralItem6.setHidden(false); buyGeneralItem7.setHidden(false); }\n if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 1 && collectItems.storeItems[4].owned == 1) { item6y = 0; item7y = 65; buyGeneralItem4.setHidden(true); buyGeneralItem6.setHidden(false).setPosition(0, item5y); buyGeneralItem7.setHidden(false); }\n else if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 0 && collectItems.storeItems[4].owned == 1) { item6y = 0; item7y = 65; buyGeneralItem6.setHidden(false); }\n else if (collectItems.storeItems[2].owned == 0 && collectItems.storeItems[3].owned == 1 && collectItems.storeItems[4].owned == 1) { item6y = 0; item7y = 65; buyGeneralItem6.setHidden(false); }\n else if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 1 && collectItems.storeItems[4].owned == 0) { item6y = 0; item7y = 65; buyGeneralItem4.setHidden(false); buyGeneralItem6.setHidden(true); }\n else if (collectItems.storeItems[2].owned == 0 && collectItems.storeItems[3].owned == 0 && collectItems.storeItems[4].owned == 1) { item6y = 130; item7y = 195; buyGeneralItem6.setHidden(false); }\n else if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 0 && collectItems.storeItems[4].owned == 0) { item6y = 130; item7y = 195; buyGeneralItem4.setHidden(false); buyGeneralItem6.setHidden(true); buyGeneralItem7.setHidden(true); }\n else if (collectItems.storeItems[2].owned == 0 && collectItems.storeItems[3].owned == 1 && collectItems.storeItems[4].owned == 0) { item6y = 130; item7y = 195; buyGeneralItem4.setHidden(false); buyGeneralItem6.setHidden(true); buyGeneralItem7.setHidden(true); }\n if (collectItems.storeItems[4].owned == 1) { buyGeneralItem4.setHidden(true); buyGeneralItem6.setHidden(false); buyGeneralItem7.setHidden(false); }\n buyGeneralItem3.setPosition(0, item3y);\n buyGeneralItem4.setPosition(0, item4y);\n \n buyGeneralItem6.setPosition(0, item5y);\n buyGeneralItem7.setPosition(0, item6y);\n //console.log(\"item6 is hidden = \" + buyGeneralItem6.getHidden() + \" position = \" + buyGeneralItem6.getPosition().y)\n if (collectItems.storeItems[7].owned == 1) { buyGeneralItem7.setHidden(true); }\n }", "function afterRemove(product){\n document.getElementById('cart-' + product).style.display = 'none';\n const itemNum = getProductCount(product);\n const unitPrice = (product === 'phone')? 1219 : 59 ;\n\n const subTotal = parseFloat((document.getElementById('subtotal').innerText).split(\",\").join(\"\"));\n const updatedSubtotal = subTotal - (itemNum*unitPrice);\n document.getElementById('subtotal').innerText = updatedSubtotal.toLocaleString();\n\n const updatedTax = Math.round(updatedSubtotal * 0.08);\n document.getElementById('tax').innerText = updatedTax.toLocaleString();\n\n const updatedTotal = updatedSubtotal + updatedTax;\n document.getElementById('total').innerText = updatedTotal.toLocaleString();\n}", "function calcItemPrice(baseCost, quantity, frameCost, glassCost, mattID) {\n var cost = (baseCost + frameCost + glassCost) * quantity;\n if(mattID != 35) { cost += (10 * quantity);}\n return formatMoney(cost);\n }", "function add_tax_to_price_onscreen(tax) {\n let price_id = get_price_div();\n let price = get_price()\n let p = document.getElementById(price_id);\n p.innerText = \"$\" + (price * (1 + tax)).toFixed(2) + \" with tax\";\n console.log(\"price adjusted.\");\n}", "function updateCartTotal() {\n var cartItem = document.getElementsByClassName(\"cart-item\");\n var total = 0;\n for (var i = 0; i < cartItem.length; i++) {\n var price = parseFloat(\n cartItem[i]\n .getElementsByClassName(\"item-price\")[0]\n .innerText.replace(\"$\", \"\")\n );\n var quantity = parseInt(\n cartItem[i].getElementsByClassName(\"item-quantity\")[0].innerText\n );\n total = total + price * quantity;\n }\n document.getElementsByClassName(\"subtotal\")[0].innerText = total.toFixed(2);\n document.getElementsByClassName(\"qst\")[0].innerText = (\n 0.09975 * total\n ).toFixed(2);\n document.getElementsByClassName(\"gst\")[0].innerText = (0.05 * total).toFixed(\n 2\n );\n document.getElementsByClassName(\"total\")[0].innerText = (\n parseFloat(document.getElementsByClassName(\"subtotal\")[0].innerText) +\n parseFloat(document.getElementsByClassName(\"qst\")[0].innerText) +\n parseFloat(document.getElementsByClassName(\"gst\")[0].innerText)\n ).toFixed(2);\n }", "function handleQuantityChange (input) {\r\n // make sure the minimum value is 1\r\n if (input.value < 1) input.value = 1\r\n // make sure the maximum value is 10\r\n if (input.value > 10) input.value = 10\r\n\r\n // get the id(index of item with the modified quantity)\r\n const id = input.id[input.id.length - 1]\r\n // get price element using the id and retrive the price\r\n const priceEl = document.getElementById('price' + id)\r\n let price = priceEl.innerHTML\r\n price = price.substring(1).split(' ').join('') // remove any spaces from the text\r\n price = eval(price + '*' + input.value) // multiply the price by the new quantity value (input)\r\n price = price.toFixed(2) // fix it to 2 decimal places\r\n\r\n // get the price-tag element based on the id and update the price with the new price\r\n const priceTag = document.getElementById('pricetag' + id)\r\n priceTag.innerHTML = String(price)\r\n\r\n // re-calculate the cart total\r\n getCartTotal()\r\n}", "addToCart(newItem) {\n let itemExisted = false\n let updatedCart = this.state.cart.map(item => {\n if (newItem === item.sku) {\n itemExisted = true\n return { sku: item.sku, quantity: ++item.quantity }\n } else {\n return item\n }\n })\n if (!itemExisted) {\n updatedCart = [...updatedCart, { sku: newItem, quantity: 1 }]\n }\n this.setState({ cart: updatedCart })\n // Store the cart in the localStorage.\n // localStorage.setItem('stripe_checkout_items', JSON.stringify(updatedCart))\n }", "function update_local_cart(case_option,cart,ops=null){\r\n switch(case_option) {\r\n case 1:\r\n cart.push(ops)\r\n break;\r\n case 2:\r\n \r\n for (let i = 0; i < cart.length; i++) {\r\n const element = cart[i];\r\n if(element['item'] == ops.item){\r\n cart.splice(i, 1);\r\n // element['qty'] = 0\r\n }\r\n }\r\n break;\r\n case 3:\r\n for (let i = 0; i < cart.length; i++) {\r\n const element = cart[i];\r\n if(element['item']==ops.item){\r\n element['qty'] = parseFloat(ops.qty)\r\n }\r\n }\r\n break; \r\n default:\r\n \r\n }\r\n \r\n \r\n return cart\r\n \r\n }", "function removeFromInvoice( id )\n\t{\n\n\t\t\tvar item = {};\n\t\t\t// console.log(\"finding : \" + id );\n\t\t\t// find item from array. this may not work in old browsers\n\t\t\titem\t\t\t\t=\tcart.find(x => x.ID == id);\n\t\t\t\n\t\t\tif( item === undefined) return;\n\t\t\t\n\t\t\t// subtract price from total (decimal float)\n\t\t\tcart.totalCost \t\t-= parseFloat(item.PriceSAR, 10);\n\t\t\tcart.totalCost\t\t= parseFloat(cart.totalCost.toFixed(4));\n\t\t\t\n\t\t\t// items total cost\n\t\t\tcart.itemsCost \t\t-= parseFloat(item.PriceSAR, 10);\n\t\t\tcart.itemsCost\t\t= parseFloat(cart.itemsCost.toFixed(4)) ;\n\t\t\t\n\t\t\t// items total shipping cost\n\t\t\tcart.shippingCost \t-= parseFloat(item.ShippingCost, 10);\n\t\t\tcart.shippingCost\t= parseFloat(cart.shippingCost.toFixed(4)) ;\n\t\t\t\n\t\t\t// item tax\n\t\t\tcart.itemsTax \t\t-= parseFloat(item.TaxSAR, 10);\n\t\t\tcart.itemsTax\t\t= parseFloat(cart.itemsTax.toFixed(4)) ;\n\t\t\t\n\t\t\tcart.invoiceCost\t= cart.itemsCost + cart.shippingCost;\n\t\t\tcart.invoiceCost\t= parseFloat(cart.invoiceCost.toFixed(4));\n\t\t\t\n\t\t\t\n\t\t\t// remove product from cart\n\t\t\tcart.removeItem(\"ID\", id)\n\t\t\t\n\t\t\t// update invoice\n\t\t\tupdateInvoice();\n\t\t\n\t}", "function addItemToCart(user, item) {\n\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}", "function getTaxRate(shoppingCart){\n //takes in the above shopping cart as input\n //returns the tax rate\n var taxRate = shoppingCart.tax;// grabs shopping cart object and pulls tax information out of it\n return taxRate;// return the tax value\n}", "function makePurchase(product, quantity) {\n\tconnection.query(\n\t \"UPDATE products SET stock_quantity = stock_quantity - ? WHERE item_id = ?\",\n\t [quantity, product.item_id],\n\t function(err, res) {\n\t\t// Let the user know the purchase was successful, re-run loadProducts\n\t\tconsole.log(\"\\nSuccessfully purchased \" + quantity + \" \" + product.product_name + \"'s!\");\n\t\tdisplayProducts();\n\t }\n\t);\n }", "setItemsInCartTaxes(state, taxes) {\n state.itemsInCartTaxes = taxes;\n }", "function adjustQuantity() {\n let incrementButton = document.querySelectorAll(\".cartIncrement\");\n let decrementButton = document.querySelectorAll(\".cartDecrement\");\n let cartProduct = localStorage.getItem(\"coffeeInCart\");\n let currentQuantity = 0;\n let currentItem = \"\";\n cartProduct = JSON.parse(cartProduct);\n\n for (let i = 0; i < incrementButton.length; i++) {\n incrementButton[i].addEventListener(\"click\", () => {\n currentQuantity = incrementButton[i].parentElement.querySelector(\"span\").textContent;\n currentItem = incrementButton[i].parentElement.previousElementSibling.previousElementSibling.querySelector(\"span\").textContent;\n cartProduct[currentItem].insideCart += 1;\n cartQuantity(cartProduct[currentItem]);\n costTotal(cartProduct[currentItem]);\n localStorage.setItem(\"coffeeInCart\", JSON.stringify(cartProduct));\n cartDisplay();\n });\n }\n\n for (let i = 0; i < decrementButton.length; i++) {\n decrementButton[i].addEventListener(\"click\", () => {\n currentQuantity = decrementButton[i].parentElement.querySelector(\"span\").textContent;\n currentItem = decrementButton[i].parentElement.previousElementSibling.previousElementSibling.querySelector(\"span\").textContent;\n\n if (cartProduct[currentItem].insideCart > 1) {\n cartProduct[currentItem].insideCart -= 1;\n cartQuantity(cartProduct[currentItem], \"decrement\");\n costTotal(cartProduct[currentItem], \"decrement\");\n localStorage.setItem(\"coffeeInCart\", JSON.stringify(cartProduct));\n cartDisplay();\n }\n });\n }\n}", "function buyMe(selection){\n\t\tif(selection.attr(\"data-cart\") === \"no\"){\n\t\t\tselection.attr(\"data-cart\", \"yes\");\n\t\t\t$(\".buy\").text(\"Remove Item\");\n\t\t\t$(\".buy\").removeClass(\"buy-green\").addClass(\"buy-black\");\n\t\t\tshoppingTotal += parseFloat(selection.attr(\"data-price\"));\n\t\t\t$(\".shopping-total\").text(\"$\" + parseFloat(shoppingTotal).toFixed(2));\n\t\t}else{\n\t\t\tselection.attr(\"data-cart\", \"no\");\n\t\t\t$(\".buy\").text(\"Add to Cart\");\n\t\t\t$(\".buy\").removeClass(\"buy-black\").addClass(\"buy-green\");\n\t\t\tshoppingTotal -= parseFloat(selection.attr(\"data-price\"));\n\t\t\t$(\".shopping-total\").text(\"$\" + parseFloat(shoppingTotal).toFixed(2));\n\t\t}\n\t}", "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 removeItemFromCart(){\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 applyTaxToItems(user){\n const\n}", "function increaseQuantity(){\n let currentCost = (document.getElementById(\"cat-harness-item-cost\").innerHTML).replace( /^\\D+/g, '');\n if (quantity == 1){\n totalCost = 58;\n }\n else{\n totalCost = totalCost+(parseInt(currentCost)/(quantity));\n }\n quantity = parseInt(document.getElementById(\"num-items\").innerHTML, 10) + 1;\n document.getElementById(\"num-items\").innerHTML = quantity;\n document.getElementById(\"cat-harness-item-cost\").innerHTML = \"$\" + totalCost;\n \n}", "function upDateTotalPrice() {\n let cartItems = document.getElementsByClassName(\"cart-items\");\n for (let i = 0; i < cartItems.length + 1; i++) {\n const cartItem = cartItems[i];\n if (cartItems.length > 0) {\n const elementPrice = cartItem.getElementsByClassName(\"element-price\")[i].innerHTML;\n const elementPriceInt = parseFloat(elementPrice);\n\n\n\n\n let totalPrices = document.getElementsByClassName(\"Total-prices\")\n for (let j = 0; j < totalPrices.length; j++) {\n const totalPrice = totalPrices[j]\n totalPrice.innerHTML = \"$\" + elementPriceInt\n }\n }\n else {\n let totalPrices = document.getElementsByClassName(\"Total-prices\")\n for (let j = 0; j < totalPrices.length; j++) {\n const totalPrice = totalPrices[j]\n totalPrice.innerHTML = \"$\" + 0\n alert(\"Are you went to remove all product\")\n }\n\n }\n\n\n }\n}", "function addToCart(payload) {\n const inCart = cartItems.findIndex((item) => item.beer === payload.beer);\n if (inCart === -1) {\n //add\n console.log(payload);\n const nextPayload = { ...payload };\n nextPayload.amount = payload.amount;\n setCartItems((prevState) => [...prevState, nextPayload]);\n } else {\n //it exists, modify amount\n const nextCart = cartItems.map((item) => {\n if (item.beer === payload.beer) {\n item.amount += payload.amount;\n }\n return item;\n });\n setCartItems(nextCart);\n }\n }", "function addToInvoice( newItem ){\n\t\t\n\t\t// console.log( \"adding newItem: \" + newItem.ID);\n\t\t// add product to cart\n\t\tcart.push(newItem);\n\t\t\n\t\t// items total cost\n\t\tcart.itemsCost \t+= parseFloat(newItem.PriceSAR, 10);\n\t\tcart.itemsCost\t= parseFloat(cart.itemsCost.toFixed(4)) ;\n\t\t\n\t\tcart.itemsTax\t+= parseFloat(newItem.TaxSAR, 10) ;\n\t\tcart.itemsTax\t= parseFloat(cart.itemsTax.toFixed(4)) ;\n\t\t\n\t\t// items total shipping cost\n\t\tcart.shippingCost \t+= parseFloat(newItem.ShippingCost, 10);\n\t\tcart.shippingCost\t= parseFloat(cart.shippingCost.toFixed(4)) ;\n\t\t// console.log( cart.totalCost)\n\t\t\n\t\t// item tax\n\t\tcart.invoiceCost\t= cart.itemsCost + cart.shippingCost + cart.itemsTax;\n\t\tcart.invoiceCost\t= parseFloat(cart.invoiceCost.toFixed(4));\n\t\t\n\t\t// update invoice\n\t\tupdateInvoice();\n\t\t\n\t\tmycart = cart;\n\t}", "function placeOrder(id, quantity, item){\n\n var currentQuantity = item.quantity - quantity;\n var price = item.price * quantity;\n\n var query = `UPDATE PRODUCTS `+ \n `SET STOCK_QUANTITY = ${currentQuantity}, ` + \n `PRODUCT_SALES = ${price} + COALESCE(PRODUCT_SALES,0), ` +\n `PRODUCT_SOLD = ${quantity} + COALESCE(PRODUCT_SOLD,0) ` +\n `WHERE ITEM_ID = ${id};`;\n\n connection.query(query, function(err,data){\n if(err) {\n connection.end();\n throw err\n };\n\n console.log(`Product Updated to New Quantity ${currentQuantity}`);\n console.log(`Price $${price}`);\n });\n\n connection.end();\n }", "function itemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n}", "function addAnotherProductToCart(event) {\n let productname = event.dataset.productname;\n let product = myCart.find(element => element.product === productname);\n product.amount++;\n //update the amount html\n updateProductAmountHtml(productname, product.amount);\n //also update the storage\n saveToStorage(productname, JSON.stringify(product));\n}", "function MovetoCart() {\n saleprice = parseFloat(shoppingcartitem.SalePrice);\n regularprice = parseFloat(shoppingcartitem.RegularPrice);\n isFreeShipping = shoppingcartitem.isFreeShipping;\n if (shoppingcartitem.isOnSale === true) {\n arrayShoppingCart.push({LblProductCartName: shoppingcartitem.Name, ImgCart: \"cartremoveitem.png\", LblProductCartPrice: {text:\"$ \" + saleprice, skin:\"red\"}, cartdetailproductprice: saleprice, \"saleprice\": saleprice, \"regularprice\": regularprice, \"isFreeShipping\": isFreeShipping});\n } else {\n arrayShoppingCart.push({LblProductCartName: shoppingcartitem.Name, ImgCart: \"cartremoveitem.png\", LblProductCartPrice: {text:\"$ \" + regularprice, skin: \"\"}, cartdetailproductprice: regularprice, \"saleprice\": saleprice, \"regularprice\":regularprice, \"isFreeShipping\": isFreeShipping});\n }\n alert(\"Added to Cart\");\n}", "updateBasket(item, amount){\n let itemsBought = Object.assign({}, this.state.itemsBought);\n //if changed mind and down to 0, remove from bought items list\n if(amount < 1){\n delete itemsBought[item];\n }else{\n itemsBought[item] = this.state.items[item];\n }\n this.setState({itemsBought : itemsBought});\n }", "function buyItem() {\n\n}", "function purchase(itemId, neededQuant) {\n connection.query(`SELECT * FROM products WHERE id = ${itemId}`, function (err, res) {\n if (err) throw err;\n if(res[0].stock_quantity < neededQuant) {\n console.log(\"Insufficient stock! Sorry. Please check again.\")\n } else {\n connection.query(`UPDATE products SET stock_quantity = ${res[0].stock_quantity} - ${neededQuant} WHERE id = ${itemId}`);\n //sets price to a variable for easy use\n var total = res[0].price * neededQuant;\n console.log(`\nYour total today comes up to ${total}. Thank you for shopping and please come again.\n `)\n }\n connection.end();\n });\n}", "function purchaseItem() {\n return\n}", "function cartQntAndPrice(el) {\n let inpEl = el.querySelector('.product__qntInput'); // get element of input\n let qntValue = Number(inpEl.getAttribute('value')); // get value of input\n let decBtn = el.querySelector('.product__qnt-btn--dec'); // get element of decrease button\n let incBtn = el.querySelector('.product__qnt-btn--inc'); // get element of increase button\n\n // let maxQnt = Number(document.querySelector('.product__qnt-note-num').innerHTML); // get element of max quantity then convert to number\n let maxQnt = Number(document.querySelector('.product__max_quantity').value); // get element of max quantity\n \n\n let priceTotal = el.querySelector('.price'); // get element of total price of item\n let cartEls = document.querySelectorAll('.cart-item'); // get element of cart items\n let amountTotal = document.querySelector('.cart-page-footer__summary-amount'); // get element of total amount\n let amountTotalNew = 0;\n\n let itemsQnt = document.querySelector('.cart-page-footer__summary-text .qnt'); // get element of current cart items quanity\n let allQntBtn = document.querySelector('.cart-page-footer__product-count'); // get element of cart sellect all quanity button\n let allQnt = allQntBtn.querySelector('.qnt'); // get element of cart sellect all quanity\n \n let cartElsQnt; // save quantity of cart items\n\n // get quantity of cart items\n let getCardsQnt = () => {\n let cartProductsCtn = document.querySelector('.cart-page-shop-section__items'); // get element of cart items container\n let cartEls = cartProductsCtn.querySelectorAll('.cart-item'); // get element of cart items\n cartElsQnt = 0;\n \n for (let cartEl of cartEls) {\n cartElsQnt += Number(cartEl.querySelector('.product__qntInput').value);\n }\n itemsQnt.innerHTML = cartElsQnt;\n allQnt.innerHTML = cartElsQnt;\n }\n\n getCardsQnt();\n\n // handle total price when manipulate with input\n // let handlePriceTotal = (btn) => {\n // let curPrice = btn.parentElement.previousElementSibling.querySelector('.cart-item__cell-unit-price--new').innerHTML; // get element of current prices\n // curPrice = Number(curPrice.replace(/đ|\\./g,'')); // convert current price to number\n // curPrice *= inpEl.value;\n // priceTotal.innerHTML = `đ${(numberWithCommas(curPrice))}`;\n // }\n \n // inpEl.setAttribute('maxlength', (maxQnt.toString()).length);\n\n inpEl.oninput = () => {\n inpEl.setAttribute('value', inpEl.value);\n qntValue = Number(inpEl.value);\n\n if (inpEl.value >= maxQnt) {\n inpEl.value = maxQnt;\n inpEl.setAttribute('value', maxQnt);\n qntValue = Number(inpEl.value);\n alert(\"Sản phẩm trong kho chỉ còn < \" +maxQnt);\n }\n\n if (/^\\d*$/.test(inpEl.value)) {\n inpEl.oldValue = inpEl.value;\n } else if ('oldValue' in inpEl) {\n inpEl.setAttribute('value', inpEl.oldValue);\n inpEl.value = inpEl.oldValue;\n } else {\n inpEl.value = '';\n }\n\n // handlePriceTotal(inpEl);\n // handleAmountTotal(0);\n getCardsQnt(inpEl.value);\n }\n\n window.onclick = () => {\n let inpEls = document.querySelectorAll('.product__qntInput'); // get element of inputs\n for (let inpEl of inpEls) {\n if (inpEl.value === '') {\n let inpPar = inpEl.parentElement; // get element of input's parrent\n let oldPrice = inpPar.previousElementSibling.querySelector('.cart-item__cell-unit-price--new').innerHTML; // get element of old price\n let totalPrice = inpPar.nextElementSibling; // get element of total price\n \n inpEl.setAttribute('value', '1');\n inpEl.value = 1;\n totalPrice.innerHTML = oldPrice;\n // handleAmountTotal(0);\n }\n }\n }\n \n incBtn.onclick = (e) => {\n if (incBtn.previousElementSibling.value === '1') {\n qntValue = 1;\n }\n\n if (qntValue < maxQnt) {\n \n inpEl.setAttribute('value', qntValue += 1);\n inpEl.value = qntValue;\n \n // handlePriceTotal(incBtn);\n // handleAmountTotal(0);\n getCardsQnt(inpEl.value);\n }\n else {\n alert(\"Sản phẩm trong kho chỉ còn < \" +maxQnt);\n }\n e.preventDefault();\n \n } \n\n decBtn.onclick = (e) => {\n if (qntValue > 1) {\n inpEl.setAttribute('value', qntValue -= 1);\n inpEl.value = qntValue;\n\n // handlePriceTotal(decBtn);\n // handleAmountTotal(0);\n getCardsQnt(inpEl.value);\n } \n e.preventDefault();\n }\n\n // handle amount total\n // let handleAmountTotal = (num) => {\n // let cartEls = document.querySelectorAll('.cart-item'); // get element of cart items\n // if (num === 0) {\n // amountTotalNew = num;\n // } \n // for (let cartEl of cartEls) {\n // let cartElPrice = cartEl.querySelector('.price').innerHTML; \n // cartElPrice = Number(cartElPrice.replace(/đ|\\./g, ''));\n // amountTotalNew+=cartElPrice;\n // }\n // amountTotal.innerHTML = `đ${(numberWithCommas(amountTotalNew))}`;\n // }\n\n // handleAmountTotal();\n\n function numberWithCommas(x) {\n return x.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \".\");\n }\n\n \n //handle actions\n let handleActions = () => {\n let allQnt = allQntBtn.querySelector('.qnt'); // get element of cart sellect all quanity\n // check cart items length\n let checkLen = () => {\n return document.querySelectorAll('.cart-item').length; // get element of cart items length\n }\n\n \n let allCheck = document.querySelector('#cart-checkbox-all'); // get element of checkbox all input\n let supChecks = document.querySelectorAll('.cart-checkbox-sup'); // get element of sup input checkboxs\n let delBtnMain = document.querySelector('.cart-page-footer__btn-delete'); // get element of delete button\n let checkCl = 'cart-checkbox--checked';\n \n for (let supCheck of supChecks) {\n supCheck.oninput = () => {\n if (supCheck.classList.contains(checkCl)) {\n supCheck.classList.remove(checkCl);\n allCheck.classList.remove(checkCl);\n } else {\n supCheck.classList.add(checkCl);\n }\n }\n }\n\n // auto checked all checkbox when checkbox all is clicked\n let checkAll = () => {\n if (allCheck.classList.contains(checkCl)) {\n allCheck.classList.remove(checkCl);\n } else {\n allCheck.classList.add(checkCl);\n }\n\n for (let supCheck of supChecks) {\n if (supCheck.classList.contains(checkCl)) {\n supCheck.classList.remove(checkCl);\n } \n if (allCheck.classList.contains(checkCl)) {\n supCheck.classList.add(checkCl);\n }\n }\n }\n\n allQntBtn.onclick = () => {\n checkAll();\n }\n \n allCheck.oninput = () => {\n checkAll();\n }\n\n delBtnMain.onclick = () => { \n let confirmCtn = document.querySelector('.confirm-deletion-container'); // get element of deletion confirm container \n let cfmOverlay = confirmCtn.querySelector('.confirm-deletion-overlay'); // get element of deletion confirm overlay \n\n for (let cartEl of cartEls) {\n if (cartEl.querySelector('.cart-checkbox').classList.contains(checkCl)) {\n confirmCtn.style.display = 'flex';\n\n let cfmBackBtn = confirmCtn.querySelector('.confirm-deletion__btn--back'); // get element of confirm back button\n\n cfmBackBtn.onclick = () => {\n confirmCtn.style.display = 'none';\n }\n\n cfmOverlay.onclick = () => {\n confirmCtn.style.display = 'none';\n }\n }\n }\n }\n }\n \n handleActions();\n}", "function addToCart(newItem, itemQuantity, itemPrice) {\n\n for (let i = 0; i < cartItems.length; i++) {\n if (cartItems[i].item === newItem) {\n cartItems[i].quantity += itemQuantity;\n total()\n\n return\n }\n }\n\n setCartItems([...cartItems, {\n item: newItem,\n quantity: itemQuantity,\n price: itemPrice\n }])\n\n\n total()\n }", "function getItem(){ \n var itemContainer = this.closest(\"div\"); \n var quantity = itemContainer.querySelector(\".quantity-input\");\n var itemName = itemContainer.querySelector(\".item-name\")\n var totalPrice = itemContainer.querySelector(\".total-price\")\n var newItem = {}; \n inventory.map(function (inventoryItem){\n if(itemName.innerHTML === inventoryItem.name){\n newItem = inventoryItem\n totalPrice.innerHTML = (inventoryItem.price).toFixed(2)\n }\n })\n addItemToCart(newItem, parseInt(quantity.value))\n quantity.value = \"\";\n quantity.placeholder = 1\n}", "function addTax(goods, taxPct){\n return goods + (goods * (taxPct/100));\n}" ]
[ "0.7443831", "0.729691", "0.7206038", "0.71875536", "0.689346", "0.68917716", "0.6810214", "0.6809397", "0.68011695", "0.6760368", "0.6757188", "0.6750302", "0.6685144", "0.66638607", "0.66591364", "0.6634718", "0.65394664", "0.65353835", "0.6533203", "0.6527724", "0.6527724", "0.6527724", "0.6527724", "0.6527724", "0.6527724", "0.65215135", "0.64618206", "0.64618206", "0.64129514", "0.6391204", "0.63750917", "0.6371556", "0.6345889", "0.63412905", "0.63106984", "0.6279491", "0.6264504", "0.62319976", "0.61935866", "0.6188162", "0.61850524", "0.6180622", "0.6176336", "0.6169185", "0.6162426", "0.6146424", "0.6125352", "0.61253345", "0.610427", "0.6098765", "0.6087995", "0.606061", "0.60525566", "0.60525566", "0.60525566", "0.6049702", "0.604071", "0.6035877", "0.6031187", "0.6031076", "0.6027148", "0.6024245", "0.6021773", "0.599601", "0.59891635", "0.5988368", "0.5983719", "0.5981026", "0.5971813", "0.59713405", "0.59704083", "0.59697074", "0.59671205", "0.5963104", "0.59618473", "0.5961055", "0.5960774", "0.5958903", "0.59578395", "0.5954618", "0.59531057", "0.5952756", "0.59506744", "0.59448767", "0.5944643", "0.594389", "0.5940047", "0.5937586", "0.5934397", "0.59322244", "0.592858", "0.59256566", "0.5922372", "0.5921882", "0.5918301", "0.59176344", "0.5916574", "0.5910551", "0.5904536", "0.5901577", "0.58976614" ]
0.0
-1
again using our functional approach this should be an easy one all we need to do object dot assign
function buyItem(user){ return Object.assign() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dAssign222(result, curr) {\n\t//console.log(arr)\n\tconsole.log(Reflect.ownKeys(curr).length)\n\t/*for (let i=0; i<Object.keys(curr).length; i++) {\n\t\tresult[Object.keys(curr)[i]] = curr[Object.keys(curr)[i]]\n\t}\t*/\t\n\tReflect.ownKeys(curr).forEach()\n\tconsole.log(Reflect.ownKeys(curr))\n\t//console.log(result)\n\treturn result\n}", "static _assignValue(path, value, object) {\n object = object || ApplicationState._state;\n\n const nodes = ApplicationState.walk(path);\n\n for (let index = 0; index < nodes.length; index++) {\n const node = nodes[index];\n switch (node.type) {\n case 'object':\n if (typeof object[node.name] === 'undefined') {\n object[node.name] = {};\n }\n object = object[node.name];\n break;\n case 'array':\n if (typeof object[node.name] === 'undefined') {\n object[node.name] = [];\n }\n object = object[node.name];\n break;\n case 'leaf':\n return object[node.name] = value;\n break;\n }\n }\n\n throw Error(\"We should have returned after setting the value.\");\n }", "function objectAssign(target, source) {\n for (var i = 0, keys = Object.keys(source); i < keys.length; i++) {\n target[keys[i]] = source[keys[i]];\n }\n return target;\n }", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n return merged;\n}", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=void 0}", "function assign(left, right, keepMods) {\n if (left instanceof Array) {\n if (!(right instanceof Array))\n console.log('errrr');\n left.forEach(function(_, prop) {\n assignHelper(left, right, prop, keepMods);\n });\n }\n else {\n for (var prop in left) {\n if (!isPOJS(right))\n console.log('errrr');\n assignHelper(left, right, prop, keepMods);\n }\n }\n return right;\n }", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n console.log(merged);\n return merged;\n}", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n console.log(merged);\n return merged;\n}", "function setIn(obj,path,value){var res=clone(obj);// this keeps inheritance when obj is a class\nvar resVal=res;var i=0;var pathArray=toPath(path);for(;i<pathArray.length-1;i++){var currentPath=pathArray[i];var currentObj=getIn(obj,pathArray.slice(0,i+1));if(currentObj&&(isObject$2(currentObj)||Array.isArray(currentObj))){resVal=resVal[currentPath]=clone(currentObj);}else {var nextPath=pathArray[i+1];resVal=resVal[currentPath]=isInteger(nextPath)&&Number(nextPath)>=0?[]:{};}}// Return original object if new value is the same as current\nif((i===0?obj:resVal)[pathArray[i]]===value){return obj;}if(value===undefined){delete resVal[pathArray[i]];}else {resVal[pathArray[i]]=value;}// If the path array has a single element, the loop did not run.\n// Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\nif(i===0&&value===undefined){delete res[pathArray[i]];}return res;}", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}", "function deepObjectAssignNonentry() {\n for (var _len2 = arguments.length, values = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n values[_key2] = arguments[_key2];\n }\n\n if (values.length < 2) {\n return values[0];\n } else if (values.length > 2) {\n var _context2;\n\n return deepObjectAssignNonentry.apply(void 0, concat$2(_context2 = [deepObjectAssign(values[0], values[1])]).call(_context2, toConsumableArray(slice$6(values).call(values, 2))));\n }\n\n var a = values[0];\n var b = values[1];\n\n var _iterator = _createForOfIteratorHelper(ownKeys$3(b)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var prop = _step.value;\n if (Object.prototype.propertyIsEnumerable.call(b, b[prop])) ;else if (b[prop] === DELETE) {\n delete a[prop];\n } else if (a[prop] !== null && b[prop] !== null && _typeof_1(a[prop]) === \"object\" && _typeof_1(b[prop]) === \"object\" && !isArray$3(a[prop]) && !isArray$3(b[prop])) {\n a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);\n } else {\n a[prop] = clone(b[prop]);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return a;\n}", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=undefined;}", "function deepObjectAssignNonentry() {\n for (var _len2 = arguments.length, values = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n values[_key2] = arguments[_key2];\n }\n\n if (values.length < 2) {\n return values[0];\n } else if (values.length > 2) {\n var _context2;\n\n return deepObjectAssignNonentry.apply(void 0, concat$2(_context2 = [deepObjectAssign(values[0], values[1])]).call(_context2, toConsumableArray(slice$3(values).call(values, 2))));\n }\n\n var a = values[0];\n var b = values[1];\n\n var _iterator = _createForOfIteratorHelper(ownKeys$3(b)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var prop = _step.value;\n if (Object.prototype.propertyIsEnumerable.call(b, b[prop])) ;else if (b[prop] === DELETE) {\n delete a[prop];\n } else if (a[prop] !== null && b[prop] !== null && _typeof_1(a[prop]) === \"object\" && _typeof_1(b[prop]) === \"object\" && !isArray$5(a[prop]) && !isArray$5(b[prop])) {\n a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);\n } else {\n a[prop] = clone(b[prop]);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return a;\n}", "function assign(object, source) {\n Object.keys(source).forEach(function(key) {\n object[key] = source[key];\n });\n}", "function deepObjectAssignNonentry() {\n for (var _len2 = arguments.length, values = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n values[_key2] = arguments[_key2];\n }\n\n if (values.length < 2) {\n return values[0];\n } else if (values.length > 2) {\n var _context2;\n\n return deepObjectAssignNonentry.apply(void 0, concat$2(_context2 = [deepObjectAssign(values[0], values[1])]).call(_context2, toConsumableArray(slice$4(values).call(values, 2))));\n }\n\n var a = values[0];\n var b = values[1];\n\n var _iterator = _createForOfIteratorHelper(ownKeys$3(b)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var prop = _step.value;\n if (!Object.prototype.propertyIsEnumerable.call(b, prop)) ;else if (b[prop] === DELETE) {\n delete a[prop];\n } else if (a[prop] !== null && b[prop] !== null && _typeof_1(a[prop]) === \"object\" && _typeof_1(b[prop]) === \"object\" && !isArray$5(a[prop]) && !isArray$5(b[prop])) {\n a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);\n } else {\n a[prop] = clone(b[prop]);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return a;\n}", "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key]}}}", "setObjectWithNestedKey(obj, key, value) {\n\n if(key.indexOf(\".\")) {\n // Need to deal with arrays\n var keys = key.split(\".\");\n var lastHash = keys.pop();\n for(var i = 0; i < keys.length; i++) {\n let keyPointer = keys[i];\n\n if(_.isString(keyPointer) && keyPointer.indexOf(\"[\") === 0) {\n keyPointer = keyPointer.replace(\"[\", \"\").replace(\"]\", \"\");\n keyPointer = parseInt(keyPointer, 10);\n }\n\n if(!_.has(obj, keyPointer) || !_.isObject(obj[keyPointer])) {\n\n var newObj = {};\n var nextKey = i + 1;\n\n if(keys.length > nextKey && _.isString(keys[nextKey]) && keys[nextKey].indexOf(\"[\") === 0) {\n newObj = [];\n }\n\n\n obj[keyPointer] = newObj;\n\n }\n\n obj = obj[keyPointer];\n }\n\n //obj[lastHash] = {};\n key = lastHash;\n }\n\n obj[key] = value;\n\n\n return true;\n }", "function objectAssign(target, source) {\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n target[prop] = source[prop];\n }\n }\n return target;\n}", "function va(t){if(null==t)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}", "setJsonDeep(target, keys, value) {\n let origin = target;\n keys = keys.split('.');\n for (let key of keys) {\n let last = key === keys[keys.length - 1];\n if (typeof origin[key] === 'undefined' || !origin[key]) {\n origin[key] = last ? value : {};\n } else {\n origin[key] = last ? value : origin[key];\n }\n origin = origin[key];\n }\n }", "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key];}}}", "function pureDeepObjectAssign(base) {\n var _context;\n\n for (var _len = arguments.length, updates = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n updates[_key - 1] = arguments[_key];\n }\n\n return deepObjectAssign.apply(void 0, concat$2(_context = [{}, base]).call(_context, updates));\n}", "function pureDeepObjectAssign(base) {\n var _context;\n\n for (var _len = arguments.length, updates = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n updates[_key - 1] = arguments[_key];\n }\n\n return deepObjectAssign.apply(void 0, concat$2(_context = [{}, base]).call(_context, updates));\n}", "function pureDeepObjectAssign(base) {\n var _context;\n\n for (var _len = arguments.length, updates = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n updates[_key - 1] = arguments[_key];\n }\n\n return deepObjectAssign.apply(void 0, concat$2(_context = [{}, base]).call(_context, updates));\n}", "function dc(){return dc=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},dc.apply(this,arguments)}", "function $o(){return $o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$o.apply(this,arguments)}", "function _assign () {\n\t var args = [].slice.call(arguments).filter(function (i) { return i })\n\t var dest = args.shift()\n\t args.forEach(function (src) {\n\t Object.keys(src).forEach(function (key) {\n\t dest[key] = src[key]\n\t })\n\t })\n\t\n\t return dest\n\t}", "function _assign () {\n\t var args = [].slice.call(arguments).filter(function (i) { return i })\n\t var dest = args.shift()\n\t args.forEach(function (src) {\n\t Object.keys(src).forEach(function (key) {\n\t dest[key] = src[key]\n\t })\n\t })\n\t\n\t return dest\n\t}", "function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}", "function assign$1($){for(var k=1;k<arguments.length;k++){var V=arguments[k];for(var z in V)$[z]=V[z]}return $}", "function oc(){return oc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oc.apply(this,arguments)}", "function objectAssign(obj1,obj2){\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n}", "static initialize(obj, subspace, key, subkey, value) { \n obj['subspace'] = subspace;\n obj['key'] = key;\n obj['subkey'] = subkey;\n obj['value'] = value;\n }", "function xx(a,b){return\"method\"!==b.kind||!b.ej||\"value\"in b.ej?(ia(),{kind:\"field\",key:Symbol(),oW:\"own\",ej:{},Dj:function(){\"function\"===typeof b.Dj&&(this[b.key]=b.Dj.call(this))},$l:function(c){c.Ca(b.key,a)}}):Object.assign(Object.assign({},b),{$l:function(c){c.Ca(b.key,a)}})}", "function n(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}", "static initialize(obj) { \n obj['left'] = left;\n obj['right'] = right;\n obj['operator'] = operator;\n }", "function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}", "function setIn(obj, path, value) {\n var res = (0,lodash_es_clone__WEBPACK_IMPORTED_MODULE_5__.default)(obj); // this keeps inheritance when obj is a class\n\n var resVal = res;\n var i = 0;\n var pathArray = (0,lodash_es_toPath__WEBPACK_IMPORTED_MODULE_4__.default)(path);\n\n for (; i < pathArray.length - 1; i++) {\n var currentPath = pathArray[i];\n var currentObj = getIn(obj, pathArray.slice(0, i + 1));\n\n if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {\n resVal = resVal[currentPath] = (0,lodash_es_clone__WEBPACK_IMPORTED_MODULE_5__.default)(currentObj);\n } else {\n var nextPath = pathArray[i + 1];\n resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};\n }\n } // Return original object if new value is the same as current\n\n\n if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {\n return obj;\n }\n\n if (value === undefined) {\n delete resVal[pathArray[i]];\n } else {\n resVal[pathArray[i]] = value;\n } // If the path array has a single element, the loop did not run.\n // Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\n\n\n if (i === 0 && value === undefined) {\n delete res[pathArray[i]];\n }\n\n return res;\n}", "function setIn(obj, path, value) {\n var res = (0,lodash_es_clone__WEBPACK_IMPORTED_MODULE_5__.default)(obj); // this keeps inheritance when obj is a class\n\n var resVal = res;\n var i = 0;\n var pathArray = (0,lodash_es_toPath__WEBPACK_IMPORTED_MODULE_4__.default)(path);\n\n for (; i < pathArray.length - 1; i++) {\n var currentPath = pathArray[i];\n var currentObj = getIn(obj, pathArray.slice(0, i + 1));\n\n if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {\n resVal = resVal[currentPath] = (0,lodash_es_clone__WEBPACK_IMPORTED_MODULE_5__.default)(currentObj);\n } else {\n var nextPath = pathArray[i + 1];\n resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};\n }\n } // Return original object if new value is the same as current\n\n\n if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {\n return obj;\n }\n\n if (value === undefined) {\n delete resVal[pathArray[i]];\n } else {\n resVal[pathArray[i]] = value;\n } // If the path array has a single element, the loop did not run.\n // Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\n\n\n if (i === 0 && value === undefined) {\n delete res[pathArray[i]];\n }\n\n return res;\n}", "function setIn(obj, path, value) {\n var res = (0,lodash_es_clone__WEBPACK_IMPORTED_MODULE_5__.default)(obj); // this keeps inheritance when obj is a class\n\n var resVal = res;\n var i = 0;\n var pathArray = (0,lodash_es_toPath__WEBPACK_IMPORTED_MODULE_4__.default)(path);\n\n for (; i < pathArray.length - 1; i++) {\n var currentPath = pathArray[i];\n var currentObj = getIn(obj, pathArray.slice(0, i + 1));\n\n if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {\n resVal = resVal[currentPath] = (0,lodash_es_clone__WEBPACK_IMPORTED_MODULE_5__.default)(currentObj);\n } else {\n var nextPath = pathArray[i + 1];\n resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};\n }\n } // Return original object if new value is the same as current\n\n\n if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {\n return obj;\n }\n\n if (value === undefined) {\n delete resVal[pathArray[i]];\n } else {\n resVal[pathArray[i]] = value;\n } // If the path array has a single element, the loop did not run.\n // Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\n\n\n if (i === 0 && value === undefined) {\n delete res[pathArray[i]];\n }\n\n return res;\n}", "$assign( dest, value ) {\n if( arguments.length === 1 ) {\n value = dest;\n dest = this.$data;\n }\n\n for( const key of Object.keys( value ) ) {\n this.$set( dest, key, value[ key ] );\n }\n }", "function update(obj/*, …*/) {\n for (var i=1; i<arguments.length; i++) {\n for (var prop in arguments[i]) {\n var val = arguments[i][prop];\n if (typeof val == \"object\") // this also applies to arrays or null!\n update(obj[prop], val);\n else\n obj[prop] = val;\n }\n }\n return obj;\n }", "function test() {\n 'use strict';\n\n let obj1 = { a: 0 , b: { c: 0}};\n let obj2 = Object.assign({}, obj1);\n console.log(JSON.stringify(obj2)); // { a: 0, b: { c: 0}}\n\n obj1.a = 1;\n console.log(JSON.stringify(obj1)); // { a: 1, b: { c: 0}}\n console.log(JSON.stringify(obj2)); // { a: 0, b: { c: 0}}\n\n obj2.a = 2;\n console.log(JSON.stringify(obj1)); // { a: 1, b: { c: 0}}\n console.log(JSON.stringify(obj2)); // { a: 2, b: { c: 0}}\n\n obj2.b.c = 3;\n console.log(JSON.stringify(obj1)); // { a: 1, b: { c: 3}}\n console.log(JSON.stringify(obj2)); // { a: 2, b: { c: 3}}\n\n // Deep Clone\n obj1 = { a: 0 , b: { c: 0}};\n let obj3 = JSON.parse(JSON.stringify(obj1));\n obj1.a = 4;\n obj1.b.c = 4;\n console.log(JSON.stringify(obj3)); // { a: 0, b: { c: 0}}\n}", "objd(obj) {\n\n return toObject(obj);\n }", "static initialize(obj, id, value) { \n obj['id'] = id;\n obj['value'] = value;\n }", "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "function copyPropsAndEles(originOne,newOne){\n for(var key in originOne){\n //console.log(arguments.callee.caller);\n newOne[key]=arguments.callee.caller(originOne[key]);\n }\n }", "function copyProps(src,dst){for(var key in src){dst[key]=src[key]}}", "function pr(n){if(n===null||n===undefined)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(n)}", "function destructivelyUpdateDriverWithKeyAndValue(obj, key, value) {\n obj[key] = value;\n\n return obj;\n}", "appendObject(keys, append, state) {\n\t\tlet temp = state;\n\t\tkeys = keys.split('.');\n\n\t\tfor (let i = 0; i < keys.length - 1; i++) {\n\t\t\tconst key = keys[i];\n\t\t\tif (Object.keys(temp).indexOf(`_${key}`) !== -1) {\n\t\t\t\tconst parentCopy = this.copyObject(temp[key]);\n\t\t\t\tlet tempParent = parentCopy;\n\t\t\t\tfor (let j = i + 1; j < keys.length - 1; j++) {\n\t\t\t\t\ttempParent = tempParent[keys[j]];\n\t\t\t\t}\n\t\t\t\ttempParent[keys[keys.length - 1]] = append;\n\t\t\t\ttemp[`_${key}`] = parentCopy;\n\t\t\t}\n\t\t\ttemp = temp[key];\n\t\t}\n\n\t\tif (Object.keys(temp).indexOf(`_${keys[keys.length - 1]}`) !== -1) {\n\t\t\ttemp[`_${keys[keys.length - 1]}`] = append;\n\t\t} else {\n\t\t\ttemp[keys[keys.length - 1]] = append;\n\t\t}\n\n\t\treturn state;\n\t}", "applyValue(useProp, key, value, skipAccessors, field) {\n var _field2;\n\n // If we don't have a field, but we have a property defined\n // eg, the fullDuration property defined in TaskModel, then\n // use the property\n if (useProp) {\n this[key] = value;\n return;\n } // Might be setting value of nested object\n\n if (!field && key.includes('.')) {\n const nestedName = key.split('.')[0];\n field = this.constructor.fieldMap[nestedName];\n } // Use complex mapping?\n\n if ((_field2 = field) === null || _field2 === void 0 ? void 0 : _field2.complexMapping) {\n ObjectHelper.setPath(this.data, key, value);\n } // Otherwise, push the value through into the data.\n else {\n this.data[key] = value;\n }\n }", "function demo008(){\n var obj = {\n subObject: {\n subKey: 'subvalue',\n subSubObject: {\n subSubKey: 'subSubValue'\n }\n }\n } ;\n const originalMap = Immutable.fromJS(obj) ;\n const newMap = originalMap.setIn(['subObject','subKey'],'ha ha!') ;\n console.info(newMap.toJS()) ;\n // {subObject:{subKey:'ha ha!', subSubObject:{subSubKey:'subSubValue'}}}\n const newerMap2 = originalMap.setIn(\n ['subObject', 'subSubObject', 'subSubKey'],\n 'ha ha ha!');\n console.info(newerMap2.toJS()) ;\n //// {subObject:{subKey:'subvalue', subSubObject:{subSubKey:'ha ha ha!'}}}\n}", "setDepth(obj, path, value) {\n obj = obj || {};\n let tags = path.split(\".\").reverse();\n\n obj[tags.shift()] = value;\n\n for (let tag of tags) {\n let _obj = Object.assign({}, obj);\n obj = {[tag]: _obj};\n }\n return obj;\n }", "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "function setIn(obj, path, value) {\n var res = Object(lodash_es_clone__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(obj); // this keeps inheritance when obj is a class\n\n var resVal = res;\n var i = 0;\n var pathArray = Object(lodash_es_toPath__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(path);\n\n for (; i < pathArray.length - 1; i++) {\n var currentPath = pathArray[i];\n var currentObj = getIn(obj, pathArray.slice(0, i + 1));\n\n if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {\n resVal = resVal[currentPath] = Object(lodash_es_clone__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(currentObj);\n } else {\n var nextPath = pathArray[i + 1];\n resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};\n }\n } // Return original object if new value is the same as current\n\n\n if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {\n return obj;\n }\n\n if (value === undefined) {\n delete resVal[pathArray[i]];\n } else {\n resVal[pathArray[i]] = value;\n } // If the path array has a single element, the loop did not run.\n // Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\n\n\n if (i === 0 && value === undefined) {\n delete res[pathArray[i]];\n }\n\n return res;\n}", "copy() {\n return Object.assign(Object.create(this), JSON.parse(JSON.stringify(this)))\n }", "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "function destructivelyUpdateDriverWithKeyAndValue(driver,key,value) {\n return Object.assign(driver, {[key]: value});\n\n}", "function X(){return(X=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}", "function mC(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}", "static initialize(obj, name, expression) { \n obj['name'] = name;\n obj['expression'] = expression;\n }", "function assign(path, obj, root) {\n var levels = path.split('.');\n var objName = levels.splice(levels.length - 1, 1)[0];\n var pkg = levels.join('.');\n var pkgObj = null;\n\n // Default to the module's global root.\n root = root || global;\n\n pkgObj = definePkg(pkg, root);\n pkgObj[objName] = obj;\n\n cache[path] = obj;\n\n return obj;\n }", "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "set(path, value) {\n if (typeof path === 'string') {\n let array = path.split('.');\n return this.set(array, value);\n }\n let data = this.data;\n let len = path ? path.length : 0;\n let i;\n for (i = 0; i < len - 1; i++) {\n let segment = path[i];\n let next = data[segment];\n if (!next)\n break;\n data = next;\n }\n // Add missing objects\n for (; i < len - 1; i++) {\n let segment = path[i];\n data = data[segment] = {};\n }\n if (data) {\n let segment = path[path.length - 1];\n data[segment] = value;\n }\n return this;\n \n }", "function apply(obj, source) {\r\n for (var prop in source) {\r\n obj[prop] = source[prop];\r\n }\r\n return obj;\r\n}", "function setIn(obj, path, value) {\n var res = lodash_es_clone(obj); // this keeps inheritance when obj is a class\n\n var resVal = res;\n var i = 0;\n var pathArray = lodash_es_toPath(path);\n\n for (; i < pathArray.length - 1; i++) {\n var currentPath = pathArray[i];\n var currentObj = getIn(obj, pathArray.slice(0, i + 1));\n\n if (currentObj && (formik_esm_isObject(currentObj) || Array.isArray(currentObj))) {\n resVal = resVal[currentPath] = lodash_es_clone(currentObj);\n } else {\n var nextPath = pathArray[i + 1];\n resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};\n }\n } // Return original object if new value is the same as current\n\n\n if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {\n return obj;\n }\n\n if (value === undefined) {\n delete resVal[pathArray[i]];\n } else {\n resVal[pathArray[i]] = value;\n } // If the path array has a single element, the loop did not run.\n // Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\n\n\n if (i === 0 && value === undefined) {\n delete res[pathArray[i]];\n }\n\n return res;\n}", "function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}", "function t(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function t(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function deepCopy(obj){\n if(typeof obj ==\"object\"){\n return Object.keys(obj)\n .map((key)=>({[key]:deepCopy(obj[key])}))\n .reduce((acc,cur)=>Object.assign(acc,cur),{});\n\n\n}\nreturn obj;\n\n}", "function o(){return(o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}", "function s(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function an(e){if(null==e)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(e)}", "function updateObjectWithKeyAndValue(obj, key, value) { //returns clone with new data\n var obj2 = {};\n var toAddIn = [value].toString();\n \n obj2 = Object.assign({}, obj);\n obj2[key] = toAddIn;\n return obj2;\n}", "update(_changedProperties){if(this._reflectingProperties!==void 0&&0<this._reflectingProperties.size){// Use forEach so this works even if for/of loops are compiled to for\n// loops expecting arrays\nthis._reflectingProperties.forEach((v,k)=>this._propertyToAttribute(k,this[k],v));this._reflectingProperties=void 0}}", "function ontoAnObject() {\n const array = [1, 2, 3, 4, 5, 6];\n const object = {};\n // refactor the lines below\n // object.one = array[0];\n // object.two = array[1];\n // object.three = array[2];\n // object.rest = array.slice(3);\n // YOUR CODE STARTS HERE\n [object.one, object.two, object.three, ...object.rest] = array;\n console.group(\"ontoAnObject();\");\n console.log(\"return object; \");\n return object;\n}", "function assign(obj, source) {\n if (source) {\n for (var prop in source) {\n var propDescriptor = (0, _getOwnPropertyDescriptor2.default)(source, prop);\n propDescriptor ? (0, _defineProperty2.default)(obj, prop, propDescriptor) : obj[prop] = source[prop];\n }\n }\n return obj;\n}", "function map(obj) {\n\n\n obj.forEach(function(el) {\n for (key in el) {\n var k = mapObj[key]\n if (k) {\n\n el[k] = el[key];\n\n }\n }\n\n })\n\n }", "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "function Rn(){return Rn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Rn.apply(this,arguments)}", "function _assign () {\n var args = [].slice.call(arguments).filter(function (i) { return i })\n var dest = args.shift()\n args.forEach(function (src) {\n Object.keys(src).forEach(function (key) {\n dest[key] = src[key]\n })\n })\n\n return dest\n}", "function data_structure() { //data structure is called to insert the data about all players in the same team\n \n for (let i = 0; i < players_list.length; i++) {\n \n if (players_list[i].teamname == data1.team_name) {\n \n var key = makeSlug.makeSlug(players_list[i].nickname); //set the value of object key to player nickename\n \n player_curent = { \n \n [key]: {\n \n nickname: players_list[i].nickname,\n \n someData: `someDataAboutPlayer ${players_list[i].nickname}`\n \n }\n }\n Object.assign(data1.players, player_curent);\n }\n }\n return data1.players;\n }", "static initialize(obj, type, operation, value) { \n obj['type'] = type;\n obj['operation'] = operation;\n obj['value'] = value;\n }", "aliasObjects (alias, value) {\n const cloned = Object.assign({}, value)\n for (const a in alias) {\n if (a in cloned) {\n cloned[alias[a]] = cloned[a]\n delete cloned[a]\n }\n }\n return cloned\n }", "set (data) {\n if (!Util.isObject(data)) {\n return\n }\n\n let keys = Object.keys(data)\n\n let i = 0, len = keys.length\n let item\n\n for (i; i < len; i++) {\n item = data[keys[i]]\n\n if (Util.isObject(item)) {\n // Filter out classes.\n if ([\n 'Object', 'Boolean', 'String', 'Array'\n ].indexOf(item.constructor) === -1) {\n this[keys[i]] = item\n continue\n }\n\n if (!this[keys[i]]) {\n this[keys[i]] = {}\n }\n\n Object.assign(this[keys[i]], item)\n } else {\n this[keys[i]] = item\n }\n }\n\n return this\n }", "function apply(source, target) {\n for (prop in source) {\n target[prop] = source[prop];\n }\n} //apply()", "objectify(key,value){\n \t return {\n [key]: value\n }\n }", "function assign( target ){\n\t\tfor( var i = 1, l = arguments.length; i < l; i++ )\n\t\t\tfor( var key in arguments[ i ] )\n\t\t\t\tif( arguments[ i ].hasOwnProperty( key ) )\n\t\t\t\t\ttarget[ key ] = arguments[ i ][ key ]\n\t}", "function pv(){return pv=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},pv.apply(this,arguments)}", "function updateDriverWithKeyAndValue(driver, key ,value) {\n return Object.assign({}, driver, { [key]: value });\n}", "function toObject(Ye){if(null==Ye)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(Ye)}", "function assignProxies (obj, cbs, shouldComponentUpdate, parent) {\n for (let k in obj) {\n if (obj[k] instanceof Array || obj[k] instanceof Object) {\n let curPosition = (parent === null ? '' : parent)\n let key = getCorrectPathOfObject(obj, k)\n obj[k] = assignProxies(obj[k], cbs, shouldComponentUpdate, curPosition + key)\n }\n }\n if (obj instanceof Array || obj instanceof Object) {\n Object.defineProperty(obj, '_parent', {\n enumerable: false,\n writable: true\n })\n obj._parent = parent\n }\n if (obj instanceof Array) {\n return makeArrayProxy(obj, cbs, shouldComponentUpdate)\n } else if (obj instanceof Object) {\n return makeObjectProxy(obj, cbs, shouldComponentUpdate)\n } else {\n return obj\n }\n}", "static assign(object, attributes) {\n return Object.assign({ __proto__: Object.getPrototypeOf(object) }, object, attributes);\n }", "function cumpleanosClonandoObjeto(persona){\n return {\n ...persona,\n edad: persona.edad += 1\n }\n}", "function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}", "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }", "function fillProperties(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n }" ]
[ "0.61705", "0.6156957", "0.6136031", "0.6037386", "0.5956187", "0.59539384", "0.5925172", "0.5925172", "0.592437", "0.5865132", "0.58543915", "0.5822048", "0.5818879", "0.58131427", "0.58119524", "0.57855284", "0.57828677", "0.57781136", "0.57534695", "0.5749399", "0.5748441", "0.5725574", "0.5725574", "0.5725574", "0.5687407", "0.5680839", "0.5651192", "0.5651192", "0.5644622", "0.563867", "0.5637863", "0.5635261", "0.5633882", "0.5619971", "0.5609978", "0.56005883", "0.5600159", "0.5597371", "0.5597371", "0.5597371", "0.5594512", "0.55915934", "0.558751", "0.5586285", "0.5584895", "0.55802447", "0.55802447", "0.55802447", "0.55783904", "0.5574934", "0.5568284", "0.5566873", "0.55633056", "0.55599225", "0.55536944", "0.5550469", "0.5547616", "0.55459654", "0.5539732", "0.5539372", "0.55358624", "0.5528086", "0.55278623", "0.5527186", "0.5524358", "0.5523015", "0.5522849", "0.55214703", "0.55213153", "0.5520101", "0.55127144", "0.55120414", "0.55120414", "0.551204", "0.551023", "0.550804", "0.55075735", "0.55059767", "0.5505947", "0.55048066", "0.54992706", "0.5482953", "0.5477577", "0.5466207", "0.54636735", "0.54630494", "0.54615086", "0.5461268", "0.546108", "0.54591435", "0.54492146", "0.5447883", "0.54465073", "0.54431593", "0.5440799", "0.54389983", "0.54308486", "0.54244626", "0.542181", "0.5419869", "0.5419869" ]
0.0
-1
& in here we have an empty object
function buyItem(user){ return Object.assign({}, ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Object$empty() {\n return {};\n }", "function Object$empty() {\n return {};\n }", "function Object$zero() {\n return {};\n }", "function Object$zero() {\n return {};\n }", "function makeEmptyObject() {\n return new Object();\n}", "function empty() {\n\treturn Object.create(null);\n}", "function toEmptyObject() {\n return function () {\n return {};\n };\n}", "function newObject() { return {}; }", "function obj() {\n return Object.create(null);\n}", "function instantiatePlainObject() {\n\t return {};\n\t }", "function instantiatePlainObject() {\n\t return {};\n\t }", "function instantiatePlainObject() {\n\t return {};\n\t }", "function instantiatePlainObject() {\n return {};\n }", "function makeNewEmpty(object) {\n\treturn (Object.prototype.toString.call(object) === '[object Array]')? [] : {};\n}", "static get EMPTY()\n\t{\n\t\treturn 0;\n\t}", "empty() {\n return assay.make(strategy.empty());\n }", "constructor() {\n this.obj = {};\n this.key = 0;\n }", "clear() {\n this._objects = {};\n }", "function manipulationBareObj( value ) {\n\treturn value;\n}", "function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }", "function emptyDog() {\n return {name: '', imgs: [], age: 0, description: '', gender: '', matchesIds : [], favs : []}\n}", "function empty () {}", "function empty () {}", "function empty () {}", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }", "function empty(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]' ? [] : {};\n}", "empty() {\n\t}", "function empty() {\n }", "function Object(){}", "function Object(){}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "constructor() {\n this.data = {};\n }", "constructor() {\n this.data = {};\n }", "empty() {}", "get None() {}", "get None() {}", "get None() {}", "get None() {}", "function NXObject() {}", "constructor () {\n this.data = {}\n }", "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 empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}" ]
[ "0.79855925", "0.79855925", "0.7497064", "0.7497064", "0.74441254", "0.73145586", "0.6973477", "0.6820783", "0.67450047", "0.67225456", "0.67225456", "0.67225456", "0.66453165", "0.65873176", "0.65399355", "0.6516783", "0.643919", "0.64344174", "0.6352483", "0.6297621", "0.6292237", "0.6273221", "0.6273221", "0.6273221", "0.6267782", "0.6267782", "0.6267782", "0.6267782", "0.6267782", "0.6253724", "0.6219879", "0.6140996", "0.6127522", "0.6099616", "0.6099616", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60705656", "0.60255754", "0.60255754", "0.59985757", "0.599778", "0.599778", "0.599778", "0.599778", "0.59951127", "0.5993011", "0.59902656", "0.59902656", "0.59902656", "0.59902656", "0.59902656", "0.59902656", "0.59883344", "0.59883344", "0.59883344", "0.59883344", "0.59883344", "0.59883344", "0.59883344", "0.59883344", "0.59883344", "0.59883344", "0.59883344" ]
0.0
-1
the user that we receive
function buyItem(user){ return Object.assign({}, user, ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUser () {return user;}", "function getUser() {\n return user;\n }", "function getUser(){\n return user;\n }", "get user() { return this.args.user }", "get user() { return this.user_; }", "function current() {\n return user;\n }", "function GetCurrentUser() {\r\n\t \r\n \tvar folder=GetFirstSelectedMsgFolder();\r\n\tvar identity = null;\t\r\n\tvar server;\r\n\t\r\n\ttry {\r\n\t\tif (folder){\r\n \t// Get the incoming server associated with this uri.\r\n \tserver = folder.server; \r\n \tidentity = getIdentityForServer(server);\r\n \t} \r\n \t}catch (ex){\r\n\t\tgConsole.logStringMessage(\"ximfmail error - failed to get an identity to pre-select: \" + error);\r\n\t return \"\";\r\n\t}\r\n\tif(identity){\r\n \t\tgCurrentIdentity=identity;\r\n \t\tvar prefName=\"mail.identity.\"+identity.key+\".useremail\"; \t\t\r\n \t\ttry{\r\n \t\t\tif(gXBranch.prefHasUserValue( prefName ))\r\n \t\t\treturn gXBranch.getCharPref(prefName); \t\t\r\n \t\t}catch(exp){ \t\r\n\t\t\tgConsole.logStringMessage(\"ximfmail error - failed to get the prefence account type : \" + error);\r\n\t \t}\r\n \t}\t\r\n}", "function getCurrentUser() {\n // SERVER_CALL Get information of user profile from server\n // For now return fake user we created\n user = patientList[0];\n}", "getUser(idUser) {\n this.helper.publish(JSON.stringify(idUser), Constants.USERS, Constants.GET_USER, (err, user) => {\n this.sockets.forEach((socket) => {\n if (err) socket.emit(Constants.ERROR);\n else socket.emit(Constants.USER_RETURNED, user);\n });\n });\n }", "getUser() {\n return decode(this.getToken());\n }", "get user() {\n return this._user;\n }", "function getUserId() {\n return _userInformation.UserId;\n }", "get user() {\n return this._model.data\n }", "getUserID() {\n return this.userData.id;\n }", "getUser() {\n return decode(this.getToken());\n }", "async setUser() {\n return Channel.promptedMessage('What\\'s your username?\\n\\n> ');\n }", "function user() {\n return currentUser;\n }", "user(cb) {\n svclib.KVDataStore.get([{\n table: 'email_to_user',\n key: email,\n }], (err, items) => {\n if (err) return cb(err);\n if (!items[0].exists) {\n return cb(new Error('That user does not exist.'));\n }\n const userId = items[0].value.userId;\n svclib.KVDataStore.get([{\n table: 'users',\n key: _.toString(userId),\n }], (err, items) => {\n if (err) return cb(err);\n if (!items[0].exists) {\n return cb(new Error('That user does not exist.'));\n }\n return cb(null, items[0]);\n });\n });\n }", "function getUser() {\n return {\n name: 'Awotunde',\n handle: '@egunawo33', \n location: 'Orun, Aye'\n }\n}", "getCurrentUser() {\r\n return this.users[0];\r\n }", "function getUserId(req, res, next){\r\n\tlet send;\r\n\r\n\tUser.findOne()\r\n\t.where({_id:req.params.userID})\r\n\t.exec(function(err, result){\r\n\t\tif(err){\r\n\t\t\tres.status(500).send(\"No such person exist Maybe try logging in on the home page! and error => \" + err);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// if the privacy is true then the user can not see the page and is exited from the program\r\n\t\tif (req.session.username != result.username && result.privacy == true){\r\n\t\t\tres.status(403).send(\"YOU CAN NOT ACCESS DUE TO PRIVACY REASON!! BY THE PROFILE OWNER!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// display the result for testing and confirmation\r\n\t\t// console.log(result);\r\n\t\t// building response object to be rendered\r\n\t\tsend = result;\r\n\t\t// now we made a place where we can access the this all overa gain elsewhere\r\n\t\treq.session.user = result;\r\n\t\tsend.sessionName = req.session.username;\r\n\r\n\t\t// display the session username for testing and confirmation\r\n\t\tconsole.log(\"send.username \" + send.sessionName);\r\n\r\n\t\t// renders the page\r\n\t\tres.render(\"pages/userProfile\" , {result:send , id:req.session.userId})\r\n\t})\r\n}", "get user() {\n return this._user;\n }", "get userInput() {\n return this._user;\n }", "async getInfo() {\n let userResult = await this.request(\"user\");\n return userResult.user;\n }", "function findCurrentUser() {\n return \"stefan\"\n }", "function getUserId(msg) {\n return msg.message.user.id;\n}", "async getUserInfo(ctx) {\r\n const { name } = ctx.state.user;\r\n ctx.body = { name };\r\n }", "function gotUser(err, user) {\n if (err) return callback(err);\n callback(null, user);\n }", "getUserName() {\n return this.userData.name;\n }", "function getUserId(){\n VK.api(\"users.get\", { fields: 'timezone'}, \n function(data){ \n appUserId = data.response[0].id;\n appUserTimeZone = data.response[0].timezone;\n getHashtagsFromServerAndShow();\n }\n );\n }", "function user(){\n\n var person = usuario.name+\" - (\"+usuario.username+\")\";\n socket.emit(\"nickname\", person);\n\n return false;\n }", "get userId(){\n\t\treturn this._user.user_id;\n\t}", "function onSendClick(){\n setUserId(userIdInputRef.current.value);\n }", "get user() {\n return ( async () => this._user || await this.retrieve() )();\n }", "getUserId() {\n return this.getSession().user.userId;\n }", "user(state) {\n return state.user;\n }", "function storeTo() {\n \n //console.log(toUser);\n}", "static async getUserInfo(userId) {\n let res = await db.query('SELECT username, mail FROM users WHERE id = $1', [userId]);\n return res.rows[0];\n }", "info_user_to(){\n var username = this;\n var user_to = username.assigned_to;\n Meteor.subscribe('assigned_to_user_name', user_to);\n return user_details.find({\"user_id\" : user_to }).fetch();\n }", "function currentUser(req) {\n for (let user in users) {\n if (req.session.user_id === user) {\n return user;\n }\n }\n return \"\";\n}", "function retrieveUser(){\n console.log(\"retrieving\");\n thisUserId = thisUser.split(\"petesCookie\");\n thisUserId = thisUserId[1];\n currentUser = firebase.database().ref(\"/users\").child(thisUserId);\n currentUser.on('value', function (snapshot){\n snapshot.forEach(function(childSnapshot) {\n if (childSnapshot.key === \"ipAddresses\"){\n ips = childSnapshot.val();\n if(!ips.includes(thisIp)){\n ips.push(thisIp);\n }\n }else if (childSnapshot.key === \"sessions\"){\n dataSession = childSnapshot.val();\n thisSession = thisSession.concat(dataSession);\n }\n });\n });\n // setTimeOnBrowserOpen();\n}", "userId() {\n if (this._userIdDeps) this._userIdDeps.depend();\n return this._userId;\n }", "get user() {\n return this.use().user;\n }", "user() {\n return Member.findOne({_id: Meteor.userId()});\n\t}", "getNextUser() {\r\n return this.users[1];\r\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "function get_user_name() {\n switch (event_type) {\n case \"user\":\n var nameurl = \"https://api.line.me/v2/bot/profile/\" + user_id;\n break;\n case \"group\":\n var groupid = msg.events[0].source.groupId;\n var nameurl = \"https://api.line.me/v2/bot/group/\" + groupid + \"/member/\" + user_id;\n break;\n }\n\n try {\n // call LINE User Info API, get user name\n var response = UrlFetchApp.fetch(nameurl, {\n \"method\": \"GET\",\n \"headers\": {\n \"Authorization\": \"Bearer \" + CHANNEL_ACCESS_TOKEN,\n \"Content-Type\": \"application/json\"\n },\n });\n var namedata = JSON.parse(response);\n var reserve_name = namedata.displayName;\n }\n catch {\n reserve_name = \"not avaliable\";\n }\n return String(reserve_name)\n }", "function user(){\r\n uProfile(req, res);\r\n }", "function getCurrentUser(req, res) {\n // I'm picking only the specific fields its OK for the audience to see publicly\n // never send the whole user object in the response, and only show things it's OK\n // for others to read (like ID, name, email address, etc.)\n const { id, username } = req.user;\n res.json({\n id, username\n });\n}", "getUserInfo(){\n return getUser()\n }", "function currentUser(callback) {\n\tsendRequest({ request: 'current user' }, callback);\n}", "userReceived(p) {\n let player = newUser(p);\n players.push(player);\n requestPlayers();\n }", "function getUser() {\n if (promisedUser.data.success) {\n $scope.user = promisedUser.data.user;\n $window.sessionStorage.setItem('currentUser', JSON.stringify($scope.user));\n }\n }", "getUser() {\r\n return (this.user instanceof core.User) ? this.user : core.User.fromJWT(this.user);\r\n }", "async getUser () {\n\t\tthis.user = await this.data.users.getById(this.tokenInfo.userId);\n\t\tif (!this.user || this.user.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'user' });\n\t\t}\n\t}", "function getUser(param1, callback) {\n\n bot.api.users.info({user: param1}, function(err, result){\n callback(result.user.name);\n }); \n}", "function api_getuser(ctx) {\n api_req({\n a: 'ug'\n }, ctx);\n}", "function getUserInfo() {\n\t\t\treturn User.getUser({\n\t\t\t\tid: $cookieStore.get('userId')\n\t\t\t}).$promise.then(function(response) {\n\t\t\t\tswitch(response.code) {\n\t\t\t\t\tcase 0: {\n\t\t\t\t\t\t$scope.ganbaru.username = response.data.username;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, function() {\n\t\t\t\t//Handling error\n\t\t\t});\n\t\t}", "user(post) {\n return post.getUser();\n }", "function getConnectedUser() {\n\n //recup val bouton\n /*var xml = ( window.XMLHttpRequest ) ?\n new XMLHttpRequest() : new ActiveXObject(\"Microsoft.XMLHTTP\");\n\n xml.open(\"GET\", user/myName, true);\n xml.setRequestHeader(\"Content-type\", \"application/json\");\n\n xml.onreadystatechange = function()\n {\n if( xml.readyState === 4 &&\n xml.status === 200 )\n {\n var serverResponse = JSON.parse(xml.responseText);\n switch(serverResponse.d)\n {\n //GET user id et stocker sous forme userID =\n }\n }\n }\n xml.send(null);\n */\n }", "get userPopulated() {\n return this.user && this.user.id;\n }", "@computed get getUserId() {\n return this.userInformation.id;\n }", "function getCurrentUser()\n{ \n\treturn currentUser;\n}", "function userClick(user) {\n if (store.get('profile').user_id == user.user_id) {\n return;\n }\n logger.info('[TEST] Messaging ' + (user.name || user.nickname));\n }", "async getCreator() {\n return (await this._client.helix.users.getUserById(this._data.creator_id));\n }", "async getUser(uid) {\n return this.user[uid]\n }", "get userName(){\n\t\treturn this._user.user_name;\n\t}", "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 }", "get userId() {\n return this._data.user_id;\n }", "get userId() {\n return this._data.user_id;\n }", "get userId() {\n return this._data.user_id;\n }", "get userId() {\n return this._data.user_id;\n }", "get currentUser() {\n const activeUsers = this.users.filter(\n (user) => user.state === UserState.Active\n );\n\n if (activeUsers.length === 0) {\n return null;\n } else {\n // Current user is the top of the stack\n return activeUsers[0];\n }\n }", "getCurrentUser() {\n var self = this;\n return self.user;\n }", "getCurrentUserId() {\r\n return JSON.parse(localStorage.getItem(\"user\")).id;\r\n }", "get user() {\n return this.fapp.get('user');\n }", "static async getRandomUser(){\n let res = await this.request(`matches/random`);\n return res.user;\n }", "function getSender(context, activeUsername) {\n return $(context).find('a').first().attr('href').replace('https://www.facebook.com/','').replace('profile.php?id=','') === activeUsername ? activeUsername : 'me';\n }", "getUserId() {\n return this.userId;\n }", "function storedUser(): Object {\n return userState.selectors.getUser(store.getState());\n}", "static getUser() {\n return JSON.parse(localStorage.getItem('userInfo'));\n }", "handleOnUserMessage() {\n var user = this; // der aktuelle User\n user.socket.on(\"message\", function(message){\n console.log(\"[User`\"+user.Username+\"`] sent message: \" + message);\n user.room.handleOnUserMessage(user, message);\n });\n}", "info_user_by(){\n var username = this;\n var user_by = username.assigned_by;\n Meteor.subscribe('assigned_by_user_name', user_by);\n return user_details.find({'user_id' : user_by}).fetch();\n }", "function getUserId() {\n\tif (userid != null) {\n\t\treturn userid;\n\t} else {\n\t\treturn localStorage.getItem('userid');\n\t}\n}", "static getCurrentUserID() {\n const myInfo = (document.querySelector('.mmUserStats .avatar a'));\n if (myInfo) {\n const userID = this.endOfHref(myInfo);\n console.log(`[M+] Logged in userID is ${userID}`);\n return userID;\n }\n console.log('No logged in user found.');\n return '';\n }", "function getUserName() {\n return _userInformation.UserName;\n }", "__getMessageSender() {\n return this.message ? this.message.sender : client.user;\n }", "get userId() {\n\t\treturn this.__userId;\n\t}", "function getCurrentUser(id) {\n // SERVER_CALL Get information of user profile from server\n // For now return fake user we created\n user = patientList.filter(function(account) {\n return account.id == id;\n })[0];\n}", "static async getCurrentUser(username) {\n let res = await this.request(`users/${username}`);\n return res.user;\n }", "function who(tok,fn){\n\tisValid(tok,function(resultado){\n\t\tif(resultado){\n\t\t\tvar param={token:tok};\n\t\t\t//Find the token in the database\n\t\t\tToken.find(param).exec(function(err, tokens){\n\t\t\t\tif(err){\n\t\t\t\t\tfn(\"\");\n\t\t\t\t}\n\t\t if(tokens.length==1){\n\t\t \t//Consult who is the creator\n\t\t \tvar answer = {\temail:tokens[0].email,\n \t\t\t\ttoken:tokens[0].token};\n\t\t \t\tfn(answer);\n\t\t\t }\n\t\t });\n\t\t}else{\n\t\t\tfn(\"\");\n\t\t}\n\t});\n}", "async getCurrentUser() {\n // Lo que hacemos es detectar los cambios en tiempo real\n return new Promise((resolve, reject) => {\n const unsubscribe = Service.auth.onAuthStateChanged(\n // Si tenemos usuario, resolvemos la promesa y lo retornamos\n (user) => {\n unsubscribe();\n resolve(user);\n },\n // Rechazamos\n () => {\n reject();\n },\n );\n });\n }", "function getUser() {\n return $localStorage.user;\n }", "function getCurrentUser() {\n var current = localStorage.getItem(\"User\");\n return current ? JSON.parse(current) : {};\n }", "async function getUserInfo() {\n let userData = await Auth.currentAuthenticatedUser();\n setUser(userData.username);\n setUserEmail(userData.attributes.email);\n }", "async getUser(uid) {\n console.log('GET /user/%s', uid)\n return this.server.getUser(uid)\n }", "function userGet(data) {\n data = data.split(\"Logged in user name: \").pop();\n data = data.substr(0, data.indexOf('\\n'));\n data = data.substr(0, data.indexOf('\\r'));\n console.log('Got username on startup')\n console.log(data)\n if(data !== undefined){\n encrypt(data);\n messaging(setup,'userSet', true, '')\n } else {\n messaging(setup,'userSet', false, '')\n }\n return\n}", "function user()\n {\n\n }" ]
[ "0.74128604", "0.7068514", "0.7034865", "0.6944389", "0.68714726", "0.6727432", "0.66817117", "0.6655455", "0.65990317", "0.6596135", "0.65659785", "0.65361875", "0.65215397", "0.64980596", "0.6473161", "0.6424909", "0.640973", "0.638212", "0.6362784", "0.6346945", "0.63394725", "0.6336302", "0.6311612", "0.6307397", "0.6286553", "0.62828803", "0.62782216", "0.6276782", "0.6257498", "0.625187", "0.6243706", "0.62318426", "0.622785", "0.62149763", "0.6213927", "0.6206862", "0.6190436", "0.6178268", "0.617682", "0.61696655", "0.61590713", "0.615268", "0.61474293", "0.61415535", "0.6137488", "0.61053705", "0.61053705", "0.61053705", "0.61053705", "0.6105141", "0.60929525", "0.60832447", "0.60810506", "0.60688907", "0.60656995", "0.60618335", "0.6061056", "0.605613", "0.60558003", "0.60552675", "0.6053419", "0.60436827", "0.60384303", "0.60372734", "0.6031978", "0.60304475", "0.6017634", "0.6012529", "0.6011715", "0.6011579", "0.6011406", "0.6010343", "0.6010343", "0.6010343", "0.6010343", "0.5992445", "0.59904873", "0.598871", "0.5987649", "0.5984586", "0.59812576", "0.5976889", "0.59741616", "0.59696573", "0.5965883", "0.5963022", "0.59607273", "0.59529984", "0.59507245", "0.5948857", "0.59406346", "0.5935055", "0.59195805", "0.5910347", "0.5909678", "0.59015876", "0.5894884", "0.5889742", "0.58896756", "0.5885417", "0.58822984" ]
0.0
-1
& all we do is well we have the purchases
function buyItem(user){ return Object.assign({}, user, { purchases: }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {\n return\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 freeShipping(order){\n var sum = 0;\n for (const items in order){\n sum += order[items]\n }\n return sum > 50;\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}", "async function purchase() {\n\n // SHOW LOADING SCREEN\n dispatch({\n type: 'show-prompt',\n payload: 'loading'\n })\n\n // FETCH THE TOKEN PRICE\n const token_price = await read({\n contract: 'token',\n func: 'price',\n }, state)\n\n // ATTEMPT TO BUY TOKENS\n const result = await write({\n contract: 'token',\n func: 'purchase',\n args: [input.amount.value],\n payable: input.amount.value * token_price\n }, state)\n\n // SLEEP FOR 2 SECONDS TO SMOOTHEN TRANSITION\n await sleep(2)\n\n // EVERYTHING WENT FINE\n if (result.success) {\n\n // CREATE TOAST MESSAGE\n dispatch({\n type: 'toast-message',\n payload: {\n type: 'good',\n msg: 'tokens purchased'\n }\n })\n\n // OTHERWISE, SHOW ERROR\n } else {\n dispatch({\n type: 'toast-message',\n payload: {\n type: 'bad',\n msg: result.reason\n }\n })\n }\n\n // HIDE THE PROMPT WINDOW\n dispatch({ type: 'hide-prompt' })\n }", "function allPremium(shoppingCart) {\n const premiumProducts = filterPremiumProducts(shoppingCart);\n if (premiumProducts.length == shoppingCart.length) {\n console.log(\"Pedidos sin gastos de envio\")\n }\n}", "checkout(){\n\n let total = 0\n this.products.forEach(item =>{\n GRAPHQL.decrementQuantity(item.id)\n total += item.price\n })\n\n return total\n }", "function purchaseMM(){\n if(!cookie.count >= cookie.upgradesPurchased[0]){\n \n if(cookie.count >= cookie.upgradeCosts[0]) {\n cookie.cookieType = \"Chocolate Chip\";\n cookie.logMessage = \"New Upgrade: \" + cookie.cookieType;\n addLogText();\n cookie.upgradesPurchased[0] = true; // Change the boolean of the first index Chocolate Chip to true\n increaseUpgradeCount();\n showUpgrades(); // refreshes the boolean array\n }\n \n else {\n alert(\"You must have \" + cookie.upgradeCosts[0] + \"clicks!\");\n }\n }\n else {\n alert(\"You have already purchaed this upgrade!\");\n \n }\n \n }", "function proceed(count) {\n\t\t\t\t\t\tif(count > 0) return; // Not done yet\n\n\t\t\t\t\t\t// Save items to final purchase\n\t\t\t\t\t\tfinal.items = items;\n\n\t\t\t\t\t\tif(preview)\n\t\t\t\t\t\t\treturn callback(null, { items: items });\n\n\t\t\t\t\t\t// Stringify data\n\t\t\t\t\t\tvar payMethod = connection.escape(final.payMethod);\n\t\t\t\t\t\tvar address = connection.escape(JSON.stringify(final.address));\n\t\t\t\t\t\tvar products = connection.escape(JSON.stringify(final.items));\n\n\t\t\t\t\t\t// Save final purchase to database\n\t\t\t\t\t\tvar _sql = sql.purchases.add(user.id, payMethod, address, products);\n\t\t\t\t\t\tconnection.query(_sql, function(err, result) {\n\t\t\t\t\t\t\tif(err) throw err;\n\n\t\t\t\t\t\t\tcallback(null, { id: result.insertId });\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "function checkPurchase(player) {\n if (parseInt(players[currentPlayer].money - tiles2[players[player].location].cost) < 1) {\n console.log(\"Log - Player cannot afford propery.\")\n updateText(\"You cannot afford to purchase this property.\");\n } else {\n\n if (players[player].passed_go == 1) {\n\n if (confirm('Would you like to purchase ' + tiles2[players[player].location].name)) {\n // Buy\n tiles2[players[player].location].ownedBy = currentPlayer;\n tiles2[players[player].location].canBuy = 0;\n console.log(\"Owned buy set to \" + currentPlayer);\n players[currentPlayer].money = parseInt(players[currentPlayer].money - tiles2[players[player].location].cost);\n\n console.log(\"Log - Player \" + currentPlayer + \"'s new balance is \" + parseInt(players[currentPlayer].money));\n updateMoney(player, players[currentPlayer].money);\n\n changeOwnedPropertyIcons(player);\n } else {\n startBidding(players[player].location);\n }\n } else {\n updateText(\"You must pass go once before you can purchase properties.\");\n }\n\n }\n trade(currentPlayer, tradeWith);\n}", "isPurchaseStatusOk() {\n const purchaseStatus = this.getPurchaseStatus();\n return purchaseStatus === PURCHASE_STATUS.OK;\n }", "getPurchasedItems() {\n return this.purchasedItem;\n }", "function checkInv() {\n\n connection.query(\"SELECT * FROM products\", function (err, res) {\n stockQuantity = res[saleItem].stock_quantity;\n var totalPrice = res[saleItem].price * saleQuantity;\n if (err) throw err;\n //call the purchase function again if not enough stock\n if (res[saleItem].stock_quantity < saleQuantity) {\n console.log(colors.brightRed(\"\\nI'm sorry, we don't have that many of those. We only have \" + res[saleItem].stock_quantity + \".\\n\"));\n purchase();\n\n } else {\n console.log(colors.brightYellow(\"\\nWord. That'll be \" + totalPrice + \" rupies. Enjoy your \" + res[saleItem].product_name + \"!\\n\"));\n transact()\n\n }\n })\n}", "function buyThis(){\n inqurier.prompt([\n {\n message: \"What is the ITEM ID of the PRODUCT you would like to buy?\",\n name: \"id\"\n },\n { \n message: \"How many UNITS would you like to buy?\",\n name: \"purchase\",\n },\n ]).then(function(answer){\n //convert to integers\n var id = parseInt(answer.id);\n var quantity = parseInt(answer.purchase)\n\n //purcahse logic\n\n if (isNaN(answer.id) == true || id <=0 || id > resultArray.length) {\n //error message for invalid number entry \n console.log(\"Error: INVALID ITEM ID\")\n }\n else if (isNan(answer.purcahse) == true || quantity <= 0){\n //error for purchasing zero items\n console.log(\"You must order more than one\")\n }\n else if (quantity > resultArray[id -1].stock_quantity){\n //error for not enough stock \n console.log(\"WE ARE OUT OF THAT\")\n }\n else {\n //for a sucessful order\n purchaes.push(resultArray[id - 1].product_name);\n amounts.push(quantity);\n\n //total of curent order and total order\n var orderCost = quantity * resultArray[id-1].price;\n orderCost = parseFloat(orderCost.toFixed(2));\n total += orderCost;\n total = parseFloat(total.toFixed(2))\n\n sales = resultArray[id - 1].product_sales + orderCost;\n\n console.log(\"You have selected ITEM\" + id + \",\" + resultArray[id - 1].product_name + \".\" )\n console.log(\"This item costs $\" + resultArray[id - 1].price + \" per unit. You have ordered \" + quantity + \" units.\");\n console.log(\"This purchase costs $\" + orderCost + \".\");\n \n //display quantites and ordered as well as cost\n console.log(\"YOU HAVE ORDERED\")\n for (var i = 0; i < purchaes.length; i++){\n console.log(amounts[i] + \"|\" + purchaes[i]);\n }\n console.log(\"mYour total cost is \" + total + \".\");\n\n\t\t\t// query to update the database\n\t\t\tupdate = \"UPDATE products SET stock_quantity = \" + (resultArray[id - 1].stock_quantity - quantity) + \", product_sales = \" + sales + \" WHERE item_id = \" + id;\n\n\t\t\t// updates the database\n\t\t\tconnection.query(update, function (error, results, fields) {\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t};\n });\n keepGoing();\n }\n })\n}", "function purchase () {\n // prompting the user what they want and what quantity\n\tinquirer.prompt([\n \t{\n \ttype: \"input\",\n \tname: \"item\",\n \tmessage: \"Which item do you want to purchase? (Please type item ID)\"\n \t}, {\n \tname: \"quantity\",\n \ttype: \"input\",\n \tmessage: \"How many would you like?\"\n // processing customer purchase\n \t}]).then(function(answers) {\n var item = answers.item;\n var quantity = answers.quantity;\n\n // connecting the the database to check for availability and update stock quantity\n connection.query(\"SELECT stock_quantity, price FROM products WHERE id=\" + item, function (err,res) {\n var stockQuantity = res[0].stock_quantity;\n var total = res[0].price * quantity;\n var newStock = stockQuantity - quantity;\n\n // if their quantity exceeds the inventory the order does not go through\n if (newStock < 0){\n console.log(\"Insufficient quantity! Try again.\");\n purchase();\n }\n // if the inventory is available, quantity in the database is updated\n // and the customer is given their total\n else {\n connection.query(\"UPDATE products SET stock_quantity=\" + newStock + \"WHERE item_id=\" + item, function (err,res) {\n });\n console.log(\"Success! Your total is $\" + total);\n }\n\n });\n\t});\n}", "function purchase() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.table(res);\n inquirer.prompt([{\n name: \"itemId\",\n type: \"number\",\n message: \"Enter the item ID of the item you want to buy.\".brightYellow\n },\n {\n name: \"itemQuantity\",\n type: \"number\",\n message: \"Excellent Choice! How many would you like?\".brightYellow\n }]).then(function (answer) {\n saleItem = answer.itemId - 1;\n saleQuantity = answer.itemQuantity;\n checkInv()\n\n });\n\n });\n\n}", "async function getCompletedPurchases(account) {\n try {\n const IdsBoughtEvents = await EventsModule.GetBoughtRefs(account);\n let IdsBoughtList = await EventsModule.EventsToIds(IdsBoughtEvents);\n\n let IdsNoMoreActionsEvents = await EventsModule.WithdrawFundsEventGeneral();\n let IdsNoMoreActionsList = await EventsModule.EventsToIds(IdsNoMoreActionsEvents)\n\n let IdsList = await EventsModule.ComputeInter(IdsNoMoreActionsList, IdsBoughtList)\n let Ids = await EventsModule.GetRefs(IdsList);\n return Ids;\n } catch (err) {\n throw err;\n }\n}", "buyCunsumable (product) {\n if (!this._isPlugin()) return Promise.resolve();\n\n if (!product || !product.productId) return Promise.reject(new Error('Failed buy product Error: product or no product ID'));\n return new Promise((resolve, reject) => {\n return inAppPurchase\n .buy(product.productId)\n .then(data => {\n console.log('GOT MY SKULLS!!!! ' + JSON.stringify(data.productId));\n // The consume() function should only be called after purchasing consumable products\n // otherwise, you should skip this step\n\n let skullsAmount = parseInt((product.description || '').trim(), 10) || 0;\n\n if (isIOS()) {\n skullsAmount = parseInt((product.description.split(' ')[1] || '').trim(), 10) || 0;\n }\n\n Player.updateCurrentGold(skullsAmount);\n\n // TODO: return response with token and such\n // TODO: THIS IS FOR Android only. IOS need to have separated products\n if (isIOS()) return Promise.resolve();\n\n return inAppPurchase.consume(data.type, data.receipt, data.signature);\n })\n .then(() => {\n console.log('CONSUME THIS SHIT!');\n return resolve();\n })\n .catch(err => {\n console.log('GETTING SKULLS FAILED: ' + JSON.stringify(err));\n reject(err);\n });\n });\n }", "function main(){\n // Display the products available for purchase\n getProducts()\n \n }", "function viewPurchases() {\n $.ajax({\n url: '/get/purchases/',\n method: 'GET',\n success: (data) => buildListingArea(data);\n })\n}", "purchases(gallery_id, { user, trx } = {}) {\n return Gallery\n .forge( { id: gallery_id })\n .fetch({\n require: true,\n transacting: trx,\n withRelated: 'posts.purchases.outlet'\n })\n .then(gallery => {\n if (gallery.get('owner_id') != user.get('id') && !user.permissions.can('admin', 'get', 'purchase')) {\n return Promise.reject(\n ferror(ferror.FORBIDDEN)\n .msg('You do not have permission to view purchases for this gallery')\n );\n }\n\n let posts = [];\n for (let post of gallery.related('posts').models) {\n let purchases = [];\n for (let purchase of post.related('purchases').models) {\n purchases.push({\n id: purchase.get('id'),\n outlet: {\n id: purchase.related('outlet').get('id'),\n title: purchase.related('outlet').get('title'),\n avatar: purchase.related('outlet').get('avatar'),\n object: 'outlet'\n },\n amount: parseInt(purchase.get('amount')) - parseInt(purchase.get('fee'))\n });\n }\n if (purchases.length) {\n delete post.relations.purchases;\n post.set('purchases', purchases);\n posts.push(post);\n }\n }\n return Promise.resolve(posts);\n })\n .catch(Gallery.NotFoundError, err =>\n Promise.reject(ferror(ferror.NOT_FOUND).msg('Gallery not found'))\n )\n .catch(err => Promise.reject(ferror.constraint(err)));\n }", "function getLicenses() {\n console.log(\"google.payments.inapp.getPurchases\");\n statusDiv.text(\"Retreiving list of purchased products...\");\n google.payments.inapp.getPurchases({\n 'parameters': {env: \"prod\"},\n 'success': onLicenseUpdate,\n 'failure': onLicenseUpdateFailed\n });\n}", "function checkPurchase(itemID, qty) {\n\n connection.query(\"SELECT * FROM products WHERE ?\",\n {\n id: itemID\n },\n function (err, res) {\n if (err) throw err;\n\n let stock = res[0].stock_quantity;\n let price = res[0].price;\n\n if (stock >= qty) {\n console.log(\"You can buy that!\");\n finalizePurchase(itemID, qty, stock, price);\n } else {\n console.log(\"There aren't enough units to purchase that! Let's start over...\");\n startPrompt();\n\n }\n\n });\n}", "function purchaseChocSwirl() {\n if(!cookie.count >= cookie.upgradesPurchased[0]){\n \n if(cookie.count >= cookie.upgradeCosts[0]) {\n cookie.cookieType = \"Chocolate Chip\";\n cookie.logMessage = \"New Upgrade: \" + cookie.cookieType;\n addLogText();\n cookie.upgradesPurchased[0] = true; // Change the boolean of the first index Chocolate Chip to true\n increaseUpgradeCount();\n showUpgrades(); // refreshes the boolean array\n }\n \n else {\n alert(\"You must have \" + cookie.upgradeCosts[0] + \"clicks!\");\n }\n }\n else {\n alert(\"You have already purchaed this upgrade!\");\n \n }\n }", "function purchase() {\n connection.query(\n \"SELECT item_id, price*answer.purchase FROM products\",\n console.log(query.sql)\n )\n }", "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\n });\n }", "async function ongoingPurchases(account) {\n try {\n let Ids = await EventsModule.GetBoughtRefs(account); // Get the Refs which were bought\n let WithdrawnIds = await EventsModule.WithdrawFundsEventGeneral(); // References for which funds have been withdrawn\n\n let ongoingIds = await EventsModule.ComputeLeft(EventsModule.EventsToIds(Ids), EventsModule.EventsToIds(WithdrawnIds)); // Only the ongoing one's\n\n let ongoingIdsEvents = await EventsModule.GetRefs(ongoingIds); // Transform back to events\n return ongoingIdsEvents;\n } catch (e) {\n throw e;\n }\n}", "function buy()\n{\n\t//query the databse for all items being sold\n\tconnection.query(\"SELECT * FROM products\", function(err, res)\n\t{\n\t\t\n\t\tif(err) throw err;\n\n\t\t//Prompt the user to input data\n\t\tinquirer.prompt([\n\n\t\t\t{\n\t\t\t\t//Ask for id of the product the user wants to buy\n\t\t\t\tname: \"id\",\n\t\t\t\ttype: \"list\",\n\t\t\t\tchoices: function()\n\t\t\t\t{\n\t\t\t\t\tvar idChoiceArray = [];\n\n\t\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t//push all items_ids into (idChoiceArray) in order to display all ids to choose from\n\t\t\t\t\t\t//NOTE: For rawlist cannot use type(INT) only (string) hence convert int to string by JSON.stringify\n\t\t\t\t\t\tidChoiceArray.push(JSON.stringify(res[i].item_id));\n\t\t\t\t\t}\n\n\t\t\t\t\t//display all item_id's to choose from\n\t\t\t\t\treturn idChoiceArray;\n\t\t\t\t},\n\t\t\t\tmessage: \"Enter the id of the product you want to purchase\"\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t//Ask customer for how many units they'd like to buy\n\t\t\t\ttype: \"input\",\n\t\t\t\tname: \"quantity\",\n\t\t\t\tmessage: \"How many units would you like to buy?\"\n\t\t\t}\n\n\t\t\t]).then(function(answer)\n\t\t\t{\n\t\t\t\t//get the entire item object & store in variable\n\t\t\t\tvar chosenItem;\n\n\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t{\n\t\t\t\t\t//if id == user id choice then store entire object\n\t\t\t\t\tif(res[i].item_id === parseInt(answer.id) )\n\t\t\t\t\t{\n\t\t\t\t\t\tchosenItem = res[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t//call the checkQuantity function & update the table if the quantity entered is sufficient\n\t\t\t\tcheckQuantity(chosenItem, answer, err);\n\n\t\t\t});\n\n\t});\n}", "function checkBuyable() {\n\tfor(var i = 0; i < costUpgrade.length; i++) {\n\t\tdocument.getElementById('costUpgrade' + i).innerHTML = '' + costUpgrade[i];\n\n\t\tif(currentMoney < costUpgrade[i])\n\t\t\tdocument.getElementById('shopItem' + i).style.opacity = '0.5';\n\t\telse\n\t\t\tdocument.getElementById('shopItem' + i).style.opacity = '1';\n\t}\n}", "function makePurchase(){\n // ask the user which product they would like to buy and the number of units they would like to purchase\n inquirer.prompt([\n {\n name: \"productId\",\n type: \"input\",\n message: \"Which product would you like to purchase? (Please enter the product ID number.)\",\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n },\n {\n name: \"productQuantity\",\n type: \"input\",\n message: \"How many units of this product would you like to purchase?\",\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n }\n ]).then(function(answers){\n\n // begin query to the bamazon database \n connection.query(\"SELECT item_id, stock_quantity, price FROM products WHERE ?\", \n {\n item_id: answers.productId\n },\n function(err, data){\n if (err) throw err;\n\n // check if the product ID entered actually matches one that is available \n var productExists = false;\n\n // loop through the result\n for (var i = 0; i < data.length; i++){\n\n // if the product exists\n if (data[i].item_id == answers.productId){\n // change the value of productExists to true \n productExists = true;\n\n // check if there is sufficient quantity to make the purchase \n if (data[i].stock_quantity >= parseInt(answers.productQuantity)){\n \n // if true, return the price to the user \n console.log(\"Great! \\nYour total will be: \\n $\" + calculatePrice(parseInt(answers.productQuantity), data[i].price) + \"\\nThank you for your purchase.\");\n\n // update product quantity in the database to reflect the purchase \n connection.query(\"UPDATE products SET ? WHERE ?\", \n [\n {stock_quantity: data[i].stock_quantity - answers.productQuantity},\n\n {item_id: answers.productId}\n ], \n function (err) {\n if (err) throw err;\n }\n )\n\n }else{\n // return message to user if there is an insufficient quantity of the product available \n console.log(\"Sorry, insufficient quantity available.\")\n }\n }\n }\n\n // if the product does not exist, tell the user \n if(productExists === false){\n console.log(\"Oops, please enter a valid product ID number.\")\n }\n \n // run the showProducts function to begin the program again\n showProducts();\n })\n })\n}", "function checkAvailability(customerData) {\n// Object destructuring \n let { customerSelection, purchaseQuantity } = customerData;\n connection.query(\"SELECT stock_quantity, product_name, price FROM products WHERE product_name=?\", [customerSelection], (err, results, fields) => {\n if (err) {\n throw err;\n }\n let stock_quantity = results[0].stock_quantity;\n let productPrice = results[0].price;\n let remainingItems = stock_quantity - purchaseQuantity;\n let salesPrice = productPrice * purchaseQuantity;\n\n if (remainingItems > -1) {\n if (purchaseQuantity > 1) {\n console.log(`You just purchased ${purchaseQuantity} ${customerSelection}s for $${salesPrice}`);\n } else {\n console.log(`You just purchased ${purchaseQuantity} ${customerSelection} for $${salesPrice}`);\n }\n return updateDatabase(customerSelection, remainingItems, salesPrice);\n }\n console.log(\"Sorry, we have insufficient quantity\");\n return continueShoppingPrompt();\n });\n}", "processOrders() {\r\n /*\r\n this.orders.forEach(order => {\r\n const isBuy = order.amount > 0;\r\n const amount = Math.abs(order.amount);\r\n const base = order.pair.split('-')[0];\r\n const quote = order.pair.split('-')[1];\r\n const quoteAmount = base * amount;\r\n // check price\r\n const orderBooks = this.cobinhood.orderBooks;\r\n\r\n // execute order\r\n if (isBuy) {\r\n if (this.wallet.withdraw(quote, quoteAmount)) {\r\n this.wallet.deposit(base, amount);\r\n }\r\n }\r\n else {\r\n if (this.wallet.withdraw(base, amount)) {\r\n this.wallet.deposit(quote, quoteAmount);\r\n }\r\n }\r\n console.log(order);\r\n });*/\r\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 getAllPurchases() {\n return Purchase.find();\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 purchase(itemId, neededQuant) {\n connection.query(`SELECT * FROM products WHERE id = ${itemId}`, function (err, res) {\n if (err) throw err;\n if(res[0].stock_quantity < neededQuant) {\n console.log(\"Insufficient stock! Sorry. Please check again.\")\n } else {\n connection.query(`UPDATE products SET stock_quantity = ${res[0].stock_quantity} - ${neededQuant} WHERE id = ${itemId}`);\n //sets price to a variable for easy use\n var total = res[0].price * neededQuant;\n console.log(`\nYour total today comes up to ${total}. Thank you for shopping and please come again.\n `)\n }\n connection.end();\n });\n}", "function purchase() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"itemID\",\n message: \"What is the ID of the item you would like to purchase?\",\n validate: function(value) {\n if (isNaN(value) === false && value !== '' && parseInt(value) > 0) {\n return true;\n } else {\n console.log(\"\\nPlease enter a valid ID.\");\n return false;\n }\n }\n },\n {\n type: \"input\",\n name: \"itemQuantity\",\n message: \"How many would you like?\",\n validate: function(value) {\n if (isNaN(value) === false && value !== '' && parseInt(value) > 0) {\n return true;\n } else {\n console.log(\"\\nPlease enter a valid quantity.\");\n return false;\n }\n }\n }\n ])\n .then(function(choice) {\n //console.log(\"User's choice: \", choice);\n\n var currentItem = currentInventory.filter(\n item => item.id === parseInt(choice.itemID)\n );\n \n // Above function if written in longer form\n // var currentItem = currentInventory.filter(function(item) {\n // return item.id === parseInt(choice.itemID);\n // });\n\n //console.log(\"currentItem\", currentItem);\n //console.log(\"choice.itemQuantity\", parseInt(choice.itemQuantity));\n //console.log(\"currentItem.stock_quantity\", currentItem[0].stock_quantity);\n \n // if item ID given by the customer does NOT match the ID in the 'products' table\n if (currentItem.length == 0) {\n console.log(\"Sorry that item doesn't exist\");\n // ask customer if they want to move onto a different purchase\n confirmNextPurchase();\n\n //if item ID given by the customer DOES match the ID in the 'products' table\n } else {\n // If the quantity requested is LESS THAN OR EQUAL to the stock quantity\n if (parseInt(choice.itemQuantity) <= currentItem[0].stock_quantity) {\n //fulfill order\n //console.log(\"Enough quantity\");\n console.log(\"You have picked \" + choice.itemQuantity + \" of the \" + currentItem[0].product_name + \".\")\n var cost = parseInt(choice.itemQuantity) * currentItem[0].price;\n console.log(\"Please pay the total of $\" + cost + \" before moving onto the next purchase!\")\n \n // Check if the customer paid\n paidOrUnpaid( function(isPaid) {\n if(isPaid){\n // ONLY update the inventory (aka the 'products' table) if the customer has PAID\n\n //console.log('isPaid working');\n var updatedStock = currentItem[0].stock_quantity - choice.itemQuantity;\n //console.log(\"updatedStock\", updatedStock);\n\n // UPDATE the 'stock_quantity' in the 'products' table using the product ID chosen by the customer after the purchase\n updateInventory(parseInt(choice.itemID), updatedStock);\n confirmNextPurchase();\n // Ends connection if the amount is NOT PAID\n } else {\n console.log(\"The amount is not paid.\");\n connection.end();\n }\n });\n // If the quantity requested is GREATER THAN the stock quantity\n } else {\n // Alert customer about the quantity left\n console.log(\"Insufficient quantity!\");\n console.log(\"We only have \" + currentItem[0].stock_quantity + \" of the \" + currentItem[0].product_name + \" left.\")\n // Ask if customer would like to move onto a new purchase\n confirmNextPurchase();\n }\n }\n });\n}", "function purchase() {\n con.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n inquirer.prompt([\n {\n name: \"choice\",\n type: \"input\",\n message: \"Input ID of item you would like to purchase.\",\n validate: function(value) {\n\n //Validates if input is a number\n var pass = value.match(/\\d/g);\n if (pass) {\n return true;\n }\n return \"Please enter a number ID\" \n }\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many would you like to purchase?\",\n validate: function(value) {\n\n //Validates if input is a number\n var pass = value.match(/\\d/g);\n if (pass) {\n return true;\n }\n return \"Please enter a number quantity\" \n }\n }\n ])\n .then(function(ans) {\n\n //Traverses the array to locate the item the user selected\n var chosenItem;\n for (var i = 0; i < res.length; i++) {\n if (ans.choice == res[i].item_id) {\n chosenItem = res[i];\n console.log(\"You have chosen \" + ans.quantity + \" of \" + chosenItem.product_name);\n }; \n };\n\n //If in stock, fulfills customer's request\n if (chosenItem.stock_quantity >= ans.quantity) {\n console.log(\"Your order is being processed!\")\n\n //Calculates new stock of product selected\n updatedStock = chosenItem.stock_quantity - ans.quantity;\n\n //Updates MySql with new stock quantity\n con.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function(err) {\n if (err) throw err;\n console.log(\"Purchase successful!\");\n\n //Shows customer cost of purchase(s)\n console.log(\"Your total comes out to \" + (ans.quantity * chosenItem.price) + \"$.\");\n\n //Prompts the user to continue shopping or not\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"confirm\",\n message: \"Do you want you to continue shopping?\"\n }\n ])\n .then(function(ans) {\n if (ans.continue == true) {\n purchase();\n } else if (ans.continue == false) {\n console.log(\"Come back soon!\");\n con.end();\n }\n })\n })\n\n //If not in stock, notifies customer and ends transaction\n } else if (chosenItem.stock_quantity <= ans.quantity) {\n console.log(\"Sorry, Insufficient Quantity.\")\n\n //Prompts the user to continue shopping or not\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"confirm\",\n message: \"Do you want you to continue shopping?\"\n }\n ])\n .then(function(ans) {\n if (ans.continue == true) {\n purchase();\n } else if (ans.continue == false) {\n console.log(\"Come back soon!\");\n con.end();\n }\n })\n };\n });\n });\n}", "function purchase(quantityRemaining, quantityRequest, price, id) {\n if (quantityRemaining < quantityRequest) {\n inquirer\n .prompt({\n name: \"editRequest\",\n type: \"rawlist\",\n message:\n \"Insufficient quantity to fullfill order. Would you like to change your request to a smaller value?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(data) {\n if (data.confirm === \"No\") {\n console.log(\"Thank you for your business!\");\n connection.end();\n } else {\n runSearch();\n }\n });\n } else {\n total = total + price * quantity;\n connection.query(\n \"UPDATE products SET stock_quantity = stock_quantity - \" +\n quantity +\n \" WHERE ?\",\n [\n {\n item_id: id\n }\n ],\n //alert user of the balance for their current request, if they want to make additional purchases \n //then price and quantity is added to the \"total\" variable.\n function(err, res) {\n if (err) throw err;\n\n inquirer\n .prompt({\n name: \"confirm\",\n type: \"rawlist\",\n message:\n \"\\nYour total for this transaction is: $\" +\n (price * quantity).toString() +\n \". Would you like to make another purchase?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(data) {\n if (data.confirm === \"No\") {\n console.log(\"\\nThe total for today is: $\" + total.toString());\n connection.end();\n } else {\n runSearch();\n }\n });\n }\n );\n }\n}", "function showPurchases() {\n app.getView().render('account/giftregistry/purchases');\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 purchaseItem(...fns)\n\n\n{} // & these spreads functions", "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}", "updatePurchaseState(ingredients){\n\n const sum = Object.keys(ingredients).map(ingKey =>{return ingredients[ingKey]}).reduce((sum, ele) => {return sum+ele}, 0);\n\n this.setState({\n purchasable : sum > 0 //set to true if sum greater than 0\n })\n }", "function purchaseDoubleChoc() {\n if(!cookie.count >= cookie.upgradesPurchased[0]){\n \n if(cookie.count >= cookie.upgradeCosts[0]) {\n cookie.cookieType = \"Chocolate Chip\";\n cookie.logMessage = \"New Upgrade: \" + cookie.cookieType;\n addLogText();\n cookie.upgradesPurchased[0] = true; // Change the boolean of the first index Chocolate Chip to true\n increaseUpgradeCount();\n showUpgrades(); // refreshes the boolean array\n }\n \n else {\n alert(\"You must have \" + cookie.upgradeCosts[0] + \"clicks!\");\n }\n }\n else {\n alert(\"You have already purchaed this upgrade!\");\n \n }\n }", "async function isOrderCampaignPaid(order, shop, accessToken) {\n try {\n let result = await fetch(\n `https://${shop}/admin/api/${apiVersion}/orders/${order.id}/events.json?verb=placed`,\n {\n headers: {\n \"X-Shopify-Access-Token\": accessToken,\n \"Content-Type\": \"application/json\"\n }\n }\n );\n result = await result.json();\n\n if (!result.events || !result.events.length) {\n return false;\n }\n\n let draftId = null;\n\n const resultMatch = result.events[0].message.match(\n /href=\".*?admin\\/draft_orders\\/(\\d*?)\"/\n );\n\n if (resultMatch && resultMatch[1]) {\n draftId = resultMatch[1];\n }\n\n if (!draftId) {\n return false;\n }\n const orderApp = await Orders.findOne({\n order_draft_id: draftId,\n is_order: 0\n });\n if (!orderApp) {\n return false;\n }\n\n const shopSuccesfulOrders = await Orders.find({\n shopId: new ObjectId(orderApp.shopId),\n is_order: 1,\n amount: { $gt: 0 }\n });\n\n orderApp.order_id = order.id;\n orderApp.is_order = 1;\n orderApp.upsell_amount = orderApp.tmp_upsell_amount;\n orderApp.amount = parseFloat(order.total_price);\n orderApp.save();\n\n notifyMerchantAboutSuccesfulUpsell(shop, orderApp.order_id);\n reportEvent(shop, \"uou-upsell_order_checkout_completed\", {\n amount: order.total_price\n });\n\n // if it's the first order then send an email to the mercahnt\n if (\n shopSuccesfulOrders &&\n shopSuccesfulOrders.length === 0 &&\n orderApp.amount > 0\n ) {\n reportEvent(shop, \"uou-upsell_order_checkout_completed-first-checkout\", {\n amount: order.total_price\n });\n }\n\n return orderApp;\n } catch (error) {\n console.log(error);\n return false;\n }\n}", "vendItem(productIndex) {\n //check if valid\n let product = vm.products[productIndex]\n // IF Exists we have some you have enough money\n if (product && product.quantity > 0 && vm.currentTransaction >= product.price) {\n this.processTransaction(product)\n return JSON.parse(JSON.stringify(product))\n }\n return false\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 transaction() {\n\n // Queries the bamazon db and selects all fields from the products table\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n\n // Prompt that will display everything currently in inventory and then asks the use to select the Item ID for the desired product\n inquirer\n .prompt([\n {\n name: \"choice\",\n type: \"rawlist\",\n choices: function () {\n var idArray = [];\n console.log(\"\\n\\n-------------------------------\\n Products Currently for sale\\n-------------------------------\\n\");\n for (var i = 0; i < results.length; i++) {\n console.log(\"==================================================\")\n console.log(\" Item ID: \" + idArray.push(results[i].item_id));\n console.log(\" Product Name: \" + results[i].product_name);\n console.log(\" Category: \" + results[i].department_name);\n console.log(\" Price: $\" + results[i].price);\n console.log(\" Current Stock: \" + results[i].stock_quantity);\n console.log(\"==================================================\\n\")\n }\n return idArray;\n },\n message: \"Enter the Item ID number of the product you would like to buy.\"\n },\n\n // Asks the user the quantity they would like to purchase\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many would you like to buy?\"\n }\n ])\n\n .then(function (answer) {\n\n // Defines variables for the product and it's table values\n var arrayNum = answer.choice - 1;\n var price = round(results[arrayNum].price, 2)\n var total = round(answer.quantity * price, 2)\n var itemID = results[arrayNum].item_id;\n var prodName = results[arrayNum].product_name;\n var quantityToBuy = answer.quantity;\n var stockQuantity = results[arrayNum].stock_quantity;\n\n // Checks to see if there is enough inventory stock to fullfill the user's purchase\n if (quantityToBuy > stockQuantity) {\n console.log(\"Insufficient quantity!\");\n }\n\n else {\n // Variable that holds the updated inventory stock after the purchase\n var updatedQuantity = stockQuantity - quantityToBuy;\n\n // Updates the products table and sets the stock_quantity value to the updated quantity \n // where the item_id is the number the user selected\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedQuantity\n },\n {\n item_id: itemID\n }\n ],\n function (error) {\n if (error) throw err;\n\n // Shows the user what they purchased and the amount.\n console.log(\"\\nItem(s) Purchased!\");\n console.log(\"==================================\\n Item ID: \" + itemID + \"\\n Product: \" + prodName + \"\\n Price: $\" + price + \"\\n Quantity: \"\n + quantityToBuy + \"\\n Total: $\" + total + \"\\n==================================\");\n }\n );\n }\n\n // Closes connection to bamazon db\n connection.end();\n });\n });\n}", "updatePurchaseState(updatedIngredients) {\n\n const sum = Object.values(updatedIngredients)\n .reduce((sum, el) => {\n return sum + el;\n }, 0)\n this.setState({ purchaseable: sum > 0 })\n }", "function customerBuy(){\n var productInfo = {\n properties: {\n item_id: {description: ' Chose by typing ID'},\n stock_quantity: {description: ' Quantity: How many items? '}\n },\n };\n \n prompt.start();\n prompt.get(productInfo, function (err, res){\n var purchase = {\n item_id: res.item_id,\n stock_quantity: res.stock_quantity\n };\n\n transaction.push(purchase);\n \n // Take a look at the table and see if the quantity ordered is less than the quantity on hand and confirm order\n connection.query('SELECT * FROM products WHERE item_id=?', transaction[0].item_id, function(err, res){\n if (res[0].stock_quantity >= transaction[0].stock_quantity) { \n // Repeat order back customer at console window\n console.log(\"Your order is \" + res[0].product_name); \n console.log(\"TOTAL = $\" + (transaction[0].stock_quantity*res[0].price));\n stock_quantity_left = res[0].stock_quantity - transaction[0].stock_quantity;\n connection.query('UPDATE products SET stock_quantity ='+ stock_quantity_left + ' WHERE item_id ='+ transaction[0].item_id, function(err, res){\n // Give order confirmation message\n console.log(\"Your order has been confirmed. Thank you.\");\n connection.end();\n });\n // If the order exceeds the amount on hand, inform customer it is out of stock\n } else {\n console.log(\"Our apologies but we are currently out of stock in that item....we'll be back soon!\");\n connection.end();\n }\n });\n });\n}", "async purchase() {\n if (!this.canUnlock(this.category)) {\n return alert('Did not match category requirements.');\n }\n\n if (confirm(`Are you sure you want to purchase ${this.category.name}?`) === false) return;\n\n this.isPurchasing = true;\n\n try {\n let response = await this.einsteinChamberService.purchase(this.category.id);\n this.user.update(response.user);\n this.isPurchasing = false;\n } catch (response) {\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 purchase1() {\n\tvar h = parseInt(localStorage.getItem(\"Amount\"));\n\tvar k = JSON.parse(localStorage.getItem(\"Items\"));\n\n\tlocalStorage.setItem(\"Amount\", 0)\n\tlocalStorage.setItem(\"Items\", JSON.stringify([]));\n// create function to generate reference number\n\tvar l = (Math.random() * 0xFFFFFF).toString(16)\n\talert(\"The reference number for your order is \" + l)\n}", "function buyProducts(id, quantity)\n {\n connection.query(\"SELECT * FROM products WHERE item_id = \"+id,\n function(err, res) \n {\n if (err) throw err;\n if(quantity > res[0].stock_quantity)\n {\n console.log(\"Quantity Requested: \"+quantity);\n console.log(\"Quantity In Stock: \"+res[0].stock_quantity);\n console.log(\"SORRY! We don't have enough to fill your order\");\n connection.end();\n }\n else\n {\n var inventory = parseInt(res[0].stock_quantity) - quantity;\n var newid = res[0].item_id;\n var newname = res[0].product_name;\n console.log(\"Product name: \"+newname+ \" , Product ID: \"+newid);\n\n console.log(\"Stock Inventory BEFORE your Purchase: \"+res[0].stock_quantity);\n console.log(\"Units you are purchasing: \"+quantity);\n console.log(\"Stock Inventory AFTER your Purchase: \"+inventory);\n updateQuantity(res[0].stock_quantity, newid, inventory );\n priceIt(quantity, res[0].price);\n } \n });\n }", "handleCheckout() {\n let postedCart = [];\n let userID;\n for (let i = 0; i < this.state.cart.length; i++) {\n postedCart.push({\n item: this.state.cart[i],\n count: this.state.cart[i].quantity\n });\n }\n callBackendAPI('/api/verify', 'post', {}).then(response => {\n userID = response.user._id;\n callBackendAPI('/api/getAllClients', 'get').then(response => {\n let i = 0;\n let searching = true;\n while(i < response.length && searching) {\n if (response[i].alienNumber === Number(this.state.clientId)) {\n callBackendAPI('/api/transactions/addTransaction', 'post', {\n transaction: {\n volunteerItems: [],\n shopItems: postedCart,\n authorizedUser: userID,\n clientId: response[i]._id,\n type: 'SHOP'\n }\n }).then(response => {\n if (response) { console.log(response); }\n });\n searching = false;\n }\n i++;\n }\n if (searching) {\n this.setState({\n open: true,\n message: 'Invalid Client Id!'\n });\n }\n });\n });\n }", "updatePurchaseState(ingredients) {\n // const ingredients = {\n // ...this.state.ingredients\n // };\n const sum = Object.keys(ingredients)\n .map(igkey => {\n return ingredients[igkey];\n })\n .reduce((sum, el) => {\n return sum + el;\n }, 0);\n\n this.setState({purchasable: sum > 0})\n }", "function checkTotals() {\n\t/* See if a new breeder can be unlocked.\n\t As prices are in acending order, we know we cannot buy any after */\n\twhile (state.nextBreederUnlock < state.breeders.length\n\t\t\t&& state.larvae >= state.breeders[state.nextBreederUnlock].unlock) {\n\t\taddBreeder(state.nextBreederUnlock);\n\t\tstate.nextBreederUnlock++;\n\t}\n\t/* Check which breeders can be bought */\n\tfor (var i = 0; i < state.nextBreederUnlock; i++) {\n\t\tsetBreederLock(i, state.breeders[i].cost <= state.larvae);\n\t}\n\t/* Check if a new upgrade can be unlocked */\n\tfor (var i = state.nextUpgradeUnlock; i < state.upgrades.length; i++) {\n\t\t/* As prices are in acending order, we know we cannot buy any after */\n\t\tif (state.upgrades[i].canUnlock(state)) {\n\t\t\taddPurchaseUpgrade(i);\n\t\t\tstate.nextUpgradeUnlock++;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\t/* Check if the currently selected upgrade can be bought */\n\tif (screen1.currentUpgrade >= 0) {\n\t\tsetUpgradeLock(state.upgrades[screen1.currentUpgrade].cost <= state.larvae);\n\t}\n}", "function completePurchase(input) {\n console.log(input);\n\n let query = \"SELECT stock_quantity, price FROM products WHERE ?\";\n connection.query(query, { item_id: input.productID }, function (err, res) {\n\n if (err) throw err;\n\n let stock = res[0].stock_quantity;\n let purchasePrice = res[0].price;\n\n if (input.productUnits >= stock) {\n console.log(\"🚫 Out of Stock!\");\n requestProduct();\n\n } else {\n let newQuantity = stock - input.productUnits;\n\n let query = \"UPDATE products SET ? WHERE ?\"\n connection.query(query, [{ stock_quantity: newQuantity }, { item_id: input.productID }], function (err, res) {\n\n if (err) throw err;\n\n let totalPrice = input.productUnits * purchasePrice;\n\n console.log(`✅ Transaction Complete! Grand Total: $ ${totalPrice}`);\n\n });\n\n displayProducts();\n }\n });\n\n}", "purchase(productSkus = [], planSkus = [], appStoreDetails) {\n\t\tconst cart = {\n\t\t\tproductSkus,\n\t\t\tplanSkus\n\t\t};\n\n\t\tif(appStoreDetails) cart.appStoreDetails = appStoreDetails;\n\n\t\treturn _makeRequest('/purchase', {needsAuth: true, method: 'POST', body: cart})\n\t\t\t.then(responseData => {\n\t\t\t\tif(responseData.success) {\n\t\t\t\t\t// Unsubscribe from no_purchases_made topic\n\t\t\t\t\tfirebaseClient.unsubscribe(constants.firebase.topics.NO_PURCHASES_MADE);\n\n\t\t\t\t\treturn responseData.order;\n\t\t\t\t} else {\n\t\t\t\t\t// Throw an erro for downstream\n\t\t\t\t\tthrow new Error(responseData.errors[0]);\n\t\t\t\t}\n\t\t\t});\n\t}", "function purchaseChocChip() {\n\n if(!cookie.count >= cookie.upgradesPurchased[0]){\n \n if(cookie.count >= cookie.upgradeCosts[0]) {\n cookie.cookieType = \"Chocolate Chip\";\n cookie.logMessage = \"New Upgrade: \" + cookie.cookieType;\n addLogText();\n cookie.upgradesPurchased[0] = true; // Change the boolean of the first index Chocolate Chip to true\n increaseUpgradeCount();\n showUpgrades(); // refreshes the boolean array\n }\n \n else {\n alert(\"You must have \" + cookie.upgradeCosts[0] + \"clicks!\");\n }\n }\n else {\n alert(\"You have already purchaed this upgrade!\");\n\n }\n}", "function purchaseItem() {\n\n // Defining query terms to select the item being purchased\n var queryTerms = \"SELECT * FROM products WHERE ?\";\n connection.query(queryTerms, {item_id: itemID}, function(err, results) {\n if (err) throw err;\n\n // Reassigning data into new variables\n quantityOnHand = results[0].stock_quantity;\n totalPrice = (purchaseQuantity * results[0].price).toFixed(2);\n newSales = totalPrice;\n\n // Getting data from the individual record to handle total product sales\n // Sometimes the product sales are recorded as \"null\" in the table, so this is error handling for that.\n if (results[0].product_sales === null) {\n totalSales = 0;\n } else {\n totalSales = (results[0].product_sales).toFixed(2);\n }\n\n // If the item being purchased fits within the inventory...\n if (purchaseQuantity <= quantityOnHand) {\n console.log(\"\\nYou ordered \" + purchaseQuantity + \" \" + results[0].product_name + \"(s).\" +\n \"\\nYour total is $\" + totalPrice + \" + tax.\\n\");\n updateQuantity();\n // Otherwise reroute to the beginning\n } else {\n console.log(\"\\n**** Insufficient quantity on hand. Please try again.\\n\"); \n start(); \n }\n });\n} // End purchaseItem function", "function checkIfAvailable() {\n // query bamazon DB for the entered item and available quantity\n connection.query(\"SELECT stock_quantity, product_name, price FROM products WHERE id=?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // if quantity entered is higher than quantity available, alert user there is insufficient stock then call viewAll function to start over\n else if (quantityToBuy > parseInt(res[0].stock_quantity)) {\n console.log(chalk.bgRed(\"Insufficient stock!\"));\n console.log('\\n*******************');\n viewAll();\n } else {\n // if quantity entered is equal or lower than quantity available, alert user of the purchase and total cost\n console.log(\"You successfully purchased \" + quantityToBuy + \" \" + res[0].product_name);\n console.log(chalk.bgYellow.red(\"The total cost was: $\" + (quantityToBuy * res[0].price)));\n console.log('\\n*******************');\n // call update Quantity function\n updateQuantity();\n }\n });\n}", "function verifyItemPurchase (review, user, item_id)\r\n{\r\n\t'use strict';\r\n\tif (item_id)\r\n\t{\r\n\t\tvar results = new nlapiSearchRecord('salesorder', null, [\r\n\t\t\tnew nlobjSearchFilter('entity', null, 'is', user)\r\n\t\t,\tnew nlobjSearchFilter('item', null, 'is', item_id.toString())\r\n\t\t]);\r\n\r\n\t\treview.setFieldValue('custrecord_ns_prr_verified', results && results.length ? 'T' : 'F');\r\n\t}\r\n}", "checkout(Inventory) {\n let total = 0;\n this.items.forEach(i => {\n let [ sku, name, quantity, price ] = Inventory.get(i[0]);\n console.log(`${name} ${i[1]} x ${price} = ${i[1] * price}`);\n total += i[1] * price;\n\n // update Inventory state\n Inventory.items = Inventory.items.map(item => {\n if (item[0] === sku) {\n item[2] -= i[1];\n }\n return item;\n });\n });\n console.log(\"---------------------------\");\n console.log(`TOTAL: ${total}`);\n console.log(\"---------------------------\\n\");\n\n this.items = [];\n }", "function buy() {\n \n //this prompts the user as to which item to buy, the item ID is what is used for the rest of the function to know what it is pulled from the database\n inquirer.prompt({\n name: \"chosenItem\",\n type: \"input\",\n message: \"Which item would you like to buy?\"\n }).then(function (answer) {\n console.log(answer.chosenItem);\n var wantToBuy = answer.chosenItem;\n var query = \"SELECT item_id, product_name, price, stock_quantity FROM products WHERE ?\"\n connection.query(query, { item_id: wantToBuy }, function (err, res) {\n if (err) throw err;\n\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n Item ID: \" + res[i].item_id + \" | Product Name: \" + res[i].product_name + \" | Price: \" + res[i].price + \"\\n\");\n \n //this prompt asks if the user is sure they want to buy this item\n inquirer.prompt({\n name: \"purchase\",\n type: \"rawlist\",\n message: \"Are you sure you want to buy this item?\",\n choices: [\"Yes\", \"No\"]\n }).then(function (answer) {\n connection.query(query, { item_id: wantToBuy }, function (err, res) {\n \n console.log(answer.purchase);\n console.log(wantToBuy);\n for (var i = 0; i < res.length; i++) {\n \n // if the user selects \"no\", the function will run again so they can select an item they do want\n if (answer.purchase === \"No\"){\n return buy();\n } else {\n console.log(\"We have \" + res[i].product_name + \" in stock. There is \" + res[i].stock_quantity + \" left in stock.\");\n };\n };\n \n // this prompt allows the quantity to be selected \n inquirer.prompt({\n name: \"quantityAmount\",\n type: \"number\",\n message: \"Please enter the how many you want to purchase.\"\n }).then(function (answer) {\n\n connection.query(query, { item_id: wantToBuy }, function (err, res) {\n for (var i = 0; i < res.length; i++) {\n var wantedQuantity = answer.quantityAmount;\n var subtractedQuantity = res[i].stock_quantity - wantedQuantity;\n \n //this will check if the the user's amount is within the amount that Bamazon has.\n if (answer.quantityAmount > res[i].stock_quantity){\n console.log(\"I'm sorry, we do not have that much. Please select another amount\");\n return buy();\n } else \n var originalCost = res[i].price;\n var totalPrice = originalCost * wantedQuantity;\n console.log(\"That will cost: $\" + totalPrice);\n function update() {\n var update = connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n { stock_quantity: subtractedQuantity },\n { item_id: wantToBuy }\n ], function (err, res) {\n \n console.log(\"Products updated! \\n\");\n \n }\n\n );\n console.log(\"Thank you for your purchase!\");\n };\n update();\n connection.end();\n };\n })\n\n })\n });\n });\n };\n console.log(\"\\n\");\n });\n });\n}", "function freeShipping(object) {\n let total = 0;\n for (let property in object) {\n total += object[property];\n } \n if (total > 50) {\n return true; \n } else {\n return false;\n \n }\n}", "function buy(res) {\n // the prompt asking which item they would like to purchase. The user has to provide the item id #\n inquirer.prompt([{\n type: \"input\",\n name: \"productID\",\n message: \"Please enter the item number you would like to purchase:\"\n }]).then(function (answer) {\n // checking if the item id given by the user is correct\n var correct = false;\n for (var i = 0; i < res.length; i++) {\n if (res[i].item_id == answer.productID) {\n correct = true;\n var product = answer.productID;\n var id = i;\n // once it's confirmed that is correct, another prompt asks how many the user would like to buy\n inquirer.prompt({\n type: \"input\",\n name: \"quantity\",\n message: \"How many would you like to buy? \",\n validate: function (value) {\n // checking if the quantity given is a number\n if (isNaN(value) == false) {\n return true;\n } else {\n return false;\n }\n }\n }).then(function (answer) {\n // substracting the quantity purchased from the product database\n var qty = parseInt(answer.quantity);\n if ((res[id].stock_quantity - qty) > 0) {\n connection.query(\"UPDATE products SET stock_quantity ='\" +\n (res[id].stock_quantity - answer.quantity) + \"' WHERE item_id = '\" +\n product + \"'\", function (err, res2) {\n // adding the total from the purchase to the product sales in the department database\n connection.query(\"UPDATE departments SET product_sales= product_sales+\"+\n (answer.quantity*res[id].price)+\", total_sales=product_sales-overheadcosts WHERE department_name='\"+\n res[id].department_name+\"';\", function(err,res3) {\n console.log(\"Sales Added to Department!\");\n });\n console.log(\"Product Purchase Complete!\");\n\n var total = parseFloat(((res[id].price) * qty).toFixed(2));\n console.log('Your order has been placed!');\n console.log('You have ordered ' + qty + ' items of the ' +\n res[id].product_name + '.');\n console.log('Your total is $' + total);\n console.log('Thank you and come again!');\n makeTable();\n })\n } else {\n console.log('Sorry, we do not have enough in stock of this product. Your order could not be be placed.');\n console.log('Please modify your order.');\n buy(res);\n }\n })\n }\n }\n });\n}", "getPurchases(user, callback) {\n\t\tvar _sql = sql.purchases.byUserId(user.id);\n\t\tthis._connection.query(_sql, function (err, result) {\n\t\t\tif(err) throw err;\n\n\t\t\t// Transform purchases\n\t\t\tvar purchases = [];\n\t\t\tresult.forEach(function(row) {\n\t\t\t\tvar purchase = sqlDataModel.purchase(row);\n\t\t\t\tpurchases.push(purchase);\n\t\t\t})\n\n\t\t\t// Return purchases\n\t\t\tcallback(null, purchases);\n\t\t});\n\t}", "async function buyFromWho(quadKeys, buyMode, userId) {\n\n const arrPM = await Promise.all(quadKeys.map(itemQK => checkExistQuadkey(itemQK.quadKey)));\n if (typeof buyMode !== 'undefined' && buyMode === 'forbid') {\n let result = quadKeys.reduce((splitLand, itemQK, i) => {\n if (arrPM[i]) {\n if (arrPM[i].forSaleStatus === true) {\n itemQK.seller = arrPM[i].user._id;\n itemQK.sellerNid = arrPM[i].user.nid;\n itemQK.userRole = arrPM[i].user.role;\n splitLand.buyFromOtherUserSale.push(itemQK);\n } else {\n splitLand.buyFromOtherUserNoSale.push(itemQK);\n }\n } else {\n splitLand.buyFromSystem.push(itemQK);\n }\n return splitLand;\n }, { buyFromSystem: [], buyFromOtherUserSale: [], buyFromOtherUserNoSale: [] });\n return result;\n }\n else {\n const qkeys = quadKeys.map(itemQk => itemQk.quadKey);\n const pendings = await LandPending.find({ 'quadKey': { $in: qkeys } });\n if (pendings.length !== qkeys.length) {\n return { buyFromSystem: [], buyFromOtherUserSale: [], buyFromOtherUserNoSale: [] };\n } else {\n let result = quadKeys.reduce((splitLand, itemQK, i) => {\n if (arrPM[i]) {\n if (arrPM[i].forSaleStatus === true) {\n itemQK.seller = arrPM[i].user._id;\n itemQK.sellerNid = arrPM[i].user.nid;\n itemQK.userRole = arrPM[i].user.role;\n splitLand.buyFromOtherUserSale.push(itemQK);\n } else {\n splitLand.buyFromOtherUserNoSale.push(itemQK);\n }\n } else {\n splitLand.buyFromSystem.push(itemQK);\n }\n return splitLand;\n }, { buyFromSystem: [], buyFromOtherUserSale: [], buyFromOtherUserNoSale: [] });\n //console.log('result', result);\n return result;\n }\n }\n}", "purchaseBook() {\n const Purchase = {\n user_email: this.state.myEmail,\n book_id: this.state.bookID,\n quantity: 1 \n };\n API.addPurchase(Purchase)\n .then(() => alert(\"Book Purchased!\"))\n .catch(err => console.log(err));\n }", "function purchase() {\n\n inquirer\n .prompt([\n {\n name: \"itemID\",\n type: \"input\",\n message: \"\\nGreat! What is the Item # of the product you would like to purchase?\\n\"\n },\n {\n name: \"units\",\n type: \"number\",\n message: \"\\nHow many units of the item would you like to purchase?\\n\"\n },\n\n ])\n .then(function (selection) {\n // get the information of the chosen item\n\n // query the database for all items available to purchase\n connection.query(\"SELECT * FROM products WHERE id=?\", selection.itemID, function (err, res) {\n\n for (var i = 0; i < res.length; i++) {\n\n if (selection.units > res[i].stockQuantity) {\n\n console.log(chalk.green.bold(\"===================================================\"));\n console.log(chalk.green.bold(\"Sorry! Not enough of that item in stock.\"));\n console.log(chalk.green.bold(\"===================================================\"));\n newOrder();\n\n } else {\n //list item information for user for confirm prompt\n console.log(chalk.green.bold(\"===================================================\"));\n console.log(chalk.green.bold(\"Awesome! We can fulfull your order.\"));\n console.log(chalk.green.bold(\"===================================================\"));\n console.log(chalk.green.bold(\"You've selected:\"));\n console.log(chalk.green.bold(\"----------------\"));\n console.log(chalk.green.bold(\"Item: \" + res[i].productName));\n console.log(chalk.green.bold(\"Department: \" + res[i].departmentName));\n console.log(chalk.green.bold(\"Price: $\" + res[i].price));\n console.log(chalk.green.bold(\"Quantity: \" + selection.units));\n console.log(chalk.green.bold(\"----------------\"));\n console.log(chalk.green.bold(\"Total: $\" + res[i].price * selection.units));\n console.log(chalk.green.bold(\"===================================================\\n\"));\n\n var newStock = (res[i].stockQuantity - selection.units);\n var purchaseId = (selection.itemID);\n //console.log(newStock);\n confirmPrompt(newStock, purchaseId);\n }\n }\n });\n })\n}", "function productsForSale() {\n // console.log(\"Here are the items in stock: \");\n connection.query(\"SELECT * FROM products\", function(err, response) {\n //if there is an error, console log the error\n if (err) {throw err;\n } else {\n // if no error log all results of the SELECT statement\n console.table(response);\n }\n //calls function that prompts customer request\n likeToBuy();\n });\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 }", "determineTotals(receipt) {\n let total = 0;\n receipt.inventories.forEach(inventory => {\n total += inventory.buyAmount;\n });\n return total;\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 purchaseProducts(cartItems) {\r\n let purchaseButton= document.querySelector('.btn-purchase')\r\n // console.log(purchaseButton);\r\n purchaseButton.addEventListener('click', function(){\r\n if(!cartItems.hasChildNodes()){\r\n alert(\"Please buy something into the cart before purchasing\")\r\n return;\r\n }\r\n alert(\"Thank You for shopping with the Blue Coporation\");\r\n while(cartItems.hasChildNodes()){\r\n cartItems.removeChild(cartItems.firstChild);\r\n }\r\n updateCartTotal(cartItems);\r\n })\r\n}", "function purchase(action = \"\") {\n if (action == \"init\") {\n }\n\n // Prompt the user to enter Product's item_id to review detail of the product:\n inquirer.prompt([\n {\n name: \"ID\",\n type: \"input\",\n message:\n \"Enter the product's item ID to review detail. [Quit with Ctrl+C]\",\n filter: Number,\n validate: function(val) {\n return !isNaN(val);\n }\n },\n {\n name: \"qty\",\n type: \"input\",\n message: \"OK, how many would you like to buy? \",\n filter: Number,\n validate: function(value) {\n if (isNaN(value) == false) {\n return true;\n } else {\n return false;\n }\n }\n }\n ]).then(function(userInput) {\n connection.query(\"SELECT * FROM products WHERE item_id = ?\", [userInput.ID], function(err, inventoryRes) {\n if (err) {\n console.log(\"ERROR: \", err);\n }\n console.log(\"\");\n console.log(\n \"====================\",\n \"\\nPRODUCT DETAIL: \",\n inventoryRes,\n \"\\n====================\"\n );\n console.log(\"\");\n purchaseItem(userInput.ID, userInput.qty);\n });\n });\n // *** This is the end of the function purchase() ***\n}", "function allItemsCollected () {\n\tif (Inventory.length === 4) {\n\t\talert(\"Congrats, you now have all the items you need. But whats next...?\");\n\t\tused = true;\n\t}\n}", "function purchase() {\r\n //prompt user to select item\r\n ask\r\n .prompt([{\r\n type: 'input',\r\n name: 'id_item',\r\n message: 'Please enter the item ID.',\r\n validate: valInput,\r\n filter: Number\r\n },\r\n {\r\n type: 'input',\r\n name: 'stock_quant',\r\n message: 'How many?',\r\n validate: valInput,\r\n filter: Number\r\n },\r\n ]).then(function (input) {\r\n var item = input.id_item;\r\n var quant = input.stock_quant;\r\n\r\n //query db to confirm ID exists\r\n var queryStr = 'select * from products WHERE id_item = ' + item ;\r\n // console.log('built first part of string');\r\n // console.log(queryStr);\r\n // console.log('...');\r\n\r\n conn.query(queryStr, {\r\n id_item: item\r\n },\r\n function (err, data) {\r\n if (err) throw err;\r\n if (data.length === 0) {\r\n console.log('Error invalid ID.');\r\n displayInven();\r\n } else {\r\n var productData = data[0];\r\n if (quant <= productData.stock_quant) {\r\n console.log('');\r\n console.log('Item is in stock!');\r\n\r\n //construct the updating string\r\n // console.log('quant:' + quant );\r\n // console.log('productData.stock_quant:' + productData.stock_quant);\r\n var updateQuStr = 'update products set stock_quant = ' + (productData.stock_quant - quant) + ' where id_item = ' + item;\r\n // console.log(updateQuStr);\r\n // console.log('...')\r\n\r\n //update invent\r\n conn.query(updateQuStr, function (err, data) {\r\n if (err) throw err;\r\n console.log('');\r\n console.log('Your order has been placed');\r\n console.log('Thank you for shopping with us!');\r\n console.log('|||||||||||||||||||||||||||||||');\r\n //end connection\r\n conn.end();\r\n });\r\n } else {\r\n console.log('');\r\n console.log('Sorry out of stock');\r\n console.log('Please come back later');\r\n console.log('|||||||||||||||||||||||');\r\n displayInven();\r\n }\r\n }\r\n }\r\n );\r\n });\r\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 buy() {\n \n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n \n inquirer.prompt([\n {\n type: \"input\",\n name: \"id\",\n message: \"What is product ID you want to buy?\"\n },\n {\n type: \"input\",\n name: \"qty\",\n message: \"How many units would you like to buy?\"\n }\n ])\n .then(function(answer) {\n \n var custProduct = (answer.id) - 1;\n var orderQuantity = parseInt(answer.qty);\n var total = parseFloat(((res[custProduct].price) * orderQuantity).toFixed(2));\n\n // Check if quantity is sufficient\n if(res[custProduct].stock_quantity >= orderQuantity) {\n \n // After purchase, update the quantity in products & product sales in departments table\n var query = \"UPDATE products INNER JOIN departments ON products.dept_name = departments.dept_name SET ? WHERE ?\"\n \n connection.query(\n query,\n [{\n stock_quantity: (res[custProduct].stock_quantity - orderQuantity),\n product_sales: total\n },{\n item_id: answer.id\n }], \n\n function(err, res){\n if (err) throw err;\n console.log(\"Your total is $\" + total + \". Thanks for your order!\");\n reRun();\n });\n\n } \n else \n {\n console.log(\"There isn't enough in stock!\");\n reRun();\n }\n })\n })\n}", "function checkCartItemsOnBuy(cartItemsID) {\n const { keyPair } = items;\n for (const cartKey in cartItemsID) {\n if (\n !keyPair[cartKey] ||\n keyPair[cartKey] - cartItemsID[cartKey].quantity < 0\n ) {\n swal({\n title: \"Eksik ürün\",\n text: `${cartItemsID[cartKey].name} ürünü tükenmiş olabilir.`,\n icon: \"warning\",\n button: \"Tamam\",\n });\n return false;\n } else {\n cartItemsID[cartKey].leftItems =\n keyPair[cartKey] - cartItemsID[cartKey].quantity;\n }\n }\n\n return true;\n }", "function printBill(purchasedShirts, purchasedPants, purchasedShoes, discount) {\n\n console.log('Purchased Stock');\n console.log('Shirts:' + purchasedShirts);\n console.log('pants:' + purchasedPants);\n console.log('Shoes:' + purchasedShoes);\n\n console.log('Remining Stock');\n console.log(`remaining stock ${stockShirts.quantity-purchasedShirts}`);\n console.log(`remaining stock ${stockPants.quantity-purchasedPants}`);\n console.log(`remaining stock ${stockShoes.quantity-purchasedShoes}`);\n\n console.log('total price');\n\n let shirtsPrice = purchasedShirts * stockShirts.price;\n let pantsPrice = purchasedPants * stockPants.price;\n let shoesPrice = purchasedShoes * stockShoes.price;\n let totalPrice = shirtsPrice + pantsPrice + shoesPrice;\n let discountPrice = totalPrice * discount / 100;\n\n console.log(`shirts price ${purchasedShirts * stockShirts.price}`);\n console.log(`pants price ${purchasedPants * stockPants.price}`);\n console.log(`shoes price ${purchasedShoes * stockShoes.price}`);\n console.log(`toatal price:${shirtsPrice + pantsPrice + shoesPrice}`);\n console.log(`discount:${totalPrice*discount/100}`);\n console.log(`payable Amount ${totalPrice-discountPrice}`);\n\n}", "function startpurchase() {\n inquirer\n .prompt([\n {\n name: \"itemID\",\n type: \"input\",\n message: \"What is the ID of the product you wish to purchase?\",\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many units would you like to buy?\"\n }\n ]).then(function(inquirerResponse) {\n userAnswer = {\n item_id: parseInt(inquirerResponse.item_id),\n quantity: parseInt(inquirerResponse.quantity)\n }\n {\n checkStore(userAnswer);\n }\n })\n}", "function buy() {\n // query the database for all items\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n // once you have the items, prompt the user for which they'd like to buy\n inquirer\n .prompt([\n {\n name: \"choice\",\n type: \"input\",\n message: \"Please input the ID# of the product you want to buy?\".bgGreen.white\n },\n {\n name: \"amount\",\n type: \"input\",\n message: \"How many would you like to buy?\".bgGreen.white\n }\n ])\n .then(function(input) {\n // get the information of the chosen item\n var item = input.choice;\n var quantity = input.amount;\n\n // Query db to confirm that the given item ID exists in the desired quantity\n var queryStr = 'SELECT * FROM products WHERE ?';\n\n connection.query(queryStr, {item_id: item}, function(err, data) {\n if (err) throw err;\n\n // If the user has selected an invalid item ID, data attay will be empty\n\n if (data.length === 0) {\n console.log('ERROR: Invalid Item ID. Please select a valid Item ID.'.bgCyan.white);\n buy();\n }\n \n else {\n var productData = data[0];\n\n // If the quantity requested by the user is in stock\n if (quantity <= productData.stock_quantity) {\n console.log(' '.bgGreen.white);\n console.log(' Congratulations, the product you requested is in stock! Placing order! '.bgGreen.white);\n console.log(' '.bgGreen.white);\n // Construct the updating query string\n var updateQueryStr = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE item_id = ' + item;\n // console.log('updateQueryStr = ' + updateQueryStr);\n\n // Update the inventory\n connection.query(updateQueryStr, function(err, data) {\n if (err) throw err;\n console.log('\\n Your total is: $' + productData.price * quantity);\n console.log(' ');\n console.log(\" \".bgMagenta.white)\n console.log(\" Thanks for shopping with Bamazon. \".bgMagenta.white)\n console.log(\" \".bgMagenta.white)\n // End the database connection\n connection.end();\n })\n } \n\n else {\n console.log(' '.bgRed.white);\n console.log(' That item is out of stock :( '.bgRed.white);\n console.log(' '.bgRed.white);\n console.log(' '.bgGreen.white);\n console.log(' Would you like to buy something else? '.bgGreen.white);\n console.log(' '.bgGreen.white);\n buy();\n }\n }\n })\n })\n\t\t\n });\n}", "function setupPurchase() {\r\n // Get chosen package information\r\n var depFlight = JSON.parse(localStorage.getItem('departure'));\r\n var hotel = JSON.parse(localStorage.getItem('hotel'));\r\n var retFlight = JSON.parse(localStorage.getItem('return'));\r\n\r\n // Display correct package price numbers\r\n document.getElementById('hotel').innerHTML = 'Hotel: $' + numberWithCommas(parseInt(hotel.price));\r\n document.getElementById('flight').innerHTML = 'Flight: $' + numberWithCommas(parseInt(depFlight.price) + parseInt(retFlight.price));\r\n document.getElementById('total').innerHTML = localStorage.getItem('total');\r\n}", "function purchaseStart() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"ID\",\n message: \"What is the id number of your product?\",\n validate: validateInput,\n filter: Number\n },\n {\n type: \"input\",\n name: \"stockQuantity\",\n message: \"How many units would you like to purchase today?\",\n validate: validateInput,\n filter: Number\n }\n ])\n .then(function(answer) {\n //take answers and pass through as variable parameters\n\n var requestedQuantity = answer.stockQuantity;\n var idRequested = answer.ID;\n // use the mysql command to select product from table created in bamazon_db\n query = \"SELECT * FROM products WHERE ?\";\n connection.query(query, { id: idRequested }, function(err, res) {\n if (res.length === 0) {\n console.log(\"error!\");\n throw err;\n\n // displayProduct();\n } else {\n var selection = res[0];\n\n if (requestedQuantity <= selection.stock_quantity) {\n console.log(\" Your order is now being processed!!!\");\n\n var stockUpdate =\n \"UPDATE products SET stock_quantity = \" +\n (selection.stock_quantity - requestedQuantity) +\n \" WHERE id = \" +\n idRequested;\n\n connection.query(stockUpdate, function(err, res) {\n if (err) throw err;\n\n console.log(\n \"Your order is completed cool beans!! Pay me now!!!\" +\n selection.price * requestedQuantity\n );\n console.log(requestedQuantity);\n // the inquirer list below has a case function that allows the user to decide if they want to continue shopping or not\n // the breaks are used to cut the connection of each option\n inquirer\n .prompt({\n name: \"choose\",\n type: \"list\",\n message: \"would you like to purchase more today?\",\n choices: [\"Yes I would!\", \"No, thanks\"]\n })\n .then(function(answer) {\n switch (answer.choose) {\n case \"Yes I would!\":\n displayProduct();\n break;\n\n case \"No, thanks\":\n connection.end();\n break;\n }\n });\n });\n } else {\n // returns back to the original table and prompts user to try again next time\n displayProduct();\n // change to error message\n console.log(\"Sorry but we cannot process that quantity amount\");\n console.log(\"We will have more in stock soon! \");\n }\n }\n });\n });\n}", "function purchase(){\n /*\n - check if at least 1 check box is checked\n - false => alert plz choose at least 1\n - true\n - send ajax : purchase?book=bookid\n - response ok => alert thanh cong., reload page\n */\n\n if(!window.confirm(\"Buy all choosen item ?\")) return;\n\n let flag = false;\n for(let i=0 ; i<checkbox.length; i++){\n if(checkbox[i].checked){\n flag = true;\n //send ajax request :\n let xhttp = new XMLHttpRequest();\n xhttp.open(\"GET\", \"purchase?book=\"+bookid[i].innerHTML, true);\n xhttp.send();\n }\n }\n\n if(flag){\n window.alert(\"Success!!\");\n window.location.href = \"shoppingcart\";\n }\n else{\n window.alert(\"Please choose at least 1 item!\");\n }\n\n\n}", "buyItem(req, res) {\n db.items.getById(req.params.id)\n .then((product) => {\n // Product returns an array of 1 item, so need to access that item, and change the buyer of that item to be the current request maker\n db.transactions.updateTransaction(product[0].id, { buyer_id: req.user.user.id })\n .then(() => {\n db.items.sold(Number(req.params.id));\n //Creates a new client with coinbase which allows user to purchase the item from coinbase\n const client = new coinbase.Client({ accessToken: req.user.accessToken, refreshToken: req.user.refreshToken });\n const args = {\n name: `Order for ${product[0].title}`,\n amount: /* (Number(product[0].price))*/ 0.01,\n metadata: {\n customer_id: client.id,\n customer_name: 'test'\n },\n currency: 'USD',\n type: 'order',\n style: 'custom_small',\n success_url: `http://${req.headers.host}/items/${req.params.id}/confirm`,\n cancel_url: `http://${req.headers.host}/items/${req.params.id}`,\n customer_defined_amount: false,\n collect_shipping_address: false,\n description: `Purchasing: ${product[0].title} on BitBargain`\n };\n //Create a checkout button with those args, and sends it back to BB which embeds it in a button\n client.createCheckout(args, (err, checkout) => {\n console.log(err, checkout);\n if (err) {\n res.json(`Error buying ${product[0].title}`);\n }\n res.json(checkout.embed_code);\n });\n });\n });\n }", "function purchaserQuery() {\n\tinquirer.prompt([\n\t{\n\t\ttype: \"input\",\n\t\tname: \"query\",\n\t\tmessage: \"Input the item ID you wish to purchase.\",\n\t\t//Prevents the app from accepting non-numerical inputs\n\t\tvalidate: function(res) {\n\t\t\tif (isNaN(res) === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconsole.log(\"You need to enter a valid numerical ID.\");\n\t\t\treturn false;\n\t\t}\n\t},\n\t{\n\t\ttype: \"input\",\n\t\tname: \"quantity\",\n\t\tmessage: \"How many of this item will you purchase?\",\n\t\tvalidate: function(res) {\n\t\t\tif (isNaN(res) === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconsole.log(\"You need to enter a valid numerical amount.\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t]).then(function(info) {\n\tvar item = info.query;\n\tvar quantity = info.quantity;\n\t//This grabs information from the MySQL database to assign as useable variables\n\tconnection.query(\"SELECT * FROM products WHERE item_id = ? \", item, function(err, res) {\n\t\t\tif (err) throw err;\n\t\t\tvar department = res[0].department_name;\n\t\t\tvar stock = res[0].stock_quantity;\n\t\t\tif (stock >= quantity) {\n\t\t\t\tvar stockTotal = stock - quantity;\n\t\t\t\tvar price = res[0].price;\n\t\t\t\tvar cost = quantity * price;\n\t\t\t\t//Alters the information within the database to reflect customer selections\n\t\t\t\tconnection.query(\"UPDATE departments SET ? WHERE ?\", [{total_sales: cost}, {department_name: department}], function(err, res) {});\n\t\t\t\t//Represents the user's \"Shopping cart\"\n\t\t\t\trunningTotal = runningTotal + cost;\n\t\t\t\tconsole.log(\"Your total comes to $\" + runningTotal);\n\t\t\t\t//Changes the quantity available after user check-out\n\t\t\t\tconnection.query(\"UPDATE products SET ? WHERE ?\", [{stock_quantity: stockTotal}, {item_id: item}], function(err, res) {});\n\t\t\t\t//Option to disconnect from server and end application\n\t\t\t\tinquirer.prompt([\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\t\tname: \"complete\",\n\t\t\t\t\t\tmessage: \"Have you finished shopping?\"\n\t\t\t\t\t}\n\t\t\t\t]).then(function(info){\n\t\t\t\t\tvar complete = info.complete;\n\n\t\t\t\t\tif (complete) {\n\t\t\t\t\t\tconsole.log(\"Thank you for shopping with the Bamazon Bookstore.\");\n\t\t\t\t\t\tconnection.end();\n\t\t\t\t\t} else {\n\t\t\t\t\t\trunProcess();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t//If the item is out-of-stock, the user will be prompted back to start.\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Insufficient quantity!\");\n\t\t\t\trunProcess();\n\t\t\t}\n\t\t});\n\t});\n}", "function purchaseProduct() {\n \n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw console.log(\"connection error: \" + err);\n inquirer.prompt([\n {\n name: \"id\",\n type: \"input\", \n message: \"Enter the ID of the pruduct you wish to purchase\",\n },\n {\n name: \"units\",\n type: \"input\",\n message: \"How many would you like to buy?\",\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n } \n ])\n .then(function(answer) {\n var query = \"SELECT * FROM products WHERE ?\";\n connection.query(query, { id: answer.id }, function(err, res) {\n\n var dbStock = res[0].stock_quantity;\n var reqStock = answer.units;\n\n if (dbStock >= reqStock){\n\n var NewDbStock = dbStock - reqStock;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: NewDbStock\n },\n {\n id: answer.id\n }\n ],\n function(error) {\n if (error) throw err;\n console.log(\"==============================================\");\n console.log(\"\\n\\r\");\n console.log(\"Purchase Succesfull\");\n var totalCost = res[0].price * answer.units;\n console.log(\"Your Item(s) Cost: \" + totalCost);\n console.log(\"\\n\\r\");\n console.log(\"==============================================\");\n purchaseProduct();\n } \n );\n }\n else {\n console.log(\"==============================================\");\n console.log(\"\\n\\r\");\n console.log(\"Not enough in stock, choose a different quantity\");\n console.log(\"\\n\\r\");\n console.log(\"==============================================\");\n purchaseProduct();\n }\n \n });\n \n });// inquier.prompt\n });// conection.query\n }// purchaseProduct()", "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}", "function buyProduct() {\n\n // get the user's purchase request\n inquirer.prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"What is the ID of the product you want to buy?\",\n default: defId\n },\n {\n name: \"qty\",\n type: \"input\",\n message: \"How many do you want to buy?\",\n default: defQty\n }\n ]).then(function (answers) {\n\n var id = answers.id;\n var qty = answers.qty;\n\n // get the necessary information from the database to actually process the order\n connection.query(\"SELECT product_name, department_id, price, stock_quantity FROM products WHERE item_id = ?;\", [id], function (err, rows, fields) {\n\n if (err) throw err;\n\n // different cases of database results\n switch (rows.length) {\n // One row returned is the normal case as the requested id should be unique\n case 1:\n var namProduct = rows[0].product_name;\n var idDept = rows[0].department_id;\n var prcProduct = rows[0].price;\n var qtyStock = rows[0].stock_quantity;\n // check for sufficient inventory for the order\n if (qtyStock >= qty) {\n // if sufficient inventory then execute the order and update the database\n connection.query(\"UPDATE products SET stock_quantity = ? WHERE item_id = ?;\", [(qtyStock - qty), id], function (err, rows, fields) {\n if (err) throw err;\n // compute the total price to the customer for this order and display it for the customer\n var totSale = qty * prcProduct;\n console.log(\"\\n\\nYour total price for: \" + namProduct + \", Quantity: \" + qty + \" is $\" + totSale.toFixed(2) + \"\\n\\n\");\n // add the total price for this order to the department sales total in the database\n connection.query(\"UPDATE departments SET total_sales = total_sales + ? WHERE department_id = ?;\", [totSale, idDept], function (err, rows, fields) {\n if (err) throw err;\n // ask the customer if they want to continue purchasing more products\n buyMore();\n });\n });\n } else {\n // if there is insufficient inventory for the initial order, ask the customer if they would still like to purchase a smaller amount\n inquirer.prompt([\n {\n name: \"qty\",\n type: \"confirm\",\n message: \"There is insufficient quantity for your order. Do you want still want to buy some?\"\n }\n ]).then(function (answers) {\n // if the user does want to buy a smaller quantity, set the order defaults and go back to the start of the purchase process\n if (answers.qty) {\n defId = id;\n defQty = qtyStock;\n buyProduct();\n // otherwise just ask the customer if they would like to buy any other products\n } else {\n buyMore();\n }\n });\n }\n break;\n // if no rows were returned from the original product query, then let the customer know the product id was invalid and ask if they would like to continue\n case 0:\n console.log(\"Sorry, there is not a product with ID: \" + id);\n buyMore();\n break;\n }\n\n });\n\n });\n\n}" ]
[ "0.68480057", "0.68480057", "0.68480057", "0.68480057", "0.68480057", "0.68480057", "0.65781265", "0.64865464", "0.6476866", "0.6297486", "0.6230282", "0.62167007", "0.61998117", "0.61833054", "0.6163183", "0.6150414", "0.6143537", "0.6143105", "0.6138853", "0.61304617", "0.6111804", "0.6101567", "0.6096516", "0.60955817", "0.608547", "0.607212", "0.60639834", "0.60406435", "0.60158783", "0.6005672", "0.60007423", "0.5994129", "0.5992802", "0.5988815", "0.5955849", "0.59495175", "0.5941464", "0.5936658", "0.5934553", "0.5933863", "0.5932523", "0.59249866", "0.59235704", "0.5897803", "0.5888845", "0.58835554", "0.5876372", "0.58702606", "0.58685285", "0.58620894", "0.58595747", "0.5846945", "0.58206064", "0.58140916", "0.57981354", "0.5781163", "0.57788604", "0.57726526", "0.57694507", "0.57692677", "0.5767171", "0.576182", "0.5756734", "0.57335246", "0.5731207", "0.5726935", "0.5726757", "0.57248", "0.57175285", "0.57169586", "0.57133126", "0.5712755", "0.5704446", "0.5700571", "0.5686906", "0.56823575", "0.5677793", "0.5671993", "0.5671416", "0.56699324", "0.5658635", "0.5653933", "0.5652108", "0.56449115", "0.5641857", "0.56339955", "0.56322104", "0.5627313", "0.5625279", "0.56222856", "0.5612561", "0.5609698", "0.5589082", "0.5587815", "0.5587192", "0.5586472", "0.558517", "0.5581085", "0.5577289", "0.5576704" ]
0.5573715
100
& we update that with the items in the so it will be user dot cart
function buyItem(user){ return Object.assign({}, user, { purchases: user.cart }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCart(){\n reset();\n cart.forEach(product =>{\n appendProduct(product);\n }); \n}", "function updateMiniCart() {\n if(!cart.items ) {\n cart.items = [];\n }\n }", "async updateCart_Of_User(){\n }", "function updateCart(){\n\t\tstorage(['items', 'subtotal'], function(err, col){\n\t\t\t//console.log(\"Cart Collection - \" + JSON.stringify(col));\n\n\t\t\t//items = col[0];\n\t\t\t//subtotal = col[1];\n\n\t\t\tif(console) console.log(\"Items in Cart: \" + items);\n\t\t\tif(console) console.log(\"Subtotal of Cart: \" + subtotal);\n\t\t\t\n\t\t\t// update DOM Here\n\t\t\tdocument.getElementById( _options.itemsEleId ).innerHTML = items;\n\t\t\tdocument.getElementById( _options.subtotalEleId ).value = \"$\" + subtotal.toFixed(2);\n\n\t\t\t// reset default quantity input fields of products\n\t\t\tPRODUCTS.updateProducts();\n\t\t});\n\t}", "function updateCart() {\n emptyCart();\n let items = JSON.parse(localStorage.getItem('items'));\n if(items !== null) {\n if(typeof items.forEach !== \"function\") {\n items = [items];\n }\n items.forEach(function(item) {\n $('#shoppingcart-items').append(\n \"<li class='cart-item'>\" +\n \"<span>\" + item.name + \"</span>\" +\n \"<span>\" + item.size + \"</span>\" +\n \"<span>\" + item.color + \"</span>\" +\n \"<span>\" + item.amount + \"</span>\" +\n \"<span class='cart-item-price'>\" + item.price + \"</span>\" +\n \"<a class='remove-item' href='#' data-item='\" + item.name + \"'><i class='fa fa-times' aria-hidden='true'></i></a>\" +\n \"</li>\");\n });\n localStorage.setItem('items-timestamp', (+ new Date() / 1000) );\n }else {\n removeAllStorage();\n \n }\n updateCounter();\n updateTotal();\n }", "addItemsToCart() {\n\n Model.addItemsToCart(this.currentItems);\n }", "function addItemToCart(user, items){\n let updateCart = user.cart.concat(items);\n // NOTE: data is userClone = Object.assign({}, user , {cart: updateCart})\n return Object.assign({}, user , {cart: updateCart}) \n }", "updateCartItems() {\n // Call the 'getCartItems' apex method imperatively\n getCartItems({\n communityId: communityId,\n effectiveAccountId: this.resolvedEffectiveAccountId,\n activeCartOrId: this.recordId,\n pageParam: this.pageParam,\n sortParam: this.sortParam\n })\n .then((result) => {\n this.cartItems = result.cartItems;\n this._cartItemCount = Number(\n result.cartSummary.totalProductCount\n );\n this.currencyCode = result.cartSummary.currencyIsoCode;\n this.isCartDisabled = LOCKED_CART_STATUSES.has(\n result.cartSummary.status\n );\n })\n .catch((error) => {\n const errorMessage = error.body.message;\n this.cartItems = undefined;\n this.isCartClosed = isCartClosed(errorMessage);\n });\n }", "function handleUpdate(e) {\n\tfor (let name in updatedQuantity) { // sample updatedQuantity: {usmc fitness book: \"20\", usmc pt shirt 1: \"9\"}\n\t\tcart.updateCart(name, +updatedQuantity[name])\n\t}\n\treRenderTableBody();\n\trenderCartTotal();\n}", "function updateCartItems(ItemName, quantity, OneOrHalf) {\n for (var i = 0; i < 8; i++) {\n if (QuantityFromIceCream[i].brand == ItemName) {\n if (OneOrHalf == 1) {\n QuantityFromIceCream[i].Onekg = quantity;\n } else {\n QuantityFromIceCream[i].Halfkg = quantity;\n }\n }\n }\n var JSONreadyUsers = JSON.stringify(QuantityFromIceCream);\n updateShoppingCart();\n}", "addToCart(product) {\n // prvo trazim postoji li vec ovaj atikal na listi\n const cartProductIndex = this.cart.items.findIndex((cp) => {\n return cp.productId.toString() === product._id.toString();\n });\n console.log('cartProductIndex='.red, cartProductIndex);\n let newQuantity = 1;\n const updatedCartItems = [...this.cart.items];\n console.log(updatedCartItems);\n \n\n // ako je pronasao zapis..\n if (cartProductIndex >= 0) {\n newQuantity = this.cart.items[cartProductIndex].quantity + 1;\n updatedCartItems[cartProductIndex].quantity = newQuantity;\n } else {\n // prvi zapis\n updatedCartItems.push({\n productId: new mongodb.ObjectId(product._id),\n quantity: newQuantity,\n });\n }\n\n const updatedCart = {\n items: updatedCartItems,\n };\n // const updatedCart = {\n // items: [{...product, quantity:1 }],\n // };\n\n const db = getDb();\n return db\n .collection('users')\n .updateOne(\n { _id: new mongodb.ObjectId(this._id) },\n { $set: { cart: updatedCart } }\n );\n }", "function itemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n}", "calculateTotal(price, skuId, qty) {\n let cartListArr = this.props.elcStore.cartList.length ? JSON.parse(this.props.elcStore.cartList) : {};\n if (Object.keys(cartListArr).length && cartListArr[skuId] !== undefined) {\n for (let x in cartListArr) {\n if (x === skuId) {\n cartListArr[skuId] = {qty: cartListArr[skuId].qty + qty};\n }\n }\n } else {\n cartListArr[skuId] = {qty: qty};\n }\n const total = this.state.total + (price * qty);\n const cartList = cartListArr;\n this.props.elcStore.cartListUpdate(total, cartList);\n }", "function setCoffeeProducts(items) {\n let cartProduct = localStorage.getItem(\"coffeeInCart\");\n cartProduct = JSON.parse(cartProduct);\n\n if (cartProduct !== null) {\n if (cartProduct[items.name] == undefined) {\n cartProduct = {\n ...cartProduct,\n [items.name]: items\n };\n }\n cartProduct[items.name].insideCart += 1;\n } else {\n items.insideCart = 1;\n cartProduct = {\n [items.name]: items\n };\n }\n\n localStorage.setItem(\"coffeeInCart\", JSON.stringify(cartProduct));\n}", "function updateCart(){if(window.Cart&&window.Cart.updateCart){window.Cart.updateCart();}}", "function addItemToCart(user, item) {\n const updateCart =\n}", "setItemsInCart(state, items) {\n state.itemsInCart = items;\n }", "function buyUpdate(id, quantity) {\n var isDupicate = false;\n\n //checks to see if the item is already in the cart\n for (var i in cart) {\n\n if (cart[i].id == id) {\n //if the item is already in the cart, it adds the quantity of the purchase to the quantity already in the cart\n cart[i].quantity += parseInt(quantity);\n isDupicate = true;\n\n //removes the quantity from the amount in stock\n for (var j in stock) {\n if (cart[i].id == stock[j].ItemID) {\n stock[j].StockQuantity -= quantity;\n }\n }\n }\n }\n\n //if not already in the cart\n if (!isDupicate) {\n\n //find the id in the stock array\n for (var k in stock) {\n if (stock[k].ItemID == id) {\n //push the item to the cart\n cart.push({\n id: id,\n name: stock[k].ProductName,\n quantity: parseInt(quantity),\n price: stock[k].Price\n });\n //subtract the user quantity wanted from the quantity in stock\n stock[k].StockQuantity -= quantity;\n }\n }\n }\n\n //display the updated stock\n displayStock();\n //display the shopping cart\n shoppingCart();\n //prompt the user to continue shopping or checkout\n promptOptions();\n}", "function updateShoppingCart(){\n\t\"use strict\";\n\n\t\t$j('body').bind('added_to_cart', add_to_cart);\n\t\tfunction add_to_cart(event, parts, hash) {\n\t\t\tvar miniCart = $j('.shopping_cart_header');\n\t\t\tif ( parts['div.widget_shopping_cart_content'] ) {\n\t\t\t\tvar $cartContent = jQuery(parts['div.widget_shopping_cart_content']),\n\t\t\t\t$itemsList = $cartContent .find('.cart_list'),\n\t\t\t\t$total = $cartContent.find('.total').contents(':not(strong)').text();\n\t\t\tminiCart.find('.shopping_cart_dropdown_inner').html('').append($itemsList);\n\t\t\tminiCart.find('.total span').html('').append($total);\n\t\t\t}\n\t\t}\n}", "checkout(Inventory) {\n let total = 0;\n this.items.forEach(i => {\n let [ sku, name, quantity, price ] = Inventory.get(i[0]);\n console.log(`${name} ${i[1]} x ${price} = ${i[1] * price}`);\n total += i[1] * price;\n\n // update Inventory state\n Inventory.items = Inventory.items.map(item => {\n if (item[0] === sku) {\n item[2] -= i[1];\n }\n return item;\n });\n });\n console.log(\"---------------------------\");\n console.log(`TOTAL: ${total}`);\n console.log(\"---------------------------\\n\");\n\n this.items = [];\n }", "function updateCart(item, price, amount, ID) {\n cartItems.push(item);\n cartCost.push(price);\n CartAmount.push(amount);\n cartIDs.push(ID);\n}", "updateTotal() {\n let total = 0;\n for (let index in this.items) {\n let item = this.items[index];\n total += item.price * item.quantity;\n }\n this.total = total;\n }", "function setCartItems(item){\n let cartItems = localStorage.getItem('cartProducts');\n cartItems = JSON.parse(cartItems);\n\n//If no items in cart, set cartItems as the product just added.\n if(cartItems == null){\n item.numInCart = 1;\n cartItems = {\n [item.itemName] : item\n }\n }else {\n // get the previous items from local storage and all others\n if(cartItems[item.itemName] == undefined){\n cartItems = {\n ...cartItems,\n [item.itemName]: item\n }\n }\n cartItems[item.itemName].numInCart += 1;\n }\n\n//set new products in cart.\n localStorage.setItem(\"cartProducts\", JSON.stringify(cartItems));\n\n //update cart\n getCart();\n}", "function setItems(products) {\r\n\tlet cartItems = localStorage.getItem('productsInCart');\r\n\tcartItems = JSON.parse(cartItems);\r\n\t\r\n\tif(cartItems != null) {\r\n\t\t\r\n\t\tif(cartItems[products.tag] == undefined){\r\n\t\t\tcartItems = {\r\n\t\t\t\t...cartItems,\r\n\t\t\t[products.tag]: products\r\n\t\t\t}\r\n\t\t}\r\n\t\tcartItems[products.tag].inCart += 1;\r\n\t} else {\r\n\t\tproducts.inCart = 1;\r\n\t\tcartItems = {\r\n\t\t\t[products.tag]: products\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlocalStorage.setItem(\"productsInCart\", JSON.stringify(cartItems));\r\n}", "updateItems() {\n\t\tthis.callItemR('update');\n\t}", "function addItemToCart(user, item) {}", "addBoothToCart(product, subitem){\n this.cart.forEach(m => {\n if ( m.booths && m.id == product.id ){\n this.total -= m.price;\n this.cart = this.cart.filter(n => n.id !== m.id);\n }\n if ( m.notify ){\n this.cart = this.cart.filter(n => !n.notify);\n }\n })\n product.booths.booths = true;\n product.booths.quantity++;\n product.booths.name = subitem.name;\n product.booths.price = subitem.price;\n cartitem = Object.assign({}, product.booths);\n this.cart.push(cartitem);\n this.total += cartitem.price;\n }", "function updateItemsOrder(){\r\n\t\t\r\n\t\tvar arrIDs = g_objItems.getArrItemIDs(false, true);\r\n\t\t\r\n\t\tvar data = {addons_order:arrIDs};\r\n\t\t\r\n\t\tdata = addCommonAjaxData(data);\r\n\t\t\r\n\t\tg_manager.ajaxRequestManager(\"update_addons_order\",data,g_uctext.updating_addons_order);\r\n\t}", "async function shopping_cart_update (opts) {\r\n \r\n if(frappe.session.user ===\"Guest\") {\r\n if(localStorage) {\r\n localStorage.setItem(\"last_visited\", window.location.pathname);\r\n }\r\n window.location.href = \"/login\";\r\n } else {\r\n console.log(opts)\r\n $(\"#add_to_cart\").prop('disabled', true);\r\n frappe.freeze();\r\n return frappe.call({\r\n type: \"POST\",\r\n method: \"organic_shop.organic_cart.update_cart_custom\",\r\n args: {\"items\":opts,\"with_items\":1},\r\n btn: opts.btn,\r\n callback: function(r) {\r\n console.log(r.message)\r\n set_cart()\r\n frappe.unfreeze();\r\n $(\"#add_to_cart\").prop('disabled',false);\r\n $('#view_cart').removeAttr('hidden');\r\n $(\"input.checkmark:checkbox\").prop('checked', false)\r\n $(\"input.counter\").val(1)\r\n \r\n \r\n }\r\n });\r\n \r\n }\r\n \r\n \r\n \r\n \r\n }", "function updateCart() {\n\n}", "function updateCart(e) {\n event.preventDefault();\n var selectedProduct = e.target.productToPurchase.value;\n var selectedQuantity = e.target.quantityInCart.value;\n\n console.log(selectedProduct);\n console.log(selectedQuantity);\n\n // ++ to the timesClicked property for image user click on\n for(var i in Product.allProducts){\n if(selectedProduct === Product.allProducts[i].name){\n Product.allProducts[i].quantityInCart = selectedQuantity;\n console.log(Product.allProducts[i]);\n }\n }\n localStorage.setItem('shoppingCart', JSON.stringify(Product.allProducts));\n}", "static async update(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 // check if we have enough items in stock\n // we are only comparing *updated* cart items\n const diff = { items: [] };\n _.each(req.body.items, (item) => {\n const cartItem = _.find(cart.items, { sku: item.sku });\n if (cartItem && parseInt(cartItem.count, 10) !== parseInt(item.count, 10)) {\n diff.items.push(item);\n }\n });\n const invalid = await CartController._checkProductsAvailInStock(diff);\n if (invalid !== '') {\n return res.error(`Item '${invalid}' is not sufficient in stock`);\n }\n\n // update cart\n delete req.body._id; // eslint-disable-line no-underscore-dangle\n const updated = _.assign(cart, req.body);\n\n await updated.save();\n return res.item_with_products(updated);\n } catch (err) {\n return res.error(err.message);\n }\n }", "function cartIconQtyUpdate(){\n var totalQty = 0;\n if(cart.length) {\n for(var i=0; i<cart.length; i++) {\n var cartItem = cart[i];\n totalQty += cartItem.quantity;\n }\n $('.qty').html(totalQty);\n } else {\n $('.qty').html(totalQty);\n }\n}", "function update_cart_item(cart_id){\r\n showHint('bill-item.jsp?cart_id='+cart_id+'&update_cartitem=yes',cart_id,'bill_item');\r\n}", "function updateCartGlaze() {\n var cartItems = sessionStorage.getObj(\"cartItems\"); // retrieve cart items\n for (var i = 0; i < cartItems.length; i++)\n {\n \tvar originalGlaze = document.getElementsByClassName(\"glaze2\")[i]; //retrieve glaze options in cart page\n \tvar currentGlaze = originalGlaze.options[originalGlaze.selectedIndex].text; //retrieve selected page\n \tvar currentPicture = document.getElementsByClassName(\"itemImage\")[i]; //retrieve displayed image\n\n // update displayed image of glaze\n \tif (currentGlaze==\"none\")\n \t{\n \t\tcurrentPicture.src=\"Assets/images/smallnone.png\";\n \t}\n \telse if (currentGlaze==\"vanilla-milk\")\n \t{\n \t\tcurrentPicture.src=\"Assets/images/smalloriginal.png\";\n \t}\n \telse if (currentGlaze==\"sugar-milk\")\n \t{\n \t\tcurrentPicture.src=\"Assets/images/smallsugar.png\";\n \t}\n \telse if (currentGlaze==\"double-chocolate\")\n \t{\n \t\tcurrentPicture.src=\"Assets/images/smallchoco.png\";\n \t}\n\n \tcartItems[i].glaze = currentGlaze; // update current selected glaze\n cartItems[i].image = currentPicture.src // update current picture\n \tsessionStorage.setObj(\"cartItems\", cartItems) //save changes to array\n }\n}", "update({ body, ...req }, res) {\n\n const { restaurantId, itemId, quantity } = body;\n \n if (!cache.has('cart')) {\n cache.set('cart', createNewCart());\n }\n\n const inMemoCart = cache.get('cart');\n const foundItem = inMemoCart.items.find(item => item.id === itemId);\n const nextInMemoCart = foundItem ? {\n ...inMemoCart,\n items: [\n ...inMemoCart.items.filter(item => item.id === itemId), //.map((i, iIdx) => (iIdx === idx) ? { ...i, count: quantity } : i)\n {\n ...foundItem,\n count: quantity\n }\n ]\n } : {\n ...inMemoCart,\n items: [\n ...inMemoCart.items,\n {\n id: itemId,\n count: quantity,\n restaurantId: restaurantId,\n }\n ]\n }\n\n if (nextInMemoCart.items.every(({ count }) => count === 0)) {\n nextInMemoCart.items = [];\n }\n\n cache.set('cart', updateCartWithStats(nextInMemoCart));\n console.log(JSON.stringify(updateCartWithStats(nextInMemoCart), null, 2));\n return new Promise(rs => setTimeout(() => {\n const result = updateCartWithStats(nextInMemoCart)\n res.json(result);\n rs();\n }, 2000));\n\n }", "function updateCart(flavors) {\n //Creating a variable to store the flavors selected.\n //If no flavors were selected (in the case of Single count), an empty array is created.\n var extraFlavors = flavors || [];\n var quantity=$('#product-qty').val(); \n var itemName=$('#product-name').text();\n if(extraFlavors.length) {\n itemName = itemName+\" - \"+extraFlavors.join(\", \");\n }\n var itemFound = false;\n //Iterate through the cart to see if the desired item exists already\n for(var i=0; i<cart.length; i++){\n //If the item already exists, update the quantity and subtotal\n if(cart[i].rollName === itemName){\n var existingQty = parseInt(cart[i].numQty);\n cart[i].numQty = parseInt(quantity) + existingQty;\n cart[i].subtotal = parseInt(cart[i].rollPrice) * parseInt(cart[i].numQty);\n //Update the changes in local storage\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n localStorage.setItem(\"cartCount\", cart.length);\n itemFound = true;\n break;\n }\n }\n //If the item doesn't exist yet, add the item\n if(!itemFound) {\n var itemImage=$('#roll-image').attr('src');\n var price=$('#product-price').text();\n var subtotal=parseInt(price)*parseInt(quantity);\n var bakeryRoll = new newCartItem(itemImage, itemName, quantity, price, subtotal);\n cart.push(bakeryRoll);\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n localStorage.setItem(\"cartCount\", cart.length);\n $('#cartCount').show();\n $('#cartCount').html(cart.length).css('display', 'block');\n }\n }", "addToCart(item, index, size, quantity) {\n var itemsArray = this.state.itemsInCart;\n var itemTemp = Object.assign({}, item)\n itemTemp.key = uuid.v4()\n itemTemp.size = size\n itemTemp.quantity = Math.floor(Math.abs(quantity))\n itemTemp.donation = (itemTemp.price * quantity)\n itemsArray.push(itemTemp)\n this.setState({ itemsInCart: itemsArray })\n this.updateMerchAmount()\n // Update Left Side Bar\n let length = this.state.itemsInCart.length\n this.setState({\n menuItems: [\n { name: 'donate', title: 'Donate' },\n { name: 'bills', title: 'KZSC Bills' },\n { name: 'merch', title: 'Merchandise' },\n { name: \"cart\", title: \"Your Cart\", label: length }\n ]\n })\n }", "function updateQuantity() {\n let prod = this.closest(\".cart-item\");\n let prod_cost = prod.children[2].innerText.slice(1);\n prod.children[4].innerText = `$${Number(prod_cost)*this.value}`\n\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 == prod.children[1].innerText) {\n z[k].quantity = this.value;\n }\n arr.push(z[k]);\n }\n localStorage.setItem(\"CartItem\", JSON.stringify(arr));\n}", "function update_local_cart(case_option,cart,ops=null){\r\n switch(case_option) {\r\n case 1:\r\n cart.push(ops)\r\n break;\r\n case 2:\r\n \r\n for (let i = 0; i < cart.length; i++) {\r\n const element = cart[i];\r\n if(element['item'] == ops.item){\r\n cart.splice(i, 1);\r\n // element['qty'] = 0\r\n }\r\n }\r\n break;\r\n case 3:\r\n for (let i = 0; i < cart.length; i++) {\r\n const element = cart[i];\r\n if(element['item']==ops.item){\r\n element['qty'] = parseFloat(ops.qty)\r\n }\r\n }\r\n break; \r\n default:\r\n \r\n }\r\n \r\n \r\n return cart\r\n \r\n }", "function addItemToCart(user, item) {\n\n}", "function update_cart_item(cart_id){\r\n showHint('quote-item.jsp?cart_id='+cart_id+'&update_cartitem=yes',cart_id,'quote_item');\r\n}", "updateProductInCart(product) {\n \n //1. fetch value of local storage's cartData. \n var cart = JSON.parse(localStorage.getItem(\"cartData\"));\n console.log(\"Cart BEFORE update: \" + cart);\n\n //2. Find the product in cart\n for(var i = 0; i < cart.length; i++) { \n if(cart[i].productId === product.productId) {\n //update count field\n cart[i].productCurrentCount = product.productCurrentCount;\n }\n }\n\n //store this updated cart in local storage\n localStorage.setItem('cartData', JSON.stringify(cart));\n console.log(\"Cart with updated count of product : \" + JSON.stringify(cart));\n }", "function setItems(products) {\r\n let cartItems = localStorage.getItem('productsInCart')\r\n\r\n cartItems = JSON.parse(cartItems);\r\n\r\n\r\n if (cartItems != null) {\r\n if (cartItems[products.tag] == undefined) {\r\n cartItems = {\r\n ...cartItems,\r\n [products.tag]: products\r\n }\r\n }\r\n cartItems[products.tag].inCart += 1;\r\n } else {\r\n products.inCart = 1;\r\n\r\n cartItems = {\r\n [products.tag]: products\r\n }\r\n }\r\n localStorage.setItem(\"productsInCart\", JSON.stringify(cartItems));\r\n}", "handleAddToCard (e, products) {\n this.setState(state => {\n const cartItems = state.cartItems;\n let productAlreadyInCart = false;\n cartItems.forEach(item => {\n console.log('dentro de forEach')\n if (item._id === products._id) {\n productAlreadyInCart = true;\n item.count++;\n }\n });\n if (!productAlreadyInCart) {\n console.log('dentro de cartItem push')\n cartItems.push({...products, count: 0});\n }\n localStorage.setItem(\"cartItems\", JSON.stringify(cartItems));\n console.log(this.state.cartItems, \"cart item\")\n return cartItems;\n })\n }", "addToCart(items) {\n console.log(\"items\", items);\n API.userItemsToCart(items)\n .then(res => {\n console.log(res, \"working at addtocart\");\n this.setState({ itemsToCart: items });\n })\n .catch(err => console.log(err))\n }", "function setCart(){\n\t\tstorage.set({ \n\t\t\titems: 0, \n\t\t\tsubtotal: 0\n\t\t}, function(){\n\t\t\tupdateCart();\n\t\t});\n\t}", "function setItems(product) {\n //Get cartItems in local Storage\n let cartItems = localStorage.getItem('productsInCart');\n //Because of productsInCart now is string but now we want it string to array Json =>\n cartItems = JSON.parse(cartItems);\n //Check cartItems \n if (cartItems != null) {\n //Check product have tag or not =>\n if (cartItems[product.tag] == undefined) {\n //Set cartItem with tag =>\n cartItems = {\n ...cartItems,\n [product.tag]: product\n }\n }\n //=> if cartItem in stock => +1 cart in next time\n cartItems[product.tag].inCart += 1;\n }\n else {\n //=>if not, cart =1 and next time will be +1=> loop if\n product.inCart = 1;\n //=>set cartItems\n cartItems = {\n [product.tag]: product\n }\n }\n //cartItems array to string =>\n localStorage.setItem(\"productsInCart\", JSON.stringify(cartItems));\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n\n })\n}", "function setItems(product) {\r\n\tlet cartItems = localStorage.getItem('productsInCart');\r\n\tcartItems = JSON.parse(cartItems);\r\n\tif (cartItems != null) {\r\n\t\tif (cartItems[product.title] == undefined) {\r\n\t\t\tcartItems = {\r\n\t\t\t\t...cartItems,\r\n\t\t\t\t[product.title]: product\r\n\t\t\t}\r\n\t\t}\r\n\t\tcartItems[product.title].incart += 1;\r\n\t} else {\r\n\t\tproduct.incart = 1;\r\n\tcartItems = {\r\n\t\t[product.title]: product\r\n\t}\r\n\t}\r\n\tlocalStorage.setItem('productsInCart', JSON.stringify(cartItems))\r\n}", "function addItemToCart() {}", "function addItemToCart() {}", "function updateList() {\n\t$(\".cart-products\").empty();\n\tvar cartTotal = 0.00;\n\tvar storedItems = JSON.parse(localStorage.getItem(\"items\"));\n\t// update number of items in cart in badge icon\n\tif (storedItems != null) {\n\t\t$(\".badge\").text(storedItems.length);\n\t\tstoredItems.forEach( function(storedItem) {\n\t\t\t// calculate cart total from price and quantity\n\t\t\tvar total = (parseInt(storedItem.quantity) * parseFloat(storedItem.price)).toFixed(2);\n\t\t\tcartTotal += parseFloat(total);\n\t\t\t// dynamically add html based on number of storedItems\n\t\t\tvar cartItem = `<div class=\"cart-item\">\n\t\t\t\t\t\t\t\t<img src=\"` + storedItem.image + `\" alt=\"\" class=\"item-img\" id=\"cart-image\"/>\n\t\t\t\t\t\t\t\t<div class=\"item-description\">\n\t\t\t\t\t\t\t\t\t<div class=\"left-descript\">\n\t\t\t\t\t\t\t\t\t\t<h3 id=\"cart-name\">` + storedItem.name + `</h3>\n\t\t\t\t\t\t\t\t\t\t<span id=\"cart-flavors\"> Additional Flavors: ` + storedItem.firstFlavor + \" , \" + storedItem.secFlavor + `</span>\n\t\t\t\t\t\t\t\t\t\t<p id=\"price-row\"> Price: $<span id=\"cart-price\">` + storedItem.price + `</span> each </p>\n\t\t\t\t\t\t\t\t\t\t<p id=\"quantity-row\"> Quantity: &nbsp; <span id=\"cart-quantity\">` + storedItem.quantity + `</span></p>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"right-descript\">\n\t\t\t\t\t\t\t\t\t\t<p>Total: $<span id=\"cart-total\">` + total + `</span></p>\n\t\t\t\t\t\t\t\t\t\t<h3> <span class=\"small-button hover\"> <a href=\"javascript:void(0);\" class=\"pink\" id=\"remove\"><span id=\"remove-id\">` + storedItem.id + `</span> Remove</a></span></h3>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<span class=\"divider\" ><hr/></span>`;\n\t\t\t$(\".cart-products\").append(cartItem);\n\t\t});\n\t\t\n\t\t// dynamically calculate checkout information\n\t\tcartTotal = cartTotal.toFixed(2);\n\t\tvar tax = (cartTotal * 0.085).toFixed(2);\n\t\tvar shipping = (cartTotal * 0.15).toFixed(2);\n\t\t$(\"#total\").text(cartTotal);\n\t\t$(\"#tax\").text(tax);\n\t\t$(\"#shipping\").text(shipping);\n\t\tvar grandTotal = parseFloat(cartTotal) + parseFloat(shipping) + parseFloat(tax);\n\t\t$(\"#grand-total\").text(grandTotal.toFixed(2));\n\t}\n}", "function updateCart() { //mostando ou nao o carrinho\n c('.menu-openner span').innerHTML = cart.length; // dando update na tela do cel\n\n\n\n\n if (cart.length > 0) {\n c('aside').classList.add('show'); // ad a class que foi criada chamada de show para aparecer o carrinho\n c('.cart').innerHTML = '';\n\n let subtotal = 0;\n let desconto = 0;\n let total = 0;\n\n for (let i in cart) {\n let pizzaItem = pizzaJson.find((item) => item.id == cart[i].id);\n subtotal += pizzaItem.price[cart[i].size] * cart[i].qt; // calculando subtotal; (ADD a parte do size) [cart[i].size]\n\n\n let cartItem = c('.models .cart--item').cloneNode(true);\n\n let pizzaSizeName;\n switch (cart[i].size) {\n case 0:\n pizzaSizeName = 'P'\n break;\n case 1:\n pizzaSizeName = 'M'\n break;\n case 2:\n pizzaSizeName = 'G'\n break;\n }\n\n let pizzaName = `${pizzaItem.name} (${pizzaSizeName})`\n //add as infos da pizza no carrinho//\n\n cartItem.querySelector('img').src = pizzaItem.img;\n cartItem.querySelector('.cart--item-nome').innerHTML = pizzaName;\n cartItem.querySelector('.cart--item--qt').innerHTML = cart[i].qt;\n cartItem.querySelector('.cart--item-qtmenos').addEventListener('click', () => {\n\n if (cart[i].qt > 1) {\n cart[i].qt--;\n } else {\n cart.splice(i, 1);\n }\n\n updateCart();\n });\n cartItem.querySelector('.cart--item-qtmais').addEventListener('click', () => {\n cart[i].qt++;\n updateCart();\n });\n\n\n //--------------------------------//\n\n\n c('.cart').append(cartItem);\n\n }\n\n desconto = subtotal * 0.1;\n total = subtotal - desconto;\n\n c('.subtotal span:last-child').innerHTML = `R$ ${subtotal.toFixed(2)}`; // comando last-child para pergar ultimo item do span\n c('.desconto span:last-child').innerHTML = `R$ ${desconto.toFixed(2)}`;\n c('.total span:last-child').innerHTML = `R$ ${total.toFixed(2)}`;\n } else {\n c('aside').classList.remove('show');\n c('aside').style.left = '100vw'\n };\n }", "function setItems(product){\r\n let cartItems = localStorage.getItem('productsInCart');\r\n cartItems = JSON.parse(cartItems);\r\n //checked if the cartItems is null\r\n if(cartItems != null){\r\n if(cartItems[product.tag] == undefined){\r\n cartItems = {\r\n ...cartItems,\r\n [product.tag]: product\r\n }\r\n }\r\n cartItems[product.tag].inCart += 1; \r\n } else {\r\n product.inCart = 1;\r\n cartItems = {\r\n [product.tag]: product\r\n }\r\n } \r\n product.inCart = 1;\r\n\r\n //json stringify turns object into subjects that can stored on the browser local storage\r\n localStorage.setItem(\"productsInCart\", JSON.stringify (cartItems));\r\n}", "function addBasket() {\n if (basket.length === 0 || (basket.find(x => x.name === item.name)) === undefined) {\n item.quantity = updatedQuantity\n basket.push(item)\n } else {\n for (let i=0; i < basket.length; i++) {\n if (basket[i].name === item.name) {\n basket[i].quantity = basket[i].quantity + updatedQuantity\n } \n }\n }\n productTotal();\n basketCount();\n localStorage.setItem(\"savedBasket\", JSON.stringify(basket));\n}", "function addItemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n return Object.assign({}, )\n}", "updateItemsList({commit, state}){\n api.getProducts((res) => { \n commit('pushItems',addProductsFromPage(state.items,res.results)) \n }) \n }", "updateOffers(items){\n for (let x = 0; x < this.props.offers.length; x++) {\n for (let y = 0; y < items.length; y++) {\n if (this.props.offers[x].companyID === this.props.company.id &&\n this.props.offers[x].offerID === items[y].offerID) {\n items[y].available = this.props.offers[x].available;\n items[y].price = this.props.offers[x].price;\n }\n }\n }\n return items;\n }", "function updateQuantityToStorage(self) {\r\n\r\n // Create and get various elements\r\n var cartItem = self.parentElement.parentElement.parentElement.parentElement; // The clicked cart item\r\n var itemName = cartItem.querySelector('.cart-item-name').textContent; // The name of the item\r\n var itemQuantity = parseInt(self.value); // The new item quantity it should be\r\n var itemPrice, itemImgSrc, itemHref, itemDesc; // Declare other item details to be used when updating the new item\r\n\r\n // Get current session storage\r\n var cartContents = JSON.parse(sessionStorage.getItem('cart-contents'));\r\n cartContents.forEach(item => {\r\n var arr = Object.entries(item);\r\n arr.forEach(el => {\r\n // Find the item name inside session storage\r\n if (el[0] == 'name' && el[1] == itemName) {\r\n // Get position of item in cart list\r\n index = cartContents.indexOf(item);\r\n\r\n // Get other details of the same item\r\n arr.forEach(el2 => {\r\n if (el2[0] == 'price') { itemPrice = el2[1] }\r\n if (el2[0] == 'imgsrc') { itemImgSrc = el2[1] }\r\n if (el2[0] == 'href') { itemHref = el2[1] }\r\n if (el2[0] == 'desc') { itemDesc = el2[1] }\r\n });\r\n\r\n // Replace the original item with the new updated item\r\n cartContents[index] = { name: itemName, price: itemPrice, quantity: itemQuantity, imgsrc: itemImgSrc, href: itemHref, desc: itemDesc }\r\n\r\n // Update the new item to session storage\r\n sessionStorage.setItem('cart-contents', JSON.stringify(cartContents));\r\n }\r\n });\r\n });\r\n\r\n}", "function updateNumberToCart() {\n let currentUser = sessionStorage.getItem(\"successLogin\") \n let productList = JSON.parse(localStorage.getItem(\"userList\"))\n\n for (let i = 0; i < productList.length; i++) {\n const cart = productList[i].cart\n\n if(currentUser == productList[i].name)\n document.getElementById(\"purchase\").innerText = cart.length\n else {\n document.getElementById(\"purchase\").innerText = null\n }\n } \n}", "addToCart(newItem) {\n let itemExisted = false\n let updatedCart = this.state.cart.map(item => {\n if (newItem === item.sku) {\n itemExisted = true\n return { sku: item.sku, quantity: ++item.quantity }\n } else {\n return item\n }\n })\n if (!itemExisted) {\n updatedCart = [...updatedCart, { sku: newItem, quantity: 1 }]\n }\n this.setState({ cart: updatedCart })\n // Store the cart in the localStorage.\n // localStorage.setItem('stripe_checkout_items', JSON.stringify(updatedCart))\n }", "function appendToCart(){\n ui.cartItems.innerHTML = \"\";\n cart.forEach((item)=>{\n ui.appendToCart(item.imgSrc,item.title,item.size,item.price,item.id,item.numberOfUnits);\n })\n}", "function addCart() {\n\n let sameItems = stylishStorage.cart.list.filter( el => \n el.id === details_product_id.textContent &&\n el.color.code === currentColor && \n el.size === currentSize); \n\n if (sameItems.length > 0){\n stylishStorage.cart.list.forEach( item => {\n if ( item.id === details_product_id.textContent &&\n item.color.code === currentColor &&\n item.size === currentSize ){\n item.qty = quantity_count_value.textContent;\n }\n })\n \n }else{\n newItem ={\n id: details_product_id.textContent,\n name: details_product_name.textContent,\n main_image: main_img,\n price: product_price,\n color: {\n name: currentColorName,\n code: currentColor\n },\n size: currentSize,\n qty: quantity_count_value.textContent,\n stock: stock_qty\n }\n\n stylishStorage.cart.list.push(newItem);\n }\n\n localStorage.setItem('cart', JSON.stringify(stylishStorage.cart));\n}", "set cartItems(cartItems) {\n //store.cartItems = storedCartItems; //added*\n this.storage.setItem(this.CART_KEY, JSON.stringify(cartItems));\n }", "function updateQuantity(id, newQuantity) {\n\n var basket = JSON.parse(localStorage.BASKET);\n // loop through products in basket\n for (var i = 0; i < basket.length; i++) {\n\n var basketProduct = JSON.parse(basket[i]);\n\n // if the product is already in the basket, add the new quantity\n if (basketProduct.productID == id) {\n basketProduct.quantity = newQuantity;\n basket[i] = JSON.stringify(basketProduct);\n }\n }\n // updates the basket\n localStorage.BASKET = JSON.stringify(basket);\n ajaxGet('inc/basket.php', loadBasket);\n updateBasketCost();\n}", "function updateCart(){\n \n if( cart.length > 0 ){\n section('aside').classList.add('show');\n // zerando o cart para depois adicionar com append\n section('.cart').innerHTML = '';\n\n let subtotal = 0;\n let desconto = 0;\n let total = 0;\n\n for(let i in cart){\n let pizzaItem = pizzaJson.find( (item) => {\n return item.id == cart[i].id\n });\n\n subtotal = pizzaItem.price * cart[i].quantidade;\n\n console.log(pizzaItem);\n\n let cartItem = section('.models .cart--item').cloneNode(true);\n\n let pizzaSizeName;\n\n switch (cart[i].size) {\n case 0:\n pizzaSizeName = 'P';\n break;\n\n case 1:\n pizzaSizeName = 'M';\n break;\n \n default:\n pizzaSizeName = 'G';\n break;\n }\n\n let pizzaName = `${pizzaItem.name} (${pizzaSizeName}) `;\n\n cartItem.querySelector('img').src = pizzaItem.img;\n cartItem.querySelector('.cart--item-nome').innerHTML = pizzaName;\n cartItem.querySelector('.cart--item--qt').innerHTML = cart[i].quantidade;\n\n cartItem.querySelector('.cart--item-qtmenos').addEventListener('click', () => {\n \n if(cart[i].quantidade > 1 ){\n cart[i].quantidade--;\n } else {\n cart.splice(i, 1);\n }\n updateCart();\n });\n\n cartItem.querySelector('.cart--item-qtmais').addEventListener('click', () => {\n cart[i].quantidade++;\n updateCart();\n });\n\n // Adicionando os itens que pegamos do JSON na div CART\n section('.cart').append(cartItem);\n\n }\n\n desconto = subtotal * 0.1;\n total = subtotal - desconto; \n\n section('.subtotal span:last-child').innerHTML = `R$ ${subtotal.toFixed(2)}`;\n section('.desconto span:last-child').innerHTML = `R$ ${desconto.toFixed(2)}`;\n section('.total span:last-child').innerHTML = `R$ ${total.toFixed(2)}`;\n\n } else {\n section('aside').classList.remove('show');\n }\n}", "function UpdateShop() {\n for (let i = 0; i < shopItems.length; i++) {\n let obj = shopItems[i];\n let x = ((i % itemAmountPerLineS) * (itemSize + itemMargin) + (halfWidthOfShopbox / itemAmountPerLineS)) + hw;\n let y = Math.floor(i / itemAmountPerLineS) * (itemSize + itemMargin) + 60 + hItemSize + itemMargin / 2 + (70 * widthOfShopbox / 500 * 2);\n if (mouse.trueX > x - hItemSize && mouse.trueX < x + hItemSize &&\n mouse.trueY > y - hItemSize && mouse.trueY < y + hItemSize) {\n obj.selected = true;\n if (mouse.leftPressed && !mouse.leftClicked) {\n if (totalStorage >= obj.cost) {\n sellRequest += obj.cost;\n // bee.inventory.push({\n // id: obj.id,\n // type: obj.type\n // });\n addToInventory(obj.id, obj.type, obj.name);\n mouse.leftClicked = true;\n\n } else {\n obj.outOfCost = true;\n obj.outOfCostAnimation = 0;\n\n }\n break;\n }\n } else {\n obj.selected = false;\n }\n }\n}", "function addItemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n return Object.assign()\n}", "addToCart(item) {\n const nameKey = item.name;\n // If the item that is being added to the cart is already in the cart,\n // we increment the numInCart variable to show that an additional unit\n // is being added\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 this.setState({\n aggregatedItems: currAggregatedItems\n })\n // If it is not already in the cart, we need to add this key-value pair to the \n // aggregatedItems state variable. We do so using the setState function\n } else {\n let currAggregatedItems = this.state.aggregatedItems;\n currAggregatedItems[nameKey] = {\n numInCart: 1,\n price: item.price,\n image: item.image,\n shelf_life: item.shelf_life,\n type: item.type\n\n }\n this.setState({\n aggregatedItems: currAggregatedItems\n })\n }\n }", "function setCartUser() {\n userCart.forEach(\n (item) =>\n !filteredCartUser.filter(\n (cart) =>\n (cart.item.name === item.item.name) &\n (cart.item.size === item.item.size)\n ).length > 0 && filteredCartUser.push(item)\n );\n\n filteredCartUser.forEach((item) =>\n cartNewUser.push(\n userCart.filter(\n (i) =>\n (i.item.name === item.item.name) & (i.item.size === item.item.size)\n )\n )\n );\n }", "function updateCart(cartJSON) {\n \n var shopCart = jsonParse(cartJSON);\n var generated = shopCart.generated;\n \n if (generated > lastCartUpdate) {\n lastCartUpdate = generated;\n var contents = document.getElementById(\"contents\");\n contents.innerHTML = \"\";\n\n var cartItems = shopCart.cart;\n for (var i in cartItems) {\n if (i%2 == 1) {\n var itemDetails = cartItems[i];\n \n var name = itemDetails.name;\n var quantity = itemDetails.quantity;\n\n var listItem = document.createElement(\"li\");\n listItem.appendChild(document.createTextNode(name+\" x \"+quantity));\n contents.appendChild(listItem);\n }\n }\n\n }\n\n document.getElementById(\"total\").innerHTML = shopCart.total;\n}", "function updateItemQuantity(itemId, itemQty){\n /* get items of cart in localStorage */\n let cartItem = JSON.parse(localStorage.getItem('cart'));\n /* update psc_item using Map */\n let newCartData = cartItem.map(item => {\n if(item.item_id == itemId){\n if(parseInt(item.item_available) < itemQty.value){\n item.pcs_item = parseInt(item.item_available);\n }else{\n item.pcs_item = parseInt(itemQty.value);\n }\n return item;\n }else{\n return item;\n }\n });\n\n /* convert newCartData to JSON string to be set in localStorage */\n localStorage.setItem('cart',JSON.stringify(newCartData));\n /* update cart Display */\n updateCartDisplay();\n}", "stockProduct (e) {\n // stock\n\n let orderUpdate, newOrderId, saveClientOrder\n newOrderId = JSON.parse(localStorage.getItem('newOrderId'))\n orderUpdate = JSON.parse(localStorage.getItem('orderUpdate'))\n if (orderUpdate !== null && saveClientOrder !== null) {\n orderUpdate.unshift({ status: \"En préparation\", orderId: newOrderId })\n\n saveClientOrder = this.state.appStateClients\n saveClientOrder.forEach(client => {\n if (client.id == this.state.currentUser) {\n client.order = [...client.order, orderUpdate]\n }\n })\n\n localStorage.setItem('AppStateClients', JSON.stringify(saveClientOrder))\n localStorage.setItem('newOrderId', JSON.stringify(newOrderId + 1))\n\n // nettoie\n ;[...this.shopRef.current.children].forEach(e => {\n e.children[0].children[0].children[2].children[1].value = \"\"\n console.log(e.children[0].children[0].children[2].children[1]);\n })\n\n // document.querySelectorAll('.jsx_InputQuantityArticleShop').forEach(e => e.value = \"\")\n\n localStorage.removeItem('orderUpdate')\n this.forceUpdate()\n\n }\n }", "add(id, product) {\n // if an item exists in the cart\n const item = this.items[id]\n ? new CartItem(this.items[id])\n : new CartItem({ id, product });\n\n // increment the items quantity\n item.qty += 1;\n // Update the items price\n item.price = item.product.price * item.qty;\n\n this.items = {\n ...this.items,\n [id]: item\n };\n }", "function replaceQuantity(qty, name, list) {\n // console.log(\"list\", list)\n list.forEach(function(obj) {\n if (obj.item === name) obj.quantity = qty;\n });\n }", "function addSelectedItemToCart() {\n // TODO: suss out the item picked from the select list\n let selectedItem = event.target.items.value;\n console.log(selectedItem);\n // TODO: get the quantity\n let quantity = event.target.quantity.value;\n // TODO: using those, add one item to the Cart\n \n \n carts.addItem(selectedItem,quantity); \n console.log(carts.items);\n \n}", "function updateShoppingCart(addQty) {\n\tvar totalItems = getTotalItemsCart() + addQty;\n\tdocument.getElementById('shopping-cart-text').innerHTML = totalItems + ' items';\n}", "function addItemToCart(user, item) {\n const updateCart = user.cart.concat(item)\n return Object.assign({}, user, { cart: updateCart })\n}", "function itemcart(item)\r\n{\r\n\r\n let citem=sweets.map( i=>{\r\n if(i.name==item)\r\n {\r\n user.cart.push(i);\r\n alert(\"Product is added To The Cart\");\r\n }\r\n })\r\n cartview();\r\n}", "cartPlusOne(product) {\r\n product.quantity = product.quantity + 1;\r\n }", "updateQuantityInCart(lineItemId, quantity) {\n const state = store.getState().home.cart; // state from redux store\n const checkoutId = state.checkout.id\n const lineItemsToUpdate = [{ id: lineItemId, quantity: parseInt(quantity, 10) }]\n state.client.checkout.updateLineItems(checkoutId, lineItemsToUpdate).then(res => {\n store.dispatch({ type: 'UPDATE_QUANTITY_IN_CART', payload: { checkout: res } });\n });\n }", "addItemToCart(item){\n // check for duplicates\n if(this.cart.hasOwnProperty(item.id)){\n this.cart[item.id].quantity += 1\n localStorage.setItem('cart', JSON.stringify(this.cart))\n }\n else {\n item.index = Object.keys(this.cart).length\n item.quantity = 1\n this.cart[item.id] = item\n localStorage.setItem('cart', JSON.stringify(this.cart))\n }\n return this\n }", "function updateQuantity(item, type) {\n let indx = cart.findIndex((x) => x.name == item.name);\n let qty = qtyBtn.textContent;\n\n if (type == \"dec\") {\n if (qty > 0) {\n qty--;\n qtyBtn.textContent = qty;\n if (indx != -1) {\n cart[indx].quantity = qty;\n } else {\n let billObj = {\n name: item.name,\n price: item.price,\n quantity: qty,\n category: item.category\n };\n cart.push(billObj);\n }\n }\n if (qty == 0) {\n cart = cart.filter((item) => item.quantity != 0);\n }\n }\n\n if (type == \"inc\") {\n if (qty < 10) {\n qty++;\n qtyBtn.textContent = qty;\n if (indx != -1) {\n cart[indx].quantity = qty;\n } else {\n let billObj = {\n name: item.name,\n price: item.price,\n quantity: qty,\n category: item.category\n };\n cart.push(billObj);\n }\n }\n }\n\n updateBill();\n showCartItems();\n }", "handleAddCart(e, product){\n this.setState(state => {\n const cartItems = state.cartItems;\n let productAlreadyInCart = false;\n cartItems.forEach(item => {\n if(item.id === product.id){\n productAlreadyInCart= true;\n item.count++;\n }\n });\n if(!productAlreadyInCart){\n cartItems.push({...product, count:1});\n }\n localStorage.setItem(\"cartItems\",JSON.stringify(cartItems));\n return cartItems;\n })\n }", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n}", "function addItemToCart(user, item) {\n const updatedCart = user.cart.concat(item)\n return Object.assign({}, user, {cart : updatedCart})\n}", "function updateCart(cartJSON) {\n // Get the entire json object from the document\n var cartJsonObj = jsonParse(cartJSON);\n // Read cart generated timestamp value from cartJsonObj\n var generated = cartJsonObj[\"cart generated\"];\n // Check that a more recent cart document hasn't been processed\n // already\n if (generated > lastCartUpdate) {\n lastCartUpdate = generated;\n\n // Clear the HTML list used to display the cart contents\n var contents = document.getElementById(\"contents\");\n contents.innerHTML = \"\";\n\n // Fetch items array from cartJsonObj\n var items = cartJsonObj.items;\n selectedFeeds = new Array();\n // Loop over the items fetched\n for (var I = 0; I < items.length; I++) {\n\n var item = items[I];\n // Extract the values of name and quantity from item json object\n var name = item.name;\n\n selectedFeeds.push(item[\"item code\"]);\n // Create and add a list item HTML element for this cart item\n var listItem = document.createElement(\"li\");\n listItem.appendChild(document.createTextNode(name));\n contents.appendChild(listItem);\n }\n\n }\n // Update the cart's total using the value from the cartJsonObj\n document.getElementById(\"total\").innerHTML = cartJsonObj.total;\n}", "function updateMiniCarts() {\n\t\tvar callbackCart = { \n\t\t\tsuccess : function(o) {\n\t\t\t\tcarts = document.getElementsByClassName( 'vmCartModule' );\n\t\t\t\tif( carts ) {\n\t\t\t\t\t\tfor (var i=0; i<carts.length; i++){\n\t\t\t\t\t\t\t\tcarts[i].innerHTML = o.responseText;\n\t\t\t\t\t\t\t\tnew Effect.Highlight( carts[i] );\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfailure : function( hxr ) { alert( hxr.statusText ) }\n\t\t}\n\t\toption = { method: 'get', onSuccess: callbackCart.success,onFailure: callbackCart.failure }\n\t\tnew Ajax.Request('index2.php?only_page=1&page=shop.basket_short&option=com_virtuemart', option);\n\t\t\n}", "function getItemsInCart(){\n\t\t\treturn items;\n\t\t}", "addToCart(){ \n const cartItems = localStorage.getItem('cartItems') ? JSON.parse(localStorage.getItem('cartItems')) : {};\n let cartSize = localStorage.getItem('cartSize') ? JSON.parse(localStorage.getItem('cartSize')) : 0;\n cartSize ++;\n if(this.state.selectedSource.id in cartItems){\n cartItems[this.state.selectedSource.id]['count'] ++;\n }else{\n cartItems[this.state.selectedSource.id] = {};\n cartItems[this.state.selectedSource.id]['count'] = 1;\n cartItems[this.state.selectedSource.id]['product'] = this.state;\n }\n this.setState({cartItems: cartItems, cartSize});\n localStorage.setItem('cartItems', JSON.stringify(cartItems));\n localStorage.setItem('cartSize', JSON.stringify(cartSize));\n }", "function plusItem() {\n const productId = this.name;\n const cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n const item = cartList.find(product => product.id == productId);\n cartList.push(item);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n}", "function addtocart1() {\n\tvar a = JSON.parse(sessionStorage.getItem(\"Catalogue\"));\n\tvar b = JSON.parse(localStorage.getItem(\"Items\"));\n\tvar c = parseInt(localStorage.getItem(\"Amount\"));\n\n\tif (b == null) {\n\t\tb = [a[0]];\n\t} else {\n\t\tb.push(a[0]);\n\t};\n\n\tlocalStorage.setItem(\"Items\", JSON.stringify(b));\n\n\tlocalStorage.setItem(\"Amount\", c += a[0].price);\n\talert(\"The current total of the items is R\" + c);\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {}\n })\n}", "function updateCartDB() {\n\tconsole.log(\"Updating backend\")\n var shoppingCartJson = {};\n var Items = {};\n shoppingCartJson[\"ShopperID\"] = document.getElementById('Shop_User').innerText\n console.log(shoppingCartJson)\n\n var cartItemContainer = document.getElementsByClassName('cart-items')[0]\n var cartRows = cartItemContainer.getElementsByClassName('cart-row')\n for (var i = 0; i < cartRows.length; i++) {\n var cartRow = cartRows[i]\n var itemName = cartRow.getElementsByClassName('cart-item-title')[0].innerText\n var priceElement = cartRow.getElementsByClassName('cart-price')[0]\n var quantityElement = cartRow.getElementsByClassName('cart-quantity-input')[0]\n var price = parseFloat(priceElement.innerText.replace('$', ''))\n var quantity = quantityElement.value\n var description = cartRow.getElementsByClassName('cart-description')[0].innerText\n console.log(\"Checking updateCartTotal\")\n console.log(itemName)\n console.log(price)\n console.log(quantity)\n console.log(description)\n var item = {}\n var itemDetails = {}\n itemDetails[\"Name\"] = itemName;\n itemDetails[\"Description\"] = description;\n itemDetails[\"Quantity\"] = parseInt(quantity);\n itemDetails[\"Price\"] = parseFloat(price);\n Items[itemName] = itemDetails;\n console.log(Items)\n }\n shoppingCartJson[\"Items\"] = Items;\n versionHTML = document.getElementById(\"version\")\n if (versionHTML.innerText.length != 0) {\n VersionJSON = JSON.parse(versionHTML.innerText)\n console.log(\"Version JSON is\"+VersionJSON)\n shoppingCartJson[\"Version\"] = VersionJSON;\n } else{\n shoppingCartJson[\"Version\"] = {\"Vector\":{}};\n }\n shoppingCartJsonString = JSON.stringify(shoppingCartJson);\n var xhr = new XMLHttpRequest();\n\n\txhr.onreadystatechange = function() {\n\t if (this.readyState == 4 && this.status == 200) {\n console.log(this.responseText);\t\n var shoppingCart = JSON.parse(JSON.parse(this.responseText));\n var shoppingCartVersion = shoppingCart[\"Version\"]\n console.log(shoppingCartVersion)\n var versionHTML = document.getElementById(\"version\")\n versionHTML.innerText = JSON.stringify(shoppingCartVersion)\n\t }\n\t};\n\n xhr.open(\"POST\",\"http://localhost:9000/put\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(shoppingCartJsonString);\n\n \n console.log(shoppingCartJsonString)\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n }\n })\n}", "updateItemOfCurrentList(id, data) {\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(data)\n });\n }", "addToCart({commit}) { \n commit('setCartItemsLocal');\n }", "function increaseQuantity(id) {\n let products = getItemFromLocalStorage('productsCart');\n products.forEach((value) => {\n if (value.id == id) {\n value.quantity++;\n }\n });\n // location.reload();\n\n setItemToLocalStorage('productsCart', products);\n displayCartData();\n}", "ADD_TO_CART(state, product) {\n // Check if cart is empty\n if (Object.keys(state.cart).length != 0) {\n for (const [key, value] of Object.entries(state.cart)) {\n // Check if product already in cart, then change quantity \n if (key === product.reference) {\n product.qty = value.qty + state.qty\n state.cart[key].qty = product.qty\n } else {\n state.cart[product.reference] = product\n }\n }\n } else {\n state.cart[product.reference] = product\n }\n }", "function updateQuantity() {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n item_id: answer.userId\n }\n ],\n );\n }" ]
[ "0.7289283", "0.723617", "0.7103477", "0.7100007", "0.7062099", "0.6936709", "0.6862387", "0.68604136", "0.6832831", "0.68196964", "0.6781367", "0.6777007", "0.67340124", "0.6727093", "0.67100394", "0.6691258", "0.667923", "0.66478145", "0.663374", "0.65717614", "0.65565306", "0.6539932", "0.6537652", "0.6523488", "0.65005165", "0.64987916", "0.6489901", "0.6481606", "0.64770454", "0.6467188", "0.64654326", "0.64397603", "0.6436322", "0.643331", "0.6430106", "0.64251333", "0.6415951", "0.64154375", "0.6411559", "0.64034724", "0.64007694", "0.63888", "0.63855857", "0.6384655", "0.63830304", "0.638135", "0.63799536", "0.6379055", "0.63790035", "0.637189", "0.6371522", "0.6371522", "0.63697714", "0.6367369", "0.63665736", "0.6364239", "0.6360313", "0.6352852", "0.6347449", "0.6346562", "0.6341047", "0.6339422", "0.6335754", "0.6326556", "0.6315358", "0.63076097", "0.63002354", "0.6286493", "0.6281694", "0.6267077", "0.62521696", "0.6241741", "0.6237483", "0.62327224", "0.6219784", "0.62178224", "0.62049484", "0.6190576", "0.6188199", "0.6188087", "0.61864644", "0.617624", "0.61759734", "0.6171254", "0.6170167", "0.61691886", "0.6165732", "0.61654264", "0.6157015", "0.61566067", "0.61536086", "0.6152486", "0.6152454", "0.61482173", "0.61476916", "0.6143922", "0.61374784", "0.6136653", "0.61331517", "0.6124288", "0.61239046" ]
0.0
-1
Hey look at that we have our purchases but we need to remove this from the actual cart because now Kim have purchased her laptop so the last option, to finish things off lets do the last piece
function emptyCart(user) { return user }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "function cleanCart() {\n wecache.remove(CART_KEY);\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 purchaseClicked(){\n alert('Thank you for your purchase')\n let cartItems = document.getElementsByClassName('cart-items')[0]\n while(cartItems.hasChildNodes()){\n cartItems.removeChild(cartItems.firstChild)\n }\n updateCartTotal()\n}", "function removeFromCart(eventOrProduct) {\n \n if (eventOrProduct.target) {\n productRef = eventOrProduct.target.getAttribute('data-id');\n } else {\n productRef = eventOrProduct;\n }\n\n cart.forEach((product, index) => {\n\n if (product.ref == productRef) {\n cart.splice(index, 1);\n cartTotalFunc();\n };\n });\n fillModal();\n return true;\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 removeItemFromCart(){\n\n}", "function removeAllProducts() {\n cart = {};\n saveCart();\n showCart();\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 removeFromCart() {\n\t// if (sessionStorage.cart == null) {\n\t// sessionStorage.cart = '';\n\t// }\n\tvar item = sessionStorage.cart.split(\"'\\'\");\n\tsessionStorage.cart = '';\n\n\tfor (var i = 0; i < item.length - 2; i++) {\n\t\tsessionStorage.cart = sessionStorage.cart + item[i] + \"'\\'\";\n\t}\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 removeFromShoppingCart() { \n var uid = $(this).attr(\"roll-del-uid\");\n if (uid) {\n var selector = '[roll-uid=\"' + uid + '\"]';\n var element = document.querySelector(selector);\n if (element) {\n element.parentNode.removeChild(element);\n }\n dataArray = dataArray.filter(x => x.uid !== uid);\n localStorage.setItem(\"dataArray\", JSON.stringify(dataArray));\n }\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 removeCartItem(event) {\n var buttonClicked = event.target\n var iceCreamRemoved = buttonClicked.parentElement.parentElement.children[0].innerText\n for (var i = 0; i < 8; i++) {\n if (QuantityFromIceCream[i].brand == iceCreamRemoved) {\n QuantityFromIceCream[i].Onekg = 0\n QuantityFromIceCream[i].Halfkg = 0\n var JSONreadyUsers = JSON.stringify(QuantityFromIceCream);\n sessionStorage.setItem('QuantityFromIceCream', JSONreadyUsers);\n }\n }\n buttonClicked.parentElement.parentElement.parentElement.remove()\n updateShoppingCart()\n UpdateCart()\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 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 afterRemove(product){\n document.getElementById('cart-' + product).style.display = 'none';\n const itemNum = getProductCount(product);\n const unitPrice = (product === 'phone')? 1219 : 59 ;\n\n const subTotal = parseFloat((document.getElementById('subtotal').innerText).split(\",\").join(\"\"));\n const updatedSubtotal = subTotal - (itemNum*unitPrice);\n document.getElementById('subtotal').innerText = updatedSubtotal.toLocaleString();\n\n const updatedTax = Math.round(updatedSubtotal * 0.08);\n document.getElementById('tax').innerText = updatedTax.toLocaleString();\n\n const updatedTotal = updatedSubtotal + updatedTax;\n document.getElementById('total').innerText = updatedTotal.toLocaleString();\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 deleteItemsfromcart() {\n var transformObject1 = kony.ui.makeAffineTransform();\n var transformObject2 = kony.ui.makeAffineTransform();\n transformObject1.scale(1,1);\n transformObject2.scale(0,0);\n var animDefinitionOne = {0: {\"transform\": transformObject1}, 100: {\"transform\": transformObject2}};\n var animDefinition = kony.ui.createAnimation(animDefinitionOne);\n var animConfig = {\"duration\": 0.7, \"iterationCount\": 1, \"delay\": 0, \"fillMode\": kony.anim.NONE};\n var animationObject = {definition: animDefinition, config: animConfig};\n var selectedindex = ShoppingCartScreen.SegmentShoppingCart.selectedIndex[1];\n var secIndex=ShoppingCartScreen.SegmentShoppingCart.selectedIndex[0];\n ShoppingCartScreen.SegmentShoppingCart.removeAt(selectedindex,secIndex,animationObject);\n arrayShoppingCart.splice(selectedindex, 1);\n Total();\n if (arrayShoppingCart.length === 0) {\n kony.timer.schedule(\"disableTotalLblTimer\", removeTotal, 1, true);\n ShoppingCartScreen.LblQualifies.isVisible = false;\n } \n TimeOut();\n totalanimation();\n unregisterForIdleTimeout();\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 }", "removeBoothFromCart(booth, selector){\n if ( selector == 'events' ){\n this.cart.forEach(m => {\n if ( m.id == booth.id ){\n this.total -= m.price;\n return;\n }\n })\n }\n else this.total -= booth.price;\n this.products.forEach(m => {\n if ( m.id == booth.id ){\n m.booths.quantity = 0;\n m.selectBoothBoolean = false;\n }\n })\n booth.quantity--;\n this.cart = this.cart.filter( m => m.id !== booth.id && !m.notify );\n }", "function removeFromCart(){\n let removecart = document.querySelectorAll('.remove');\n\n for(let i=0; i<removecart.length; i++){\n removecart[i].addEventListener('click', ()=>{\n // console.log(\"removed from cart: \" + items[i].itemName);\n\n let cartItems = localStorage.getItem('cartProducts');\n cartItems = JSON.parse(cartItems);\n // console.log(cartItems);\n\n //check if it exists using name\n if(cartItems.hasOwnProperty(items[i].itemName)){\n //get cur totalCart\n let totalcost = localStorage.getItem('totalCost')\n totalcost = parseInt(totalcost);\n\n //get cur number of items in cart\n let productNumb = localStorage.getItem('cartNumbers');\n productNumb = parseInt(productNumb);\n\n //If it's more than 1, reduce quantity\n if(cartItems[items[i].itemName].numInCart > 1 ){\n\n //decrease quantity with 1\n cartItems[items[i].itemName].numInCart -= 1;\n\n\n //set new local storage\n localStorage.setItem(\"cartProducts\", JSON.stringify(cartItems));\n\n //set new total total\n // console.log(\"previous totalcost: \"+ totalcost);\n localStorage.setItem(\"totalCost\", totalcost - items[i].price)\n\n //set new number of items in cart\n localStorage.setItem('cartNumbers', productNumb - 1);\n document.querySelector('.cart span').textContent = productNumb - 1;\n\n // console.log(\"new totalcost: \" + parseInt(localStorage.getItem('totalCost')));\n\n // If quantity is 1, remove item from cart.\n }else {\n //hide the remove from cart button\n var target = $(\".remove.cart\"+i);\n target.hide();\n\n\n // console.log(cartItems[items[i].itemName].numInCart);\n\n //0 of this item are in the cart after removing\n cartItems[items[i].itemName].numInCart = 0;\n items[i].numInCart = 0;\n\n //delete whole item entry\n delete cartItems[items[i].itemName];\n\n //update cart items in local storage\n localStorage.setItem(\"cartProducts\", JSON.stringify(cartItems));\n\n //set new total total\n localStorage.setItem(\"totalCost\", totalcost - items[i].price)\n\n //set new number of items in cart\n localStorage.setItem('cartNumbers', productNumb - 1);\n document.querySelector('.cart span').textContent = productNumb - 1;\n\n }\n //update cart\n getCart();\n }\n });\n }\n}", "function removecart() {\n\tdocument.getElementById(\"everything1\").remove();\n\tdocument.getElementById(\"everything2\").remove();\n\tdocument.getElementById(\"prodpic\").remove();\n\tdocument.getElementById(\"quantitypic\").remove();\n\tdocument.getElementById(\"glazingpic\").remove();\n\tlocalStorage.removeItem(\"mySelected\");\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 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 cleanCart1() {\n cartList=[];\n}", "function clearCart() {}", "function clearCart() {}", "function clearCart() {}", "function emptyCart(){\n\t\t\tvar itemsLength = items.length;\n\t\t\t\n\t\t\tfor(var i = items.length-1; i > -1; i--){\n\t\t\t\tvar item = items[i];\n\t\t\t\tremoveItem(item);\n\t\t\t}\n\t\t}", "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 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}", "_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 removeFromCart(id){\n for (let i = 0; i < cart.length; i++){\n if (cart[i].id == id) {\n cart.splice(i, 1);\n //splicing it at that index and only going one space\n displayTotal();\n displayCart();\n break;\n }\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 purchaseProducts(cartItems) {\r\n let purchaseButton= document.querySelector('.btn-purchase')\r\n // console.log(purchaseButton);\r\n purchaseButton.addEventListener('click', function(){\r\n if(!cartItems.hasChildNodes()){\r\n alert(\"Please buy something into the cart before purchasing\")\r\n return;\r\n }\r\n alert(\"Thank You for shopping with the Blue Coporation\");\r\n while(cartItems.hasChildNodes()){\r\n cartItems.removeChild(cartItems.firstChild);\r\n }\r\n updateCartTotal(cartItems);\r\n })\r\n}", "function RemoveAllItems(name)\n{\n\tfor (var i in Cart) {\n\t\tif (Cart[i].name === name){\n\t\t\tCart.splice(i, 1);\n\t\t\tbreak;\n\t\n\t\t}\n\t}\t\n\t//update the bubblu number\t\n\tadd();\n\t//display cart\n\tNoDisplay(name);\t\n\t//if the cart is not empty display cost and total items in cart page\n\tif (TotalCount()>0) {\n\tdocument.getElementById('notempty').innerHTML = \"Total Items in Cart \" + TotalCount();\n\tdocument.getElementById('order').innerHTML = \" \";\n\tdocument.getElementById('currentprice').innerHTML = TotalCost();}\n\tSaveCart();\n\n}", "function removeFromCart(item) {\n var countup = 0;\n var itemFails = 0;\n while (countup < cart.length) {\n if(cart[countup].itemName === item) {\n cart.splice(countup, countup);\n countup++;\n } else {\n itemFails++;\n countup++;\n }\n }\n if(itemFails === cart.length){\n console.log(cart);\n return 'That item is not in your cart.';\n } else {\n console.log(cart);\n return cart;\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 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 deleteFromCart(productId) {\n if (confirm('Bỏ mua sản phẩm này khỏi giỏ hàng? ')) {\n var current_cart = readCookie('quick_shopping_cart');\n var newCart = current_cart.split('$$');\n for (i = 0; i < newCart.length; i++)\n {\n var str = newCart[i].split(\"#\");\n if (str[0]==productId)\n newCart.splice(i, 1);\n }\n var newC = newCart.join(\"$$\");\n createCookie('quick_shopping_cart', newC, 1);\n }\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(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 }", "_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 removeCart(){\n\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 listenForCartCleanup() {\n document.querySelector(\".clear-cart\").addEventListener(\"click\", function () {\n Storage.clear();\n displayHeaderQtyOfProductInCart();\n updatePageStatus();\n });\n}", "removeAdvert(advert){\n this.total -= advert.price;\n this.cart = this.cart.filter(m => m.name !== advert.name);\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}", "clearCart(){\n //get all the id of the items have in the cart \n let cartItems = cart.map(item => item.id);\n cartItems.forEach(id =>{ this.removeItem(id)});\n // remove from DOM\n while(cartContent.children.length > 0 ){\n // console.log(cartContent.children[0])\n cartContent.removeChild(cartContent.children[0]);\n }\n this.hideCart(); \n }", "function remove_from_cart(cart_id, part_id) {\n\tvar cur = \"\";\n\tvar amount = 0;\n\t// Check if the entry is in the cart\n\tif($(\".cart table #part_\" + part_id).length) {\n\t\t// If it is in the cart ger the current amount\n\t\tcur = $(\".cart table #part_\" + part_id + \" .amount\").text();\n\t\tamount = parseInt(cur) - 1;\n\t\tconsole.log(\"Value: \" + amount);\n\t\t// If the current amount is more than 1\n\t\tif(amount != 0) {\n\t\t\t$.post(\"update_part.json\", {cart_id: cart_id, part_id: part_id, quantity_requested: amount}).done(function(){\n\t\t\t\t$(\".cart table #part_\" + part_id + \" .amount\").html(\"<a href='#basicModal' role='button' class='btn-default btn-s' data-toggle='modal'><b>\"+amount+\"</a></b>\");\n\t\t\t\tget_total(cart_id);\n\t\t\t});\n\t\t} else {\n\t\t\tconsole.log(\"Remove\");\n\t\t\t$.post(\"remove_part.json\", {cart_id: cart_id, part_id:part_id}).done(function(data) {\n\t\t\t\t$(\".cart table #part_\" + part_id).remove();\t\n\t\t\t\tget_total(cart_id);\n\t\t\t});\n\t\t\t\n\t\t}\n\t}\n\tget_total(cart_id);\n}", "function deleteFromCart(item){\n item.parentElement.remove();\n showTotals();\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 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 removeShoppingCartItem(event){\n const buttonClicked = event.target;\n buttonClicked.closest('.shoppingCartItem').remove();\n //invocamos la funcion q actualizara el total//\n updateShoppingCartTotal();\n}", "function removeFromCart(postResponse,qty,page,value,from) {\n\n let answer = document.getElementById(\"color\"+postResponse.colors+postResponse._id).value;\n let success = document.getElementById(\"success\");\n success.innerHTML = \"\";\n success.className = \"\";\n if (answer !== 'Select Color'){\n var total = qty;\n var item = findMyItem(postResponse,answer);\n if(item != 0){\n var lenght = localStorage.length;\n var array = localStorage.getItem(item);\n var json = JSON.parse(array);\n\n if (total > json.count ){\n\n alert(\"You can't delete more than you have in your cart\");\n let qty = document.getElementById(\"qty\"+postResponse.colors+postResponse._id);\n qty.value = postResponse.count;\n qty.innerHTML == postResponse.count;\n }else{\n total = json.count - total;\n json.count = total;\n if (total <= 0 ){\n const responseDanger = document.getElementById('danger');\n responseDanger.innerHTML=\"You have removed an item from the cart\";\n responseDanger.className = \"alert-danger\";\n localStorage.removeItem(item);\n if(from === \"single\"){\n\n }else{\n parent.open(page, value);\n }\n\n }else{\n const responseDanger = document.getElementById('danger');\n responseDanger.innerHTML=\"You have removed an item from the cart\";\n responseDanger.className = \"alert-danger\";\n localStorage.setItem(item,JSON.stringify(json));\n let qty = document.getElementById(\"qty\"+postResponse.colors+postResponse._id);\n qty.value = total;\n qty.innerHTML == total;\n //parent.open(page, value);\n }\n var array = localStorage.getItem(item);\n var json = JSON.parse(array);\n }\n\n }else{\n alert('You dont have this item in your cart');\n\n }\n }else{\n alert('You need to select a color');\n }\n\n \n cartCount();\n\n}", "function removeProduct(product) {\n $cart.removeChild(product)\n $cart = document.querySelector('#cart tbody');\n calculateAll()\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}", "removeFromCart (product, productPos) {\n product.parentElement.remove()\n this.productInCart.splice(productPos, 1)\n console.log(this.productInCart)\n }", "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}", "function removeProductCart(prodId) {\n for (d in productCart) {\n if (productCart[d].id == prodId) {\n console.log(\"inside if\" + d);\n productCart.splice(d, 1);\n cartPage();\n console.log(productCart);\n break;\n }\n }\n}", "function clearCartItems() {\n var con = confirm('Are you sure you want to clear your cart?');\n if(con==true) {\n $('.receipt_main table.orders tr').remove();\n $('.subtotal').val(0);\n $('.subtotal').text('$0.00');\n $('.tax').val(0);\n $('.tax').text('$0.00');\n if($('#pickup1').hasClass('deliverychecked')) {\n $('.subtotal').val(minimum);\n $('.subtotal').text('$' + minimum);\n\n $('.grandtotal').val(0);\n $('.grandtotal').text('$0.00');\n } else {\n var d_fee = $('.df input').val();\n d_fee = 0;\n if(!d_fee){d_fee=Number(0);} else {d_fee = Number(d_fee);}\n $('.grandtotal').val(d_fee);\n $('.grandtotal').text('$'+d_fee.toFixed(2));\n }\n $('.grandtotal').text('$0.00');\n total_items = 0;\n updatecart(\"clearCartItems\");\n } else {\n return false;\n }\n}", "function removeItems() {\n var buttonClicked = event.target;\n buttonClicked.parentElement.parentElement.remove();\n updateCartTotals();\n updateCartNumbers();\n const addToCartButtons = document.getElementsByClassName(\"bag-btn\");\n for (let i = 0; i < addToCartButtons.length; i++) {\n addToCartButton = addToCartButtons[i];\n addToCartButton.innerHTML = \"Add to Cart\";\n addToCartButton.disabled = false;\n }\n}", "function removeProduct(){\n cy.get('.cart-items').find('a.remove-from-cart').click({multiple: true});\n cy.screenshot('removeProduct'); \n }", "function removeFromTotal() {\n let cartItems = document.getElementsByClassName(\"items\")[0];\n let itemRows = cartItems.getElementsByClassName(\"item\");\n let total = document.getElementById(\"total\").innerText;\n total = total.replace(\"Total: $\", '');\n total = parseFloat(total);\n let priceSum = JSON.parse(localStorage.getItem('priceSum'))\n if (priceSum === null){\n localStorage.setItem('priceSum', JSON.stringify(0))\n }\n localStorage.setItem('priceSum', JSON.stringify(total));\n //console.log(itemRows);\n for (let i = 0; i < itemRows; i++){\n //console.log('entered');\n let item = itemRows[i];\n let itemPrice = item.getElementsByClassName(\"price\").text;\n total = total - itemPrice;\n }\n document.getElementById(\"total\").text = total;\n localStorage.setItem('priceSum', JSON.stringify(total));\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 removeFromCart(itemCode) {\n // remove the item from the cart\n localStorage.removeItem(itemCode);\n // update the cart section shown to user\n updateCartDisplay();\n}", "removeItem(id){\n // 1) filter out the item \n cart= cart.filter(item => item.id !=id);\n // 2) update the value after filter\n this.setCartValues(cart);\n // *) save to LS\n Storage.saveCart(cart);\n // select specific \n let button =this.getSingleCartButton(id);\n button.innerHTML= \n `<i class=\"fas fa-shopping-cart\"></i>\n add to bag`;\n button.disabled= false;\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}", "deleteCartItem(productData, itemNumber, event) {\n // sending the data to Google Analytics on delete icon click\n if (typeof dataLayer !== 'undefined') {\n const analyticsObject = {\n code: productData.product.code,\n name: productData.product.name,\n quantity: productData.quantity,\n };\n this.analyticsService.trackRemoveFromCart(analyticsObject);\n }\n this.manageShoppingCartService.deleteCartItem({},\n this.handleDeleteCartItemResponse,\n this.handleDeleteCartItemError,\n itemNumber,\n );\n this.$refs.spinner.showSpinner();\n // sending data to yMarketing on delete icon click\n const cartData = {\n cartCode: this.globals.getCartGuid(),\n productCode: productData.product.code,\n productName: productData.product.name,\n productPrice: productData.totalPrice.value,\n };\n this.yMarketing.trackRemoveFromCart(\n productData.product.code,\n productData.quantity,\n cartData,\n );\n }", "function removeFromCart(msg) {\n header('REMOVE CART ITEM', msg);\n\n var table = new Table({\n chars: {\n 'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗',\n 'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚', 'bottom-right': '╝',\n 'left': '|', 'left-mid': '╟', 'mid': '-', 'mid-mid': '┼',\n 'right': '|', 'right-mid': '╢', 'middle': '│',\n },\n head: [\"id\", \"Product\", \"Qty\", \"Unit Price ($)\", \"Acc Price ($)\"],\n colWidths: [5, 20, 5, 19, 19]\n });\n cart.forEach((e, index) => {\n table.push(\n [index + 1, e.name, e.qty, e.unit_price, e.accum_price]\n );\n });\n \n console.log(table.toString());//displays cart array\n console.log();\n console.log('-------------------------------------------------------------------------'.red);\n\n prompt.question(\"Enter product Id: \", (id) => { // Ask the user the Id of the Product he/she wants to remove \n let i = parseInt(id); // to make it an integer\n i = i - 1;\n if (i < (cart.length ) && i > -1) {\n let message = \"Removed \\\"\" + cart[i].name + \"\\\" from cart\";\n cart.splice(i, 1); // This removes the element from the cart array.\n editedCartItem(message.cyan);\n } else {\n removeFromCart(\"SORRY, CART ID DOSEN'T EXIST\" .cyan)\n }\n })\n}", "function purchaseClicked() {\n // alert('Merci pour votre achat')\n var cartItems = document.getElementsByClassName('cart-items')[0]\n while (cartItems.hasChildNodes()) {\n cartItems.removeChild(cartItems.firstChild)\n }\n let total = updateCartTotal()\n console.log(total);\n window.location = '/paiement.html?total=' + total\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 removeCartItem(event) {\r\n var buttonClicked = event.target;\r\n buttonClicked.parentElement.parentElement.remove();\r\n updateCartTotal();\r\n }", "function removeThis(e) {\n cart = JSON.parse(sessionStorage.getItem(\"price\"));\n vinylObject = JSON.parse(sessionStorage.getItem(\"object\"));\n discountCode = JSON.parse(sessionStorage.getItem(\"discount\"));\n discountLock = JSON.parse(sessionStorage.getItem(\"discLock\"));\n let paraValue = e.parentElement.value;\n vinylObject.splice(paraValue, 1);\n cart.splice(paraValue, 1);\n e.parentElement.remove();\n let total = cart.reduce(function(a, b) {\n return a + b\n }, 0)\n if (total === 0) {\n $(\"#total\").html(\"Total: 0\");\n $(\".fas\").css(\"color\", \"#696464\");\n $(\"#vat\").html(\"VAT: 0\")\n } else {\n if ($(\"#express\").prop(\"checked\") == true) {\n $(\"#total\").html(\"Total: \" + (total + 99.99 - discountLock));\n let num = (15 * (total + 99.99) / 100);\n $(\"#vat\").html(\"VAT: R\" + num.toFixed(2));\n } else if ($(\"#standard\").prop(\"checked\") == true) {\n $(\"#total\").html(\"Total: \" + (total + 49.99 - discountLock));\n let num = (15 * (total + 49.99) / 100);\n $(\"#vat\").html(\"VAT: \" + num.toFixed(2));\n } else {\n $(\"#total\").html(\"Total: \" + (total - discountLock));\n $(\"#vat\").html(\"VAT: \" + (15 * total) / 100);\n }\n $(\".fas\").css(\"color\", \"#ff5200\");\n }\n sessionStorage.setItem(\"price\", JSON.stringify(cart));\n sessionStorage.setItem(\"object\", JSON.stringify(vinylObject));\n sessionStorage.setItem(\"discount\", JSON.stringify(discountCode));\n}", "removeFromPlannedActivities(item) {\n var new_planned_activities = this.state.planned_activities\n for(var i = 0; i < new_planned_activities.length; i++){\n //this item is in cart\n if(new_planned_activities[i][0] === item) {\n\n if (new_planned_activities[i][1] > 1) {\n new_planned_activities[i][1] -= 1;\n }\n //this item is in the cart and we want to remove it\n else if (new_planned_activities[i][1] === 1) {\n new_planned_activities.splice(i, 1);\n }\n this.setState({\n planned_activities: new_planned_activities\n })\n return;\n }\n }\n }", "function removeFromCart(itemName) {\n for (var i = 0; i < cart.length; i++){\n var itemPrice = cart[i]; //itemPrice is the value stored in the cart array and the variable we are cycling through\n var item = Object.keys(itemPrice); //item is the key or index of the data pairs\n if (itemPrice.hasOwnProperty(itemName)) {\n cart.shift(itemPrice); //not sure shift is the right choice. if you're referencing a specific array entry does it matter?\n }\n }\n console.log (`That item is not in your cart.`)\n return cart;\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}", "removeFromCart(event)\n {\n const ticket = this.getTicketById(event.detail.id)\n const ticketElt = event.detail.elt\n\n if (!ticket.inCart) return\n this.cart.remove(ticketElt, ticket)\n .then(() => this.searchResult.reactivateTicket(ticket))\n // this.searchResult.reactivateTicket(ticket)\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 removeItem(key) {\n if (confirm('Etes-vous sûr de vouloir supprimer le produit?')) {\n // On supprime du localStorage la clé du produit\n delete cart[key]\n localStorage.setItem('cart', JSON.stringify(cart));\n keys = Object.keys(cart)\n if (keys.length === 0) {\n basketContent.innerHTML = '<h3>Le panier est vide</h3>'\n } else {\n // On supprime visuellement la ligne du tableau\n const line = document.querySelector(`[data-key=\"${key}\"]`)\n line.remove()\n // Recalcul du total du pannier\n document.querySelector(`#total`).innerHTML = getTotalCart();\n }\n }\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 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 clearCart() {\r\n\r\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 removeCartItem(event) {\n var buttonClicked = event.target\n buttonClicked.parentElement.parentElement.parentElement.remove();\n //Update the cart total after the cart item has been removed.\n updateCartTotal()\n }", "function cancelCart() {\n localStorage.removeItem('cartProducts');\n refreshSectionAndCart();\n}", "function removeItemFromCart(event) {\n if (event.target.type === 'button') {\n currentInventory.removeItem(event.target.name);\n currentInventory.saveToLocalStorage();\n renderTable();\n }\n}", "function removeCartItem(event) {\n\tvar buttonClicked = event.target;\n\tbuttonClicked.parentElement.parentElement.remove();\n\tupdateCartTotal()\n}", "removeItem(value){\n var itemsInCartTemp = this.state.itemsInCart;\n for(let i = 0; i < itemsInCartTemp.length; i++){\n if(itemsInCartTemp[i].id === value){\n itemsInCartTemp.splice(i, 1);\n }\n }\n this.setState({\n itemsInCart: itemsInCartTemp,\n menuItems: [\n { name: 'donate', title: 'Donate' },\n { name: 'bills', title: 'KZSC Bills' },\n { name: 'merch', title: 'Merchandise' },\n { name: \"cart\", title: \"Your Cart\", label: itemsInCartTemp.length }\n ]\n })\n this.updateMerchAmount()\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 }", "clearCart() {\n let cartItems = cart.map(item => item.id);\n cartItems.forEach(id => this.removeItem(id));\n while (cartContent.children.length > 0) {\n cartContent.removeChild(cartContent.children[0]);\n }\n this.hideCart();\n }", "function onRemove( prodctName) {\n const productIndex = cartInfo.articles.findIndex(product => product.name === prodctName);\n cartInfo.articles.splice(productIndex, 1);\n \n updateShippingmethod();\n showCart(cartInfo.articles);\n}", "function removeToCart() {\n\t\tdispatch({\n\t\t\ttype: 'REMOVE_TO_CART',\n\t\t\titemIndex: productIndex,\n\t\t});\n\t}", "function removeCartItem(event){\n let buttonClicked = event.target;\n buttonClicked.parentElement.parentElement.remove();\n updateCartTotal()\n}", "function cancelCart() {\n localStorage.removeItem('cartProducts');\n refreshSectionAndCart();\n}", "function removeFromInvoice( id )\n\t{\n\n\t\t\tvar item = {};\n\t\t\t// console.log(\"finding : \" + id );\n\t\t\t// find item from array. this may not work in old browsers\n\t\t\titem\t\t\t\t=\tcart.find(x => x.ID == id);\n\t\t\t\n\t\t\tif( item === undefined) return;\n\t\t\t\n\t\t\t// subtract price from total (decimal float)\n\t\t\tcart.totalCost \t\t-= parseFloat(item.PriceSAR, 10);\n\t\t\tcart.totalCost\t\t= parseFloat(cart.totalCost.toFixed(4));\n\t\t\t\n\t\t\t// items total cost\n\t\t\tcart.itemsCost \t\t-= parseFloat(item.PriceSAR, 10);\n\t\t\tcart.itemsCost\t\t= parseFloat(cart.itemsCost.toFixed(4)) ;\n\t\t\t\n\t\t\t// items total shipping cost\n\t\t\tcart.shippingCost \t-= parseFloat(item.ShippingCost, 10);\n\t\t\tcart.shippingCost\t= parseFloat(cart.shippingCost.toFixed(4)) ;\n\t\t\t\n\t\t\t// item tax\n\t\t\tcart.itemsTax \t\t-= parseFloat(item.TaxSAR, 10);\n\t\t\tcart.itemsTax\t\t= parseFloat(cart.itemsTax.toFixed(4)) ;\n\t\t\t\n\t\t\tcart.invoiceCost\t= cart.itemsCost + cart.shippingCost;\n\t\t\tcart.invoiceCost\t= parseFloat(cart.invoiceCost.toFixed(4));\n\t\t\t\n\t\t\t\n\t\t\t// remove product from cart\n\t\t\tcart.removeItem(\"ID\", id)\n\t\t\t\n\t\t\t// update invoice\n\t\t\tupdateInvoice();\n\t\t\n\t}", "function loadCartContent() {\n\n //on load the the invoice div slides up\n $(\"#invoiceDiv\").slideUp();\n\n //variable declaration\n var deliveryForm = document.getElementById(\"deliveryDetails\");\n loadCart = JSON.parse(sessionStorage.getItem(\"myCart\"));\n cartTotal = JSON.parse(sessionStorage.getItem(\"total\"));\n\n //with the use of a for loop the cart items are appended to the checkout page\n for(items of loadCart) {\n\n var outterDiv = document.createElement(\"div\");\n var divCart = document.querySelector(\".checkOutCart\");\n\n outterDiv.innerHTML = items;\n divCart.appendChild(outterDiv);\n };\n\n //more variable declarations\n let eleForTotal= document.createElement(\"p\");\n eleForTotal.id = \"orderTotal\";\n //A proforma text is created and appended to the same div where the cart items were added.\n eleForTotal.innerHTML = `<br><br><h3>Proforma Invoice: </h3>\n \n Purchase order Total: R ${cartTotal}.00 (excluding VAT)<br><br>\n \n (Note: This amount is subject to change on account of delivery charges and/or applicable discounts.)`\n divCart.appendChild(eleForTotal);\n\n //remove buttons that now appear on the checkout page\n let removeBtns = document.getElementsByClassName(\"remove\");\n \n //using a for loop iterate each of the remove buttons\n for(press2 of removeBtns){\n //add an event listener\n press2.addEventListener(\"click\", (e)=>{\n \n //find the node that will be removed and the price to be deducted from the total\n //due to the buttons position, its next sibling would be our target\n var targetParent2 = e.target.nextSibling;\n var priceToChange2 = targetParent2.rows[1].cells[3].innerText;\n \n var confirmation3 = confirm(\"You are about to remove this item from your cart. Click ok to continue\");\n \n //once the user confirms\n if(confirmation3){\n //change the total and ...\n var oldotal2 = JSON.parse(sessionStorage.getItem(\"total\"));\n var newTotal2 = (parseInt(oldotal2) - parseInt(priceToChange2)).toFixed(2);\n //remove the node\n targetParent2.remove();\n //remove the button\n e.target.remove();\n\n //change the total accordingly and notify user\n alert(\"Current Cart Total: R \" + newTotal2);\n \n var newOrderTotal = document.getElementById(\"orderTotal\");\n\n newOrderTotal.innerHTML = `<br><br><h3>Proforma Invoice: </h3>\n \n Purchase order Total: R ${newTotal2}.00 (excluding VAT)<br><br>\n \n (Note: This amount is subject to change on account of delivery charges and/or applicable discounts.)`;\n\n divCart.appendChild(newOrderTotal);\n\n sessionStorage.setItem(\"total\", newTotal2);\n }\n });\n\n }\n\n //function to take user form input and create an invoice and order notifaction\n //create an event listener for the form submission\n //which will execute the function\n deliveryForm.addEventListener(\"submit\", function(e){\n //here, prevent default so that we can use the form data\n e.preventDefault();\n \n //variable declaration\n let invDiv = document.getElementById(\"invoiceDiv\");\n let invParts = document.createElement(\"p\");\n let refNum = Math.floor(Math.random()*10000) + 1;\n var prodTotal = JSON.parse(sessionStorage.getItem(\"total\"));\n var vatTotal = (prodTotal*0.15).toFixed(2);\n var coupons = new Map();\n coupons.set(\"TSC0021\", 0.02);\n coupons.set(\"TSC0022\", 0.03);\n coupons.set(\"TSC0023\", 0.04);\n coupons.set(\"TSC0024\", 0.05);\n coupons.set(\"TSC0025\", 0.10);\n var deliveryCost = new Map();\n deliveryCost.set(\"freight\", 250);\n //variable declaration using form elements\n var inputName = document.getElementById(\"deliveryDetails\").elements.namedItem(\"name\").value;\n var inputEmail = document.getElementById(\"deliveryDetails\").elements.namedItem(\"email\").value;\n var inputPhone = document.getElementById(\"deliveryDetails\").elements.namedItem(\"phoneNumber\").value;\n var inputAltPhone = document.getElementById(\"deliveryDetails\").elements.namedItem(\"alternativeNumber\").value;\n var inputAddress1 = document.getElementById(\"deliveryDetails\").elements.namedItem(\"address1\").value;\n var inputAddress2 = document.getElementById(\"deliveryDetails\").elements.namedItem(\"address2\").value;\n var inputAddress3 = document.getElementById(\"deliveryDetails\").elements.namedItem(\"address3\").value;\n var inputAddress4 = document.getElementById(\"deliveryDetails\").elements.namedItem(\"address4\").value;\n var compAddress = `${inputAddress1}, ${inputAddress2}, ${inputAddress3}, ${inputAddress4}`;\n \n var discountPerc = 0;\n var today = new Date();\n var date = today.getDate() + \"-\" + (today.getMonth() + 1) + \"-\" + today.getFullYear()\n \n //the if else statements below determine the correct value from the checked radio buttons\n if (document.getElementById(\"deliver\").checked) {\n deliveryMethod = document.getElementById(\"deliveryDetails\").elements.namedItem(\"deliverMethod\").value;\n //delivery charge from array\n deliveryCharge = deliveryCost.get(deliveryMethod);\n }\n else if(document.getElementById(\"collect\").checked){\n \n deliveryCharge = 0;\n }\n\n if (document.getElementById(\"account\").checked) {\n paymentMethod = document.getElementById(\"deliveryDetails\").elements.namedItem(\"account\").value;\n }\n else if(document.getElementById(\"cash\").checked) {\n paymentMethod = document.getElementById(\"deliveryDetails\").elements.namedItem(\"cash\").value;\n }\n else if(document.getElementById(\"creditCard\").checked){\n paymentMethod = document.getElementById(\"deliveryDetails\").elements.namedItem(\"creditCard\").value;\n }\n\n\n if(document.getElementById(\"couponYes\").checked) {\n couponVal = document.getElementById(\"couponYes\").value;\n var couponRef = document.getElementById(\"deliveryDetails\").elements.namedItem(\"couponCode\").value;\n //discount percentage from coupons array\n discountPerc = coupons.get(couponRef);\n //calculate actual discount amount\n discountAmt = (prodTotal*discountPerc).toFixed(2);\n }\n else if(document.getElementById(\"couponNo\").checked){\n couponVal = document.getElementById(\"deliveryDetails\").elements.namedItem(\"couponNo\").value;\n discountAmt = (prodTotal*discountPerc).toFixed(2);\n }\n //calculate final total\n var finalTotal = (prodTotal + deliveryCharge + parseFloat(vatTotal) - discountAmt).toFixed(2)\n \n //create an alert for user with all info\n alert(`\n Reference: TS${refNum}\n Client: ${inputName}\n Date: ${date}\n Email: ${inputEmail}\n Phone: ${inputPhone}\n Alt Phone: ${inputAltPhone}\n Adrress: ${compAddress}\n\n Product Total (PT): R ${prodTotal}.00\n Delivery Charge (DC): R ${deliveryCharge}.00 \n Discount: R ${discountAmt}\n VAT (15%): R ${vatTotal}\n Order Total: R ${finalTotal}\n `);\n\n \n //append all order info to invoice on checkout page\n invParts.innerHTML = `\n <span class=\"amt\">Ref: ${refNum}</span><br>\n <span class=\"amt\">Date: ${date}</span><br><br>\n ${inputName}<br>\n ${inputEmail}<br>\n ${inputPhone}<br>\n ${compAddress} <br>\n <hr class=\"invHr\"><br>\n Product Total <span class=\"amt\">R ${prodTotal}.00 </span><br>\n Delivery Charge <span class=\"amt\">R ${deliveryCharge}.00 </span><br>\n Discount <span class=\"amt\">R ${discountAmt}</span><br>\n VAT (15%) <span class=\"amt\">R ${vatTotal}</span><br>\n <hr class=\"invHr\"><br>\n Order Total <span class=\"amt\">R ${finalTotal}</span><br>\n <hr class=\"invHr\"><br>`;\n \n invDiv.appendChild(invParts);\n\n //slide populated invoice div down after submission\n $(\"#invoiceDiv\").slideDown(1000); \n });\n}", "function upDateTotalPrice() {\n let cartItems = document.getElementsByClassName(\"cart-items\");\n for (let i = 0; i < cartItems.length + 1; i++) {\n const cartItem = cartItems[i];\n if (cartItems.length > 0) {\n const elementPrice = cartItem.getElementsByClassName(\"element-price\")[i].innerHTML;\n const elementPriceInt = parseFloat(elementPrice);\n\n\n\n\n let totalPrices = document.getElementsByClassName(\"Total-prices\")\n for (let j = 0; j < totalPrices.length; j++) {\n const totalPrice = totalPrices[j]\n totalPrice.innerHTML = \"$\" + elementPriceInt\n }\n }\n else {\n let totalPrices = document.getElementsByClassName(\"Total-prices\")\n for (let j = 0; j < totalPrices.length; j++) {\n const totalPrice = totalPrices[j]\n totalPrice.innerHTML = \"$\" + 0\n alert(\"Are you went to remove all product\")\n }\n\n }\n\n\n }\n}", "static removeProduct(prodID) {\n let storageProducts = CartManager.getItem(CartManager.key);\n let products = storageProducts.filter(p => p.productID !== prodID);\n CartManager.setItem(products);\n }", "function removeCartItem(event) {\n var buttonClicked = event.target;\n buttonClicked.parentElement.parentElement.remove();\n updateCartTotal();\n}" ]
[ "0.71327853", "0.7098311", "0.7069868", "0.704039", "0.7012164", "0.6976155", "0.6964491", "0.6923108", "0.6920773", "0.69204795", "0.69193035", "0.6881149", "0.6878736", "0.6872928", "0.68678886", "0.67989063", "0.6798291", "0.6794826", "0.67944556", "0.6758043", "0.6750638", "0.67406833", "0.6740421", "0.6725764", "0.6713696", "0.6708616", "0.67019767", "0.67019767", "0.67019767", "0.66996825", "0.6685678", "0.66801643", "0.66739964", "0.6643427", "0.662642", "0.6621798", "0.6617137", "0.66157615", "0.66074324", "0.6591923", "0.65875834", "0.65874946", "0.65747494", "0.653571", "0.6533328", "0.6530091", "0.6528815", "0.6525591", "0.6523313", "0.65137213", "0.6508681", "0.6504946", "0.6500603", "0.6497729", "0.64860874", "0.6482598", "0.64795905", "0.64713573", "0.6470386", "0.64562875", "0.6455078", "0.6451201", "0.6450486", "0.64470416", "0.6440135", "0.64372987", "0.6434557", "0.6431712", "0.641653", "0.639454", "0.6394205", "0.63858646", "0.6380044", "0.63798696", "0.6366985", "0.63648975", "0.6364181", "0.63544345", "0.6349925", "0.6348141", "0.6347745", "0.6345317", "0.63448834", "0.63445413", "0.634421", "0.6343654", "0.6337258", "0.63335073", "0.6326269", "0.6315969", "0.63127476", "0.63099736", "0.6302184", "0.629962", "0.6295265", "0.62930447", "0.6283557", "0.6283105", "0.62815994", "0.6279296", "0.6274403" ]
0.0
-1
we have an empty object
function emptyCart(user) { return Object.assign({}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Object$empty() {\n return {};\n }", "function Object$empty() {\n return {};\n }", "function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }", "function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }", "function makeEmptyObject() {\n return new Object();\n}", "function Object$zero() {\n return {};\n }", "function Object$zero() {\n return {};\n }", "isEmpty(obj) {\n return Object.keys(obj).length === 0;\n }", "isEmpty(obj) {\n return Object.keys(obj).length === 0;\n }", "function isEmptyObject(obj) {\n return !Object.keys(obj).length;\n }", "function empty() {\n\treturn Object.create(null);\n}", "function isEmpty(obj) {\n return !obj || Object.keys(obj).length === 0;\n }", "isEmpty(obj){\n return !Object.keys(obj).length;\n }", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function empty() {\n }", "function checkEmptyObject(obj) {\n return Object.keys(obj).length <= 0;\n }", "function isEmptyObject(obj) {\n let ret = new Object();\n ret.isValid = true;\n ret.message = '';\n ret.phoneNumbers = [];\n if (!Object.keys(obj).length)\n { \n ret.isValid = false;\n ret.message = 'empty body';\n }\n return ret;\n}", "function _isEmptyObject(obj) {\n var name;\n\n for (name in obj) {\n return false;\n }\n return true;\n }", "function _isEmptyObject(obj) {\n var name;\n\n for (name in obj) {\n return false;\n }\n return true;\n }", "function empty () {}", "function empty () {}", "function empty () {}", "isObjEmpty(obj){\n for (var i in obj) if (obj.hasOwnProperty(i)) return false;\n return true;\n }", "function isObjEmpty(obj) {\n for (let prop in obj) {\n if (obj.hasOwnProperty(prop))\n return false;\n }\n return true;\n }", "function isEmpty(obj) {\n return Object.keys(obj).length === 0 && obj.constructor === Object\n}", "function _isEmptyObject(v) {\n return _isObject(v) && Object.keys(v).length === 0;\n}", "function _isEmptyObject(v) {\n return _isObject(v) && Object.keys(v).length === 0;\n}", "function _isEmptyObject(v) {\n return _isObject(v) && Object.keys(v).length === 0;\n}", "function _isEmptyObject(v) {\n return _isObject(v) && Object.keys(v).length === 0;\n}", "function _isEmptyObject(v) {\n return _isObject(v) && Object.keys(v).length === 0;\n}", "function isEmpty(obj) {\n return Object.keys(obj).length === 0 && obj.constructor === Object;\n}", "empty() {\n return assay.make(strategy.empty());\n }", "function cd_isBlankStructure(objName, selection) {\n if(cd_getSpecificObject(objName).Objects == undefined){\n return true;\n }\n\treturn (cd_getSpecificObject(objName).Objects.Count == 0);\n}", "function isEmptyObject(obj) {\n\t\t\t\t/*jshint forin: false */\n\t\t\t\tfor (var name in obj) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "function isEmptyObject(obj) {\n\t\t\t\t/*jshint forin: false */\n\t\t\t\tfor (var name in obj) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "function isEmptyObject(obj) {\n\t\t\t\t/*jshint forin: false */\n\t\t\t\tfor (var name in obj) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "empty() {\n\t}", "function isEmpty(obj) {\r\n return !Object.keys(obj).length;\r\n}", "static get EMPTY()\n\t{\n\t\treturn 0;\n\t}", "function makeNewEmpty(object) {\n\treturn (Object.prototype.toString.call(object) === '[object Array]')? [] : {};\n}", "function isEmptyDataObject(obj) {\n var name;\n for (name in obj) {\n\n // if the public data object is empty, the private is still empty\n if (name === \"data\" && jQuery.isEmptyObject(obj[name])) {\n continue;\n }\n if (name !== \"toJSON\") {\n return false;\n }\n }\n\n return true;\n }", "function empty(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]' ? [] : {};\n}", "function isEmpty(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key))\n return false;\n }\n return true;\n }", "function isEmpty(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key))\n return false;\n }\n return true;\n }", "empty(){\r\n return this.size == 0;\r\n }", "function isEmpty(obj){\r\n \r\n if(typeof obj === 'undefined'){\r\n return true;\r\n } \r\n\r\n return Object.keys(obj).length === 0;\r\n}", "empty() {}", "function nonEmptyObject (data) {\n return object(data) && Object.keys(data).length > 0;\n }", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function isEmptyObject(obj) {\r\n return !Object.keys(obj).length;\r\n}", "function isEmpty(obj) { \n\t for (var x in obj) { return false; }\n\t return true;\n\t }", "function isEmptyDataObject( obj ) {\n var name;\n for ( name in obj ) {\n \n // if the public data object is empty, the private is still empty\n if ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n continue;\n }\n if ( name !== \"toJSON\" ) {\n return false;\n }\n }\n \n return true;\n }", "function isEmptyObject(obj) {\n\t\t\t\tfor (var prop in obj) {\n\t\t\t\t\tif(obj.hasOwnProperty(prop)) return false; \n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "function isEmptyObject(obj) {\n return Object.keys(obj).length === 0;\n}", "function isEmpty(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key))\n return false;\n }\n return true;\n }", "function isEmptyObject(obj) {\n /*jshint forin: false */\n for (var name in obj) {\n return false;\n }\n return true;\n }", "function isEmptyObject(obj) {\n return !Object.keys(obj).length;\n}", "function isEmptyObject(obj) {\n return !Object.keys(obj).length;\n}" ]
[ "0.7978587", "0.7978587", "0.75720143", "0.7550998", "0.7261981", "0.7145195", "0.7145195", "0.7108276", "0.7108276", "0.7092023", "0.70807767", "0.70325994", "0.6980002", "0.69753695", "0.69753695", "0.69753695", "0.69753695", "0.69753695", "0.6949144", "0.6892917", "0.68424606", "0.6762588", "0.6762588", "0.6731776", "0.6731776", "0.6731776", "0.6729967", "0.6720366", "0.6715513", "0.6684731", "0.6684731", "0.6684731", "0.6684731", "0.6684731", "0.6671779", "0.66698587", "0.66611385", "0.66594756", "0.66594756", "0.66594756", "0.6637959", "0.66369647", "0.66331965", "0.663176", "0.66283065", "0.6627313", "0.6618746", "0.6618746", "0.6613919", "0.66092527", "0.65971166", "0.65897506", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.6588895", "0.65864104", "0.65788823", "0.655917", "0.65531695", "0.655146", "0.6551034", "0.6550924", "0.65427816", "0.65427816" ]
0.0
-1
that we attach the user to
function emptyCart(user) { return Object.assign({}, user) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachNewUserToIncident() {\n attachNewUser = true;\n $(\"#user_add_username\").val($(\"#user_name\").val());\n openAddUser();\n }", "async postSave () {\n\t\t// save an invite code as a signup token for this user\n\t\tawait this.saveSignupToken();\n\n\t\t// grant the user access to their own me-channel, strictly for testing purposes\n\t\t// (since they are not confirmed yet)\n\t\tawait this.grantMeChannel();\n\t}", "function attachUser () {\n return function (req, res, next) {\n if (req.session) {\n if (req.session.idToken) {\n // We have an id_token, let's check if it's still valid\n const decoded = jwt.decode(req.session.idToken)\n if (assertAlive(decoded)) {\n req.session.user_id = decoded.sub\n req.session.user = decoded.preferred_username\n req.session.user_picture = decoded.picture\n return next()\n } else {\n // no longer alive, let's flush the session\n req.session.destroy(function (err) {\n if (err) next(err)\n return next()\n })\n }\n }\n }\n next()\n }\n}", "attachToUser(user) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_iam_IUser(user);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.attachToUser);\n }\n throw error;\n }\n if (this.users.find(u => u === user)) {\n return;\n }\n this.users.push(user);\n }", "addUser() {\r\n // Create a new user with the given email and password.\r\n firebase.auth().createUserWithEmailAndPassword(this.state.email,this.state.password)\r\n .then(() => {\r\n var username = firebase.auth().currentUser.uid;\r\n // Set the user status to active.\r\n firebase.database().ref(\"/users/\"+username+\"/settings/active\").set({\r\n value: true\r\n });\r\n // Initialize a date that will allow the user to start a new conversation.\r\n firebase.database().ref(\"/users/\"+username+\"/settings/latestConvo\").set({\r\n timestamp: \"6/20/2018, 00:00:00 AM\"\r\n });\r\n firebase.database().ref(\"/users/\"+username+\"/settings/gender\").set(\"other\")\r\n firebase.database().ref(\"/users/\"+username+\"/settings/blocked\").set(\"false\")\r\n firebase.database().ref(\"/activeUsers/\"+username).set({\r\n username: username\r\n })\r\n // Navigate to the main menu with firstLogin as true, meaning that the intro page will display.\r\n this.props.navigation.navigate('Tabs', {firstLogin: true})})\r\n .catch(error => this.setState({errorMessage: error.message}));\r\n }", "updateUserDetails() {\n if (!activeUser()) return;\n $(conversations_area).find(`[data-user-id=\"${activeUser().id}\"] .sb-name,.sb-top > a`).html(activeUser().get('full_name'));\n $(conversations_area).find('.sb-user-details .sb-profile').setProfile();\n SBProfile.populate(activeUser(), $(conversations_area).find('.sb-profile-list'));\n }", "function setUser(u) {\n user = u\n}", "function addUserToCustomerIO(){\n if (hasSignedUp()) return;\n\n var email = $(\"#cio-email\").val();\n var firstName = $(\"#cio-firstname\").val();\n var source = $(\"#cio-source\").val();\n var id = email.replace('@', '_');\n id = id.replace('.', '_');\n\n _cio.identify({\n // Required Items\n id: id,\n email: email,\n created_at: Math.round( new Date().getTime()/1000), // seconds since the epoch\n\n // Optional (these are examples. You can name attributes what you wish)\n type: 'lead',\n first_name: firstName,\n source: 'leads',\n referrer: document.referrer\n });\n\n setSignedUp();\n }", "function addUser() {\n }", "function registerUser() {\n addUser()\n }", "addUserToRoom() {\n const { newUser, currentUser, currentRoom } = this;\n currentUser.addUserToRoom({\n userId: CHATKIT_USER_NAME,\n roomId: this.props.items.name\n })\n .then((currentRoom) => {\n this.roomUsers = currentRoom.users;\n })\n .catch(err => {\n console.log(`Error adding user: ${err}`);\n });\n\n this.newUser = '';\n }", "function create_user(userobject){\n\n}", "function user()\n {\n\n }", "function setAppboyUser() {\n // get email and create user ids and such\n var emailAddress = document.getElementById('email-address').value\n var hashedAddress = emailAddress.hashCode()\n var abUser = appboy.getUser().getUserId()\n\n appboy.changeUser(hashedAddress)\n appboy.getUser().setEmail(emailAddress)\n\n // set user attributes in profile\n var firstName = document.getElementById('first-name').value\n var lastName = document.getElementById('last-name').value\n var phoneNumber = document.getElementById('phone-number').value\n\n if (firstName) appboy.getUser().setFirstName(firstName);\n if (lastName) appboy.getUser().setLastName(lastName);\n if (phoneNumber) appboy.getUser().setPhoneNumber(phoneNumber);\n\n // change id button to Identified!\n document.getElementById('login-button').value = \"Identified!\"\n}", "signUp (userName, password, referralParam) {\n if (!this.waitlistRank[userName]) {\n this.joinWaitlistRank(userName) = new User(username, password)\n if (referralParam) addRankScore(referralParam)\n }\n }", "function addUser(){\n\t\tuserFactory.getFBCurrentUser()\n\t\t.then( (user) => {\n\t\t\tconsole.log(\"****user in addUser****\", user);\n\t\t\t// console.log(\"userFactory.userIsInFirebase(user.uid) in addUser\", userFactory.userIsInFirebase(user.uid));\n\t\t\tuserFactory.userIsInFirebase(user.uid)\n\t\t\t.then((isInFirebase) => {\n\t\t\t\tconsole.log(\"isInFirebase inside nested .then in addUser\", isInFirebase);\n\t\t\t\tconsole.log(\"user in nested .then in addUser\", user);\n\t\t\t\tconsole.log(\"user.email in nested .then in addUser\", user.email);\n\t\t\t\tconsole.log(\"user.displayName\", user.displayName);\n\t\t\t\tif(isInFirebase === false) {\n\t\t\t\t\tif($scope.displayName === \"\"){\n\t\t\t\t\t\tlet userObj = {\n\t\t\t\t\t\t\tdisplayName: user.displayName,\n\t \tuid: user.uid,\n\t \tphotoURL: user.photoURL\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconsole.log(\"userObj in addUser\", userObj);\n\t\t\t\t\t\tuserFactory.addUserToFirebase(userObj);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlet userObj = {\n\t\t\t\t\t\t\tdisplayName: $scope.displayName,\n\t \tuid: user.uid,\n\t \tphotoURL: user.photoURL\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconsole.log(\"userObj in addUser\", userObj);\n\t\t\t\t\t\tuserFactory.addUserToFirebase(userObj);\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tconsole.log(\"user already in firebase\");\n\t\t\t\t}\n\t\t\t\t//show home view\n\t\t\t\t$window.location.href = \"#!/home\";\n\t\t\t});\n\t\t\t\n\t\t\t\t// userFactory.addUserToFirebase(user);\n\n\t\t\t\n\n\t\t});\n\n\t}", "function addStateToUserObject () {\n\t\tme.subscribe(\"ready\", \"User self-subscription\", function(){\n\t\t\tuser.signedin = signedin;\n\t\t}).runAsap(function(){\n\t\t\tuser.signedin = signedin;\n\t\t});\n\t}", "function addRoomUser(info) {\n\tvar dude = new PalaceUser(info);\n\tif (theRoom.lastUserLogOnID == dude.id && ticks()-theRoom.lastUserLogOnTime < 900) { // if under 15 seconds\n\t\ttheRoom.lastUserLogOnID = 0;\n\t\ttheRoom.lastUserLogOnTime = 0;\n\t\tif (!getGeneralPref('disableSounds')) systemAudio.signon.play();\n\t}\n\tif (theUserID == dude.id) {\n\t\ttheUser = dude;\n\t\tfullyLoggedOn();\n\t}\n\n\ttheRoom.users.push(dude);\n\tloadProps(dude.props);\n\tdude.animator();\n\tdude.grow(10);\n\tPalaceUser.setUserCount();\n}", "_registerUser(id){\n\t\tthis.idUser = id;\n\t}", "initTalkUser() {\n if (!this.talkUser) {\n if (this.authStore.isLoggedIn) {\n const profile = this.authStore.profile;\n\n this.talkUser = new global.window.Talk.User(_.defaults({\n id: profile.dorbel_user_id,\n name: getUserNickname(profile),\n email: profile.email,\n photoUrl: profile.picture\n }, TALKJS_USER_OBJ_EXTRA));\n } else {\n return false;\n }\n }\n\n return true;\n }", "function user(){\r\n uProfile(req, res);\r\n }", "edit({ email, name, password, image }) {\n let details = { email, name, password, image };\n for (const key in details)\n if (details[key]) {\n currentUser[key] = details[key];\n }\n callFuture(updateUserListeners);\n }", "function addUser() {\n var user = {\n primaryEmail: 'liz@example.com',\n name: {\n givenName: 'Elizabeth',\n familyName: 'Smith'\n },\n // Generate a random password string.\n password: Math.random().toString(36)\n };\n user = AdminDirectory.Users.insert(user);\n Logger.log('User %s created with ID %s.', user.primaryEmail, user.id);\n}", "function attachProfileListener(store){\n const profileRef = firebaseApp.database().ref().child('users').child(currentUser().uid)\n\n profileRef.on('value', (snapshot) => {\n store.dispatch( updateProfileSuccess( snapshot.val() ) )\n })\n}", "addUser(user,callback){\n baseRef.createUser({\n email:user.email,\n password:user.password\n },function(error,userData){\n baseRef.post(userData.uid,{\n data:{name:user.name}\n })\n callback(error,userData);\n })\n }", "async postSave () {\n\t\tawait super.postSave();\n\t\tawait this.updateUser();\t// update the current user to indicate they are a member of the team\n\t\tawait this.grantUserMessagingPermissions();\t\t// grant permission to the team creator to subscribe to the team broadcaster channel\n\t\t//await this.sendTeamCreatedEmail();\t// send email to us that a new team has been created\n\t}", "function appendUser() {\n return compose()\n // Attach user to request\n .use(function(req, res, next) {\n validateJwt(req, res, function(val) {\n if(_.isUndefined(val)) {\n\t\t\t\t\t\n\t\t\t User.find({\n\t\t\t where: {\n\t\t\t _id: req.user._id\n\t\t\t },\n\t\t\t \t\tinclude: [{\n\t\t\t \t\t\tmodel: Role}]\n\t\t\t })\n\t\t\t .then(function(user) {\n\t\t\t if (!user) {\n req.user = undefined;\n return next();\n\t\t\t } else {\n\t\t\t req.user = user;\n\t\t\t next();\n\t\t\t\t }\n\t\t\t })\n\t\t\t .catch(function(err) {\n\t\t\t\t\t\tconsole.log(\"ERROR \"+err)\n\t\t\t return next(err);\n\t\t\t });\n\t\t\t\t\t\n\t\t\t\n } else {\n req.user = undefined;\n next();\n }\n });\n });\n}", "function createAnonymousUserAndSave() {\n // Retrieve the stored User from Local Device Storage\n var userId = window.localStorage.getItem('deviceUser');\n if (userId === null) {\n app.appUser().create({\n anonymous: true\n }).then(function (anonymousUser) {\n console.log('Created anonymous user: ', anonymousUser);\n $('#results').append('<h2>User</h2>' + JSON.stringify(anonymousUser, null, 2));\n if (window.localStorage) {\n localStorage.deviceUser = anonymousUser.id;\n localStorage.deviceApiKey = anonymousUser.apiKey;\n }\n });\n }\n else {\n var anonymousUser = new EVT.User({\n id: localStorage.deviceUser,\n apiKey: localStorage.deviceApiKey\n }, app);\n console.log('Anonymous User read from Local Storage : ' + JSON.stringify(anonymousUser));\n $('#results').append('<h2>User</h2>' + JSON.stringify(anonymousUser, null, 2));\n }\n}", "function setUser() {\n\tuser = firebase.auth().currentUser;\n\tisSignedIn = true;\n\tcheckIfIt();\n\tcheckIt();\n\tconnectUser();\n\tdisplayScreen();\n}", "function createUser(userData) {\n\t\tuserAuth.register(userData, function(err) {\n\t\t\tif(err){ \n\t\t\t\t$rootScope.flashMessage = {data: \"Something went wrong please try again\", type: \"error\"}\n\t\t\t}else{\n\t\t\t\tif($rootScope.currentUser.role == \"Author\"){\n\t\t\t\t\t$location.path('/info');\n\t\t\t\t\t$rootScope.flashMessage = {data: \"Kindly fill your profile details\", type: \"success\"}\n\t\t\t\t\tvm.showForm = true;\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t$location.path('/');\n\t\t\t\t$rootScope.flashMessage = {data: \"Successfully Logged In\", type: \"success\"}\n\t\t\t}\n\t\t});\n\t}", "function storeUserCallback (err) {\n if (err) {console.log(\"account already in database, moving on\");}\n else {console.log(\"inserted user into db\");}\n //I set googleid as primary key so uniqueness is forced.\n }", "async createAddedUsers () {\n\t\t// trickiness ... we need to include the codemark or review or code error ID in the invited user objects, but we\n\t\t// don't know them yet, and we need to create the users first to make them followers ... so here we\n\t\t// lock down the IDs we will use later in creating the codemark or review\n\t\tif (this.attributes.codemark) {\n\t\t\tthis.codemarkId = this.request.data.codemarks.createId();\n\t\t\tthis.inviteTrigger = `C${this.codemarkId}`;\n\t\t}\n\t\tif (this.attributes.review) {\n\t\t\tthis.reviewId = this.request.data.reviews.createId();\n\t\t\tthis.inviteTrigger = `R${this.reviewId}`;\n\t\t}\n\t\tif (this.attributes.codeError) {\n\t\t\tthis.codeErrorId = this.request.data.codeErrors.createId();\n\t\t\tthis.inviteTrigger = `E${this.codeErrorId}`;\n\t\t}\n\n\t\t// filter to users that have a valid email\n\t\tthis.addedUsers = (this.addedUsers || []).filter(email => {\n\t\t\treturn typeof EmailUtilities.parseEmail(email) === 'object';\n\t\t});\n\t\tif (!this.addedUsers || this.addedUsers.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// adding users is not allowed when creating a code error\n\t\tif (this.creatingCodeError || !this.stream) {\n\t\t\tthrow this.errorHandler.error('validation', { reason: 'cannot add users when creating a code error' });\n\t\t} else if (!this.stream.get('isTeamStream')) {\n\t\t\tthrow this.errorHandler.error('validation', { reason: 'cannot add users to a stream that is not a team stream' });\n\t\t}\n\n\t\tthis.request.log('NOTE: Inviting user under one-user-per-org paradigm');\n\t\tthis.userInviter = new UserInviter({\n\t\t\trequest: this.request,\n\t\t\tteam: this.team,\n\t\t\tinviteCodeExpiresIn: this._inviteCodeExpiresIn,\n\t\t\tdelayEmail: this._delayEmail,\n\t\t\tinviteInfo: this.inviteInfo,\n\t\t\tuser: this.user,\n\t\t\tdontSendInviteEmail: true, // we don't send invite emails when users are invited this way, they get extra copy in their notification email instead\n\t\t\tdontPublishToInviter: true // we don't need to publish messages to the inviter, they will be published as the creator of the post instead\n\t\t});\n\n\t\tconst userData = this.addedUsers.map(email => {\n\t\t\treturn { \n\t\t\t\temail,\n\t\t\t\tinviteTrigger: this.inviteTrigger\n\t\t\t};\n\t\t});\n\t\tthis.transforms.invitedUsers = await this.userInviter.inviteUsers(userData);\n\t}", "function addButton() {\n firebase.auth().onAuthStateChanged(function(user) {\n if (user) { \n var usernam = user.email.substr(0,user.email.indexOf(\".\"));\n firebase.database().ref(\"Users\").child(usernam).push( {\n \"AMPM\": ap.value, \n \"Classroom\": classroom.value, \n \"Name\": build.value,\n \"Time\": time.value\n });\n refresh();\n } else {\n window.location.href = \"index.html\";\n }\n });\n }", "function setUser(){\n var user = JSON.parse(urlBase64Decode(getToken().split('.')[1]));\n o.status.username = user.username;\n o.status._id = user._id;\n console.log(o.status);\n }", "function joined(e) {\n userId = e.id;\n $('#controls').show();\n startPrompts();\n}", "async attachToCompany () {\n\t\t// get the company\n\t\tthis.company = await this.data.companies.getById(this.attributes.companyId);\n\t\tif (!this.company || this.company.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'company' });\n\t\t} \n\n\t\t// can only attach to a company that was created by the same user creating the team\n\t\tif (!(this.user.get('companyIds') || []).includes(this.company.id)) {\n\t\t\tthrow this.errorHandler.error('updateAuth', { reason: 'user can only attach a team to a company they are a member of' });\n\t\t}\n\n\t\tconst op = {\n\t\t\t$addToSet: {\n\t\t\t\tteamIds: this.attributes.id\n\t\t\t},\n\t\t\t$set: {\n\t\t\t\tmodifiedAt: Date.now()\n\t\t\t}\n\t\t};\n\t\tthis.transforms.companyUpdate = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.data.companies,\n\t\t\tid: this.company.id\n\t\t}).save(op);\n\t}", "function init() {\n \n newUser()\n\n}", "function attachUserClaims(done) {\n\n for (var userAttribute in this.req.userDetails) {\n if (this.req.userDetails.hasOwnProperty(userAttribute)) {\n var userClaim = {};\n var idToken = jwt.decode(this.req.oauth.bearerToken.idToken, this.req.oauth.client.clientSecret);\n\n userClaim.issuer = idToken.iss;\n userClaim.name = userAttribute.name;\n userClaim.value = userAttribute.value;\n\n this.req.ticket.permission.claimsSupplied.push(userClaim);\n }\n }\n\n done();\n\n}", "function storeTo() {\n \n //console.log(toUser);\n}", "function createUser() {}", "addUser(addr, Intro_json, callback) {\n\t\tftContract.deployed().then((instance) => {\n\t\t\tthis.saveHash(Intro_json, hash => {\n\t\t\t\tinstance.createCharacter.call(hash, {from: addr})\n\t\t\t\t.then((id) => {\n\t\t\t\t\tconsole.log(\"add newUser successfully,addr = \", addr);\n\t\t\t\t\tcallback(id);\n\t\t\t\t\t//console.log(\"add newUser successfully,addr = \", addr, \", Info = \", result)\n\t\t\t\t});\n\t\t\t});\n\t\t\t//return get_user(addr) //return json\n\t\t});\n\t}", "function appendUser(user) {\n var username = user.username;\n /*\n * A new feature to Pepper, which is a permission value,\n * may be 1-5 afaik.\n *\n * 1: normal (or 0)\n * 2: bouncer\n * 3: manager\n * 4/5: (co-)host\n */\n var permission = user.permission;\n\n /*\n * If they're an admin, set them as a fake permission,\n * makes it easier.\n */\n if (user.admin) {\n permission = 99;\n }\n\n /*\n * For special users, we put a picture of their rank\n * (the star) before their name, and colour it based\n * on their vote.\n */\n var imagePrefix;\n switch (permission) {\n case 0:\n imagePrefix = 'normal';\n break;\n // Normal user\n case 1:\n // Featured DJ\n imagePrefix = 'featured';\n break;\n case 2:\n // Bouncer\n imagePrefix = 'bouncer';\n break;\n case 3:\n // Manager\n imagePrefix = 'manager';\n break;\n case 4:\n case 5:\n // Co-host\n imagePrefix = 'host';\n break;\n case 99:\n // Admin\n imagePrefix = 'admin';\n break;\n }\n\n /*\n * If they're the current DJ, override their rank\n * and show a different colour, a shade of blue,\n * to denote that they're playing right now (since\n * they can't vote their own song.)\n */\n if (API.getDJs()[0].username == username) {\n if (imagePrefix === 'normal') {\n drawUserlistItem('void', '#42A5DC', username);\n } else {\n drawUserlistItem(imagePrefix + '_current.png', '#42A5DC', username);\n }\n } else if (imagePrefix === 'normal') {\n /*\n * If they're a normal user, they have no special icon.\n */\n drawUserlistItem('void', colorByVote(user.vote), username);\n } else {\n /*\n * Otherwise, they're ranked and they aren't playing,\n * so draw the image next to them.\n */\n drawUserlistItem(imagePrefix + imagePrefixByVote(user.vote), colorByVote(user.vote), username);\n }\n}", "_define_user() {\n if ( GenericStore.defaultUserId ) {\n this.definedProps[ 'uid' ] = GenericStore.defaultUserId;\n }\n }", "setupUserInDatabase(){\n let user = firebase.auth().currentUser\n let databseVersionRef = firebase.database().ref('users/'+user.uid+'/version')\n databseVersionRef.once('value')\n .then((databseVersion)=>{\n if(!databseVersion.val() || databseVersion.val() < newestVersion){\n this.addDefaultNewUserData(newestVersion, user)\n }else{\n this.showMainScreen()\n }\n })\n\n //user.displayName this stores the users name\n /*firebase.database().ref('users/'+this.user.uid+'/testInsert')\n .set('test')\n .then(\n this.showMainScreen()\n )*/\n }", "add(userObject, response) {\n //password encryption\n userObject.password = encryptOperations.encryptPassword(\n userObject.password\n );\n UserModel.create(userObject, (err) => {\n if (err) {\n console.log(\"Error in Record Add\");\n response.status(appCodes.SERVER_ERROR).json({\n status: appCodes.ERROR,\n message: \"Record Not Added Due to Error\"\n });\n } else {\n console.log(\"Record Added..\");\n sendMail(userObject.userid, \"register\");\n\n response\n .status(appCodes.OK)\n .json({ status: appCodes.SUCCESS, message: \"Record Added\" });\n }\n });\n }", "function write_user(options, completed, failed) {\n db.users.erase_db(function(removed_data){\n db.users.add(options, function(added_data){\n // console.log(added_data);\n completed(added_data);\n });\n });\n}", "function addUserToShapeOfUser(joiner, captain) {\n if(!captain.shape)\n newShapeForUser(captain);\n\n if(joiner.shape != captain.shape) {\n if(joiner.shape)\n removeUserFromShape(joiner);\n\n captain.shape.addUser(joiner);\n }\n}", "function addToRegisteredUsers( obj ) {\n\t// alter this function if mongoDB is used later\n\tconsole.log(\"pushing the new user to the storage\");\n\tregisteredUsers.push(obj);\n\t//obj = {};\n}", "createUser(userId) {\n if (this.hasUser(userId)) {\n console.warn(`User:${ userId } already exist`);\n return;\n }\n this.data[userId] = { reminders:[] };\n }", "set_user(on) { store.dispatch(hpUser(on)); }", "function upsertUser(userData) {\n $.post(\"/api/user/create\", userData)\n .then(function(){\n localStorage.setItem(\"currentUser\", JSON.stringify(userData));\n localStorage.setItem(\"loggedIn\", true);\n window.location = \"/\"\n });\n }", "_updateUser() {\n\t\tconst user = UserStore.activeUser();\n\t\tconst authInfo = UserStore.activeAuthInfo();\n\t\tconst emails = user && user.UID ? UserStore.emails.get(user.UID) : null;\n\t\tconst primaryEmail = emails && !emails.Error ? emails.filter(e => e.Primary).map(e => e.Email)[0] : null;\n\n\t\tif (this._authInfo !== authInfo) {\n\t\t\tif (this._authInfo && this._authInfo.UID && (!authInfo || this._authInfo.UID !== authInfo.UID)) {\n\t\t\t\t// The user logged out or another user logged in on the same browser.\n\n\t\t\t\t// Distinguish between 2 users who log in from the same browser; see\n\t\t\t\t// https://github.com/amplitude/Amplitude-Javascript#logging-out-and-anonymous-users.\n\t\t\t\tif (this._amplitude) this._amplitude.regenerateDeviceId();\n\n\t\t\t\t// Prevent the next user who logs in (e.g., on a public terminal) from\n\t\t\t\t// seeing the previous user's Intercom messages.\n\t\t\t\tif (this._intercom) this._intercom(\"shutdown\");\n\n\t\t\t\tif (this._fullStory) this._fullStory.clearUserCookie();\n\t\t\t}\n\n\t\t\tif (authInfo) {\n\t\t\t\tif (this._amplitude && authInfo.Login) this._amplitude.setUserId(authInfo.Login || null);\n\t\t\t\tif (window.ga && authInfo.Login) window.ga(\"set\", \"userId\", authInfo.Login);\n\n\t\t\t\tif (this._telligent && authInfo.Login) this._telligent(\"setUserId\", authInfo.Login);\n\n\t\t\t\tif (authInfo.UID) this.setIntercomProperty(\"user_id\", authInfo.UID.toString());\n\t\t\t\tif (authInfo.IntercomHash) this.setIntercomProperty(\"user_hash\", authInfo.IntercomHash);\n\t\t\t\tif (this._fullStory && authInfo.Login) {\n\t\t\t\t\tthis._fullStory.identify(authInfo.Login);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._intercom) this._intercom(\"boot\", this._intercomSettings);\n\t\t}\n\t\tif (this._user !== user && user) {\n\t\t\tif (user.Name) this.setIntercomProperty(\"name\", user.Name);\n\t\t\tif (this._fullStory) this._fullStory.setUserVars({displayName: user.Name});\n\t\t\tif (user.RegisteredAt) {\n\t\t\t\tthis.setUserProperty(\"registered_at\", new Date(user.RegisteredAt).toDateString());\n\t\t\t\tthis.setIntercomProperty(\"created_at\", new Date(user.RegisteredAt).getTime() / 1000);\n\t\t\t}\n\t\t}\n\t\tif (this._primaryEmail !== primaryEmail) {\n\t\t\tif (primaryEmail) {\n\t\t\t\tthis.setUserProperty(\"email\", primaryEmail);\n\t\t\t\tthis.setIntercomProperty(\"email\", primaryEmail);\n\t\t\t\tif (this._fullStory) this._fullStory.setUserVars({email: primaryEmail});\n\t\t\t}\n\t\t}\n\n\t\tthis._user = user;\n\t\tthis._authInfo = authInfo;\n\t\tthis._primaryEmail = primaryEmail;\n\t}", "async createUsers () {\n\t\tthis.invitedUsers = [];\n\t\tawait Promise.all(this.userData.map(async userData => {\n\t\t\tawait this.createUser(userData);\n\t\t}));\n\t}", "function createUser(name,email,password){\n firebase.auth().createUserWithEmailAndPassword(email,password).then((userCredential,error) => {\n console.log(userCredential,error);\n const user = firebase.auth().currentUser;\n ref.child('users/info/joined/'+user.uid).set(new Date().stamp()).then(function (){\n ref.child('users/info/name/'+user.uid).set(name).then(function (){\n user.sendEmailVerification().then(function() {\n user.updateProfile({\n displayName: name\n }).then(function() {\n populateAccountBar();\n }).catch(function(error) {\n // Error updating profile goes here.\n console.log(error);\n\n });\n }).catch(function(error) {\n // Error sending email verification goes here.\n console.log(error);\n\n });\n })\n })\n }).catch((error) => {\n // Error registering goes here.\n console.log(error);\n\n });\n}", "async function signUp(name, email, phone, password, street, number, neighborhood, reference) {\n setLoadingAuth(true);\n await firebase.auth().createUserWithEmailAndPassword(email, password)\n .then( async (value) => {\n let uid = value.user.uid;\n await firebase.database().ref('users').child(uid).set({\n name: name,\n street: street,\n number: number,\n neighborhood: neighborhood,\n reference: reference,\n email: email,\n phone: phone\n })\n .then(() => {\n let data = {\n uid: uid,\n name: name,\n street: street,\n number: number,\n neighborhood: neighborhood,\n reference: reference,\n email: email,\n phone: phone\n };\n setUser(data);\n storageUser(data);\n setLoadingAuth(false);\n })\n .catch(() => {\n alert(error.code);\n setLoadingAuth(false);\n })\n })\n .catch(() => {\n alert(error.code);\n setLoadingAuth(false);\n })\n }", "function addUserToDatabase(data, cb) {\n usersFb = fb.child('users/' + fb.getAuth().uid);\n var uuid = usersFb.set(data);\n cb(uuid);\n }", "onUserCreate() {\n this.userCreate();\n const { email, password, fname, lname, id } = this.state;\n /*Making First name mandatory*/\n if (this.state.fname) {\n /*Setting state params*/\n this.setState({\n error: '',\n loading: true,\n });\n /*Appending first name and Last name .. That was the requirement*/\n const name = fname + ' ' + lname;\n /*Standard firebase create User call with email and password . it returns the user data*/\n firebase.auth().createUserWithEmailAndPassword(email, password).then((user) => {\n /*On success call*/\n this.loginSuccessHandle();\n /*Firebase restricts the amount of configurable params that can be passed while\n creating users. It allows a displayName and image(Not a requirement)*/\n user.updateProfile({\n displayName: name,\n });\n /*Fetchinh the current user Data from firebase*/\n const { currentUser } = firebase.auth();\n /*There are two DB storage paths created, this one is to store extra custom\n info of the users*/\n firebase.database().ref(`/employees/info/${currentUser.uid}/`)\n .push({\n name, email, id\n });\n this.loginSuccessHandle();\n })\n .catch(this.loginFailedHandle.bind(this));\n }\n else {\n this.setState({\n error: 'Please enter First name',\n loading: false,\n });\n }\n }", "function newUser(){\r\r\n}", "function registerAuthenticationListener() {\n lock.on('authenticated', function(authResult) {\n localStorage.setItem('id_token', authResult.idToken);\n authManager.authenticate();\n\n lock.getProfile(authResult.idToken, function(error, profile) {\n if (error) {\n return console.log(error);\n }\n var userDetails = {\n emailAddress: profile.email,\n firstName: profile.given_name,\n lastName: profile.family_name,\n gender: profile.gender,\n socialId: profile.identities[0].user_id\n };\n $http.post(\"http://75.118.135.179:9080/BuffDaddyAPI/register\", JSON.stringify(userDetails))\n .then(\n function successCallback(response) {\n console.log(\"Success register\");\n },\n function errorCallback(response) {\n alert(\"Error \" + JSON.stringify(response));\n });\n localStorage.setItem('profile', JSON.stringify(profile));\n deferredProfile.resolve(profile);\n });\n\n });\n }", "function saveNewUser(userObj) {\n ref.child('users').child(userObj.uid).set(userObj);\n }", "addUser(user){\n // Default-Username setzen (u[n+1])\n if(user.Username === \"\") user.setUsername(\"u\"+this.counter);\n this.users.push(user);\n this.counter++; //counter hochzählen\n\n // aktuellen Raum ermitteln und neue Details an alle User versenden (damit diese auch wissen, dass es einen neuen hat)\n var room = this;\n room.sendDetails();\n\n // zusätzlich mittels Chat-Nachricht den user auch anzeigen\n var data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"Welcome \" + user.Username + \" joining the Room `\"+room.Roomname+\"`. Total connection: \" + this.users.length\n };\n this.sendAll(JSON.stringify(data));\n}", "authUser (state, userData) {\n \t\tstate.idToken = userData.token\n \t\tstate.userId = userData.userId\n \t}", "function firstPerson() {\n firebase.auth().onAuthStateChanged(function(user) {\n if (user) {\n var userId = firebase.auth().currentUser.uid;\n var rootRef = firebase.database().ref().child(\"Users\");\n var usersRef = rootRef.child(userId);\n var other_id = other_id_1;\n usersRef.update({\n \"other_id\": other_id\n });\n }\n });\n }", "addUserToGameLoad(user){\n this.users.push(user);\n }", "set user (value) {\n if (_user = value) {\n this.push();\n } else {\n this.clear();\n }\n }", "function selectUser(user) {\n\t vm.currentUser = user;\n\t\t}", "function submit(ev) {\n api.create_user(props.form);\n }", "function setUser(user_id) {\n Profile.setUser(user_id);\n }", "handleSignUp() {\n\n // Create a new user and save their information, THEN\n // - Update the display name of the user\n\n // - Return promise for chaining, THEN\n // - Set the state as the current (firebase) user\n\n }", "async createUser (userData) {\n\t\tconst userCreator = new UserCreator({\n\t\t\trequest: this.request,\n\t\t\tteamIds: [this.team.id],\n\t\t\tcompanyIds: [this.team.get('companyId')],\n\t\t\tsubscriptionCheat: this.subscriptionCheat, // allows unregistered users to subscribe to me-channel, needed for mock email testing\n\t\t\tuserBeingAddedToTeamId: this.team.id,\n\t\t\tinviteCodeExpiresIn: this.inviteCodeExpiresIn,\n\t\t\tinviteInfo: this.inviteInfo,\n\t\t\tinviteType: !this.dontSendEmail && this.inviteType,\n\t\t\tdontSetInviteType: this.dontSendEmail\n\t\t});\n\t\tconst createdUser = await userCreator.createUser(userData);\n\t\tconst didExist = !!userCreator.existingModel;\n\t\tconst wasOnTeam = userCreator.existingModel && userCreator.existingModel.hasTeam(this.team.id);\n\t\tthis.invitedUsers.push({\n\t\t\tuser: createdUser,\n\t\t\twasOnTeam,\n\t\t\tdidExist,\n\t\t\tinviteCode: userCreator.inviteCode\n\t\t});\n\t}", "setUser(newUser) {\n this.user = newUser\n }", "addUser(user) {\r\n if (this.userUuids.indexOf(user.getUuid()) == -1) {\r\n this.userUuids.push(user.getUuid());\r\n this.update();\r\n }\r\n }", "auth_user_data(state, user){\n state.auth_user = user\n }", "get userPopulated() {\n return this.user && this.user.id;\n }", "function registor(e) {\n e.preventDefault();\n setloading(true);\n if (!userName == \"\") {\n auth\n .createUserWithEmailAndPassword(email, password)\n .then(async (user) => {\n var User = user.user;\n await db.ref(\"User/\" + User.uid).set({\n UserName: userName,\n Email: User.email,\n Code: generatedCode,\n Major: major,\n DoB: DoB,\n Phone: phone,\n });\n })\n .then(() => (window.location = \"/upload_image\"))\n .catch((error) => {\n alert(error.message);\n setloading(false);\n // ..\n });\n }\n\n setemail(\"\");\n setDoB(\"\");\n setMajor(\"\");\n setgeneratedCode(\"\");\n setpassword(\"\");\n setuserName(\"\");\n setcareer(\"\");\n setphone(\"\");\n }", "signUp(email, password, handle, avatar) {\n /* Create a new user and save their information */\n\n }", "function WriteUserToDB() {\n var newRef;\n switch (mode) {\n case 1:\n newRef = ref.push({\n phonenumber: \"\",\n id: \"\",\n email_address: user.email_address,\n email: user.email,\n sms: user.sms,\n whatsapp: user.whatsapp,\n setting_key: settingkey2,\n });\n break;\n case 2:\n newRef = ref.push({\n phonenumber: user.phonenumber,\n id: \"\",\n email_address: \"\",\n email: 0,\n sms: user.sms,\n whatsapp: user.whatsapp,\n setting_key: settingkey2,\n });\n break;\n }\n // Add Key to Entry\n var newID = newRef.key;\n newRef.update({\n id: newID\n })\n }", "function addNewUser() {\n}", "function onUserJoin(userId) {\n function doUpdate() {\n dsobj.update('pad_cookie_userids', {id: userId}, {lastActiveDate: new Date()});\n }\n try {\n dsobj.inTransaction(function() {\n if (dsobj.selectSingle('pad_cookie_userids', {id: userId})) {\n doUpdate();\n } else {\n dsobj.insert('pad_cookie_userids',\n {id: userId, createdDate: new Date(), lastActiveDate: new Date()});\n }\n });\n }\n catch (e) {\n dsobj.inTransaction(function() {\n doUpdate();\n });\n }\n}", "async preSave () {\n\t\tif (typeof this.request.isForTesting === 'function' && this.request.isForTesting()) { // special for-testing header for easy wiping of test data\n\t\t\tthis.attributes._forTesting = true;\n\t\t}\n\t\tif (this.attributes._pubnubUuid) {\n\t\t\tthis.request.log(`Pubnub uuid of ${this.attributes._pubnubUuid} provided`);\n\t\t}\n\n\t\t// never save attributes for an existing registered user\n\t\tif (\n\t\t\tthis.existingModel &&\n\t\t\tthis.existingModel.get('isRegistered')\n\t\t) {\n\t\t\tthis.dontSaveIfExists = true;\n\t\t\tthis.notSaving = true;\n\t\t}\n\n\t\t// if username not provided, generate it from email\n\t\tif (!this.notSaving && !this.attributes.username) {\n\t\t\tthis.attributes.username = UsernameValidator.normalize(\n\t\t\t\tEmailUtilities.parseEmail(this.attributes.email).name\n\t\t\t);\n\t\t\tthis.usernameCameFromEmail = true;\t// this will force a resolution of uniqueness conflict, rather than an error\n\t\t}\n\n\t\tif (this.options && this.options.externalUserId) {\n\t\t\tthis.attributes.externalUserId = this.options.externalUserId;\n\t\t}\n\n\t\tif (this.userBeingAddedToTeamId && (!this.options || !this.options.dontSetInviteCode)) {\n\t\t\tthis.setInviteInfo();\t\t\t// set an invite code for the user to accept an invite\n\t\t}\n\n\t\tawait this.hashPassword();\t\t\t// hash the user's password, if given\n\t\t// username uniqueness is deprecated per https://trello.com/c/gG8fKXft\n\t\t//await this.checkUsernameUnique();\t// check if the user's username will be unique for the teams they are on\n\t\tawait super.preSave();\n\t}", "function createAVUser( openId, pubAccountId, followerId, moreInfo){ // follower\n\t//default user name would be 000000\n\tvar username=pubAccountId+'___'+openId;\n\tvar password='000000';\n\tvar user = new AV.User(); \n\n\tuser.set(\"username\", username);\n\tuser.set(\"password\", password);\n\tuser.set(\"followerId\", followerId);\n\tuser.set(\"wechatAccInfo\", moreInfo);\n\t\t\n\tuser.signUp(null, {\n \t\t\t success: function(user) {\n \t\t\t\tconsole.log('AVuser created');\t// 注册成功,可以使用了.\n \t\t\t},\n \t\t \terror: function(user, error) {\n \t\t\t// 失败了\n \t\t\t\tconsole.log(\"Error: \" + error.code + \" \" + error.message);\n \t\t\t}\n\t});\n\n\n}", "function loginNewPlayer(e){\n e.preventDefault()\n let userObj = { \n user: e.target.previousElementSibling.value\n }\n userAdapter.loginPlayer(userObj)\n adopt()\n }", "function bush(fn, ln, un, cpa) {\n var user = Parse.User.current();\n user.set(\"firstName\", fn);\n user.set(\"lastName\", ln);\n user.setUsername(un);\n user.setEmail(un);\n user.setPassword(cpa);\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 confirmation that it has happened\n window.location.reload();\n },\n error: function (user, error) {\n console.log(\"ERROR occured in bush()\");\n }\n });\n }", "userReceived(p) {\n let player = newUser(p);\n players.push(player);\n requestPlayers();\n }", "addUser() {\n\t\t//create a UID, then make sure it's unique\n\t\tlet uid = generateUserID();\n\n\t\t//generate new ID if UID is already in use\n\t\twhile( uid in this.users) {\n\t\t\tuid = generateUserID();\n\t\t}\n\n\t\t//add a new User with an id of uid into the users array\n\t\tthis.users[uid] = new User(uid);\n\t\t//return UID\n\t\treturn uid;\n\t}", "addUser(callback) {\n var self = this;\n \n // Check if given username is available.\n self.isUsernameAvailable(function(err, available) {\n if (err) callback(err);\n if(available) {\n var sql = \"INSERT INTO user (username, password) VALUES (?,?)\";\n pool.getConnection(function(con_err, con) {\n if(con_err) {\n console.log(\"Error - \" + Date() + \"\\nUnable to connect to database.\");\n callback(con_err);\n return;\n }\n \n con.query(sql, [self.username, md5(self.password)], function (err, result) {\n if (err) {\n console.log('Error encountered on ' + Date());\n console.log(err);\n callback(null, false);\n con.release();\n return;\n } \n \n // Assign a planet of difficulty 1 to the new user\n var planet_user = new PlanetUser(result.insertId);\n \n planet_user.addNewPlanet(1, function(err_planet, result_planet) {\n if (err_planet) {\n console.log('Error encountered on ' + Date());\n console.log(err_planet);\n callback(null, false);\n con.release();\n return;\n }\n callback(null,true);\n con.release();\n });\n });\n });\n }\n else {\n callback(null, false);\n }\n });\n \n }", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}", "async save (user) {\n user['avatar'] = ''\n user['followers'] = 0\n user['following'] = 0\n\n await Http.post('/signup', user, false)\n Events.emit('userStore:signup')\n }", "createUser () {\n this.sendButton.textContent = 'Go'\n this.form.setAttribute('class', 'userContainer')\n this.form.addEventListener('submit', this.saveUser)\n }", "function addAnotherUser() {\n // Need a unique id, will monotomically increase\n var id = getNextUserId();\n\n // Create and add the user to DOM\n createNewUser(id);\n\n // Make sure message about no users is hidden\n document.getElementById('no-added-users').style.display = 'none';\n\n // Always return false to disable the default action\n return false;\n}", "attach() {}", "function onRendered() {\n identifyUser();\n}", "function initUser(roomname) {\n peer.on('open', function(id) {\n $('#username-text').hide();\n $('#peerSubmit').hide();\n $('#id').show();\n $('#pid').text(id);\n if (peerReconnecting){\n // do nothing\n } else {\n createVideoFeedButton();\n }\n var data = {\n roomName: roomname,\n userName: id\n } \n sendUserToServer(data);\n });\n }", "function addUser(userName, userEmail, userPW){\n\tvar firebaseRef = firebase.database().ref();\n\tfirebase.auth().createUserWithEmailAndPassword(userEmail,userPW).catch(function(error){\n\t// Handle Errors\n\talert(\"User was not added!!!\");\n\t\talert(error.message);\n\t});\n\tsetTimeout(function() {\t\n\t\tfirebase.auth().currentUser.updateProfile({\n\t\t\tdisplayName:userName,\n\t\t}).then(function() {\n\t\t // Update successful.\n\t\t alert(\"should have worked\");\n\t\t}).catch(function(error) {\n\t\t // An error happened.\n\t\t alert(\"did not set user name\");\n\t\t \t\t alert(error.message);\n\t\t});\n\t\tsetTimeout(function() {window.location=\"../Login/Login.html\";}, 500);\n\t},750);\n}", "function writeUserData(admin,address) {\n push(ref(database, 'users/'), {\n deployedBy: admin,\n contractAddr: address,\n });\n }", "function attachBot(req, res, next){\n botService.getById(req.sessionUser, req.params.id, req.query.includeCommands)\n .then(function (bot) {\n if (!bot) res.sendStatus(404);\n else {\n req.bot = bot;\n // console.log('Bot1', bot);\n discordService.getBotUser(bot)\n .then(user => {\n req.botUser = user;\n next();\n })\n .catch(err => {\n console.log(err)\n next();\n });\n }\n })\n .catch(err => next(err));\n}", "function createActivationLink(res, user) {\n bcrypt.hash(user._id.toString(), 10, (error, hash) => {\n if (error) {\n handleError(res, 500, error);\n } else {\n console.log('Hash: ' + hash);\n const activation = new Activation({\n _id: mongoose.Types.ObjectId(),\n userIdHashed: hash,\n user: user._id\n });\n activation.save()\n .then(result => {\n if (result) {\n console.log('Saving Activation: ' + result);\n const activationLink = 'http://localhost:3000/login/activate/' + user._id + '/' + encodeURIComponent(hash);\n emailSender.sendRegistrationEmail(user.email, activationLink);\n }\n })\n .catch(error => {\n handleError(res, 500, error);\n });\n }\n });\n}", "function onCreateUserCallback(options, user) {\n \n const schema = Users.simpleSchema()._schema;\n\n delete options.password; // we don't need to store the password digest\n delete options.username; // username is already in user object\n\n options = runCallbacks('users.new.validate.before', options);\n\n // validate options since they can't be trusted\n Users.simpleSchema().validate(options);\n\n // check that the current user has permission to insert each option field\n _.keys(options).forEach(fieldName => {\n var field = schema[fieldName];\n if (!field || !Users.canCreateField(user, field)) {\n throw new Error(Utils.encodeIntlError({ id: 'app.disallowed_property_detected', value: fieldName }));\n }\n });\n\n // extend user with options\n user = Object.assign(user, options);\n\n // run validation callbacks\n user = runCallbacks('users.new.validate', user);\n\n // run onInsert step\n _.keys(schema).forEach(fieldName => {\n if (!user[fieldName] && schema[fieldName].onInsert) {\n const autoValue = schema[fieldName].onInsert(user, options);\n if (autoValue) {\n user[fieldName] = autoValue;\n }\n }\n });\n\n if (user.username && user.services != 'password') {\n let existingUsername = Meteor.users.findOne({ 'username': user.username });\n if (existingUsername) {\n delete user.username;\n }\n }\n\n if (user.services) {\n \n const service = _.keys(user.services)[0];\n\n let email = user.services[service].email;\n if (!email) {\n if (user.emails) {\n email = user.emails.address;\n }\n }\n if (!email) {\n email = options.email;\n }\n if (!email) {\n // if email is not set, there is no way to link it with other accounts\n\n user = runCallbacks('users.new.sync', user);\n runCallbacksAsync('users.new.async', user);\n\n // check if all required fields have been filled in. If so, run profile completion callbacks\n if (Users.hasCompletedProfile(user)) {\n runCallbacksAsync('users.profileCompleted.async', user);\n }\n return user;\n }\n // see if any existing user has this email address, otherwise create new\n let existingUser = Meteor.users.findOne({ 'emails.address': email });\n if (!existingUser) {\n // check for email also in other services\n let existingTwitterUser = Meteor.users.findOne({ 'services.twitter.email': email });\n let existingGoogleUser = Meteor.users.findOne({ 'services.google.email': email });\n let existingFacebookUser = Meteor.users.findOne({ 'services.facebook.email': email });\n let doesntExist = !existingGoogleUser && !existingTwitterUser && !existingFacebookUser;\n if (doesntExist) {\n user = runCallbacks('users.new.sync', user);\n runCallbacksAsync('users.new.async', user);\n\n if(newsletter_subs.findOne({email})){\n user.newsletter_subscribeToNewsletter = true;\n newsletter_subs.remove({email});\n }\n\n // check if all required fields have been filled in. If so, run profile completion callbacks\n if (Users.hasCompletedProfile(user)) {\n runCallbacksAsync('users.profileCompleted.async', user);\n }\n return user;\n } else {\n existingUser = existingGoogleUser || existingTwitterUser || existingFacebookUser;\n if (existingUser) {\n if (user.emails) {\n existingUser.emails = user.emails;\n }\n }\n }\n }\n\n if (!existingUser.services) {\n existingUser.services = { resume: { loginTokens: [] } };\n }\n\n existingUser.services[service] = user.services[service];\n if (service === 'password') {\n existingUser.username = user.username;\n }\n\n if(newsletter_subs.findOne({email})){\n existingUser.newsletter_subscribeToNewsletter = true;\n newsletter_subs.remove({email});\n }\n\n Meteor.users.remove({ _id: existingUser._id }); // remove existing record\n\n existingUser = runCallbacks('users.new.sync', existingUser);\n runCallbacksAsync('users.new.async', existingUser);\n\n // check if all required fields have been filled in. If so, run profile completion callbacks\n if (Users.hasCompletedProfile(existingUser)) {\n runCallbacksAsync('users.profileCompleted.async', existingUser);\n }\n\n return existingUser; // record will be re-inserted\n } else {\n user = runCallbacks('users.new.sync', user);\n runCallbacksAsync('users.new.async', user);\n\n // check if all required fields have been filled in. If so, run profile completion callbacks\n if (Users.hasCompletedProfile(user)) {\n runCallbacksAsync('users.profileCompleted.async', user);\n }\n return user;\n }\n\n}", "function createUser(cedula,apellido,email, nombre, telefono, pass){\n const password = pass;\n var userId=\"\";\n \n auth.createUserWithEmailAndPassword(email, password)\n .then(function (event) {\n user = auth.currentUser;\n userId = user.uid;\n console.log(\"UserID: \"+userId);\n insertar(cedula,apellido,email, nombre, telefono, userId);\n })\n .catch(function(error) {\n alert(error.message);\n console.log(error.message);\n });\n}", "function userPush() {\n $('.name').html(user.name);\n\n if (user.bio === '') {\n user.bio = ('\\n'+ user.name + ' Is incredibly lazy and has not filled out his bio.');\n }\n $('#bio').html(user.bio);\n $('#logo').attr('src', user.logo);\n $('.chat').attr('src', user.chaturl);\n $('.videoinfo').html(user.streamdesc);\n\n }" ]
[ "0.70610565", "0.6370864", "0.6258515", "0.61999613", "0.6174369", "0.61023957", "0.6075733", "0.60091335", "0.59679824", "0.5960956", "0.5929272", "0.59280473", "0.59259343", "0.58826303", "0.5878986", "0.58309025", "0.5792502", "0.5756952", "0.5732944", "0.57242495", "0.571885", "0.56906426", "0.5684282", "0.56689745", "0.5667784", "0.5652277", "0.5637295", "0.5631161", "0.5614123", "0.56076825", "0.5604679", "0.56019706", "0.5596503", "0.55946666", "0.55904156", "0.55758286", "0.5571008", "0.55696887", "0.55692583", "0.55622154", "0.5559259", "0.55564505", "0.5554314", "0.5553014", "0.55470353", "0.5545763", "0.5545628", "0.55392504", "0.5533443", "0.5529251", "0.5525889", "0.5502278", "0.5497141", "0.5497003", "0.54955417", "0.548987", "0.54845554", "0.5481221", "0.5480704", "0.5478606", "0.54755676", "0.54723907", "0.54713494", "0.54677135", "0.54650545", "0.5464714", "0.54645973", "0.5462659", "0.5462657", "0.5456678", "0.54505616", "0.5449901", "0.5447264", "0.5438016", "0.5435508", "0.5430589", "0.54222906", "0.5421644", "0.5410272", "0.54082924", "0.5408092", "0.5407292", "0.54044884", "0.5404078", "0.5403805", "0.5396205", "0.53917956", "0.53917956", "0.5384284", "0.53817284", "0.5379139", "0.5379103", "0.5377553", "0.5375445", "0.5370239", "0.53658354", "0.53658205", "0.5362215", "0.5358695", "0.53585553", "0.5354832" ]
0.0
-1
& then we update the cart to be what? just an empty array
function emptyCart(user) { return Object.assign({}, user, {cart: []}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCart(){\n reset();\n cart.forEach(product =>{\n appendProduct(product);\n }); \n}", "function updateMiniCart() {\n if(!cart.items ) {\n cart.items = [];\n }\n }", "function updateCart(){\n\t\tstorage(['items', 'subtotal'], function(err, col){\n\t\t\t//console.log(\"Cart Collection - \" + JSON.stringify(col));\n\n\t\t\t//items = col[0];\n\t\t\t//subtotal = col[1];\n\n\t\t\tif(console) console.log(\"Items in Cart: \" + items);\n\t\t\tif(console) console.log(\"Subtotal of Cart: \" + subtotal);\n\t\t\t\n\t\t\t// update DOM Here\n\t\t\tdocument.getElementById( _options.itemsEleId ).innerHTML = items;\n\t\t\tdocument.getElementById( _options.subtotalEleId ).value = \"$\" + subtotal.toFixed(2);\n\n\t\t\t// reset default quantity input fields of products\n\t\t\tPRODUCTS.updateProducts();\n\t\t});\n\t}", "updateCartItems() {\n // Call the 'getCartItems' apex method imperatively\n getCartItems({\n communityId: communityId,\n effectiveAccountId: this.resolvedEffectiveAccountId,\n activeCartOrId: this.recordId,\n pageParam: this.pageParam,\n sortParam: this.sortParam\n })\n .then((result) => {\n this.cartItems = result.cartItems;\n this._cartItemCount = Number(\n result.cartSummary.totalProductCount\n );\n this.currencyCode = result.cartSummary.currencyIsoCode;\n this.isCartDisabled = LOCKED_CART_STATUSES.has(\n result.cartSummary.status\n );\n })\n .catch((error) => {\n const errorMessage = error.body.message;\n this.cartItems = undefined;\n this.isCartClosed = isCartClosed(errorMessage);\n });\n }", "function updateCart(item, price, amount, ID) {\n cartItems.push(item);\n cartCost.push(price);\n CartAmount.push(amount);\n cartIDs.push(ID);\n}", "async updateCart_Of_User(){\n }", "function update_local_cart(case_option,cart,ops=null){\r\n switch(case_option) {\r\n case 1:\r\n cart.push(ops)\r\n break;\r\n case 2:\r\n \r\n for (let i = 0; i < cart.length; i++) {\r\n const element = cart[i];\r\n if(element['item'] == ops.item){\r\n cart.splice(i, 1);\r\n // element['qty'] = 0\r\n }\r\n }\r\n break;\r\n case 3:\r\n for (let i = 0; i < cart.length; i++) {\r\n const element = cart[i];\r\n if(element['item']==ops.item){\r\n element['qty'] = parseFloat(ops.qty)\r\n }\r\n }\r\n break; \r\n default:\r\n \r\n }\r\n \r\n \r\n return cart\r\n \r\n }", "function updateCart(){if(window.Cart&&window.Cart.updateCart){window.Cart.updateCart();}}", "function deleteAllCart() {\n if(Object.keys(productInCart).length === 0) return alert('Tidak ada produk di dalam cart!')\n\n // Update database (stok ditambahin ke database lagi)\n for(let id in productInCart) {\n databaseProduct[id].stokProduk += productInCart[id]\n }\n \n productInCart = {} // object kosong\n\n renderCart() // update tampilan cart\n renderProductList() // update product list => stok berubah atau produk hilang\n updateTotal() // update tampilan total\n\n return productInCart\n}", "function updateCart() {\n\n}", "function setCart(){\n\t\tstorage.set({ \n\t\t\titems: 0, \n\t\t\tsubtotal: 0\n\t\t}, function(){\n\t\t\tupdateCart();\n\t\t});\n\t}", "OnAddCart(product) {\n // this.flashMessageService.show('Product added to cart!', {cssClass:'alert-success', timeout: 4000});\n console.log(product);\n this.productAddedToCart = this.getProductFromCart();\n\n if (this.productAddedToCart == null) {\n console.log(\"This array is empty\");\n this.productAddedToCart = [];\n this.productAddedToCart.push(product);\n this.addProductToCart(this.productAddedToCart);\n console.log('Product added to cart');\n } else {\n let tempProduct = this.productAddedToCart.find(p => p.product_Name == product.product_Name);\n\n if (tempProduct == null) {\n this.productAddedToCart.push(product);\n this.addProductToCart(this.productAddedToCart);\n console.log('Product added to cart.');\n } else {\n tempProduct.product_Quantity++; // this.productAddedToCart.find(p=>p.id==product.id).product_Quantity = product.product_Quantity +1;\n\n this.addProductToCart(this.productAddedToCart);\n }\n }\n }", "function updateCart() {\n emptyCart();\n let items = JSON.parse(localStorage.getItem('items'));\n if(items !== null) {\n if(typeof items.forEach !== \"function\") {\n items = [items];\n }\n items.forEach(function(item) {\n $('#shoppingcart-items').append(\n \"<li class='cart-item'>\" +\n \"<span>\" + item.name + \"</span>\" +\n \"<span>\" + item.size + \"</span>\" +\n \"<span>\" + item.color + \"</span>\" +\n \"<span>\" + item.amount + \"</span>\" +\n \"<span class='cart-item-price'>\" + item.price + \"</span>\" +\n \"<a class='remove-item' href='#' data-item='\" + item.name + \"'><i class='fa fa-times' aria-hidden='true'></i></a>\" +\n \"</li>\");\n });\n localStorage.setItem('items-timestamp', (+ new Date() / 1000) );\n }else {\n removeAllStorage();\n \n }\n updateCounter();\n updateTotal();\n }", "function cleanCart1() {\n cartList=[];\n}", "addToCart(product) {\n // prvo trazim postoji li vec ovaj atikal na listi\n const cartProductIndex = this.cart.items.findIndex((cp) => {\n return cp.productId.toString() === product._id.toString();\n });\n console.log('cartProductIndex='.red, cartProductIndex);\n let newQuantity = 1;\n const updatedCartItems = [...this.cart.items];\n console.log(updatedCartItems);\n \n\n // ako je pronasao zapis..\n if (cartProductIndex >= 0) {\n newQuantity = this.cart.items[cartProductIndex].quantity + 1;\n updatedCartItems[cartProductIndex].quantity = newQuantity;\n } else {\n // prvi zapis\n updatedCartItems.push({\n productId: new mongodb.ObjectId(product._id),\n quantity: newQuantity,\n });\n }\n\n const updatedCart = {\n items: updatedCartItems,\n };\n // const updatedCart = {\n // items: [{...product, quantity:1 }],\n // };\n\n const db = getDb();\n return db\n .collection('users')\n .updateOne(\n { _id: new mongodb.ObjectId(this._id) },\n { $set: { cart: updatedCart } }\n );\n }", "function populateProductCart(product) {\n products_cart.items.push(product);\n updateCart();\n clearAddItemModal();\n}", "calculateTotal(price, skuId, qty) {\n let cartListArr = this.props.elcStore.cartList.length ? JSON.parse(this.props.elcStore.cartList) : {};\n if (Object.keys(cartListArr).length && cartListArr[skuId] !== undefined) {\n for (let x in cartListArr) {\n if (x === skuId) {\n cartListArr[skuId] = {qty: cartListArr[skuId].qty + qty};\n }\n }\n } else {\n cartListArr[skuId] = {qty: qty};\n }\n const total = this.state.total + (price * qty);\n const cartList = cartListArr;\n this.props.elcStore.cartListUpdate(total, cartList);\n }", "function updateCart(flavors) {\n //Creating a variable to store the flavors selected.\n //If no flavors were selected (in the case of Single count), an empty array is created.\n var extraFlavors = flavors || [];\n var quantity=$('#product-qty').val(); \n var itemName=$('#product-name').text();\n if(extraFlavors.length) {\n itemName = itemName+\" - \"+extraFlavors.join(\", \");\n }\n var itemFound = false;\n //Iterate through the cart to see if the desired item exists already\n for(var i=0; i<cart.length; i++){\n //If the item already exists, update the quantity and subtotal\n if(cart[i].rollName === itemName){\n var existingQty = parseInt(cart[i].numQty);\n cart[i].numQty = parseInt(quantity) + existingQty;\n cart[i].subtotal = parseInt(cart[i].rollPrice) * parseInt(cart[i].numQty);\n //Update the changes in local storage\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n localStorage.setItem(\"cartCount\", cart.length);\n itemFound = true;\n break;\n }\n }\n //If the item doesn't exist yet, add the item\n if(!itemFound) {\n var itemImage=$('#roll-image').attr('src');\n var price=$('#product-price').text();\n var subtotal=parseInt(price)*parseInt(quantity);\n var bakeryRoll = new newCartItem(itemImage, itemName, quantity, price, subtotal);\n cart.push(bakeryRoll);\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n localStorage.setItem(\"cartCount\", cart.length);\n $('#cartCount').show();\n $('#cartCount').html(cart.length).css('display', 'block');\n }\n }", "update({ body, ...req }, res) {\n\n const { restaurantId, itemId, quantity } = body;\n \n if (!cache.has('cart')) {\n cache.set('cart', createNewCart());\n }\n\n const inMemoCart = cache.get('cart');\n const foundItem = inMemoCart.items.find(item => item.id === itemId);\n const nextInMemoCart = foundItem ? {\n ...inMemoCart,\n items: [\n ...inMemoCart.items.filter(item => item.id === itemId), //.map((i, iIdx) => (iIdx === idx) ? { ...i, count: quantity } : i)\n {\n ...foundItem,\n count: quantity\n }\n ]\n } : {\n ...inMemoCart,\n items: [\n ...inMemoCart.items,\n {\n id: itemId,\n count: quantity,\n restaurantId: restaurantId,\n }\n ]\n }\n\n if (nextInMemoCart.items.every(({ count }) => count === 0)) {\n nextInMemoCart.items = [];\n }\n\n cache.set('cart', updateCartWithStats(nextInMemoCart));\n console.log(JSON.stringify(updateCartWithStats(nextInMemoCart), null, 2));\n return new Promise(rs => setTimeout(() => {\n const result = updateCartWithStats(nextInMemoCart)\n res.json(result);\n rs();\n }, 2000));\n\n }", "function storingCartItem() {\n \n /**\n * TODO: Create Product Object\n */\n let cartItem = product;\n cartItem.quantity = 1;\n cartItem.lensOption = updatePersonalizedFeatures();\n\n /**\n * TODO: Get \"cartItems\" value \n */\n let cartItems = JSON.parse(localStorage.getItem('cartItems'));\n\n\n /**\n * TODO: Update \"cartItems\" value with new Product Object (Push to the Array)\n */\n cartItems.push(cartItem);\n localStorage.setItem('cartItems', JSON.stringify(cartItems));\n\n // update cart badge\n let cartItemsQuantity = document.getElementById('cartItemQuantity');\n cartItemsQuantity.style.display = \"inline-block\";\n updateCartBadge();\n \n /**\n * TODO: Further \"Add to cart\" stuff....\n */\n //goToCartPage();\n \n console.log(cartItems);\n\n}", "function clearCart() {\n cart = [];\n saveCart();\n}", "function clearCart() {\n cart = [];\n saveCart();\n}", "function addToCarts(id){\r\n if(!data[id].itemInCart){\r\n cartList = [...cartList,data[id]];\r\n addItem();\r\n\r\n alert('item add to your cart');\r\n }\r\n else{\r\n alert('Your item is already there');\r\n }\r\n data[id].itemInCart = true;\r\n}", "ADD_TO_CART(state, product) {\n // Check if cart is empty\n if (Object.keys(state.cart).length != 0) {\n for (const [key, value] of Object.entries(state.cart)) {\n // Check if product already in cart, then change quantity \n if (key === product.reference) {\n product.qty = value.qty + state.qty\n state.cart[key].qty = product.qty\n } else {\n state.cart[product.reference] = product\n }\n }\n } else {\n state.cart[product.reference] = product\n }\n }", "addItemsToCart() {\n\n Model.addItemsToCart(this.currentItems);\n }", "function addCart() {\n\n let sameItems = stylishStorage.cart.list.filter( el => \n el.id === details_product_id.textContent &&\n el.color.code === currentColor && \n el.size === currentSize); \n\n if (sameItems.length > 0){\n stylishStorage.cart.list.forEach( item => {\n if ( item.id === details_product_id.textContent &&\n item.color.code === currentColor &&\n item.size === currentSize ){\n item.qty = quantity_count_value.textContent;\n }\n })\n \n }else{\n newItem ={\n id: details_product_id.textContent,\n name: details_product_name.textContent,\n main_image: main_img,\n price: product_price,\n color: {\n name: currentColorName,\n code: currentColor\n },\n size: currentSize,\n qty: quantity_count_value.textContent,\n stock: stock_qty\n }\n\n stylishStorage.cart.list.push(newItem);\n }\n\n localStorage.setItem('cart', JSON.stringify(stylishStorage.cart));\n}", "function buyUpdate(id, quantity) {\n var isDupicate = false;\n\n //checks to see if the item is already in the cart\n for (var i in cart) {\n\n if (cart[i].id == id) {\n //if the item is already in the cart, it adds the quantity of the purchase to the quantity already in the cart\n cart[i].quantity += parseInt(quantity);\n isDupicate = true;\n\n //removes the quantity from the amount in stock\n for (var j in stock) {\n if (cart[i].id == stock[j].ItemID) {\n stock[j].StockQuantity -= quantity;\n }\n }\n }\n }\n\n //if not already in the cart\n if (!isDupicate) {\n\n //find the id in the stock array\n for (var k in stock) {\n if (stock[k].ItemID == id) {\n //push the item to the cart\n cart.push({\n id: id,\n name: stock[k].ProductName,\n quantity: parseInt(quantity),\n price: stock[k].Price\n });\n //subtract the user quantity wanted from the quantity in stock\n stock[k].StockQuantity -= quantity;\n }\n }\n }\n\n //display the updated stock\n displayStock();\n //display the shopping cart\n shoppingCart();\n //prompt the user to continue shopping or checkout\n promptOptions();\n}", "addToCart(index) {\n var product = productList[index];\n var cartCopy = this.state.cart.slice();\n cartCopy[cartCopy.length] = {\n name: product.name,\n price: product.price\n };\n }", "async function shopping_cart_update (opts) {\r\n \r\n if(frappe.session.user ===\"Guest\") {\r\n if(localStorage) {\r\n localStorage.setItem(\"last_visited\", window.location.pathname);\r\n }\r\n window.location.href = \"/login\";\r\n } else {\r\n console.log(opts)\r\n $(\"#add_to_cart\").prop('disabled', true);\r\n frappe.freeze();\r\n return frappe.call({\r\n type: \"POST\",\r\n method: \"organic_shop.organic_cart.update_cart_custom\",\r\n args: {\"items\":opts,\"with_items\":1},\r\n btn: opts.btn,\r\n callback: function(r) {\r\n console.log(r.message)\r\n set_cart()\r\n frappe.unfreeze();\r\n $(\"#add_to_cart\").prop('disabled',false);\r\n $('#view_cart').removeAttr('hidden');\r\n $(\"input.checkmark:checkbox\").prop('checked', false)\r\n $(\"input.counter\").val(1)\r\n \r\n \r\n }\r\n });\r\n \r\n }\r\n \r\n \r\n \r\n \r\n }", "updateProductInCart(product) {\n \n //1. fetch value of local storage's cartData. \n var cart = JSON.parse(localStorage.getItem(\"cartData\"));\n console.log(\"Cart BEFORE update: \" + cart);\n\n //2. Find the product in cart\n for(var i = 0; i < cart.length; i++) { \n if(cart[i].productId === product.productId) {\n //update count field\n cart[i].productCurrentCount = product.productCurrentCount;\n }\n }\n\n //store this updated cart in local storage\n localStorage.setItem('cartData', JSON.stringify(cart));\n console.log(\"Cart with updated count of product : \" + JSON.stringify(cart));\n }", "addToShoppingCart() {\n\n // units is greater than zero\n if (this.state.units != 0){\n\n // validate stock\n if (this.state.units <= this.state.product.saleFormats[this.state.formatIndex].stock) {\n \n // get shpping cart\n var productsArrayCart = JSON.parse(localStorage.getItem('productsArrayCart'));\n \n // console.log(productsArrayCart);\n if (productsArrayCart == null) {\n productsArrayCart = [];\n };\n \n \n // validate if product with specific format already is in cart\n var productIsInCart = false;\n var formatIsInCart = false;\n var indexProduct = 0;\n productsArrayCart.forEach((product, idx) => {\n // validate if product is in array\n if (product.product.id == this.state.product.id) {\n productIsInCart=true;\n indexProduct= idx;\n\n // validate if format is in array\n if (product.formatIndexList.includes(this.state.formatIndex)) {\n formatIsInCart = true;\n }\n }\n });\n\n // if product is not\n // add product to cart\n if (!productIsInCart) {\n\n // alert(\"Product isn't in cart\");\n\n // add new product\n productsArrayCart.push({\n \"product\": this.state.product,\n \"formatIndexList\": [this.state.formatIndex],\n \"unitsList\": [this.state.units],\n });\n \n // console.log(productsArrayCart);\n \n // save new array\n localStorage.setItem('productsArrayCart', JSON.stringify(productsArrayCart));\n \n // console.log(productsArrayCart);\n \n // console.log(localStorage);\n alert(\"Producto agregado al carrito de compra\");\n \n // redirect\n this.props.history.push('/store/' + this.props.match.params.store_id);\n }\n\n // if product is in cart but no format\n // add format to product cart\n else if (productIsInCart & !formatIsInCart) {\n\n // alert(\"Product is in cart but format is not\");\n\n // add format index to list\n var formatIndexList = productsArrayCart[indexProduct][\"formatIndexList\"];\n formatIndexList.push(this.state.formatIndex);\n\n // add units\n var unitsList = productsArrayCart[indexProduct][\"unitsList\"];\n unitsList.push(this.state.units);\n\n // update item on product cart array\n productsArrayCart[indexProduct][\"formatIndexList\"] = formatIndexList\n productsArrayCart[indexProduct][\"unitsList\"] = unitsList;\n\n // save new array\n localStorage.setItem('productsArrayCart', JSON.stringify(productsArrayCart));\n\n // console.log(productsArrayCart);\n\n // console.log(localStorage);\n alert(\"Producto agregado al carrito de compra\");\n\n // redirect\n this.props.history.push('/store/' + this.props.match.params.store_id);\n\n\n }\n\n // if product and format is in cart\n else if (productIsInCart & formatIsInCart) {\n\n // get index of format index\n const indexFormatIndex = productsArrayCart[indexProduct][\"formatIndexList\"].indexOf(this.state.formatIndex);\n\n // get product format stock\n const productFormatStock = this.state.product.saleFormats[this.state.formatIndex].stock;\n\n // get products availables (dif between stock and units )\n const availableProducts = productFormatStock - productsArrayCart[indexProduct][\"unitsList\"][indexFormatIndex]\n\n // if it can add all units, so add to the cart\n if (this.state.units <= availableProducts) {\n\n\n // alert(\"product is in car and can add these units\");\n\n // add units to element in units array\n productsArrayCart[indexProduct][\"unitsList\"][indexFormatIndex] = productsArrayCart[indexProduct][\"unitsList\"][indexFormatIndex] + this.state.units;\n\n // save new array\n localStorage.setItem('productsArrayCart', JSON.stringify(productsArrayCart));\n\n // console.log(productsArrayCart);\n\n // console.log(localStorage);\n alert(\"Producto agregado al carrito de compra\");\n\n // redirect\n this.props.history.push('/store/' + this.props.match.params.store_id);\n\n \n }\n \n else if (availableProducts == 0) {\n // alert(\"product is in car but cann't add more units\");\n\n alert(\"Ya has agregado el máximo de unidades de este formato. Revisa tu carrito de compra para confirmar\");\n }\n // else, alert message with differecen available\n else {\n // alert(\"product is in cart but cann't add that number of units\");\n alert(\"Solo puedes agregar hasta \" + availableProducts + \" unidades de este formato\");\n };\n\n }\n\n }\n \n else{\n alert(\"Sólo puedes ordenar \" + this.state.product.saleFormats[this.state.formatIndex].stock + \" unidades de este formato\");\n };\n }\n \n else {\n alert(\"Debes elegir al menos una unidad de este producto\");\n };\n\n }", "function updateCart(){\n \n if( cart.length > 0 ){\n section('aside').classList.add('show');\n // zerando o cart para depois adicionar com append\n section('.cart').innerHTML = '';\n\n let subtotal = 0;\n let desconto = 0;\n let total = 0;\n\n for(let i in cart){\n let pizzaItem = pizzaJson.find( (item) => {\n return item.id == cart[i].id\n });\n\n subtotal = pizzaItem.price * cart[i].quantidade;\n\n console.log(pizzaItem);\n\n let cartItem = section('.models .cart--item').cloneNode(true);\n\n let pizzaSizeName;\n\n switch (cart[i].size) {\n case 0:\n pizzaSizeName = 'P';\n break;\n\n case 1:\n pizzaSizeName = 'M';\n break;\n \n default:\n pizzaSizeName = 'G';\n break;\n }\n\n let pizzaName = `${pizzaItem.name} (${pizzaSizeName}) `;\n\n cartItem.querySelector('img').src = pizzaItem.img;\n cartItem.querySelector('.cart--item-nome').innerHTML = pizzaName;\n cartItem.querySelector('.cart--item--qt').innerHTML = cart[i].quantidade;\n\n cartItem.querySelector('.cart--item-qtmenos').addEventListener('click', () => {\n \n if(cart[i].quantidade > 1 ){\n cart[i].quantidade--;\n } else {\n cart.splice(i, 1);\n }\n updateCart();\n });\n\n cartItem.querySelector('.cart--item-qtmais').addEventListener('click', () => {\n cart[i].quantidade++;\n updateCart();\n });\n\n // Adicionando os itens que pegamos do JSON na div CART\n section('.cart').append(cartItem);\n\n }\n\n desconto = subtotal * 0.1;\n total = subtotal - desconto; \n\n section('.subtotal span:last-child').innerHTML = `R$ ${subtotal.toFixed(2)}`;\n section('.desconto span:last-child').innerHTML = `R$ ${desconto.toFixed(2)}`;\n section('.total span:last-child').innerHTML = `R$ ${total.toFixed(2)}`;\n\n } else {\n section('aside').classList.remove('show');\n }\n}", "addToCart(newItem) {\n let itemExisted = false\n let updatedCart = this.state.cart.map(item => {\n if (newItem === item.sku) {\n itemExisted = true\n return { sku: item.sku, quantity: ++item.quantity }\n } else {\n return item\n }\n })\n if (!itemExisted) {\n updatedCart = [...updatedCart, { sku: newItem, quantity: 1 }]\n }\n this.setState({ cart: updatedCart })\n // Store the cart in the localStorage.\n // localStorage.setItem('stripe_checkout_items', JSON.stringify(updatedCart))\n }", "updateState(payload){\n\n console.log(\"cart: this.props.cart.cartDetail=\",this.props.cart);\n this.setState({products:this.props.cart.cartDetail.map(element => element)});\n\n console.log(\"cart.js: responseFromServer=\",payload);\n console.log(\"cart.js: this.state.products=\",this.state.products);\n if(this.state.products.length > 0){//if there are products calc total\n this.calculateTotal(this.state.products);\n }\n this.setState({loading:false});\n }", "async updateCartData(data) {\n return new Promise(async (resolve, reject) => {\n try {\n for (let index = 0; index < data.length; index++) {\n await Cart.updateOne({\n _id: data[index].id\n }, {$set: data[index].data})\n }\n resolve(true)\n } catch (error) {\n log.error(\"OrderService-->updateCartData-->\", error);\n reject(errorFactory.dataBaseError(error));\n }\n\n\n });\n }", "function initCart() {\n if (cart == null && cart == undefined) {\n cart = [];\n }\n // console.log(cart);\n}", "function addToCart(id) {\n var troba=false;\n if(cart.length==0){\n cart.push(products[id-1]);\n cart[0].quantity=1;\n }\n else if(cart.length>0){\n for(var i=0; i<cart.length; i++){\n if(products[id-1].name==cart[i].name){\n troba=true;}\n if(troba){\n cart[i].quantity++;}\n }\n if(troba==false){\n cart.push(products[id-1]);\n cart[cart.length-1].quantity=1;\n }\n }\n for( let i=0; i<cart.length; i++){\n cart[i].subtotal=cart[i].quantity*cart[i].price;\n }applyPromotionsCart();\n \n}", "function updateShoppingCart(){\n\t\"use strict\";\n\n\t\t$j('body').bind('added_to_cart', add_to_cart);\n\t\tfunction add_to_cart(event, parts, hash) {\n\t\t\tvar miniCart = $j('.shopping_cart_header');\n\t\t\tif ( parts['div.widget_shopping_cart_content'] ) {\n\t\t\t\tvar $cartContent = jQuery(parts['div.widget_shopping_cart_content']),\n\t\t\t\t$itemsList = $cartContent .find('.cart_list'),\n\t\t\t\t$total = $cartContent.find('.total').contents(':not(strong)').text();\n\t\t\tminiCart.find('.shopping_cart_dropdown_inner').html('').append($itemsList);\n\t\t\tminiCart.find('.total span').html('').append($total);\n\t\t\t}\n\t\t}\n}", "function removeAllProducts() {\n cart = {};\n saveCart();\n showCart();\n}", "function reloadCart() {\n\t\tvar cart = sessionStorage.getItem('cartItems');\n\t\tvar prdcts = JSON.parse(cart);\n\t\tloadCart(prdcts);\n\t}", "function setCartItems(item){\n let cartItems = localStorage.getItem('cartProducts');\n cartItems = JSON.parse(cartItems);\n\n//If no items in cart, set cartItems as the product just added.\n if(cartItems == null){\n item.numInCart = 1;\n cartItems = {\n [item.itemName] : item\n }\n }else {\n // get the previous items from local storage and all others\n if(cartItems[item.itemName] == undefined){\n cartItems = {\n ...cartItems,\n [item.itemName]: item\n }\n }\n cartItems[item.itemName].numInCart += 1;\n }\n\n//set new products in cart.\n localStorage.setItem(\"cartProducts\", JSON.stringify(cartItems));\n\n //update cart\n getCart();\n}", "function setCart() {\n localStorage.setItem(\"cart\", JSON.stringify(cart)); //updates the cart\n}", "addCarting({commit, state}, products) {\n // verify if the 'product' is or not add in the 'carting'. This 'hasOwnProperty' method returns \n // a boolean indicating whether the object has the specified property\n hasOwnProperty.call(state.carting, products.id) \n ? products.amount = state.carting[products.id].amount + 1\n : products.amount = 1;\n //console.log(products.amount);\n // pushing to \"mutation\"\n commit('setCarting', products);\n }", "update(data) {\n return new Promise((resolve, reject) => {\n joi.validate(data, lib.Schemas.cart.cart, (err, value) => {\n if (err) {\n return reject(new Errors.ValidationError(err))\n }\n return resolve(value)\n })\n })\n }", "addProduct(product) {\n let productClone = JSON.parse(JSON.stringify(product));\n\n // Check if product exists in shopping cart already\n let productInCart = this.products.find((p) => {\n return p.id == product.id;\n });\n\n if (productInCart) {\n // Just refresh amount\n productInCart.amount = productInCart.amount + productClone.amount;\n } else {\n // Regulary add selected product to cart\n shoppingCart.products.push(productClone);\n }\n }", "plainAddToCart(payload){\n this.$store.dispatch('cart/create', payload)\n .then(() => {\n this.inCart.push(this.product.id)\n this.product.InCart = true\n })\n }", "addToCart({commit}, product) {\n api.addToCart(product.id)\n .then((response) => {\n console.log(response)\n })\n }", "function addToCart(event) {\n console.log(event);\n\n if (cart.length == 0) {\n // if there is nothing in the cart \n console.log(\"there was nothing in the cart, lets add this product: \", event.data.added.title);\n\n cart.push(event.data.added);\n\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n\n } else {\n\n let foundProduct = false;\n\n $.each(cart, function (index, product) {\n\n if (product.id === event.data.added.id) {\n console.log(\"something similar!\", product.title, product.quantity);\n product.quantity++;\n product.price = product.pricePerUnit * product.quantity;\n foundProduct = true;\n }\n });\n\n // add of a loop over the order array to add total price?\n if (!foundProduct) {\n console.log(\"new product! we simply add it\");\n cart.push(event.data.added);\n }\n\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n }\n\n createCart();\n showBadge();\n}", "function handleUpdate(e) {\n\tfor (let name in updatedQuantity) { // sample updatedQuantity: {usmc fitness book: \"20\", usmc pt shirt 1: \"9\"}\n\t\tcart.updateCart(name, +updatedQuantity[name])\n\t}\n\treRenderTableBody();\n\trenderCartTotal();\n}", "function update_cart(data) {\n $.ajax({\n url: setting.ajax_url,\n type: 'post',\n data: {data: data, action: 'add_to_cart', _token: setting.token},\n success: function (resulf) {\n if (resulf) {\n resulf = JSON.parse(resulf);\n console.log(resulf);\n if (resulf['success']) {\n $('.mini-cart').text(cart.products ? cart.products.length : 0);\n location.href = setting.cart;\n }\n }\n }\n })\n}", "resetCart() {\n this.ds.emptyProducts();\n this.resetList();\n }", "function quanitityToCart(product) {\n let value = parseInt($(\"#amountOfBeer\").val());\n let isProductInCart = 0;\n for (let i = 0; i < cart.length; i++) {\n if (product.id === cart[i].id) {\n cart[i].inCart += value;\n isProductInCart++;\n }\n }\n if (isProductInCart == 0) {\n product.inCart = value;\n cart.push(product);\n }\n saveToLS();\n renderCart();\n}", "function updateCartQuantity() {\n\tvar quantityChange = [];\n\tvar count = 0;\n\tfor (var item in product) {\n\t\tif (cart[item] > product[item].quantity) {\n\t\t\tquantityChange[count] = product[item].name + \":\" + space + product[item].quantity + \"\\n\";\n\t\t\tcart[item] = product[item].quantity;\n\t\t\tproduct[item].quantity = 0;\n\t\t\tcount++;\n\t\t\t\n\t\t}\n\t}\n\tvar msg = \"(If Some Items Are Out Of Stock, They Will Be Automatically Removed From Your Cart)\\n\";\n\tif(quantityChange.length != 0){\n\t\twindow.alert(\"Some Items In Your Cart Have Changed Stock:\\n\" + msg + \"\\n\" + quantityChange.join(\"\"));\n\t}\n\t\n}", "function addFirstItemToLocalStorage() {\n let products = [];\n products[0] = {\n id: id,\n quantity: 1,\n };\n\n setItemToLocalStorage('productsCart', products);\n }", "function push_product_cart(id){\n // console.dir(JSON.parse(localStorage.getItem('products')));\n const product = products.find(product => parseInt(product.id) == parseInt(id));\n const tempProduct = product.price;\n product.quantity = parseInt(document.querySelector(`#quantity-${id}`).value);\n product.price = parseFloat(product.price) * product.quantity; \n let cart_products = [];\n if(localStorage.getItem('products') != null){\n cart_products = JSON.parse(localStorage.getItem('products'));\n if(cart_products.length > 0)\n if(foo(cart_products,id)){\n cart_products.forEach(function(item){\n if(item.id == id){\n item.quantity += parseInt(product.quantity);\n item.price = parseFloat(tempProduct) * parseInt(item.quantity);\n }\n });\n }else{\n cart_products = [...cart_products,product];\n }\n }else{\n cart_products = [...cart_products,product];\n }\n localStorage.setItem('products',JSON.stringify(cart_products));\n const message = document.querySelector('#message');\n message.innerHTML = `Product ${product.name} added to cart successfuly !`;\n message.style.backgroundColor = '#8BC34A';\n message.style.padding = \".5em\";\n setTimeout(function(){\n message.innerHTML = '';\n message.style.backgroundColor = '#8BC34A';\n message.style.padding = \"0px\";\n },3000);\n}", "static async update(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 // check if we have enough items in stock\n // we are only comparing *updated* cart items\n const diff = { items: [] };\n _.each(req.body.items, (item) => {\n const cartItem = _.find(cart.items, { sku: item.sku });\n if (cartItem && parseInt(cartItem.count, 10) !== parseInt(item.count, 10)) {\n diff.items.push(item);\n }\n });\n const invalid = await CartController._checkProductsAvailInStock(diff);\n if (invalid !== '') {\n return res.error(`Item '${invalid}' is not sufficient in stock`);\n }\n\n // update cart\n delete req.body._id; // eslint-disable-line no-underscore-dangle\n const updated = _.assign(cart, req.body);\n\n await updated.save();\n return res.item_with_products(updated);\n } catch (err) {\n return res.error(err.message);\n }\n }", "function addToCart(newProduct){\n let exist = false;\n\n cart.forEach(product => {\n if(product.product.id == newProduct.product.id){ \n exist = true;\n product.quantity += newProduct.quantity;\n \n }\n })\n if(!exist){ \n \n cart.push(newProduct);\n appendProduct(newProduct);\n }\n\n let $amount = document.getElementById(\"amount\");\n $amount.value = 0; \n}", "function updateCart(cartJSON) {\n // Get the entire json object from the document\n var cartJsonObj = jsonParse(cartJSON);\n // Read cart generated timestamp value from cartJsonObj\n var generated = cartJsonObj[\"cart generated\"];\n // Check that a more recent cart document hasn't been processed\n // already\n if (generated > lastCartUpdate) {\n lastCartUpdate = generated;\n\n // Clear the HTML list used to display the cart contents\n var contents = document.getElementById(\"contents\");\n contents.innerHTML = \"\";\n\n // Fetch items array from cartJsonObj\n var items = cartJsonObj.items;\n selectedFeeds = new Array();\n // Loop over the items fetched\n for (var I = 0; I < items.length; I++) {\n\n var item = items[I];\n // Extract the values of name and quantity from item json object\n var name = item.name;\n\n selectedFeeds.push(item[\"item code\"]);\n // Create and add a list item HTML element for this cart item\n var listItem = document.createElement(\"li\");\n listItem.appendChild(document.createTextNode(name));\n contents.appendChild(listItem);\n }\n\n }\n // Update the cart's total using the value from the cartJsonObj\n document.getElementById(\"total\").innerHTML = cartJsonObj.total;\n}", "function getCart() {\n return cart;\n}", "function addtocart1() {\n\tvar a = JSON.parse(sessionStorage.getItem(\"Catalogue\"));\n\tvar b = JSON.parse(localStorage.getItem(\"Items\"));\n\tvar c = parseInt(localStorage.getItem(\"Amount\"));\n\n\tif (b == null) {\n\t\tb = [a[0]];\n\t} else {\n\t\tb.push(a[0]);\n\t};\n\n\tlocalStorage.setItem(\"Items\", JSON.stringify(b));\n\n\tlocalStorage.setItem(\"Amount\", c += a[0].price);\n\talert(\"The current total of the items is R\" + c);\n}", "handleAddToCard (e, products) {\n this.setState(state => {\n const cartItems = state.cartItems;\n let productAlreadyInCart = false;\n cartItems.forEach(item => {\n console.log('dentro de forEach')\n if (item._id === products._id) {\n productAlreadyInCart = true;\n item.count++;\n }\n });\n if (!productAlreadyInCart) {\n console.log('dentro de cartItem push')\n cartItems.push({...products, count: 0});\n }\n localStorage.setItem(\"cartItems\", JSON.stringify(cartItems));\n console.log(this.state.cartItems, \"cart item\")\n return cartItems;\n })\n }", "function updateCartDB() {\n\tconsole.log(\"Updating backend\")\n var shoppingCartJson = {};\n var Items = {};\n shoppingCartJson[\"ShopperID\"] = document.getElementById('Shop_User').innerText\n console.log(shoppingCartJson)\n\n var cartItemContainer = document.getElementsByClassName('cart-items')[0]\n var cartRows = cartItemContainer.getElementsByClassName('cart-row')\n for (var i = 0; i < cartRows.length; i++) {\n var cartRow = cartRows[i]\n var itemName = cartRow.getElementsByClassName('cart-item-title')[0].innerText\n var priceElement = cartRow.getElementsByClassName('cart-price')[0]\n var quantityElement = cartRow.getElementsByClassName('cart-quantity-input')[0]\n var price = parseFloat(priceElement.innerText.replace('$', ''))\n var quantity = quantityElement.value\n var description = cartRow.getElementsByClassName('cart-description')[0].innerText\n console.log(\"Checking updateCartTotal\")\n console.log(itemName)\n console.log(price)\n console.log(quantity)\n console.log(description)\n var item = {}\n var itemDetails = {}\n itemDetails[\"Name\"] = itemName;\n itemDetails[\"Description\"] = description;\n itemDetails[\"Quantity\"] = parseInt(quantity);\n itemDetails[\"Price\"] = parseFloat(price);\n Items[itemName] = itemDetails;\n console.log(Items)\n }\n shoppingCartJson[\"Items\"] = Items;\n versionHTML = document.getElementById(\"version\")\n if (versionHTML.innerText.length != 0) {\n VersionJSON = JSON.parse(versionHTML.innerText)\n console.log(\"Version JSON is\"+VersionJSON)\n shoppingCartJson[\"Version\"] = VersionJSON;\n } else{\n shoppingCartJson[\"Version\"] = {\"Vector\":{}};\n }\n shoppingCartJsonString = JSON.stringify(shoppingCartJson);\n var xhr = new XMLHttpRequest();\n\n\txhr.onreadystatechange = function() {\n\t if (this.readyState == 4 && this.status == 200) {\n console.log(this.responseText);\t\n var shoppingCart = JSON.parse(JSON.parse(this.responseText));\n var shoppingCartVersion = shoppingCart[\"Version\"]\n console.log(shoppingCartVersion)\n var versionHTML = document.getElementById(\"version\")\n versionHTML.innerText = JSON.stringify(shoppingCartVersion)\n\t }\n\t};\n\n xhr.open(\"POST\",\"http://localhost:9000/put\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(shoppingCartJsonString);\n\n \n console.log(shoppingCartJsonString)\n}", "function saveUpdate() {\n\t\tlocalStorage.setItem('cart', JSON.stringify(storedCart));\n\t\tupdateCartCounter();\n\t}", "function addCart(id) {\n //info productos\n let data = localStorage.getItem(\"products\");\n let cart = JSON.parse(data);\n let inCart = [...cart];\n modalContainer.innerHTML = \"\";\n modal();\n //info cart\n\n inCart.map((e) => {\n if (id === e.id) {\n console.log(\"stock producto\", e.stock);\n\n //SI NO HAY STOCK\n if (e.stock === 0) {\n console.log(\"no hay stock\");\n return;\n }\n //SI HAY STOCK\n if (e.stock >= 1) {\n //RESTAR 1 AL STOCK\n e.stock = e.stock - 1;\n let actualStock = e.stock - 1;\n //GUARDAR EN LOCAL STORAGE\n localStorage.setItem(\"products\", JSON.stringify(inCart));\n\n if (localStorage.getItem(\"newProducts\")) {\n sumQuantity(id, actualStock, e);\n }\n\n console.log(\"old\", inCart);\n\n containerProducts.innerHTML = \"\";\n showProduct(cart);\n exist = false;\n }\n }\n });\n}", "function addProductToStorage(product){\r\n if(cartItems.length !== 0){\r\n\r\n console.log(cartItems);\r\n console.log(product);\r\n let found = cartItems.some(item => item.id === product.id);\r\n\r\n console.log(found);\r\n\r\n if(!found){\r\n cartItems.push(product);\r\n }else{\r\n cartItems.forEach(function(item){\r\n if(item.id === product.id){\r\n item.quantity += product.quantity;\r\n item.price += product.price;\r\n }\r\n \r\n });\r\n }\r\n \r\n }else{\r\n cartItems.push(product);\r\n }\r\n \r\n}", "function updateCart() {\n let cartString = localStorage.getItem(\"cart\");\n let cart = JSON.parse(cartString);\n\n if (cart == null || cart.length == 0) {\n console.log(\"cart is empty\");\n $(\".cart-items\").html(\"(0)\");\n $(\".cart-body\").html(\"<h3>Cart does not have any items </h3>\");\n $(\".checkout-btn\").addClass(\"disabled\");\n $(\".prcd-bt\").addClass(\"disabled\");\n\n // $(\".proceedtopay-btn\").addClass(\"disabled\");\n\n\n }\n else {\n console.log(cart);\n $(\".cart-items\").html(`(${cart.length})`);\n\n let table = `\n<table class='table table-primary table-hover'>\n<thead class='thread-light'>\n<tr>\n<th>Product Name</th>\n<th>Price</th>\n<th>Quantity</th>\n<th>TotalPrice</th>\n<th>Action</th>\n\n\n</tr>\n</thead>\n\n`;\n\n let totalPrice =0 ;\n cart.map((item) => {\n\n table += ` \n \n\n <tr>\n\n\n <td> ${item.productName} </td>\n <td> ${item.productPrize} </td>\n <td> ${item.productQuantity} </td>\n <td> ${item.productQuantity*item.productPrize} </td>\n <td> <button onclick=\" deleteItemFromCart( '${item.productName }')\" class=\"btn btn-danger btn-sm\" > Remove </button> </td>\n \n </tr>\n \n \n `\n totalPrice += item.productPrize * item.productQuantity;\n\n });\n \n\n table = table + ` \n<tr> <td colspan='5 class='text-left' ><b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Total Cart Value: &#8377 ${totalPrice} </td> </tr>\n \n</table>`\n \n $(\".cart-body\").html(table);\n \n $(\".checkout-btn\").removeClass(\"disabled\");\n $(\".prcd-bt\").removeClass(\"disabled\");\n\n }\n\n}", "function addtoCart(product_id){\n\n // find\n var result = cart_elements.find(({ id }) => id === product_id);\n if(typeof result === \"undefined\") {\n // obj is not found in cart\n // then add new product\n var new_product = {\"id\":product_id, \"count\":1};\n cart_elements.push(new_product);\n }\n else{\n // get index\n var object_index = cart_elements.findIndex((obj => obj.id == product_id));\n // console.log(\"Before update: \", cart_elements[object_index])\n //Update object's count property.\n cart_elements[object_index].count += 1; \n // console.log(\"After update: \", cart_elements[object_index])\n }\n update_cart();\n //console.log(cart_elements.length);\n}", "function updateCart(e) {\n event.preventDefault();\n var selectedProduct = e.target.productToPurchase.value;\n var selectedQuantity = e.target.quantityInCart.value;\n\n console.log(selectedProduct);\n console.log(selectedQuantity);\n\n // ++ to the timesClicked property for image user click on\n for(var i in Product.allProducts){\n if(selectedProduct === Product.allProducts[i].name){\n Product.allProducts[i].quantityInCart = selectedQuantity;\n console.log(Product.allProducts[i]);\n }\n }\n localStorage.setItem('shoppingCart', JSON.stringify(Product.allProducts));\n}", "function clearCart() {}", "function clearCart() {}", "function clearCart() {}", "function getCart() {\n if (localStorage.getItem(\"cart\") === null) {\n $(\"#cartList\").prepend(\n '<h2 style=\"text-align:center\"><B>Cart is empty</b></h2>'\n );\n removeForm();\n } else {\n tempCart = JSON.parse(localStorage.getItem(\"cart\")); // cart = localstorage cart\n console.log(\"tempCart\");\n console.log(tempCart);\n for (let i = 0; i < tempCart.length; i++) {\n if (\n tempCart[i].amount == false ||\n tempCart[i].amount == undefined ||\n tempCart[i].amount == NaN\n ) {\n getAmount();\n }\n }\n combineDuplicates();\n console.log(\"newTempCart\");\n console.log(tempCart);\n cart = tempCart;\n setCart();\n }\n}", "function addItemToCart() {}", "function addItemToCart() {}", "replaceCart(state, action) {\n state.totalQuantity = action.payload.totalQuantity;\n state.cartItems = action.payload.items;\n }", "function updateCart(cartJson) {\n \n console.log(\"Update cart\");\n \n // Handle the Json Object, parse its properties\n var jsonCart = JSON.parse(cartJson.data);\n var generated = jsonCart.cart.generated;\n \n if (generated > lastCartUpdate) {\n \n lastCartUpdate = generated;\n \n // Clear the HTML list used to display the cart contents\n var contents = document.getElementById(\"contents\");\n contents.innerHTML = \"\";\n \n // Loop over the items in the cart\n var items = jsonCart.cart.cartItem;\n for (var I = 0 ; I < items.length ; I++) {\n var item = items[I];\n \n // Extract the text nodes from the name and quantity elements\n var name = item.name;\n var quantity = item.quantity;\n \n // Create and add a list item HTML element for this cart item\n var listItem = document.createElement(\"li\");\n listItem.appendChild(document.createTextNode(name+\" x \"+quantity));\n contents.appendChild(listItem);\n }\n }\n \n // Update the cart's total using the value from the cart document\n document.getElementById(\"total\").innerHTML = jsonCart.cart.total;\n}", "function updateQuantity(id, newQuantity) {\n\n var basket = JSON.parse(localStorage.BASKET);\n // loop through products in basket\n for (var i = 0; i < basket.length; i++) {\n\n var basketProduct = JSON.parse(basket[i]);\n\n // if the product is already in the basket, add the new quantity\n if (basketProduct.productID == id) {\n basketProduct.quantity = newQuantity;\n basket[i] = JSON.stringify(basketProduct);\n }\n }\n // updates the basket\n localStorage.BASKET = JSON.stringify(basket);\n ajaxGet('inc/basket.php', loadBasket);\n updateBasketCost();\n}", "function getAmount() {\n tempCart.forEach((product) => {\n product.amount = 1;\n console.log(\"product already had an amount of \" + product.amount);\n });\n}", "function addToCart(prod_id) {\n console.log(products.data);\n let product = products.find((item) => {\n return item.prod_id == prod_id;\n });\n \n cart.push(product);\n \n localStorage.setItem(\"cart\", JSON.stringify(cart));\n renderCart(storedCartitems);\n \n console.log(prod_id);\n \n \n}", "function updateCartItems(ItemName, quantity, OneOrHalf) {\n for (var i = 0; i < 8; i++) {\n if (QuantityFromIceCream[i].brand == ItemName) {\n if (OneOrHalf == 1) {\n QuantityFromIceCream[i].Onekg = quantity;\n } else {\n QuantityFromIceCream[i].Halfkg = quantity;\n }\n }\n }\n var JSONreadyUsers = JSON.stringify(QuantityFromIceCream);\n updateShoppingCart();\n}", "function appendToCart(){\n ui.cartItems.innerHTML = \"\";\n cart.forEach((item)=>{\n ui.appendToCart(item.imgSrc,item.title,item.size,item.price,item.id,item.numberOfUnits);\n })\n}", "addToCart({commit}) { \n commit('setCartItemsLocal');\n }", "cartPlusOne(product) {\r\n product.quantity = product.quantity + 1;\r\n }", "function addBasket() {\n if (basket.length === 0 || (basket.find(x => x.name === item.name)) === undefined) {\n item.quantity = updatedQuantity\n basket.push(item)\n } else {\n for (let i=0; i < basket.length; i++) {\n if (basket[i].name === item.name) {\n basket[i].quantity = basket[i].quantity + updatedQuantity\n } \n }\n }\n productTotal();\n basketCount();\n localStorage.setItem(\"savedBasket\", JSON.stringify(basket));\n}", "function setCart() {\n cart.forEach(\n (item) =>\n !filteredCart.filter(\n (cart) => (cart.name === item.name) & (cart.size === item.size)\n ).length > 0 && filteredCart.push(item)\n );\n\n filteredCart.forEach((item) =>\n cartNew.push(\n cart.filter((i) => (i.name === item.name) & (i.size === item.size))\n )\n );\n }", "function addItemsToCart(button, products) {\n button.innerText = 'Added to Bag'; // change button text\n let productId = button.dataset.id; // get the id of the button that was clicked\n let product = products.find(product => { // compare if the array id and the returned id are the same\n return product.id === productId;\n });\n product['quantity'] = 1;\n product['discount'] = 0;\n product['total'] = product.price;\n product['discountedTotal'] = product.price;\n\n //add items to local storage\n let items;\n let cartItems = localStorage.getItem('cartItems');\n if (cartItems) {\n items = JSON.parse(cartItems);\n let itemExists = items.find(item => item.id === product.id);\n if (!itemExists) {\n items.push(product);// add product to the array\n }\n localStorage.setItem('cartItems', JSON.stringify(items));\n } else {\n items = [product];\n localStorage.setItem('cartItems', JSON.stringify(items));// put it in local storage\n }\n //send items to cart ui\n sendItemsToCartUI(items);\n grandTotals(items);\n document.querySelector('.cart-items').innerText = items.length;\n // show cart on the screen\n openCart();\n}", "handleCartUpdate() {\n // Update Cart Badge\n this.dispatchEvent(\n new CustomEvent(CART_CHANGED_EVT, {\n bubbles: true,\n composed: true\n })\n );\n // Notify any other listeners that the cart items have updated\n fireEvent(this.pageRef, CART_ITEMS_UPDATED_EVT);\n }", "cartUpdate($target) {\n const itemId = $target.data('cart-itemid');\n const $el = $('#qty-' + itemId);\n const qty = parseInt($el.val(), 10);\n const oldQty = parseInt($el.data('orig-qty'), 10);\n\n // If quantity set to 0 (or otherwise falsey), confirm removal\n if (!qty) {\n const remove = confirm(Theme.messages.cart.remove_item);\n if (!remove) {\n $el.val(oldQty);\n return;\n }\n }\n\n // Disable the cart while updates are running...\n this.$cartContent.addClass('deactivated');\n this.$cartTotals.addClass('deactivated');\n\n utils.api.cart.itemUpdate(itemId, qty, (err, response) => {\n if (response.data.status === 'succeed') {\n // if the quantity is changed \"1\" from \"0\", we have to remove the row.\n const remove = (qty === 0);\n this.refreshContent(remove);\n } else {\n $el.val(oldQty);\n // TODO: Better error messages possible? 'out_of_stock' is a bit limiting.\n alert(response.data.errors.join('\\n'));\n this.$cartContent.removeClass('deactivated');\n this.$cartTotals.removeClass('deactivated');\n }\n });\n }", "function updateCart() { //mostando ou nao o carrinho\n c('.menu-openner span').innerHTML = cart.length; // dando update na tela do cel\n\n\n\n\n if (cart.length > 0) {\n c('aside').classList.add('show'); // ad a class que foi criada chamada de show para aparecer o carrinho\n c('.cart').innerHTML = '';\n\n let subtotal = 0;\n let desconto = 0;\n let total = 0;\n\n for (let i in cart) {\n let pizzaItem = pizzaJson.find((item) => item.id == cart[i].id);\n subtotal += pizzaItem.price[cart[i].size] * cart[i].qt; // calculando subtotal; (ADD a parte do size) [cart[i].size]\n\n\n let cartItem = c('.models .cart--item').cloneNode(true);\n\n let pizzaSizeName;\n switch (cart[i].size) {\n case 0:\n pizzaSizeName = 'P'\n break;\n case 1:\n pizzaSizeName = 'M'\n break;\n case 2:\n pizzaSizeName = 'G'\n break;\n }\n\n let pizzaName = `${pizzaItem.name} (${pizzaSizeName})`\n //add as infos da pizza no carrinho//\n\n cartItem.querySelector('img').src = pizzaItem.img;\n cartItem.querySelector('.cart--item-nome').innerHTML = pizzaName;\n cartItem.querySelector('.cart--item--qt').innerHTML = cart[i].qt;\n cartItem.querySelector('.cart--item-qtmenos').addEventListener('click', () => {\n\n if (cart[i].qt > 1) {\n cart[i].qt--;\n } else {\n cart.splice(i, 1);\n }\n\n updateCart();\n });\n cartItem.querySelector('.cart--item-qtmais').addEventListener('click', () => {\n cart[i].qt++;\n updateCart();\n });\n\n\n //--------------------------------//\n\n\n c('.cart').append(cartItem);\n\n }\n\n desconto = subtotal * 0.1;\n total = subtotal - desconto;\n\n c('.subtotal span:last-child').innerHTML = `R$ ${subtotal.toFixed(2)}`; // comando last-child para pergar ultimo item do span\n c('.desconto span:last-child').innerHTML = `R$ ${desconto.toFixed(2)}`;\n c('.total span:last-child').innerHTML = `R$ ${total.toFixed(2)}`;\n } else {\n c('aside').classList.remove('show');\n c('aside').style.left = '100vw'\n };\n }", "addToCartHandler(p) {\n const { id, name, price, quantity } = p; // destructure\n const item = this.state.cart.find(v => v.id === id);\n if (item) {\n window.alert(\"Product already exists on the cart.\");\n } else {\n const product = {\n id, name, price, quantity, amount: price * quantity\n }\n this.setState(prevState => {\n return {\n ...prevState,\n cart: [...prevState.cart, product]\n }\n });\n setTimeout(() => {\n const amount = this.state.cart.map(v => v.amount).reduce((t, c) => t += c);\n this.setState({ totalAmount: amount });\n }, 500);\n }\n }", "updateCartItemQuantity(amount, cartDetailID) {\n const url = WebshopEndpoint + \"/ShoppingCartController/UpdateItemQuan/\" +\n cartDetailID; \n\n fetch(url, { \n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n dataType: \"application/json\"\n },\n body: JSON.stringify(amount)\n })\n .then(response => response.json())\n .then((json) => {\n switch (json.id) {\n case 603:\n this.setState(prevState => {\n const updatedItems = prevState.items.map(prod => {\n if (prod.cartDetailID === cartDetailID) {\n prod.quantity = json.result\n }\n return prod\n })\n return {\n items: updatedItems\n }\n }) \n break;\n case 602:\n this.removeItemFromCartItemsState(cartDetailID);\n break;\n default:\n // Logger besked så vi ved hvilken fejl der forekom \n console.log(json.message)\n }\n }).then(() => this.updateTotalCartQuantity())\n .catch(() => {\n console.log(\"An error occured\");\n });;\n }", "function getCartItems(){\n return cart_items;\n}", "function addToCart(newItem) {\n console.log(newItem);\n const index = findCartItem(\n newItem.product.id,\n newItem.toppings,\n newItem.remark\n );\n\n if (index === -1) {\n setCart([...cart, { ...newItem, id: uuidV4() }]);\n } else {\n return -1;\n }\n }", "function updateCartPreview() {\n // TODO: Get the item and quantity from the form\n // TODO: Add a new element to the cartContents div with that information\n}", "getUpdatedCart() {\n Promise.all([fetchCart(), fetchCartItems()])\n .then(results => {\n this.setState({\n cart: results[0],\n cartItems: results[1]\n })\n })\n }", "addBoothToCart(product, subitem){\n this.cart.forEach(m => {\n if ( m.booths && m.id == product.id ){\n this.total -= m.price;\n this.cart = this.cart.filter(n => n.id !== m.id);\n }\n if ( m.notify ){\n this.cart = this.cart.filter(n => !n.notify);\n }\n })\n product.booths.booths = true;\n product.booths.quantity++;\n product.booths.name = subitem.name;\n product.booths.price = subitem.price;\n cartitem = Object.assign({}, product.booths);\n this.cart.push(cartitem);\n this.total += cartitem.price;\n }", "function add_to_cart(pid,pname,price){\n\tlet cart=localStorage.getItem(\"cart\");\n\tif(cart==null){\n\t\tlet products=[];\n\t\tlet product={\"proid\":pid,\"pname\":pname,\"price\":price,\"quantity\":1};\n\t\tproducts.push(product);\n\t\tlocalStorage.setItem(\"cart\",JSON.stringify(products));\n\t}\n\telse{\n\t\tlet pcart=JSON.parse(cart);\n\t\tlet oproduct=pcart.find( (item) => item.proid==pid );\n\t\tif(oproduct){\n\t\t\toproduct.quantity=oproduct.quantity+1;\n\t\t\tpcart.map((item)=>{\n\t\t\t\tif(oproduct.proid==item.proid){\n\t\t\t\t\titem.quantity=oproduct.quantity;\n\t\t\t\t}\n\t\t\t})\n\t\t\tlocalStorage.setItem(\"cart\",JSON.stringify(pcart));\n\t\t\tconsole.log(\"product quantity increase\");\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tlet product={\"proid\":pid,\"pname\":pname,\"price\":price,\"quantity\":1};\n\t\t\tpcart.push(product);\n\t\t\tlocalStorage.setItem(\"cart\",JSON.stringify(pcart))\n\t\t\tconsole.log(\"new product added\");\n\t\t}\n\t\t\n\t}\n\tupdateCart();\n}", "addToCart (productt) {\n checkRepeated(productt) \n added()\n console.log(productt)\n }", "_changeQuantity(productId) {\n const value = this.shadowRoot.querySelector('#chart_item_' + productId).value;\n\n const cartItem = this._findCartItem(productId);\n\n const index = this.cartItems.indexOf(cartItem);\n this.cartItems[index].quantity = value;\n this.cartItems = [...this.cartItems]; // this.cartItems[index] = cartItem['quantity'] + 1;\n // this.set('cartItems.' + index + '.quantity', cartItem['quantity'] + 1);\n\n localStorage.setItem('shop-cart', JSON.stringify(this.cartItems));\n this.dispatchEvent(new CustomEvent('change-cart-count', {\n bubbles: true,\n composed: true,\n detail: {}\n }));\n }", "function updateQuantity() {\n let prod = this.closest(\".cart-item\");\n let prod_cost = prod.children[2].innerText.slice(1);\n prod.children[4].innerText = `$${Number(prod_cost)*this.value}`\n\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 == prod.children[1].innerText) {\n z[k].quantity = this.value;\n }\n arr.push(z[k]);\n }\n localStorage.setItem(\"CartItem\", JSON.stringify(arr));\n}", "addToCart(productData) {\n\n //1. create a productObj object from the data attributes in 'productData' variable\n let productObj = this.createProductObj(productData);\n\n //2. check if the product is already in cart\n let productInCart = this.productAlreadyInCart(productObj.productId);\n\n \n if(productInCart) {\n\n //2.1.) product is IN cart and IN stock \n // productObj.productCurrentCount = ++productInCart.productCurrentCount;\n let success = this.increaseProductCount(productInCart);\n if(!success) {\n console.log(\"Product is out of stock\");\n }\n return true;\n \n } else {\n \n //3.) product not in cart => set its count to 1 \n productObj.productCurrentCount = 1;\n \n //add this new product to cart\n this.addNewProduct(productObj);\n return true;\n }\n\n }" ]
[ "0.8029781", "0.78955716", "0.7504164", "0.74371463", "0.7170738", "0.712077", "0.709515", "0.7085033", "0.70527315", "0.70392627", "0.7026553", "0.70200926", "0.70095426", "0.69086605", "0.688936", "0.6771302", "0.673569", "0.673022", "0.67054623", "0.6696708", "0.66939217", "0.66939217", "0.6678672", "0.6675949", "0.6667219", "0.66631943", "0.6658783", "0.66535383", "0.66518575", "0.66484636", "0.6647524", "0.66460145", "0.66439295", "0.6636555", "0.66358244", "0.66189265", "0.65850514", "0.6583653", "0.6580517", "0.6579642", "0.6579636", "0.6569652", "0.65646106", "0.65481526", "0.65336525", "0.6519548", "0.65123683", "0.6480783", "0.6475967", "0.64739025", "0.6464248", "0.6453345", "0.6448864", "0.64451545", "0.6441767", "0.6439551", "0.6437184", "0.6432822", "0.641429", "0.6413793", "0.64134854", "0.6411928", "0.64091575", "0.640781", "0.6406962", "0.63997024", "0.63905835", "0.63811404", "0.63810444", "0.63810444", "0.63810444", "0.63779145", "0.63728267", "0.63728267", "0.63693625", "0.63661456", "0.63556594", "0.63554925", "0.6353824", "0.6347725", "0.63411385", "0.6338838", "0.6333044", "0.63322735", "0.63209736", "0.63204014", "0.63171583", "0.63116854", "0.63113856", "0.6310337", "0.6310221", "0.630899", "0.62996304", "0.62967396", "0.62921405", "0.62861514", "0.62822986", "0.62780195", "0.62751186", "0.62682784", "0.62676835" ]
0.0
-1
Kim has just purchased her first laptop it was twohundred & sixty bucks because of the big tax but now hey she all the coding that she wants how nice was that! I mean it was a little bit complicated at first, because we have to create this compose function but now that we have this compose in place purchase item works really nice exactly like a factory we add item to cart apply cart to item buy iitem empty cart if new functionality such as update Kim status to not active if we need it to add new functionality the rest of the code doesnt really care about that we can just create a new function & just add it in here thats the beauty of functional programming this idea of we are building this small composable functions that are each worried about their own world so that whentever bugs happen well as long as they are tested well its likely not them its most likely inplace in where we might have state or you might be mutating state but we know hey these functions are ok because they are prior now here is the really really interesting part why I think functional programming & the concepts arround it are so interesting because now if we wanna say create another function like refund item
function refundItem() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // & act over the data that we receive", "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // so I have to make sure that I have returned in here this property", "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // the reduce function which is in itself a higher order function", "function purchaseItem(...fns)\n\n\n{} // & these spreads functions", "function purchaseItem(...fns) => fns\n\n{} // so what I am going to do is I am going to use reduce", "function purchaseItem(...fns) => fns.reduce()\n\n{} // & in reduce I am going to pass a callback function", "getMarketItems() {\n return [\n {\n action: \"Deposit Gold\",\n cost: 10,\n info: \"Deposits remaining gold in the bank. Gain 1% interest every 5 adventure days.\",\n onBuy: (ns) => {\n ns.message = \"You deposit \" + ns.gold + \" gold into your bank account.\"\n ns.bank += ns.gold;\n ns.gold = 0; \n return ns;\n },\n },\n {\n action: \"Healing Potion\",\n cost: 2 * ((5 * (this.state.potion + 1)) ** 2),\n info: \"Carry +1 Potion that gets spent to prevent defeat and recovers 25% of your Health.\",\n onBuy: (ns) => {\n ns.message = \"You aquire a Healing Potion. It will be used automatically when needed.\"\n ns.potion++;\n return ns;\n },\n },\n {\n action: \"Purchase Sword\",\n cost: ((this.state.sword || 0) + 1) * 50,\n info: \"Grants +1 Sword, which increases damage per round. Upkeep +\" + \n (this.state.sword) * 2 + \".\",\n onBuy: (ns) => {\n ns.message = \"You buy a new armor. Gain +1 Armor.\"\n ns.upkeep += ++ns.armor * 5;\n ns.hp = ns.hpMax += 2;\n return ns;\n },\n },\n {\n action: this.state.armor < 1 ? \"Purchase Armor\" : \"Improve Armor\",\n cost: ((this.state.armor || 0) + 1) * 200,\n info: \"Grants +1 Armor, which prevents some damage per round, and +2 Health. Upkeep +\" + \n ((this.state.armor || 0) + 1) * 5 + \".\",\n onBuy: (ns) => {\n ns.message = \"You buy a new sword. Gain +1 Sword.\"\n ns.upkeep += ns.sword++ * 2;\n return ns;\n },\n },\n {\n action: this.state.mount < 1 ? \"Purchase Mount\" : \"Train Mount\",\n cost: ((this.state.mount || 0) + 1) * 500,\n info: \"Skip rooms with \" + \n (this.state.mount ? this.state.mount + \" encounters or less\" : \"no encounters\") + \n \". Reduced travel time. Upkeep +\" + ((this.state.armor || 0) + 1) * 4 + \".\",\n onBuy: (ns) => {\n ns.message = \"You \" + (ns.mount ? \"train your \" : \"buy a new\") + \" mount.\";\n ns.upkeep += ++ns.mount * 4;\n return ns;\n },\n },\n {\n action: \"Improve Lifestyle\",\n cost: ((this.state.regen * 100) ** 2),\n info: \"Grants +0.5 Regen, and +1 Health per Level.\",\n onBuy: (ns) => {\n ns.message = \"You improve your lifestyle, gain +0.5 Regen and +\" + ns.lv + \" Health\";\n ns.regen += 0.5;\n ns.hpBonus++;\n ns.hpMax += ns.lv;\n return ns;\n }\n },\n ];\n }", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {\n return\n}", "function BasketItem({ item }) {\n const deleteItem = id => {\n cartStore.dispatch({\n type: actionTypes.removeItem,\n payload: {\n id\n }\n });\n };\n\n //increase item qty\n const handleIncrement = payload => {\n cartStore.dispatch({\n type: actionTypes.increaseQty,\n payload: payload\n });\n };\n\n //Decrease item qty\n const handleDecrement = payload => {\n cartStore.dispatch({\n type: actionTypes.decreaseQty,\n payload: payload\n });\n // reCalculateTotal();\n };\n\n return (\n <div className=\"basketItem\">\n <img className=\"basketItem__Image\" src={item.data.image} />\n <div className=\"basketItem__info\">\n <p className=\"basketitem__Title\"> {item.data.title}</p>\n <p className=\"basketItem__Price\">\n <small>$</small>\n <strong>{item.data.price}</strong>\n </p>\n <div className=\"basketItem__Ratings\">\n {Array(item.data.rating)\n .fill()\n .map(() => (\n <p key={uuidv4()}>⭐️ </p>\n ))}\n </div>\n <p className=\"basketItem__description\">{item.data.description}</p>\n\n <p className=\"basketItem_qtyLabel\"> Qty :</p>\n\n <div className=\"basketItem__qty\">\n <button\n className=\"basketItem__increaseQty\"\n onClick={() => handleIncrement(item.data.id)}\n >\n +\n </button>\n <button>{item.data.qty}</button>\n\n <button\n className=\"basketItem__decreaseQty\"\n onClick={() => handleDecrement(item.data.id)}\n >\n -\n </button>\n </div>\n <button\n className=\"basketItem__RemoveBtn\"\n onClick={() => {\n deleteItem(item.data.id);\n }}\n >\n Remove from Basket\n </button>\n </div>\n </div>\n );\n}", "function buyItem() {\n\n}", "function ShoppingCartItem({ id, count, index }) {\n const { name, price } = data[id]\n const dispatcher = useDispatch()\n return (\n <li>\n <strong>{name}</strong>\n <span> * {count}</span>\n <span>{price}</span>\n <button\n onClick = {() => {} }\n >-</button>\n <button\n onClick={ () => dispatcher(removeFromCart(index) )}>\n Remove from Cart\n </button>\n <button\n onClick={ () => dispatcher(addOne(index) )}>\n Add from Cart\n </button>\n\n </li>\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 ItemContainer( props ) {\n return (\n <div>\n <h4> Item - { props.type} - { props.item } </h4>\n <button onClick = { () => props.buyItem() }> Buy { props.type }</button> \n </div>\n )\n}", "render() {\n // let { cart, increment, decrement, removeItem, clearCart } = this.context;\n\n return (\n <ProductConsumer>\n {value => {\n const {\n cart,\n increment,\n decrement,\n removeItem,\n clearCart,\n cartSubtotal,\n cartTex,\n cartTotal\n } = value;\n if (cart.length > 0) {\n return (\n <>\n <button\n type=\"submit\"\n onClick={() => {\n clearCart();\n }}\n >\n Clear Cart\n </button>\n <br />\n <div className=\"total\">\n <span>SubTotal:{cartSubtotal}</span>\n <span>Tex:{cartTex}</span>\n <span>Total:{cartTotal}</span>\n </div>\n <ul>\n {cart.map(item => {\n return (\n <li className=\"cart-item\" key={item.id}>\n <div className=\"cart-item-image\">\n <img src={item.img} alt={item.img} />\n </div>\n <div className=\"cart-item-info\">\n <span>Name:{item.title}</span>\n <br />\n <span>Company:{item.company}</span>\n <br />\n <span>Price:{item.price}</span>\n <br />\n <br />\n <div className=\"cart-item-buttons\">\n <button\n type=\"submit\"\n onClick={() => {\n increment(item.id);\n }}\n >\n +\n </button>\n <span>{item.count}</span>\n <button\n type=\"submit\"\n onClick={() => {\n decrement(item.id);\n }}\n >\n -\n </button>\n </div>\n <button\n type=\"submit\"\n onClick={() => {\n removeItem(item.id);\n }}\n >\n X\n </button>\n </div>\n </li>\n );\n })}\n </ul>\n </>\n );\n } else {\n return <div className=\"error\">Sorry NO Product in Cart</div>;\n }\n }}\n </ProductConsumer>\n );\n }", "function Cart () {\n const { cart, removeItem, cartLength, vaciarCarrito, totalPrice } = useContext(CartContext);\n\n return (\n cartLength <= 0 ? \n (<div>\n <h1 className= \"formato\">DETALLE DE TU COMPRA</h1>\n \n <div>\n <h2 className= \"formato\">Tu carrito esta vacío... \n\n ¡Comenza a disfrutar de la moda a tu manera, clickea aquí abajo!<i className=\"far fa-smile-beam\"></i></h2>\n \n <Link to=\"/\">\n <button className=\"boton empezaComprar\" >¡Empezá a comprar!</button>\n </Link>\n </div>\n </div>\n ):(\n <div>\n <div>\n <h1 className= \"formato\">DETALLE DE TU COMPRA</h1>\n </div>\n <div className= \"container-fluid\">\n <div className = \"row estiloTitulo\">\n <h4 className= \"col-md-6 estiloItems\">Productos</h4>\n <h4 className= \"col-md-2 estiloItems\">Cantidad</h4>\n <h4 className= \"col-md-2 estiloItems\">Precio</h4>\n <h4 className= \"col-md-1 estiloItems\">Acciones</h4>\n </div>\n </div>\n\n { cart.map((item) => {\n return (\n <div className= \"container-fluid\">\n <div className= \"row estiloTituloDos\" key={item.id}>\n <div className= \"col-md-2 estiloItemsDos\"><img style= {{ maxWidth: \"100%\", maxHeight: \"50px\"}} src={item.img} alt={item.name}/></div>\n <div className= \"col-md-4 estiloItemsDos\">{item.name}</div>\n <div className= \"col-md-2 estiloItemsDos\">{item.quantity}</div> \n <div className= \"col-md-2 estiloItemsDos\">$ {item.price}</div>\n <div className= \"col-md-1 estiloItemsDos\">\n <Link to={`/item/${ item.id }`}><button className=\"iconos2\"><i className=\"fas fa-pencil editar\"></i></button></Link>\n <button className=\"iconos2\" onClick={()=>removeItem(item.id)}><i className=\"fas fa-trash eliminar\"></i></button>\n </div>\n </div>\n </div>\n )\n })\n }\n <div>\n <h3 className=\"tituloCompra\">Total de su compra: ${totalPrice}</h3>\n <div className=\"acomodarBoton\">\n <button onClick={ ()=> vaciarCarrito() } className=\"emptyButton iconos\">Vaciar <i className=\"fas fa-trash eliminar\"> </i></button>\n <Link to=\"/\" ><button className=\"emptyButton iconos\" >Seguir Comprando <i className=\"fas fa-hand-point-left continuar\"> </i></button></Link>\n <Link to= \"/cartForm\"><button className=\"emptyButton iconos\">Finalizar Compra <i className=\"fas fa-check-square finalizar\"></i></button></Link>\n </div>\n </div>\n </div>\n \n ))\n}", "function addItemToCart(user, item) {\n const updateCart =\n}", "function composeCard(card, board = 'game') {\n\n let cardHtml = '';\n\n if (card.type === 'ship') {\n\n let coinHtml = '<img src=\"./img/coin.png\" width=\"32px\" class=\"ship-coin-image\">';\n let totalCoinHtml = coinHtml.repeat(card.coins);\n\n cardHtml = `\n <div class=\"board-card border-${card.color}\" ${ board !== 'modal' ? `id=\"board-card-${card.id}\"` : ''}>\n <h3>${card.name}</h3>\n <div class=\"ship-card-coins justify-content-center\">\n ${totalCoinHtml}\n </div>\n <p><i class=\"${getIcons(card.name)} lead-icon\"></i></p>\n <p><img src=\"./img/swords.png\" width=\"26px\"> ${card.swords}</p>\n ${board === 'game' ? `<button class=\"btn btn-primary btn-small m-2 card-button\" onclick=\"purchaseCard(${card.id})\" ${checkIfAffordable(card) ? '' : 'disabled'}>${(card.type == 'ship') ? 'Take coins' : 'Purchase' }</button>` : ''}\n </div>\n `;\n return cardHtml;\n }\n\n if (card.type !== 'tax') {\n\n let tooltipText = '';\n\n switch (card.name) {\n case 'Trader':\n tooltipText = `Gives an additional coin for ${card.color} ships you take from the board`;\n break;\n case 'Madamoiselle':\n tooltipText = `Discounts all prices by one coin`;\n break;\n case 'Sailor':\n case 'Pirate':\n tooltipText = `Their swords help you defeat ships in the harbor`;\n break;\n case 'Captain':\n case 'Priest':\n case 'Jack of all Trades':\n case 'Settler':\n tooltipText = `Can be used to purchase expeditions`;\n break;\n case 'Governor':\n tooltipText = `Grants you an additional move each turn`;\n break;\n case 'Admiral':\n tooltipText = `Gives you 2 coins if there are 5 cards on the board when it is your turn to act`;\n break;\n case 'Jester':\n tooltipText = `Gives you one coin any time there are two ships of the same color on the board`;\n break;\n default:\n break;\n }\n\n cardHtml = `\n <div class=\"board-card border-${card.color}\" id=\"board-card-${card.id}\">\n <div class=\"card-top\">\n <div class=\"board-card-title\">\n <h3>${card.name}</h3>\n </div>\n <div class=\"card-tooltip\">\n <i data-tippy-content=\"${tooltipText}\" class=\"far fa-question-circle\"></i>\n </div>\n </div>\n \n <p>\n <i class=\"${getIcons(card.name)} lead-icon\"></i>\n </p>\n <p>\n <img src=\"./img/coin.png\" width=\"20px\"> ${(card.coins - madamoiselleDiscount(card) >= 0) ? card.coins - madamoiselleDiscount(card) : 0 }\n </p>\n <p>\n <img src=\"./img/shield.png\" width=\"20px\"> ${card.points}\n </p>\n <p>\n <img src=\"./img/swords.png\" width=\"20px\"> ${card.swords}\n </p>\n ${board === 'game' ? `<button class=\"btn btn-primary btn-small m-2 card-button\" onclick=\"purchaseCard(${card.id})\" ${checkIfAffordable(card) ? '' : 'disabled'}>${(card.type == 'ship') ? 'Take coins' : 'Purchase' }</button>` : ''}\n </div>`;\n\n } else if (card.type === 'tax') {\n\n if (card.requirements === 'min points') {\n taxDescription = 'the least points';\n } else {\n taxDescription = 'the most swords';\n }\n\n cardHtml = `\n <div class=\"board-card border-${card.color}\">\n <h3>${card.name}</h3>\n <p><i class=\"${getIcons(card.name)} lead-icon\"></i></p>\n <p><img src=\"./img/${card.requirements === 'min points' ? 'shield' : 'swords'}.png\" width=\"40px\"></p>\n <p>${card.requirements}</p>\n </div>`;\n }\n\n return cardHtml;\n}", "function App() {\n const navigate = useNavigate();\n // const fetchPrimitive = (name) =>{\n // try {\n // return JSON.parse(localStorage.getItem(name)) ?? [];\n // } catch (error) {\n // console.log(\"Parsed local storage info could not be retrieved\")\n // return [];\n // }\n // }\n const fetchObject = (name)=>{\n try {\n if (typeof JSON.parse(localStorage.getItem(name)) === 'object'){\n return JSON.parse(localStorage.getItem(name)) ?? [];\n }else{\n return parseInt(JSON.parse(localStorage.getItem(name))) ?? 0;\n }\n \n } catch (error) {\n console.log(\"Parsed local storage info could not be retrieved\")\n return [];\n }\n }\n // STATE\n const [activeItem, setActiveItem] = useState(fetchObject(\"activeItem\"));\n const [cart, setCart] = useState(fetchObject(\"cart\"));\n const [orderTotal, setOrderTotal] = useState(fetchObject(\"orderTotal\"));\n const { data: options, loading, error } = useFetch(\"complexOptions\")\n const [sides, setSides] = useState([])\n // DERIVED STATE\n const [id, setId] = useState(fetchObject(\"id\")); \n console.log(\"id: \", id)\n //----------------------------------------------------------------------------//\n function showActiveItem(i){\n setActiveItem(i)\n if(i.complexity === \"simple\"){\n navigate('/item');\n }else{\n navigate('/complexItem')\n }\n }\n useEffect(()=>{\n localStorage.setItem(\"activeItem\", JSON.stringify(activeItem));\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n localStorage.setItem(\"id\", JSON.stringify(id)); \n localStorage.setItem(\"orderTotal\", JSON.stringify(orderTotal));\n }, [activeItem, cart, id, orderTotal]);\n\n function addToCart(i, sides, choiceList, qty){\n setId(id => id + 1)\n function priceDetermination(item, qty){\n if (qty === undefined) return item.price;\n switch (item.name.toLowerCase()) {\n case \"tacos\":\n if (parseInt(qty)===1) {\n return item.price = options.prices.tacos.one; \n } else if (parseInt(qty) === 3){\n return item.price = options.prices.tacos.three;\n }else{\n return item.price = options.prices.tacos.five;\n }\n default:\n throw new Error;\n }\n }\n\n let truePrice = priceDetermination(i, qty); \n\n setCart((item)=>{\n setOrderTotal((t)=>{\n return t + parseInt(truePrice);\n })\n return [...item, {\n name: i.name, \n price: truePrice, \n id: id, \n complexity: i.complexity, \n sides, \n qty, \n choices: choiceList}];\n });\n navigate('/cart')\n }\n function addSingleItem(i){\n setId(id => id + 1)\n setCart(item=>{\n \n setOrderTotal(t=>{\n return t + parseInt(i.price); \n })\n return [...item, {\n name: i.name,\n price: i.price, \n id: id\n }]\n })\n navigate('/cart')\n }\n \n function deleteFromCart(id){\n if(cart.length === 1){\n setOrderTotal(0);\n setId(0);\n setCart([])\n return; \n }\n let itemToDelete;\n let price; \n for (let i = 0; i < cart.length; i++) {\n if(parseInt(id)===cart[i].id){\n itemToDelete = i; \n price = parseInt(cart[i].price);\n } \n }\n cart.splice(itemToDelete, 1); \n console.log(\"deleted item\", itemToDelete)\n setCart((items)=>{\n return [...items]; \n })\n setOrderTotal(total => {\n return total - price; \n })\n \n }\n\n function addToSides(val) {\n setSides((side) => {\n return [...side, val]\n })\n }\n\n function deleteFromSides(val) {\n let newArr = [];\n for (let i = 0; i < sides.length; i++) {\n const c = sides[i];\n if (val != c) {\n newArr.push(c);\n }\n }\n setSides(newArr)\n }\n\n function emptyCart() {\n setOrderTotal(0); \n setCart([]);\n setId(0); \n }\n\n return (\n <div>\n <Link to=\"/\">Home</Link>\n <Link to=\"/about\">About</Link>\n <Link to=\"/gallery\">Gallery</Link>\n <Link to=\"/menu\">Menu</Link>\n <Link to=\"/cart\">Cart<span>{cart.length}</span></Link>\n <Routes>\n <Route path=\"/\" element={<Home />} />\n <Route path=\"/about\" element={<About />} />\n <Route path=\"/gallery\" element={<Gallery />} />\n <Route path=\"/menu\" element={\n <Menu \n // moveToActive={moveToActive}\n \n addSingleItem={addSingleItem}\n showActiveItem ={showActiveItem}\n />\n } />\n <Route path=\"/cart\" element={\n <Cart\n cart={cart}\n emptyCart={emptyCart}\n deleteFromCart={deleteFromCart}\n orderTotal={orderTotal}\n />\n } />\n <Route path=\"/item\" element={\n <Item\n sides={sides}\n activeItem={activeItem}\n addToCart={addToCart}\n addToSides={addToSides}\n deleteFromSides={deleteFromSides}\n />\n } />\n <Route path=\"/complexItem\" element={\n <ComplexItem\n sides={sides}\n activeItem={activeItem}\n addToCart={addToCart}\n addToSides={addToSides}\n deleteFromSides={deleteFromSides}\n />\n } />\n </Routes>\n </div>\n\n )\n\n\n}", "function purchase () {\n // prompting the user what they want and what quantity\n\tinquirer.prompt([\n \t{\n \ttype: \"input\",\n \tname: \"item\",\n \tmessage: \"Which item do you want to purchase? (Please type item ID)\"\n \t}, {\n \tname: \"quantity\",\n \ttype: \"input\",\n \tmessage: \"How many would you like?\"\n // processing customer purchase\n \t}]).then(function(answers) {\n var item = answers.item;\n var quantity = answers.quantity;\n\n // connecting the the database to check for availability and update stock quantity\n connection.query(\"SELECT stock_quantity, price FROM products WHERE id=\" + item, function (err,res) {\n var stockQuantity = res[0].stock_quantity;\n var total = res[0].price * quantity;\n var newStock = stockQuantity - quantity;\n\n // if their quantity exceeds the inventory the order does not go through\n if (newStock < 0){\n console.log(\"Insufficient quantity! Try again.\");\n purchase();\n }\n // if the inventory is available, quantity in the database is updated\n // and the customer is given their total\n else {\n connection.query(\"UPDATE products SET stock_quantity=\" + newStock + \"WHERE item_id=\" + item, function (err,res) {\n });\n console.log(\"Success! Your total is $\" + total);\n }\n\n });\n\t});\n}", "function purchase(action = \"\") {\n if (action == \"init\") {\n }\n\n // Prompt the user to enter Product's item_id to review detail of the product:\n inquirer.prompt([\n {\n name: \"ID\",\n type: \"input\",\n message:\n \"Enter the product's item ID to review detail. [Quit with Ctrl+C]\",\n filter: Number,\n validate: function(val) {\n return !isNaN(val);\n }\n },\n {\n name: \"qty\",\n type: \"input\",\n message: \"OK, how many would you like to buy? \",\n filter: Number,\n validate: function(value) {\n if (isNaN(value) == false) {\n return true;\n } else {\n return false;\n }\n }\n }\n ]).then(function(userInput) {\n connection.query(\"SELECT * FROM products WHERE item_id = ?\", [userInput.ID], function(err, inventoryRes) {\n if (err) {\n console.log(\"ERROR: \", err);\n }\n console.log(\"\");\n console.log(\n \"====================\",\n \"\\nPRODUCT DETAIL: \",\n inventoryRes,\n \"\\n====================\"\n );\n console.log(\"\");\n purchaseItem(userInput.ID, userInput.qty);\n });\n });\n // *** This is the end of the function purchase() ***\n}", "function useCartChannel(id, user, _a) {\n var _b = _a === void 0 ? defaultErrorHandler : _a, pushError = _b.pushError, joinError = _b.joinError;\n var _c = react_1.useState([]), items = _c[0], setItems = _c[1];\n var _d = react_1.useState(null), cart = _d[0], setCart = _d[1];\n // using useChannel Hook providing, only one event of `data`\n var initPayload = react_1.useMemo(function () { return ({ user: user }); }, [user]);\n var push = useChannel_1.useChannel(\"cart:\" + id, initPayload, {\n insert: function (_a) {\n var payload = _a.payload;\n setItems(function (prev) { return __spreadArray(__spreadArray([], prev.filter(function (item) { return item.id != payload.id; })), [\n payload,\n ]); });\n },\n delete: function (_a) {\n var payload = _a.payload;\n setItems(function (prev) { return prev.filter(function (item) { return item.id != payload.id; }); });\n },\n // required event subscriptions, join will gives use cart details which is set as state\n init: function (_a) {\n var items = _a.items, list = _a.list;\n setItems(items);\n setCart(parseCart_1.parseCart(list));\n },\n // set the joinError optionally otherwise gives a blank function\n error: function_1.optional(joinError),\n });\n // Insert uses the data event to pass a payload, and all the error will be handle optionally\n var insert = react_1.useCallback(function (item) {\n var _a;\n (_a = push(\"insert\", { item: item })) === null || _a === void 0 ? void 0 : _a.receive(\"error\", function_1.optional(pushError));\n }, [push]);\n var remove = react_1.useCallback(function (item) {\n var _a;\n (_a = push(\"delete\", { id: item.id })) === null || _a === void 0 ? void 0 : _a.receive(\"error\", function_1.optional(pushError));\n }, [push]);\n return { insert: insert, cart: cart, items: items, remove: remove };\n}", "function CheckoutProduct({ id, image, title, price, rating }) {\n // pulls the data from the dataLayer and gets all the items in the cart\n const [{cart} , dispatch] = useStateValue();\n // the function to remove items from the shopping cart\n const removeFromCart = () => {\n // in order to manipulate the cart we need to update the action type\n dispatch({\n type: 'Remove__From__Cart',\n // pass the id so that we can go to that id in the cart and remove that product from the cart once\n id: id,\n })\n }\n return (\n <div className=\"checkoutProduct\">\n {/* image source will be the image passed in as the prop */}\n <img className='checkoutProduct__image' src={image} alt=\"\" />\n <div className='checkoutProduct__info'>\n {/* p tag for product title */}\n <p className='checkoutProduct__title'>{title}</p>\n {/* p tag for product price */}\n <p className='checkoutProduct__price'>\n <small>$</small>\n <strong>{price}</strong>\n </p>\n <p\n className='checkoutProduct__rating'>\n {/* creates an array of ratings' input and fills it with empty input, and then maps through it ratings number of times */}\n {Array(rating)\n .fill()\n .map((_, i) => (\n <p>🌟</p>\n ))}\n </p>\n {/* A button to remove from basket */}\n <button onClick={removeFromCart}> Remove from cart</button>\n </div>\n </div>\n )\n}", "function shoppingCart() {\n let items = [];\n\n let find = function( item ) {\n return items.indexOf( item );\n };\n\n return {\n add: function( item ) {\n if( find( item ) === -1 ) {\n items.push( item );\n }\n },\n remove: function( item ) {\n items.splice( find( item ), 1 );\n },\n show: function() {\n console.log( 'items = ', items );\n }\n }\n}", "function addItemToCart() {}", "function addItemToCart() {}", "function Cart({navigation}) {\n const [cartItems, setCartItems, actions] = useContext(CartContext);\n\n const calculateTotal = () => {\n let total = 0;\n cartItems.forEach(item => {\n total = total + item._quatity * item._unitPrice;\n });\n return total.toString();\n };\n\n function clearCart() {\n Alert.alert(\n 'Confirm',\n 'Are you sure want to remove all items from the cart?',\n [\n {\n text: 'No',\n onPress: () => {},\n style: 'cancel',\n },\n {\n text: 'Yes',\n onPress: () => {\n const tempCart = cartItems;\n actions.clearFullCart();\n Snackbar.show({\n text: 'Cart has been cleared',\n duration: Snackbar.LENGTH_LONG,\n action: {\n text: 'UNDO',\n textColor: 'green',\n onPress: () => {\n actions.undoClearFullCart(tempCart);\n },\n },\n });\n },\n },\n ],\n );\n }\n\n const renderLeftActions = id => {\n return (\n <View\n style={{\n display: 'flex',\n alignContent: 'center',\n alignItems: 'center',\n alignSelf: 'center',\n marginTop: 25,\n }}>\n <IconButton\n icon=\"delete-forever\"\n color={'red'}\n size={25}\n onPress={() => {\n actions.removeItem(id);\n }}\n />\n </View>\n );\n };\n\n return (\n <View style={styles.container}>\n <View style={styles.emptyTop}></View>\n <Animatable.View animation=\"slideInUp\">\n <View style={styles.cartBottomContainer}>\n <View style={styles.topRowContainer}>\n <View style={styles.topRow}>\n <View style={styles.cartTopDataLeft}>\n <Icon name=\"cart\" size={20} color=\"black\" />\n <Text style={styles.cartTopDataLeftText}>\n {cartItems.length} {cartItems.length > 1 ? 'items' : 'item'}\n </Text>\n </View>\n <Text>Total - Rs {calculateTotal()}</Text>\n </View>\n <View style={styles.topRow}>\n <CommonButton\n title=\"Clear\"\n onPress={clearCart}\n color={AppColors.white}\n />\n <CommonButton\n title=\"Proceed\"\n onPress={() => {\n navigation.navigate('delivery');\n }}\n color={AppColors.primaryGreen}\n />\n </View>\n </View>\n <LineDividers color={AppColors.lightergrey} />\n {cartItems.length >= 1 ? (\n <FlatList\n keyExtractor={data => data._id}\n data={cartItems}\n renderItem={item => {\n return (\n // <Swipeable\n // renderRightActions={() => renderLeftActions(item.item._id)}\n // onSwipeableWillOpen={() => {}}>\n <ShoppingCartItem\n image={item.item._imageUrl}\n name={item.item._title}\n quantity={item.item._quatity}\n id={item.item._id}\n unitPrice={item.item._unitPrice}\n />\n // </Swipeable>\n );\n }}\n />\n ) : (\n <EmptyCart />\n )}\n </View>\n </Animatable.View>\n </View>\n );\n}", "function ItemDetail({image, title, price, vender, instock, childunmountfn}) {\n const [itemquantity, setItemquantity] = useState(1)\n const editJsonFile = require(\"edit-json-file\");\n let file = editJsonFile('../itemsincart.json');\n const [itemincart, setItemincart] = useState([])\n return (\n <div className={styles.itemDetail}>\n <div className={styles.itemDetail__cancelbtn}>\n <CancelIcon className={styles.cancel__icon} onClick={childunmountfn}/>\n </div>\n \n <img src={image} alt=\"\" />\n <div className={styles.title}>\n <div className={styles.title__name}>\n <h2>{title}</h2>\n </div>\n <div className={styles.title__price}>\n <h2>{price} Rs </h2>\n </div>\n </div>\n <div className={styles.itemDetail__bottom}>\n {instock ? <h4>item in stock</h4> : <h4>Not in stock</h4>}\n <div className={styles.venderName}>\n <h3>{vender}</h3>\n </div>\n <div className={styles.addtocart}>\n {/* plus minus */}\n <div className={styles.addtocart__quantity}>\n {\n itemquantity === 1\n ?\n <RemoveIcon className={styles.counters} style={{color: \"#d4d4d4\"}}/>\n :\n <RemoveIcon className={styles.counters} onClick={itemdecrement}/>\n }\n <p>\n {itemquantity}\n </p>\n <AddIcon className={styles.counters__increment} onClick={itemincrement}/>\n </div>\n <div className={styles.addtocart__btn}>\n <form>\n <button onClick={addtocartfn} type='submit'>Add to cart</button>\n </form>\n </div>\n </div>\n </div>\n </div>\n )\n function addtocartfn(e){\n e.preventDefault()\n // <ItemsinCart title= {title} />\n console.log('you click add to cart')\n setItemincart([...itemincart, title])\n itemincart.map((items) =>\n // file.set(\"title\", items)\n (\n // eslint-disable-next-line\n file.append(\"title\", items),\n console.log(items)\n )\n )\n console.log(file.get());\n }\n function itemincrement(e){\n setItemquantity(itemquantity + 1)\n }\n function itemdecrement(e){\n setItemquantity(itemquantity - 1)\n }\n}", "function Item({ id, name, price, image }) {\n // get the cart and dispatch function from StateManager\n const [{ cart }, dispatch] = useStateValue();\n\n // add the item to the cart\n const addToCart = () => {\n // tell StateManager to add it to the cart\n dispatch({\n type: \"ADD_TO_CART\",\n item: {\n id: id,\n name: name,\n image: image,\n price: price,\n quantity: 1\n }\n });\n }\n\n return (\n <div className=\"item\">\n <div className=\"item__info\">\n <p>{name}</p>\n <p className=\"item__price\">\n <small>$</small>\n <strong>{price}</strong>\n </p>\n </div>\n <img src={image} alt=\"\" />\n <button onClick={addToCart}>Add to Cart</button>\n </div>\n )\n}", "function App() {\n const [location, setLocation] = useState('CA')\n const [items, setItems] = useState([])\n const [modalShow, setModelShow] = useState(false)\n const [receipt, setReceipt] = useState({})\n const [newItem, setNewItem] = useState({name: '', price: '', qty: ''})\n\n useEffect(() => {\n setItems(prevItems => [...prevItems, {name: 'book', price: '17.99', qty: 1}])\n setItems(prevItems => [...prevItems, {name: 'potato chips', price: '3.99', qty: 1}])\n }, [])\n\n useEffect(() => {\n // setItems(prevItems => [...prevItems, {name: 'book', price: '17.99', qty: 1}])\n // setItems(prevItems => [...prevItems, {name: 'potato chips', price: '3.99', qty: 1}])\n window.scrollTo({behavior: 'smooth', top: document.body.scrollHeight})\n }, [items])\n\n const handleLocationChange = evt => {\n setLocation(evt.target.value)\n }\n\n const handleRemove = index => {\n const tmp = [...items]\n tmp.splice(index, 1)\n setItems(tmp)\n }\n\n const handleAddItem = () => {\n if (newItem.name && newItem.price && newItem.qty) {\n setItems([...items, {...newItem}])\n setNewItem({name: '', price: '', qty: ''})\n }\n }\n\n const generateReceipt = async () => {\n setReceipt(await getReceipt(location, items))\n setModelShow(true)\n }\n\n const hideModal = () => {\n setModelShow(false)\n }\n\n return (\n <Fragment>\n <div className='app'>\n\n <div className='location'>\n <div>Location</div>\n <div>\n <InputBox value={location} onChange={handleLocationChange} placeholder='location' />\n </div>\n </div>\n\n {/* Shopping cart items */}\n <div className='items-container'>\n\n <h4>Items</h4>\n\n <div className='item-list'>\n\n <div className='item-list-header'>\n <div></div>\n <div>Name</div>\n <div>Price</div>\n <div>Quantity</div>\n <div></div>\n </div>\n\n {items.map((item, index) => \n <Item key={index} {...item} index={index} handleRemove={handleRemove} /> \n )}\n\n {/* Add item row */}\n <div className='item'>\n <div>-></div>\n <div><InputBox value={newItem.name} onChange={(evt) => setNewItem({...newItem, name: evt.target.value})} width='70%' placeholder='Name' /></div>\n <div><InputBox value={newItem.price} onChange={(evt) => setNewItem({...newItem, price: evt.target.value})} width='35%' placeholder='Price' /></div>\n <div><InputBox value={newItem.qty} onChange={(evt) => setNewItem({...newItem, qty: evt.target.value})} width='35%' placeholder='Quantity' /></div>\n <div>\n <div className='btn item-list-btn' onClick={handleAddItem}>\n Add\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n\n {/* Button to get receipt via API */}\n <div className='btn btn-generate' onClick={generateReceipt}>\n Generate Receipt\n </div>\n </div>\n\n {/* Popup modal, hidden by default */}\n <Modal show={modalShow} handleClose={hideModal}>\n <Receipt {...receipt} />\n </Modal>\n </Fragment>\n );\n}", "renderCartItem(item, quantity) {\n let name, table;\n\n if(item.make) { // is a vehicle\n name = `${item.make} ${item.model}`;\n table = 'vehicles';\n } else {\n name = item.short_description;\n table = 'parts';\n }\n return (\n <Card style={{ width: '18rem' }}>\n \n <Card.Body>\n <Card.Title>{name}</Card.Title>\n\n <Card.Text>{\"$\" + item.price.toFixed(2)}</Card.Text>\n <Card.Text>Quantity: {quantity}</Card.Text>\n\n <Button variant=\"danger\" onClick={(e) => this.removeCartItem(item.id, table)}>Remove</Button>\n </Card.Body>\n </Card>\n );\n }", "function buy(){\n \n}", "addToCart() {\n this\n .props\n .addToCart(this.props.item);\n }", "handleProductClick(isOrder){\n //function for adding selected product into cart items array:\n function item_for_cart_items(product) {\n if (product===undefined){ //when cart is empty this value is undefined\n var item = { name : \"\", in_price : \"\", out_price : \"\", src : \"\", quantity : 0, total : 0 };\n }else{\n var item = { name : product.name, in_price : product.in_price, out_price : product.out_price,\n src : product.src, quantity : 1, total : product.out_price };\n } \n return item;\n }\n\n if(isOrder){\n var item = item_for_cart_items(this.state.product);\n if (window.items===undefined) window.items=[];\n window.items.push(item);\n\n this.updateQuantity();\n \n this.setState({\n showParam:'2',\n });\n}\nwindow.switch_caregory=false;\n}", "function Basket(pricingRules) {\r\n /**\r\n * Description of promotion functions\r\n * eg: function fooPromo(basketItems, itemsDb)\r\n * @name PromotionFunction\r\n * @function\r\n * @param { Array.<String> } basketItems - items in the basket\r\n * @param { Array.<{ productCode: String, name: String, price: Number}> } itemDb - A copy of the product array\r\n */\r\n\r\n\r\n /**\r\n * Create a basket by supplying the constuctor with an object. This object should contain the attributes 'products'\r\n * where products is the key relating to an array of product objects with productCode(string), name(sting), and price(number)\r\n * attributes.\r\n * \r\n * Optionally a 'promotions' attribute can be added to the pricingRules object. In this case the promotions key relates\r\n * to an array of promotion functions. These are function that take the basket items and items list as their argument\r\n * and return a numerical amount representing the discount to be deducted from the total cost.\r\n * \r\n * @param { Array.<{ productCode: String, name: String, price: Number}> } pricingRules.products - Product Array \r\n * @param { Array.<PromotionFunction> } pricingRules.promotions - Promotion array.\r\n */\r\n if (!pricingRules.hasOwnProperty('products') || !isArray(pricingRules.products)) {\r\n throw new Error('Need an array of products (Format: productCode, name, price) see: wiki: https://github.com/Wuntenn/acme-shopping-basket/wiki/Pricing-Rules#products');\r\n }\r\n\r\n if (pricingRules.hasOwnProperty('promotions') && !isArray(pricingRules.promotions)) {\r\n throw new Error('Promotions need to be an array see: wiki: https://github.com/Wuntenn/acme-shopping-basket/wiki/Pricing-Rules#promotions');\r\n }\r\n\r\n // Set up the state of the basket\r\n this.products = pricingRules.products;\r\n this.promotions = pricingRules.promotions;\r\n this.items = []; // empty basket\r\n}", "function Bill(props) {\n /*let ans = '';\n for (let i in userCart) {\n ans += `${userCart[i]}: ${calculator(userCart[i])}+`\n }\n return ans;*/\n const items = props.items;\n return items.map( (item, index) =>\n <div key={index}>\n <h1>{item}: {products[item].price}</h1>\n {products[item].coupon !== '' ? <h5>{products[item].coupon}</h5> : ''}\n <p>current total price = {calculator(item)}</p>\n </div>\n );\n\n// return listItems;\n}", "function Checkout() {\r\n const [{basket, user}, dispatch] = useStateValue();\r\n\r\n return (\r\n <div className=\"checkout-container\">\r\n <div className=\"checkout\"> \r\n\r\n <div className=\"checkout-top\">\r\n <img className=\"checkout-ad\" alt=\"\"\r\n src=\"https://images-na.ssl-images-amazon.com/images/G/02/UK_CCMP/TM/OCC_Amazon1._CB423492668_.jpg\"\r\n />\r\n\r\n {/* for mob users */}\r\n <div className=\"checkout-subtotal-mob\">\r\n <Subtotal/>\r\n </div>\r\n <div>\r\n <h3 className=\"username\">Hello, {user?.email}</h3> {/*by using '?' it will not error if no user logged-in */}\r\n <h2 className=\"checkout-title\">Your shopping Basket</h2>\r\n\r\n {basket.map(item => {\r\n return <CheckoutProduct\r\n key= {uuidv4()}\r\n id={item.id}\r\n title={item.title}\r\n price={item.price}\r\n rating={item.rating}\r\n image={item.image} \r\n />\r\n })}\r\n\r\n </div>\r\n </div>\r\n\r\n {/* for web users */}\r\n <div className=\"checkout-subtotal-web\">\r\n <Subtotal/>\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n )\r\n}", "function GroceryItemButtons({ item, setReadyToEdit, readyToEdit, editItem, setEditItem }) {\n\n const classes = useStyles();\n const dispatch = useDispatch();\n\n // when user clicks the \"check\" marks item as purchased and puts the item\n // into the user's pantry\n const handlePurchase = () => {\n // dispatches item to mark as purchased\n dispatch({ type: 'ITEM_PURCHASED', payload: item });\n dispatch({ type: 'ADD_ITEM_TO_PANTRY', payload: item });\n }\n\n // deletes item from grocery list\n const handleDelete = () => {\n dispatch({ type: 'DELETE_GROCERY_ITEM', payload: item });\n }\n\n // conditionally renders and populates form with item to edit\n const handleEdit = () => {\n setReadyToEdit(true);\n setEditItem({\n id: item.id,\n name: item.name,\n quantity: item.quantity,\n unit: item.unit,\n category_id: item.category_id\n });\n }\n\n // conditionally renders and undoes what handelPurchase does\n const handleUndo = () => {\n //dispatch({type: 'DELETE_ITEM_FROM_PANTRY', payload: item});\n // dispatches item to mark as un-purchased \n Swal.fire({\n title: 'are you sure?',\n text: 'this will undo the purchase',\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: 'blue',\n cancelButtonColor: 'red',\n confirmButtonText: 'Yes, Undo!'\n }).then((result) => {\n if (result.isConfirmed) {\n dispatch({ type: 'ITEM_PURCHASED', payload: item });\n dispatch({ type: 'DELETE_PANTRY_PURCHASE', payload: item });\n }\n })\n\n }\n\n return (\n <div>\n {!item.purchased &&\n <div className={classes.buttons}>\n <Tooltip title=\"Purchase Item\">\n <IconButton color=\"primary\" onClick={handlePurchase}>\n <DoneIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Edit Item\">\n <IconButton onClick={handleEdit} className={classes.edit}>\n <EditIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Delete Item\">\n <IconButton color=\"secondary\" onClick={handleDelete}>\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n </div>\n }\n {item.purchased &&\n <div className={classes.purchased}>\n <p><b>Purchased!</b></p>\n <Tooltip title=\"Undo Purchase\">\n <IconButton color=\"primary\" onClick={handleUndo}>\n <UndoIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Delete Item\">\n <IconButton color=\"secondary\" size=\"small\" onClick={handleDelete}>\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n\n </div>\n }\n\n </div>\n )\n}", "function BasketItem({ item }) {\n const { itemName, quantity, price } = item;\n\n return (\n <React.Fragment>\n <div className=\"flexRowCenter\" style={{ textAlign: \"left\" }}>\n <IncrementButton\n handler={decrementItem}\n itemName={itemName}\n price={price}\n title=\"-\"\n styles=\"minus basketButton\"\n />\n {quantity}{\" \"}\n <IncrementButton\n handler={incrementItem}\n itemName={itemName}\n price={price}\n title=\"+\"\n styles=\"plus basketButton\"\n />\n {\" \"}\n {itemName}\n </div>\n <div>£{price.toFixed(2)}</div>\n </React.Fragment>\n );\n}", "makeAction(itemDetails) {\n const self = this;\n const mappingIdToAction = {\n processItem: async ({ upc }) => {\n await this.contract.methods\n .processItem(upc)\n .send({ from: this.currentAddress });\n this.alert = {\n type: \"success\",\n message: \"item has been processed successfully\",\n };\n },\n packItem: async ({ upc }) => {\n await this.contract.methods\n .packItem(upc)\n .send({ from: this.currentAddress });\n this.alert = {\n type: \"success\",\n message: \"item has been packed successfully\",\n };\n },\n sellItem: async ({ upc, price }) => {\n await this.contract.methods\n .sellItem(upc, price)\n .send({ from: this.currentAddress });\n this.alert = {\n type: \"success\",\n message: \"item is now available for distributors\",\n };\n },\n buyItem: async ({ upc, value }) => {\n await this.contract.methods\n .buyItem(upc)\n .send({ from: this.currentAddress, value: value });\n this.alert = {\n type: \"success\",\n message: \"item has been bought successfully\",\n };\n },\n shipItem: async ({ upc }) => {\n await this.contract.methods\n .shipItem(upc)\n .send({ from: this.currentAddress });\n this.alert = {\n type: \"success\",\n message: \"item has been shipped successfully\",\n };\n },\n receiveItem: async ({ upc }) =>\n await this.contract.methods\n .receiveItem(upc)\n .send({ from: this.currentAddress }),\n purchaseItem: async () => {\n await this.contract.methods\n .purchaseItem(upc)\n .send({ from: this.currentAddress });\n this.alert = {\n type: \"success\",\n message: \"item has been purchased successfully\",\n };\n },\n };\n this.jquery(window).on(\"click\", async function (event) {\n if (mappingIdToAction[event.target.id]) {\n event.preventDefault();\n const upc = parseInt(itemDetails.itemUPC);\n const value = parseInt(itemDetails.productPrice);\n const price = parseInt(self.jquery(\"#itemPrice\").val());\n new Loader(\"#productDetails .modal-dialog\", \"loader\", \"white\");\n new Alert(\n \"#productDetails .modal-dialog\",\n \"alert\",\n \"light\",\n \"We are processing your transaction, please confirm your action on the Metamask wallet extension\",\n false\n );\n await mappingIdToAction[event.target.id]({ upc, value, price });\n // re render the all page\n self.render();\n }\n });\n }", "onAddToCartClicked(e) {\n // QuickCommerce theme Product component's onAddToCartClicked handler\n // onAddToCartClicked handler for Product\n let input = document.querySelectorAll('#product-form input.quantity')[0]\n let quantity = parseInt(input.value)\n console.log('adding ' + quantity + ' items to cart')\n\n // TODO: Use mappings!\n let item = {\n id: this.state.product['product_id'],\n quantity: quantity,\n data: this.state.product\n }\n\n if (typeof this.props.addToCart === 'function') {\n let fn = this.props.addToCart\n fn(e, item, quantity) // TODO: Quantity may be redunant...\n }\n }", "function PurchaseSimilarInventory() {\n const { setTopHeading } = useContext(TopBarContext);\n const [flow, setFlow] = useState(\"basic\");\n const [calculate, setCalculate] = useState(false);\n const [datecalculate, setDateCalculate] = useState(false);\n const [calnum, setCalnum] = useState(-1);\n\n const thebval = {\n purchtype: \"\",\n vendor: \"\",\n invnumber: \"\",\n invdate: \"\",\n location: \"Trivandrum\",\n invtype: \"\",\n gstno: \"\",\n panno: \"\",\n aadharno: \"\",\n purchlocation: \"Local\",\n };\n const [basevalues, setBaseValues] = useState(thebval);\n\n const invdetails = {\n type: \"\",\n name: \"\",\n // assetsIdHistory: \"\",\n // assetId: \"\",\n sno: \"\",\n condition: \"Good\",\n taxcategory: \"\",\n taxperc: \"\",\n rate: \"\",\n igst: \"0\",\n cgst: \"0\",\n sgst: \"0\",\n nettax: \"0\",\n amount: \"0\",\n tcs: \"0\",\n invamount: \"0\",\n wty: \"\",\n expirydate: \"\",\n //-------------------------\n purchtype: \"\",\n vendor: \"\",\n invnumber: \"\",\n invdate: \"\",\n location: \"\",\n invtype: \"\",\n gstno: \"\",\n panno: \"\",\n aadharno: \"\",\n purchlocation: \"\",\n\n brand:\"\",\n model:\"\",\n systype:\"part\",\n\n //-------\n caseId:\"\",\n };\n const [values, setValues] = useState([invdetails]);\n\n const [err, setErr] = useState({\n type: \"\",\n name: \"\",\n sno: \"\",\n condition: \"\",\n location: \"\",\n invnumber: \"\",\n });\n\n const submitItems = async () => {\n if (values.name === \"\" || values.sno === \"\" || values.invnumber === \"\") {\n // setIsReqFieldModal(true);\n console.log(\"missing inputs\");\n return;\n }\n console.log(\"Submission Start\");\n const newitems = [...values];\n newitems.map((item) => {\n item.purchtype = basevalues.purchtype;\n item.vendor = basevalues.vendor;\n item.invnumber = basevalues.invnumber;\n item.invdate = basevalues.invdate;\n item.location = basevalues.location;\n item.invtype = basevalues.invtype;\n item.gstno = basevalues.gstno;\n item.panno = basevalues.panno;\n item.aadharno = basevalues.aadharno;\n item.purchlocation = basevalues.purchtype;\n });\n console.log(newitems);\n await Axios({\n url: `${API}/inventory/${Emp.getId()}/createitems`,\n method: \"POST\",\n data: newitems,\n })\n .then((data) => {\n console.log(\"Added\", data._id);\n // setIsReviewModalOpen(true);\n setValues([invdetails]);\n setBaseValues(thebval);\n setErr({\n type: \"\",\n name: \"\",\n sno: \"\",\n condition: \"\",\n location: \"\",\n invnumber: \"\",\n });\n })\n .catch((err) => {\n console.log(\"err\", err);\n setErr({ ...err });\n });\n };\n\n // ----------------------Heading Use Effect-------------\n\n useEffect(() => {\n setTopHeading(\"Purchase Similar Inventory\");\n return () => {\n setTopHeading(\"\");\n };\n }, []);\n // ------------------- Calculations----------------------------------\n useEffect(() => {\n // console.log(\"hello\");\n // console.log(calnum);\n let newlist = [...values];\n\n if (basevalues.purchlocation == \"Local\" && calnum != -1) {\n newlist[calnum].sgst =\n parseInt(newlist[calnum].rate) *\n (parseInt(newlist[calnum].taxperc) / 200);\n newlist[calnum].cgst =\n parseInt(newlist[calnum].rate) *\n (parseInt(newlist[calnum].taxperc) / 200);\n newlist[calnum].nettax =\n parseInt(newlist[calnum].sgst) + parseInt(newlist[calnum].cgst);\n newlist[calnum].amount =\n parseFloat(newlist[calnum].rate) + parseFloat(newlist[calnum].nettax);\n\n // setValues(newlist);\n } else if (calnum != -1) {\n newlist[calnum].igst =\n parseInt(newlist[calnum].rate) *\n (parseInt(newlist[calnum].taxperc) / 100);\n newlist[calnum].nettax = newlist[calnum].igst;\n\n newlist[calnum].sgst = 0;\n newlist[calnum].cgst = 0;\n newlist[calnum].amount =\n parseFloat(newlist[calnum].rate) + parseFloat(newlist[calnum].nettax);\n\n // setValues(newlist);\n }\n\n if (calnum != -1) {\n newlist[calnum].tcs = parseFloat(newlist[calnum].amount) * 0.001;\n newlist[calnum].invamount =\n parseFloat(newlist[calnum].amount) + parseFloat(newlist[calnum].tcs);\n newlist[calnum].expirydate = moment().format(\"DD-MM-YYYY\");\n }\n\n setValues(newlist);\n\n return () => {\n console.log(\"Calculations done!\");\n };\n }, [calculate]);\n\n // const handleChange = (name) => (e) => {\n // setValues({ ...values, [name]: e.target.value });\n // };\n\n // ---------Date Calculations ------------\n\n useEffect(() => {\n // console.log(\"hello\");\n // console.log(calnum);\n let newlist = [...values];\n\n if (calnum != -1) {\n switch (newlist[calnum].wty) {\n case \"3M\":\n newlist[calnum].expirydate = moment()\n .add(3, \"M\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"6M\":\n newlist[calnum].expirydate = moment()\n .add(6, \"M\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"1Y\":\n newlist[calnum].expirydate = moment()\n .add(1, \"Y\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"2Y\":\n newlist[calnum].expirydate = moment()\n .add(2, \"Y\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"3Y\":\n newlist[calnum].expirydate = moment()\n .add(3, \"Y\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"4Y\":\n newlist[calnum].expirydate = moment()\n .add(4, \"Y\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"5Y\":\n newlist[calnum].expirydate = moment()\n .add(5, \"Y\")\n .format(\"DD-MM-YYYY\");\n\n break;\n\n default:\n break;\n }\n }\n\n setValues(newlist);\n\n return () => {\n console.log(\"Calculations done!\");\n };\n }, [datecalculate]);\n\n const handleBaseChange = (name) => (e) => {\n setBaseValues({ ...basevalues, [name]: e.target.value });\n };\n\n // const ReviewSubmit = () => {\n // return (\n // <>\n // <Modal\n // isOpen={isReviewModalOpen}\n // onClose={() => setIsReviewModalOpen(false)}\n // >\n // <ModalHeader>Information updated Successfully!</ModalHeader>\n // <ModalBody></ModalBody>\n // <ModalFooter>\n // <Button\n // className=\"w-full sm:w-auto\"\n // // onClick={() => setIsReviewModalOpen(false)}\n // onClick={() => setIsReviewModalOpen(false)}\n // >\n // Okay!\n // </Button>\n // </ModalFooter>\n // </Modal>\n // </>\n // );\n // };\n\n // const ReqFieldErrModal = () => {\n // return (\n // <>\n // <Modal\n // isOpen={isReqFieldModal}\n // onClose={() => setIsReqFieldModal(false)}\n // >\n // <ModalHeader>Required fields are not filled!</ModalHeader>\n // <ModalBody></ModalBody>\n // <ModalFooter>\n // <Button\n // className=\"w-full sm:w-auto\"\n // onClick={() => setIsReqFieldModal(false)}\n // >\n // Okay!\n // </Button>\n // </ModalFooter>\n // </Modal>\n // </>\n // );\n // };\n\n // Basic Form\n\n const BasicForm = () => {\n return (\n <div className=\"px-4 py-3 mt-4 mb-2 bg-white rounded-lg shadow-md dark:bg-gray-800\">\n <Label className=\"font-bold\">\n <span>Purchase Information</span>\n </Label>\n <hr className=\"mb-5 mt-2\" />\n {/* -----Row 1 --------- */}\n <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Purchase Type*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.purchtype}\n onChange={handleBaseChange(\"purchtype\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Vendor Name*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.vendor}\n onChange={handleBaseChange(\"vendor\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Invoice Number*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.invnumber}\n onChange={handleBaseChange(\"invnumber\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Invoice Date*</span>\n <Input\n className=\"mt-1\"\n type=\"date\"\n value={basevalues.invdate}\n onChange={handleBaseChange(\"invdate\")}\n />\n </Label>\n </div>\n </div>\n {/* ------------------------Row 2-------------------------- */}\n <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Location*</span>\n <Select\n className=\"mt-1\"\n onChange={(e) => {\n setBaseValues({ ...basevalues, location: e.target.value });\n }}\n >\n <option value=\"Trivandrum\">Trivandrum</option>\n <option value=\"Kottayam\">Kottayam</option>\n <option value=\"Kozhikode\">Kozhikode</option>\n </Select>\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Invoice Type*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.invtype}\n onChange={handleBaseChange(\"invtype\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>GST Number*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.gstno}\n onChange={handleBaseChange(\"gstno\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Pan No*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.panno}\n onChange={handleBaseChange(\"panno\")}\n />\n </Label>\n </div>\n </div>\n\n {/* -------------------------ROw 3-------------------- */}\n <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Aadhar No*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.aadharno}\n onChange={handleBaseChange(\"aadharno\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Purchase Location*</span>\n <Select\n className=\"mt-1\"\n onChange={(e) => {\n setBaseValues({\n ...basevalues,\n purchlocation: e.target.value,\n });\n\n let newlist = [...values];\n newlist.map((item, i) => {\n item.taxcategory = \"\";\n item.taxperc = \"\";\n });\n setValues([invdetails]);\n }}\n >\n <option value=\"Local\">Local</option>\n <option value=\"IGST\">IGST</option>\n </Select>\n </Label>\n </div>\n </div>\n </div>\n );\n };\n\n const ItemForm = (num) => {\n return (\n <div className=\"px-4 py-3 my-2 bg-white rounded-lg shadow-md dark:bg-gray-800\">\n <Label className=\"font-bold\">\n <span>Item Number : {num + 1},<span className=\"ml-10\"> Net Tax:{values[num].nettax} ,Invoice Amount: {values[num].invamount} </span>\n </span>\n </Label>\n <hr className=\"mb-5 mt-2\" />\n {/* ------------------------Row 1-------------------------- */}\n <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Select Type*</span>\n <Select\n className=\"mt-1\"\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].systype = e.target.value;\n setValues(newlist);\n }}\n >\n <option value=\"part\" selected >\n Part\n </option>\n <option value=\"system\">System</option>\n \n </Select>\n </Label>\n </div>\n\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Select Category*</span>\n <Select\n className=\"mt-1\"\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].type = e.target.value;\n setValues(newlist);\n }}\n >\n <option value=\"\" selected disabled>\n Select Category\n </option>\n {values[num].systype==\"part\"?<>\n <option value=\"Mouse\">Mouse</option>\n <option value=\"Keyboard\">Keyboard</option>\n <option value=\"Monitor\">Monitor</option>\n <option value=\"Cpu\">Cpu</option>\n <option value=\"Ram\">Ram</option>\n <option value=\"Fan\">Fan</option>\n <option value=\"Motherboard\">Motherboard</option>\n <option value=\"SMPS\">SMPS</option>\n <option value=\"HDD\">HDD</option>\n <option value=\"GCard\">Gcard</option>\n <option value=\"EnetCard\">Enet Card</option>\n <option value=\"SerialCard\">Serial Card</option>\n <option value=\"ParalellCard\">Paralell Card</option>\n <option value=\"OpticalDrive\">Optical Drive</option>\n <option value=\"Others\">Others</option>\n </>:<>\n\n <option value=\"console\">Console</option>\n <option value=\"DMP\">DMP</option>\n <option value=\"inkjet\">Inkjet</option>\n <option value=\"KVM\">KVM</option>\n <option value=\"laptop\">Laptop</option>\n <option value=\"laser\">Laser</option>\n <option value=\"LMP\">LMP</option>\n <option value=\"module\">Module</option>\n <option value=\"router\">Router</option>\n <option value=\"scanner\">Scanner</option>\n <option value=\"server\">Server</option>\n <option value=\"desktop\">Desktop</option>\n <option value=\"storage\">Storage</option>\n <option value=\"switch\">Switch</option>\n <option value=\"UPS\">UPS</option>\n <option value=\"others\">Others</option>\n\n </>}\n </Select>\n </Label>\n </div>\n\n {values[num].systype==\"part\"?\n <>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Product Name*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].name}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].name = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n <HelperText valid={false}>{err.name}</HelperText>\n </div>\n </>\n :<>\n <>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Brand*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].brand}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].brand = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n <HelperText valid={false}>{err.brand}</HelperText>\n </div>\n </>\n\n <>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Model*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].model}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].model = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n <HelperText valid={false}>{err.name}</HelperText>\n </div>\n </>\n\n\n </>\n }\n\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Serial Number*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].sno}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].sno = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n <HelperText valid={false}>{err.sno}</HelperText>\n </div>\n\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Select Condition*</span>\n <Select\n className=\"mt-1\"\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].condition = e.target.value;\n setValues(newlist);\n }}\n >\n <option value=\"Good\">Good</option>\n <option value=\"Bad\">Bad</option>\n </Select>\n </Label>\n </div>\n </div>\n\n {/* -------------Row 2 --------- */}\n <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Warranty*</span>\n <Select\n className=\"mt-1\"\n value={values[num].wty}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].wty = e.target.value;\n setValues(newlist);\n setCalnum(num);\n setDateCalculate(!datecalculate);\n }}\n >\n <option value=\"\" selected disabled>\n Select Category\n </option>\n <option value=\"3M\">3 Months</option>\n <option value=\"6M\">6 Months</option>\n <option value=\"1Y\">1 Year</option>\n <option value=\"2Y\">2 Year</option>\n <option value=\"3Y\">3 Year</option>\n <option value=\"4Y\">4 Year</option>\n <option value=\"5Y\">5 Year</option>\n </Select>\n </Label>\n </div>\n\n <>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Expiry Date</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].expirydate}\n readOnly={true}\n />\n </Label>\n <HelperText valid={false}>{err.name}</HelperText>\n </div>\n </>\n \n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Tax Category*</span>\n <Select\n className=\"mt-1\"\n value={values[num].taxcategory}\n onChange={(e) => {\n let newlist = [...values];\n let thestring = e.target.value;\n let theperc = thestring.slice(-3, -1);\n newlist[num].taxcategory = e.target.value;\n newlist[num].taxperc = theperc;\n setValues(newlist);\n // calculate trigger\n setCalnum(num);\n setCalculate(!calculate);\n }}\n >\n {basevalues.purchlocation == \"Local\" ? (\n <>\n <option value=\"\" selected disabled>\n Select Tax Category\n </option>\n <option value=\"GST 18%\">GST 18%</option>\n <option value=\"GST 28%\">GST 28%</option>\n </>\n ) : (\n <>\n <option value=\"\" selected disabled>\n Select Tax Category\n </option>\n <option value=\"IGST 18%\">IGST 18%</option>\n <option value=\"IGST 28%\">IGST 28%</option>\n </>\n )}\n </Select>\n </Label>\n </div>\n {/* <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Tax Percentage*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].taxperc}\n />\n </Label>\n <HelperText valid={false}>{err.invnumber}</HelperText>\n </div> */}\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Rate*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].rate}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].rate = e.target.value;\n setValues(newlist);\n setCalnum(num);\n setCalculate(!calculate);\n }}\n />\n </Label>\n </div>\n </div>\n {/* --------Row 4 ------------- */}\n {/* <div className=\"flex-row flex space-x-3 my-2\">\n {basevalues.purchlocation == \"Local\" ? (\n <>\n {\" \"}\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>CGST*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].cgst}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>SGST*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].sgst}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Net Tax*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].nettax}\n />\n </Label>\n </div>\n </>\n ) : (\n <>\n {\" \"}\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>IGST</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].igst}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Net Tax*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].nettax}\n />\n </Label>\n </div>\n </>\n )}\n </div> */}\n {/* ----row 4------ */}\n {/* <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Amount</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].amount}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].amount = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>TCS</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].tcs}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].amount = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Invoice Amount</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].invamount}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].invamount = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n </div>\n </div> */}\n\n {/* <Label className=\"font-bold mt-5 mb-2\">\n <span>Additional Information</span>\n </Label> */}\n {/* <hr /> */}\n </div>\n );\n };\n\n const BottomCard = () => {\n return (\n <Card className=\"mb-4 shadow-md \">\n <CardBody>\n <div className=\"flex flex-row flex-wrap\">\n <Button\n onClick={() => {\n let newitem = [...values];\n let add = values[0];\n console.log(add)\n newitem.push(add);\n setValues(newitem);\n }}\n aria-label=\"Notifications\"\n aria-haspopup=\"true\"\n layout=\"outline\"\n className=\" mx-2 \"\n >\n Add Item\n </Button>\n\n <Button\n onClick={() => {\n let newitem = [...values];\n if (newitem[1]) {\n newitem.pop();\n setValues(newitem);\n }\n }}\n aria-label=\"Notifications\"\n aria-haspopup=\"true\"\n layout=\"outline\"\n className=\" mx-2 \"\n >\n Remove Item\n </Button>\n\n <Button\n onClick={submitItems}\n aria-label=\"Notifications\"\n aria-haspopup=\"true\"\n layout=\"outline\"\n className=\" mx-2 \"\n >\n Submit\n </Button>\n </div>\n </CardBody>\n </Card>\n );\n };\n\n return (\n <>\n {BasicForm()}\n {values.map((item, i) => {\n return ItemForm(i);\n })}\n {BottomCard()}\n </>\n );\n}", "function cart() {\n const productsInCart = [];\n return {\n getProducts: () => {\n return productsInCart.map(item => {\n return {\n name: item.name,\n price: item.price\n };\n });\n },\n addToCart: product => {\n productsInCart.push(product);\n },\n\n totalPrice: () => {\n const totalPrice = productsInCart.reduce((total, item) => {\n total += item.price;\n return total;\n }, 0);\n return totalPrice;\n }\n };\n}", "function customerDisc(discount){\r\n return (price) => { \r\n price - price * discount;\r\n };\r\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}", "[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 applyTaxToItems(user){\n const {cart}\n}", "function buyItem(user) {\n return {\n ...user,\n purchases: [...user.cart]\n };\n}", "renderCart(){\n let products=[];\n products.push(<BackButton key={1} fromProduct={false} onClick={() => this.handleBackClick(\"fromInfo\")} />);\n products.push(<Cart product={this.state.product} updateTotalQuantity={(changed_total_quantity) => this.updateTotalQuantity(changed_total_quantity)}/>);\n return products;\n}", "function buy50() {\n const credit = 6000;\n addCredit(credit);\n return credit;\n}", "function whatToBuy(){\n console.log(\" ~crunchy store~\")\nlet customerChoice = inquirer.prompt([\n\n {\n type: \"input\",\n name: \"item\",\n message:\"What would you like to buy?\"\n },\n {\n type: \"input\",\n name: \"qty\",\n message: \"How many would you like to buy?\"\n }\n ]).then(function(x) {\n let id = x.item;\n let qty = x.qty;\n\n console.log(\"Item: \" + products[x.item].item_name);\n console.log(\"QTY: \" + x.qty);\n console.log(\"Total Price: $\" + (products[x.item].sales_price * x.qty))\n\n // CHECK INVENTORY\n\n getInventory(id,qty,function(item,qty){\n \n // IF STATEMENT\n let newQty = item.inventory_qty - qty;\n\n console.log(\"Checking inventory..... \" + item.item_name);\n console.log(\"\");\n if(newQty > 0) {\n console.log(\"Purchase Complete!\")\n updateProducts(id,\"inventory_qty\",newQty);\n }\n else{\n console.log(\"Insufficient Qty for Order...\")\n }\n console.log(\"...\");\n console.log(\"\");\n console.log(\"\");\n console.log(\"\");\n\n runProgram();\n });\n\n });\n}", "function itemQty(item, name, stock){\n \n inquirer.prompt({\n type: \"list\",\n name: \"purchase\",\n message: \"would you like to purchse this item?\",\n choices: [\n \"yes\",\n \"no\"\n ]\n }) \n .then(function(answer){\n switch (answer.purchase) {\n case \"yes\":\n getQty(item);\n break;\n \n case \"no\":\n console.log(\"please make another selection\");\n greetings();\n break;\n \n }\n });\n\n function getQty(item, stock, name) {\n \n inquirer.prompt({\n name: \"qty\",\n type: \"input\",\n message: \"please enter the quantity you would like\",\n })\n .then(function(value){ \n\n var qty = $parseInt(value.qty, 10); \n \n // if (qty > stock) {\n // console.log(\"qty: \" + qty + \", stock: \" + stock);\n // console.log(\"sorry, we have insufficient supply of \" + name);\n // } else {\n // function updateStock(item, stock, name) {\n // var query = connection.query(\n // \"UPDATE products SET ? WHERE ?\",\n // [\n // {\n // stock_qty: stock_qty - qty\n // },\n // {\n // item_ID: item\n // }\n // ],\n // function(err, res) {\n \n // console.log(res.affectedRows + \" stock has been update!\\n\");\n \n \n // }\n // );\n // }\n // }; \n purchaseItems(item, qty); \n });\n\n function purchaseItems(item, qty){ \n \n connection.query(\"SELECT item_name, price, stock_qty FROM products WHERE ?\", \n {\n item_ID: item\n }, \n function(err, res) {\n if (err) throw err;\n \n console.log(qty + \" \" + res[0].item_name + \"s will be mailed to the address we have on file.\\n\");\n console.log(\"$\" + ((qty * res[0].price).toFixed(2)) + \" will be billed to your account. \\n\");\n delay(750).then(() => {\n console.log(\"thank you for shopping with Bamazon!\");\n });\n \n\nconnection.end();\n});\n\n\n\n}\n}\n}", "function buyScreen() {\n // inquirer prompts (which item to buy and how many of it)\n inquirer\n .prompt([\n {\n name: \"item\",\n type: \"list\",\n choices: productArray,\n message: \"What is the item you would like to submit?\"\n },\n {\n name: \"quantityPurchase\",\n type: \"input\",\n message: \"How many would you like to buy?\"\n }\n ])\n .then(function (answer) {\n var quantityPurchased = answer.quantityPurchase;\n\n var query = \"SELECT * FROM products WHERE ?\";\n\n // doing some splitting to get the item ID# from the choices from the above inquirer list prompt\n var split1 = answer.item.split(\",\", 1);\n var split2 = split1[0].split(\":\", 2);\n var final = split2[1];\n\n console.log(\"Confirming your order..\");\n\n // connection query using mysql select searching in the bamazon product db for the row matching the product name the person wants and checking the quantity\n // if when the test for the current stock minus the customer's desired quantity to purchase is less than 0, display an message saying unable to fulfill order\n // otherwise if the test condition comes out positive, confirm to user that bamazon can fulfill the order then call updateProduct function while passing the product name and desired quantity to purchase as parameters\n connection.query(query, { item_id: final }, function (err, res) {\n if (err) throw err;\n\n var productName = res[0].product_name;\n var stock = res[0].stock_quantity;\n var productPrice = res[0].price;\n var total = productPrice * quantityPurchased;\n\n if ((stock - quantityPurchased) > 0) {\n console.log(\"\\nWe are able to fulfill your order.\\n\");\n\n // New stock quantity after subtracting the user's current order\n var newStockQuantity = stock - quantityPurchased;\n\n console.log(\"Your purchase order:\");\n console.log(productName + \" ($\" + productPrice + \") x \" + quantityPurchased + \" = $\" + total);\n updateProduct(productName, newStockQuantity);\n } else {\n console.log(\"Sorry, we do not have enough stock in our inventory to fulfill your order.\");\n connection.end();\n }\n }\n );\n\n });\n}", "function buy5() {\n const credit = 500;\n addCredit(credit);\n return credit;\n}", "function RequestedItemCard({\n requestedItem,\n onRequest,\n removeRequestedItem,\n showActions = true,\n}) {\n const { id, name, requestedCount, countAfterRequest } = requestedItem;\n const [showOrderModal, setShowAmountModal] = useState(false);\n\n // Handlers for showing/closing modal when ordering item\n const handleClose = () => setShowAmountModal(false);\n const handleShow = () => setShowAmountModal(true);\n\n // Removes requested item from list using callback\n function removeItem() {\n removeRequestedItem(requestedItem);\n }\n\n const classes = useStyles();\n return (\n <>\n <Fade in>\n <Card className={classes.card} variant=\"outlined\" raised>\n <Box display=\"flex\" justifyContent=\"space-between\">\n {/* Item name and count */}\n <CardContent display=\"flex\">\n <Typography>\n {name}:{' '}\n <font style={{ fontWeight: 'bold' }}>{requestedCount}</font>\n </Typography>\n </CardContent>\n\n {/* Edit count and remove item */}\n {showActions && (\n <CardActions>\n <IconButton color=\"primary\" onClick={handleShow}>\n <EditIcon />\n </IconButton>\n <IconButton color=\"secondary\" onClick={removeItem}>\n <CancelIcon />\n </IconButton>\n </CardActions>\n )}\n </Box>\n </Card>\n </Fade>\n\n <OrderModal\n show={showOrderModal}\n handleClose={handleClose}\n stockName={name}\n stockId={id}\n stockCount={countAfterRequest + requestedCount}\n onRequest={onRequest}\n defaultAmount={requestedCount}\n />\n </>\n );\n}", "render() {\n\n let discountRow, discountDescription\n //this.discountPrice = \n if (this.props.discountedPrice > 0.0) {\n this.selectTotalPrice = this.props.discountedPrice;\n discountRow = <Row><TotalColumn><TableHeaderText>Discounted Price: $ {this.selectTotalPrice.toFixed(2)}</TableHeaderText></TotalColumn></Row>\n discountDescription = <Row><TotalColumn><TableHeaderText>Description: {this.props.discountDescription}</TableHeaderText></TotalColumn></Row>\n } else {\n this.selectTotalPrice = (this.props.selectItemsInCart.reduce((acc, item) => acc + (item.price * item.quantity), 0));\n discountRow = <Row><TotalColumn><TableHeaderText>Total: $ {this.selectTotalPrice.toFixed(2)}</TableHeaderText></TotalColumn></Row>\n }\n return <CartContainer>\n {this.props.selectItemsInCart.length > 0 ? <ShoppingItemsList>\n <ListHeader>Items In Cart</ListHeader>\n <Divider />\n <Row>\n <ItemColumn><TableHeaderText>Name</TableHeaderText></ItemColumn>\n <QuantityColumn><TableHeaderText>Quantity</TableHeaderText></QuantityColumn>\n <PriceColumn><TableHeaderText>Price</TableHeaderText></PriceColumn>\n </Row>\n <Divider />\n {this.props.selectItemsInCart.map((item, index) => {\n return <><Row>\n <ItemColumn><TableItemText>{item.name}</TableItemText></ItemColumn>\n <QuantityColumn>\n <Button><FontAwesomeIcon icon={faPlus} onClick={() => { this.handleAdd(item.id) }} /></Button>\n <TableItemText>{item.quantity}</TableItemText>\n <Button><FontAwesomeIcon icon={faMinus} onClick={() => { this.handleRemove(item.id) }} /></Button>\n </QuantityColumn>\n <PriceColumn><TableItemText>{`$ ${(item.quantity * item.price).toFixed(2)}`}</TableItemText></PriceColumn>\n </Row></>\n })}\n <Divider />\n {discountRow}\n {discountDescription}\n <Row></Row>\n </ShoppingItemsList> : <ListHeader>No Items In Cart</ListHeader>}\n </CartContainer>;\n }", "cartLogic() {\n clearCartButton.addEventListener(\"click\", () => {\n this.clearCart();\n });\n\n cartContent.addEventListener(\"click\", event => {\n if (event.target.classList.contains(\"remove-item\")) {\n let removeItem = event.target;\n let id = removeItem.dataset.id;\n cartContent.removeChild(removeItem.parentElement.parentElement);\n //remove item\n this.removeItem(id);\n } else if (event.target.classList.contains(\"fa-chevron-up\")) {\n let addAmount = event.target;\n let id = addAmount.dataset.id;\n let tempItem = cart.find(item => item.id === id);\n tempItem.amount = tempItem.amount + 1;\n Storage.saveProduct(cart);\n this.setCartValues(cart);\n addAmount.nextElementSibling.innerText = tempItem.amount;\n } else if (event.target.classList.contains(\"fa-chevron-down\")) {\n let lowerAmount = event.target;\n let id = lowerAmount.dataset.id;\n let tempItem = cart.find(item => item.id === id);\n tempItem.amount = tempItem.amount - 1;\n if (tempItem.amount > 0) {\n Storage.saveCart(cart);\n this.setCartValues(cart);\n lowerAmount.previousElementSibling.innerText = tempItem.amount;\n } else {\n cartContent.removeChild(lowerAmount.parentElement.parentElement);\n this.removeItem(id);\n }\n };\n });\n }", "function buy (item) {\n if (game.fire === false) {\n if (item === 'ore' && game.gold >= settings.oreCost){\n game.ore += 1\n game.gold -= settings.oreCost\n return \"You bought 1 piece of ore!\" \n } else if(item === 'wood' && game.gold >= settings.woodCost){\n game.wood += 1\n game.gold -= settings.woodCost\n return \"You bought 1 piece of wood!\"\n } else {\n return `You cannot buy ${item}`\n }\n } else {\n return \"You must put out the fire.\"\n }\n }", "function CollectionItem({ item, addItem }) {\n const { name, price, imageUrl } = item;\n\n return (\n <div className=\"collection-item\">\n <div className=\"image\" style={{ backgroundImage: `url(${imageUrl})` }} />\n <div className=\"collection-footer\">\n <span className=\"name\">{name}</span>\n <span className=\"price\">{price}</span>\n </div>\n {/* Se manda a llamar la funcion que se obtiene de las props (mapDispatchToProps) y se manda como parametro item*/}\n <CustomButton onClick={() => addItem(item)} inverted>\n Add To Cart\n </CustomButton>\n </div>\n );\n}", "function inventory() { }", "'BUY_STOCK' (state, {stockId, quantity, stockPrice}) {\n // check to see if I already own the stock, to increase instead of create\n const record = state.stocks.find(element => element.id === stockId);\n if (record) {\n record.quantity += quantity;\n } else {\n let currentStock = { id: stockId, quantity: quantity };\n state.stocks.push(currentStock);\n }\n state.funds -= stockPrice * quantity;\n }", "function App() {\n const [{ items, cart }, dispatch] = useStateValue();\n\n useEffect(() => {\n const unsubscribe = auth.onAuthStateChanged((authUser) => {\n if (authUser) {\n dispatch({\n type: \"SET_USER\",\n payload: {\n user: authUser,\n },\n });\n } else {\n dispatch({\n type: \"SET_USER\",\n payload: {\n user: null,\n },\n });\n }\n });\n return () => unsubscribe();\n }, []);\n\n useEffect(() => {\n const fetchData = async () => {\n const products = await client.getEntries({\n content_type: \"overstockItemsOnSale\",\n });\n\n const itemsToBeAdded = products.items.map((product) => {\n const { id } = product.sys;\n const { price, title, rating } = product.fields;\n const description =\n product.fields.description.content[0].content[0].value;\n const imageUrl = product.fields.image.fields.file.url;\n return { id, price, title, description, rating, imageUrl };\n });\n\n dispatch({\n type: \"ADD_ITEMS\",\n payload: {\n items: itemsToBeAdded,\n },\n });\n if (getCartFromLocalStorage()) {\n const cartItems = getCartFromLocalStorage('cart');\n cartItems.forEach((item) => {\n console.log(item)\n dispatch({\n type: \"ADD_TO_CART\",\n payload: {\n item\n },\n })\n })\n }\n };\n\n fetchData();\n }, []);\n return (\n <Router>\n\n <div className=\"app\">\n <Switch>\n <Route path=\"/signin\">\n <Header />\n <SignInPage />\n </Route>\n <Route path=\"/checkout\">\n <Checkout />\n </Route>\n <Route path=\"/product/:id\">\n <Header />\n <ItemDescription />\n </Route>\n <Route path=\"/payment\">\n <Creditcard />\n </Route>\n <Route path=\"/\">\n <Header />\n <Home />\n </Route>\n </Switch>\n </div>\n </Router>\n );\n}", "function ShoppingBag() {\n this.list = [];\n this.date = new Date();\n this.currentYear = this.date.getFullYear();\n this.addProduct = function (object) {\n if (object.experationDate >= this.currentYear) {\n this.list.push(object);\n }\n };\n /*!!!*/ this.getAveragePrice = function () {\n this.averagePrice = 0;\n /* !!!! da bi radilo this unutar drugog objekta, a da se odnosi na konstruktor, moramo da stavimo dodatno callback-funkciju => */\n this.list.forEach((element, index) => {\n this.averagePrice += this.list[index].price;\n });\n this.averagePrice = this.averagePrice / this.list.length;\n return parseFloat(this.averagePrice.toFixed(3));\n };\n this.getMostExpensive = function () {\n this.mostExpensive = 0;\n this.mostExpensiveProduct;\n this.list.forEach((element, index) => {\n if (this.list[index].price > this.mostExpensive) {\n this.mostExpensive = this.list[index].price;\n this.mostExpensiveProduct = this.list[index].name;\n }\n });\n return this.mostExpensiveProduct + \" \" + this.mostExpensive;\n };\n this.getTotalPrice = function () {\n this.totalPrice = 0;\n this.list.forEach((element, index) => {\n this.totalPrice += this.list[index].price;\n });\n return this.totalPrice;\n };\n }", "function Cart({ initialItems }){\n\n\n const [items, setItems] = useState(initialItems)\n\n // update the qty\n const updateQty = (id, newQty) => {\n const newItems = items.map(item => {\n if (item.id === id) {\n return { ...item, qty: newQty };\n }\n return item;\n });\n setItems(newItems);\n };\n\n // delete item from cart \n const handleDelete = (id) =>{\n const newItems = items.filter(item => item.id !== id)\n setItems(newItems)\n }\n\n // calcs the grand total of all items in the cart\n const GrandTotal = items.reduce((total, item) => (\n total + item.qty * item.price), 0).toFixed(2)\n\n\n return (\n <div className=\"Cart\">\n <h1 className=\"Cart-title\">Shopping Cart</h1>\n <div className=\"Cart-items\">\n {items.map(item => (\n <CartItem {...item}\n updateQty={updateQty}\n handleDelete={handleDelete}\n key={item.id} />\n \n ))}\n\n </div>\n\n <h2 className='Cart-total'>Grand total: {GrandTotal}</h2>\n </div>\n );\n}", "function buyProduct() {\n\n // get the user's purchase request\n inquirer.prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"What is the ID of the product you want to buy?\",\n default: defId\n },\n {\n name: \"qty\",\n type: \"input\",\n message: \"How many do you want to buy?\",\n default: defQty\n }\n ]).then(function (answers) {\n\n var id = answers.id;\n var qty = answers.qty;\n\n // get the necessary information from the database to actually process the order\n connection.query(\"SELECT product_name, department_id, price, stock_quantity FROM products WHERE item_id = ?;\", [id], function (err, rows, fields) {\n\n if (err) throw err;\n\n // different cases of database results\n switch (rows.length) {\n // One row returned is the normal case as the requested id should be unique\n case 1:\n var namProduct = rows[0].product_name;\n var idDept = rows[0].department_id;\n var prcProduct = rows[0].price;\n var qtyStock = rows[0].stock_quantity;\n // check for sufficient inventory for the order\n if (qtyStock >= qty) {\n // if sufficient inventory then execute the order and update the database\n connection.query(\"UPDATE products SET stock_quantity = ? WHERE item_id = ?;\", [(qtyStock - qty), id], function (err, rows, fields) {\n if (err) throw err;\n // compute the total price to the customer for this order and display it for the customer\n var totSale = qty * prcProduct;\n console.log(\"\\n\\nYour total price for: \" + namProduct + \", Quantity: \" + qty + \" is $\" + totSale.toFixed(2) + \"\\n\\n\");\n // add the total price for this order to the department sales total in the database\n connection.query(\"UPDATE departments SET total_sales = total_sales + ? WHERE department_id = ?;\", [totSale, idDept], function (err, rows, fields) {\n if (err) throw err;\n // ask the customer if they want to continue purchasing more products\n buyMore();\n });\n });\n } else {\n // if there is insufficient inventory for the initial order, ask the customer if they would still like to purchase a smaller amount\n inquirer.prompt([\n {\n name: \"qty\",\n type: \"confirm\",\n message: \"There is insufficient quantity for your order. Do you want still want to buy some?\"\n }\n ]).then(function (answers) {\n // if the user does want to buy a smaller quantity, set the order defaults and go back to the start of the purchase process\n if (answers.qty) {\n defId = id;\n defQty = qtyStock;\n buyProduct();\n // otherwise just ask the customer if they would like to buy any other products\n } else {\n buyMore();\n }\n });\n }\n break;\n // if no rows were returned from the original product query, then let the customer know the product id was invalid and ask if they would like to continue\n case 0:\n console.log(\"Sorry, there is not a product with ID: \" + id);\n buyMore();\n break;\n }\n\n });\n\n });\n\n}", "async buy(item, quantity) {\n const res = await this.client.action(\"buy\", { itemName: item, quantity: quantity, storeName: this.store });\n if (res.success) {\n this.editCache(item, -quantity);\n await this.client.update(res.playerStringified);\n }\n return { success: res.success, msg: res.msg };\n }", "updatePurchaseState(ingredients) {\n //These \"ingredience\" argument is are updated inredients from:\n //addIngredientHandler and removeIngredientHandler!!!\n\n //This ingredients that i'm analyzing is an old state here!\n //Copy of original state ingridients to check them\n // const ingredients = {\n // ...this.state.ingredients,\n // };\n\n // const bum = Object.keys(ingredients);\n // console.log(bum);\n //Converting ingredients object to an Array\n //This will create an array of string entries\n //The sum represents the TOTAL AMOUNT od ingredients\n\n const sum = Object.keys(ingredients)\n .map((ingKey) => {\n // console.log(\"ingredients\", ingredients[ingKey]);\n return ingredients[ingKey];\n //This returns new value and replace old value which was teh property name-salad and so on...\n //Here I simply return ingredients and the value for the given key\n //and this will be the amount \"ingredients[ingKey]\"\", with this notation[ingKey]\n //im accessing the certain property of the ingredients object, ingKey is salad, bacon...\n //and im basically getting their values-numbers, that is what i return for each key!\n //Now i have an array of values!!!\n //Now all i need to do is to call reduce method, not to flatten but\n //To turn this array into a single number THE SUM OF ALL INGREDIENTS!\n //For that i will have the starting number of 0 than we have a function which is executed\n // on each element in this mapped array.\n //In this function i get the new sum and the individual element.\n //Keep in mind sum is constantly updated current sum up until the current iteration\n //where this function is executed and once this function is executed on all array elements\n //sum is the final result!!!\n })\n .reduce((sum, el) => {\n // returns current sum + element, el is the value we accessed in ingredients[\"ingKey\"]!\n // console.log(el);\n return sum + el;\n }, 0);\n this.setState({ purchasable: sum > 0 }); //This is true or false\n // console.log(sum);\n }", "function compose(fns) {\n\n\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 AppContextProvider({children}) {\n const [auto, setAuto] = useState([])\n function agregarAlCarrito(prod, cant){\n setAuto([...auto, {item: prod, quantity: cant}])\n }//Agregar objetos al cart\n const borrarListado=()=>{\n setAuto([])\n }// Borra todo los items del Cart.\n const precioTotal =()=>{\n return auto.reduce((acum, valor)=>(acum + (valor.quantity * valor.item.precio)), 0) \n }// Suma el costo total de los items.\n const iconCart = () => {\n return auto.reduce( (acum, valor)=> acum + valor.quantity, 0) \n }// Muestra cantidad de items en el Icono Carrito.\n \nreturn (\n <AppContext.Provider value={{\n auto,\n agregarAlCarrito,\n borrarListado,\n precioTotal,\n iconCart,\n }}>\n {children}\n </AppContext.Provider>\n )\n}", "function InventoryList({ data, onItemAdd, onItemDeduct }) {\n return (\n <div>\n {renderList()}\n {data && !data.length && <h3>Add books from the library!</h3>}\n </div>\n );\n\n function renderList() {\n return (\n <List\n itemLayout=\"horizontal\"\n dataSource={data}\n renderItem={(item) => (\n <List.Item\n actions={[\n <Tooltip title=\"add\">\n <Button\n type=\"dashed\"\n // shape=\"round\"\n icon={<PlusOutlined />}\n onClick={() => onItemAdd(item)}\n />\n </Tooltip>,\n <Tooltip title=\"deduct\">\n <Button\n // danger\n type=\"dashed\"\n // shape=\"circle\"\n icon={<MinusOutlined />}\n disabled={item.quantity < 1}\n onClick={() => onItemDeduct(item)}\n />\n </Tooltip>,\n ]}\n >\n <List.Item.Meta\n avatar={<Avatar src={item.thumbnail} />}\n title={item.title}\n />\n <div>\n <Tooltip title=\"Quantity\">\n <Badge count={item.quantity} showZero />\n </Tooltip>\n </div>\n </List.Item>\n )}\n />\n );\n }\n}", "function CartPage(props) {\n\n const dispatch = useDispatch();\n const [Total, setTotal] = useState(0)\n const [ShowTotal, setShowTotal] = useState(false)\n const [ShowSuccess, setShowSuccess] = useState(false)\n const [numCarrito, setNumCarrito] = useState(0)\n \n const user = useSelector(state => state.user)\n\n useEffect(() => {\n let cartItems = [];\n if (props.user.userData && props.user.userData.cart) {\n if (props.user.userData.cart.length > 0) {\n props.user.userData.cart.forEach(item => {\n cartItems.push(item.id)\n });\n dispatch(getCartItems(cartItems, props.user.userData.cart))\n .then((response) => {\n if (response.payload.length > 0) {\n calculateTotal(response.payload)\n calculateCartNumber(response.payload)\n }\n }\n )\n }\n }\n\n }, [props.user.userData])\n\n\n const calculateCartNumber = (cartDetail) => {\n var numCarrito = 0;\n try {\n cartDetail.forEach( element => {\n numCarrito += element.quantity; // sumar por ítem: user.userData.cart.length \n });\n setNumCarrito(numCarrito)\n } catch(e) {};\n return numCarrito\n };\n\n const calculateTotal = (cartDetail) => {\n let total = 0;\n\n cartDetail.map(item => {\n total += parseFloat(item.price, 10) * item.quantity\n return total\n });\n\n setTotal(total)\n setShowTotal(true)\n };\n\n\n const RemoveFromCart = (productId) => {\n dispatch(removeCartItemFromCartPage(productId))\n .then( response => {\n if (response.payload.cartDetail.length <= 0)\n setShowTotal(false)\n else\n calculateTotal(response.payload.cartDetail)\n }\n );\n };\n\n const AddToCart = (productId) => {\n dispatch(addToCartFromCartPage(productId))\n .then( response => {\n //console.log(\"Response CARTPAGE ante agregar:\", response.payload)\n if (response.payload.length <= 0)\n setShowTotal(false)\n else\n calculateTotal(response.payload)\n }\n );\n };\n\n const AddEnvio = (importe) => {\n dispatch(addEnvio(importe))\n .then((response) => {\n //console.log(\"Response CARTPAGE ante agregar:\", response.payload)\n if (response.payload.length <= 0)\n setShowTotal(false)\n else\n calculateTotal(response.payload)\n }\n );\n };\n\n const SubtractToCart = (productId) => {\n dispatch(subtractCartItemFromCartPage(productId))\n .then((response) => {\n if (response.payload.length <= 0)\n setShowTotal(false)\n else\n calculateTotal(response.payload)\n }\n );\n };\n\n // const transactionSuccess = (data) => {\n // dispatch(onSuccessBuy({\n // cartDetail: props.user.cartDetail,\n // paymentData: data\n // }))\n // .then(response => {\n // if (response.payload.success) {\n // setShowSuccess(true)\n // setShowTotal(false)\n // }\n // })\n // };\n\n // const transactionError = () => {\n // console.log('Error en Paypal')\n // };\n\n // const transactionCanceled = () => {\n // console.log('Transacción cancelada')\n // };\n\n// console.log(user.userData)\n// console.log(user.cartDetail)\n\n const pagarMP = () => {\n\n let items = [];\n\n user.userData.cart.forEach(element => {\n let id = element.id;\n let unit_price = 0;\n let title = \"\";\n let description = \"\";\n let picture_url = \"\";\n let quantity = element.quantity;\n\n user.cartDetail.forEach(item => {\n if (item._id === id) {\n unit_price = item.price;\n title = item.title;\n description = item.description;\n picture_url = \"https://glamstudio.com.ar/uploads/\" + item.images[0];\n if (description.length>255)\n description = description.slice(0, 255)\n }\n });\n\n if (quantity>0) {\n items.push({\n id,\n title,\n description,\n category_id: \"glamstudio-makeup\",\n quantity,\n currency_id: 'ARS',\n picture_url,\n unit_price\n });\n }\n });\n\n var bodyJson = { items };\n\n fetch('/api/users/procesar-pago', {\n method: 'POST',\n credentials: 'include',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify(bodyJson)\n })\n .then((response) => {\n return response.json();\n })\n .then((init_point) => {\n// console.log(\"Llegó:\", init_point);\n window.open(init_point.url, '_blank');\n });\n };\n\n\n var estiloCorreo = {marginBottom:'20px', color:'gray', fontSize:'1.7rem', fontWeight:'600'}\n try {\n if (window.screen.width<767) {\n estiloCorreo = {marginBottom:'20px', color:'gray', fontSize:'1.5rem', fontWeight:'600'}\n }\n } catch(e) {}\n \n\n\n if (user.userData) {\n const correo = user.userData.email;\n \n return (\n <div style={{width:'85%', marginLeft:'8%', marginRight:'10%', marginBottom:'0', minHeight:'800px'}}>\n \n <h1 style={{marginTop:'20px', marginBottom:'0px'}}> Mi Carrito </h1>\n <div style={estiloCorreo}>({correo})</div>\n\n <div>\n <UserCardBlock\n products={props.user.cartDetail}\n removeItem={RemoveFromCart}\n addItem={AddToCart}\n subtractItem={SubtractToCart}\n addEnvio={AddEnvio}\n />\n\n <br/>\n <br/>\n\n <hr/>\n \n {ShowTotal ?\n <div style={{marginTop:'3rem'}}>\n <h2 style={{margin:'auto', textAlign:'center'}}> Total a pagar: ${Total.toString().replace(\".\", \",\")} </h2>\n <div style={{marginBottom:'50px'}}></div>\n </div>\n :\n ShowSuccess ?\n <Result status=\"success\" title=\"Successfully Purchased Items\" /> :\n <div style={{width:'100%', display:'flex', flexDirection:'column', justifyContent:'center'}}>\n <br />\n <Empty description={false} />\n <br/>\n <h2 style={{textAlign:'center'}}> No hay nada en tu carrito </h2>\n </div>\n }\n </div>\n \n \n {ShowTotal &&\n \n <div style={{display:'block', margin:'auto', textAlign:'center'}}>\n\n {/* <div style={{display:'none'}}>\n <Paypal\n toPay={Total}\n onSuccess={transactionSuccess}\n transactionError={transactionError}\n transactionCanceled={transactionCanceled}\n />\n </div> */}\n\n <a onClick={pagarMP} style={{backgroundColor:'white', border:'0px solid white'}}>\n <h4>Click para pagar desde</h4>\n <img src=\"/imgs/mercadopago.png\" style={{maxWidth:'80%'}} />\n <h6 style={{marginTop:'12px'}}> No es necesario tener una cuenta en Mercado Pago </h6>\n </a>\n\n </div>\n }\n \n <br/><br/><br/><br/><br/>\n <br/>\n <p style={{textAlign:'center', marginBottom:'10px', paddingBottom:'0'}}>Ver <a href={'/politica-de-devoluciones'}>Política de Devoluciones</a></p>\n\n </div>\n )\n } else {\n return (<div></div>)\n }\n}", "function buyItem(user){\n return user\n}", "function purchase(quantityRemaining, quantityRequest, price, id) {\n if (quantityRemaining < quantityRequest) {\n inquirer\n .prompt({\n name: \"editRequest\",\n type: \"rawlist\",\n message:\n \"Insufficient quantity to fullfill order. Would you like to change your request to a smaller value?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(data) {\n if (data.confirm === \"No\") {\n console.log(\"Thank you for your business!\");\n connection.end();\n } else {\n runSearch();\n }\n });\n } else {\n total = total + price * quantity;\n connection.query(\n \"UPDATE products SET stock_quantity = stock_quantity - \" +\n quantity +\n \" WHERE ?\",\n [\n {\n item_id: id\n }\n ],\n //alert user of the balance for their current request, if they want to make additional purchases \n //then price and quantity is added to the \"total\" variable.\n function(err, res) {\n if (err) throw err;\n\n inquirer\n .prompt({\n name: \"confirm\",\n type: \"rawlist\",\n message:\n \"\\nYour total for this transaction is: $\" +\n (price * quantity).toString() +\n \". Would you like to make another purchase?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(data) {\n if (data.confirm === \"No\") {\n console.log(\"\\nThe total for today is: $\" + total.toString());\n connection.end();\n } else {\n runSearch();\n }\n });\n }\n );\n }\n}", "function purchase() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"itemID\",\n message: \"What is the ID of the item you would like to purchase?\",\n validate: function(value) {\n if (isNaN(value) === false && value !== '' && parseInt(value) > 0) {\n return true;\n } else {\n console.log(\"\\nPlease enter a valid ID.\");\n return false;\n }\n }\n },\n {\n type: \"input\",\n name: \"itemQuantity\",\n message: \"How many would you like?\",\n validate: function(value) {\n if (isNaN(value) === false && value !== '' && parseInt(value) > 0) {\n return true;\n } else {\n console.log(\"\\nPlease enter a valid quantity.\");\n return false;\n }\n }\n }\n ])\n .then(function(choice) {\n //console.log(\"User's choice: \", choice);\n\n var currentItem = currentInventory.filter(\n item => item.id === parseInt(choice.itemID)\n );\n \n // Above function if written in longer form\n // var currentItem = currentInventory.filter(function(item) {\n // return item.id === parseInt(choice.itemID);\n // });\n\n //console.log(\"currentItem\", currentItem);\n //console.log(\"choice.itemQuantity\", parseInt(choice.itemQuantity));\n //console.log(\"currentItem.stock_quantity\", currentItem[0].stock_quantity);\n \n // if item ID given by the customer does NOT match the ID in the 'products' table\n if (currentItem.length == 0) {\n console.log(\"Sorry that item doesn't exist\");\n // ask customer if they want to move onto a different purchase\n confirmNextPurchase();\n\n //if item ID given by the customer DOES match the ID in the 'products' table\n } else {\n // If the quantity requested is LESS THAN OR EQUAL to the stock quantity\n if (parseInt(choice.itemQuantity) <= currentItem[0].stock_quantity) {\n //fulfill order\n //console.log(\"Enough quantity\");\n console.log(\"You have picked \" + choice.itemQuantity + \" of the \" + currentItem[0].product_name + \".\")\n var cost = parseInt(choice.itemQuantity) * currentItem[0].price;\n console.log(\"Please pay the total of $\" + cost + \" before moving onto the next purchase!\")\n \n // Check if the customer paid\n paidOrUnpaid( function(isPaid) {\n if(isPaid){\n // ONLY update the inventory (aka the 'products' table) if the customer has PAID\n\n //console.log('isPaid working');\n var updatedStock = currentItem[0].stock_quantity - choice.itemQuantity;\n //console.log(\"updatedStock\", updatedStock);\n\n // UPDATE the 'stock_quantity' in the 'products' table using the product ID chosen by the customer after the purchase\n updateInventory(parseInt(choice.itemID), updatedStock);\n confirmNextPurchase();\n // Ends connection if the amount is NOT PAID\n } else {\n console.log(\"The amount is not paid.\");\n connection.end();\n }\n });\n // If the quantity requested is GREATER THAN the stock quantity\n } else {\n // Alert customer about the quantity left\n console.log(\"Insufficient quantity!\");\n console.log(\"We only have \" + currentItem[0].stock_quantity + \" of the \" + currentItem[0].product_name + \" left.\")\n // Ask if customer would like to move onto a new purchase\n confirmNextPurchase();\n }\n }\n });\n}", "function Hamburger(type, ingredients) {\n this.type = type;\n this.ingredients = ingredients;\n this.totalCal = 0;\n this.totalPrice = 0;\n\n this.currentBurger = {\n small: false,\n big: false,\n cheese: false,\n salad: false,\n potato: false,\n spice: false,\n mayo: false\n };\n\n this.productInfo = {\n small: {price: 50, cal: 40},\n big: {price: 100, cal: 60},\n cheese: {price: 10, cal: 20},\n salad: {price: 20, cal: 5},\n potato: {price: 15, cal: 10},\n spice: {price: 15, cal: 0},\n mayo: {price: 20, cal: 5}\n };\n\n Hamburger.prototype.checkInfo = function() {\n var error = false;\n\n var necesProd = function (item) {\n return (item === 'salad' || item === 'cheese' || item === 'potato')\n };\n\n var unkProd = function (item) {\n return Object.keys(this.productInfo).every(function (ing) {\n return (item !== ing)\n })\n }.bind(this);\n\n switch (true) {\n case !this.type: return _errorMessage('choose burger size', error);\n case !(typeof this.type === 'string'): return _errorMessage('enter correct type size string', error);\n case this.type !== 'small' && this.type !== 'big': return _errorMessage('enter correct type size small or big', error);\n case !this.ingredients || !this.ingredients.length: return _errorMessage('choose ingredients', error);\n case !this.ingredients.some(necesProd): return _errorMessage('enter the ingredient', error);\n case this.ingredients.some(unkProd): return _errorMessage('unknown ingredient', error);\n case this.ingredients.some(function (item) {return !item}): return _errorMessage('empty ingredients field', error);\n default: return error\n }\n };\n\n this.compileBurger = function () {\n this.ingredients.forEach(function (item) {\n this.currentBurger[item] = true\n }.bind(this));\n this.currentBurger[this.type] = true;\n };\n\n this.orderBurger = function () {\n if (this.checkInfo()) {\n return\n } else {\n this.compileBurger();\n this.countPriceAndCal();\n this.showResult();\n }\n };\n\n this.countPriceAndCal = function () {\n Object.keys(this.currentBurger).forEach(function(item) {\n if (this.currentBurger[item]) {\n this.totalPrice += this.productInfo[item].price;\n this.totalCal += this.productInfo[item].cal;\n }\n }.bind(this));\n };\n\n this.showResult = function () {\n alert('You chose ' + this.type + ' burger. It costs ' + this.totalPrice + ' lirs and have ' + this.totalCal + ' calories');\n };\n\n var _errorMessage = function (str, error) {\n alert(str);\n return error = true;\n }\n}", "function applyPromotionsCart() {\n for( let i=0; i<cart.length;i++){\n if(cart[i].name=='cooking oil'&cart[i].quantity>=3){\n cart[i].subtotalWithDiscount=cart[i].quantity*10; //afegim l'atribut subtotalWithDiscount per l'oferta a l'oli\n }else if(cart[i].name=='Instant cupcake mixture'&cart[i].quantity>=10){\n cart[i].subtotalWithDiscount=(cart[i].subtotal*2)/3; //afegim l'atribut subtotalWithDiscount per l'oferta a la mescla per pastís\n }else{cart[i].subtotalWithDiscount='No discount'} //afegim l'atribut subtotalWithDiscount sense discount per a la resta de productes \n }\n console.log(cart);\n \n}", "function updateQuantity(item, type) {\n let indx = cart.findIndex((x) => x.name == item.name);\n let qty = qtyBtn.textContent;\n\n if (type == \"dec\") {\n if (qty > 0) {\n qty--;\n qtyBtn.textContent = qty;\n if (indx != -1) {\n cart[indx].quantity = qty;\n } else {\n let billObj = {\n name: item.name,\n price: item.price,\n quantity: qty,\n category: item.category\n };\n cart.push(billObj);\n }\n }\n if (qty == 0) {\n cart = cart.filter((item) => item.quantity != 0);\n }\n }\n\n if (type == \"inc\") {\n if (qty < 10) {\n qty++;\n qtyBtn.textContent = qty;\n if (indx != -1) {\n cart[indx].quantity = qty;\n } else {\n let billObj = {\n name: item.name,\n price: item.price,\n quantity: qty,\n category: item.category\n };\n cart.push(billObj);\n }\n }\n }\n\n updateBill();\n showCartItems();\n }", "addToCart(item) {\n dispatch(addToCart(item));\n }", "function purchaseProduct() {\n \n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw console.log(\"connection error: \" + err);\n inquirer.prompt([\n {\n name: \"id\",\n type: \"input\", \n message: \"Enter the ID of the pruduct you wish to purchase\",\n },\n {\n name: \"units\",\n type: \"input\",\n message: \"How many would you like to buy?\",\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n } \n ])\n .then(function(answer) {\n var query = \"SELECT * FROM products WHERE ?\";\n connection.query(query, { id: answer.id }, function(err, res) {\n\n var dbStock = res[0].stock_quantity;\n var reqStock = answer.units;\n\n if (dbStock >= reqStock){\n\n var NewDbStock = dbStock - reqStock;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: NewDbStock\n },\n {\n id: answer.id\n }\n ],\n function(error) {\n if (error) throw err;\n console.log(\"==============================================\");\n console.log(\"\\n\\r\");\n console.log(\"Purchase Succesfull\");\n var totalCost = res[0].price * answer.units;\n console.log(\"Your Item(s) Cost: \" + totalCost);\n console.log(\"\\n\\r\");\n console.log(\"==============================================\");\n purchaseProduct();\n } \n );\n }\n else {\n console.log(\"==============================================\");\n console.log(\"\\n\\r\");\n console.log(\"Not enough in stock, choose a different quantity\");\n console.log(\"\\n\\r\");\n console.log(\"==============================================\");\n purchaseProduct();\n }\n \n });\n \n });// inquier.prompt\n });// conection.query\n }// purchaseProduct()", "checkout(Inventory) {\n let total = 0;\n this.items.forEach(i => {\n let [ sku, name, quantity, price ] = Inventory.get(i[0]);\n console.log(`${name} ${i[1]} x ${price} = ${i[1] * price}`);\n total += i[1] * price;\n\n // update Inventory state\n Inventory.items = Inventory.items.map(item => {\n if (item[0] === sku) {\n item[2] -= i[1];\n }\n return item;\n });\n });\n console.log(\"---------------------------\");\n console.log(`TOTAL: ${total}`);\n console.log(\"---------------------------\\n\");\n\n this.items = [];\n }", "function ex7(){\n // return\n\n let discount = totalShoppingCart * 0.2 \n totalShoppingCartFriday = totalShoppingCart - discount\n }", "function buy10() {\n const credit = 1100;\n addCredit(credit);\n return credit;\n}", "function budgetCalculator(watch,mobile,laptop) {\n if(watch > 0 || mobile > 0 || laptop > 0) {\n var watchPrice = watch * 50;\n var mobilePrice = mobile * 100;\n var laptopPrice = laptop * 500;\n var totalCost = watchPrice + mobilePrice + laptopPrice;\n\n return totalCost;\n }\n else{\n if(watch == 0 && mobile == 0 && laptop == 0) {\n return \"you don't buy anithing\";\n }\n else{\n return \"your item quantity is invalid\"\n }\n \n }\n}", "function ItemDetailContainer({plates, id, type}){\n\n const location = useLocation();\n\n let productID = location.state.id;\n let productType = location.state.type\n plates.id= productID\n plates.type = productType\n let product = [plates]\n let plats =[]\n plats = plates.platos\n\n const urlMenusApi = 'https://strapi.thefit-menu.com/menus';\n\n //constante en desuso\n const [infoProduct, setInfoProduct] = useState([]);\n\n //constantes para filtrar los platos seleccionados \n const [platos, setPlatos] = useState([])\n const [platosFinal, setPlatosFinal] = useState([])\n const [superPlato, setSuperPlato] = useState([]);\n const [isExeded, setIsExeded] = useState(\n {\n state: undefined,\n message: ''\n }\n );\n const [showNotificationExeded, setShowNotificationExeded] = useState(false)\n //constante para agregar item al carrito\n const {addItem} = useContext(CartContext)\n \n //MODIFICAR parametro PRODUCT para enviar solo esta informacion: \n /* -ID producto\n -TIPO producto\n -CANTIDAD producto\n -PLATOS: -ID plato\n -CANTIDAD plato (segun selecciona en cada plato)\n */\n const handleOnAdd = count => addItem(product,count)\n\n // const handleClose = (event, reason) => {\n // if (reason === 'clickaway') {\n // return;\n // }\n // setOpen(false);\n // };\n //cerrar notificacion\n const handleNotification = () => {\n setShowNotificationExeded(false)\n }\n const action = (\n <React.Fragment>\n <IconButton\n size=\"small\"\n aria-label=\"close\"\n color=\"inherit\"\n onClick={handleNotification}\n >\n <CloseIcon fontSize=\"small\"/>\n </IconButton>\n </React.Fragment>\n );\n\n useEffect(() =>{\n getMenus() \n },[])\n useEffect(() =>{\n \n })\n\n const getMenus = async () =>{\n return await fetch(urlMenusApi)\n .then((response) => response.json())\n .then((data) =>{\n setInfoProduct(data)\n filterPlates(data)\n \n })\n .catch(err => console.log(`err`, err))\n }\n\n const filterPlates = (infoProduct) => {\n plats.map((plato) => {\n infoProduct.find( o => {\n o.plates.map((plateInfoProduct) => {\n if(plateInfoProduct.id === plato){\n return setPlatos(prevPlato => {\n return [ \n ...prevPlato, \n plateInfoProduct.name\n ]\n })\n \n }\n })\n })\n })\n \n }\n\n const showItem = () =>{\n platos.forEach((p) => {\n if (!platosFinal.includes(p)) {\n setPlatosFinal(prevPlato => {\n return [ \n ...prevPlato, \n p\n ]\n })\n }\n }); \n }\n\n //Se selecciona la imagen segun tipo de vianda\n const selectImg = () =>{\n let img\n product.map((item) =>{\n if(item.type === 'Clásica'){\n img = imgClasica\n }else{\n if(item.type === 'Protéico'){\n img = imgProteica\n }else{\n if(item.type === 'Veggie'){\n img = imgVeggie\n }else{\n if(item.type === 'Light'){\n img =imgLight\n }\n }\n }\n }\n }) \n return img\n }\n\n //contador de selects\n const countSelectPlates = (e) => {\n isExeded.state = undefined;\n const count = e.target.value;\n const id = e.target.id;\n const quantity = product[0].quantity;\n const productoModifciado = superPlato.find(t => t.id === id);\n productoModifciado.quantity = parseInt(count, 10);\n \n let totalPlates = 0;\n superPlato.forEach((sp) =>{ \n totalPlates += sp.quantity;\n });\n\n if (totalPlates > quantity) {\n console.log(\"mostrar true\")\n isExeded.state = true;\n isExeded.message = `La cantidad de platos maxima es ${product[0].quantity}`\n setShowNotificationExeded(true)\n } else if(totalPlates < quantity) {\n console.log(\"mostrar false\")\n isExeded.state = false;\n isExeded.message = `La cantidad de platos minima es ${product[0].quantity}`\n setShowNotificationExeded(true)\n }\n\n setSuperPlato([...superPlato]); \n }\n\n const formChange = (e) => {\n console.log(\"formSelect\", e)\n }\n\n if (product[0]?.platos && !superPlato.length) {\n setSuperPlato(product[0]?.platos?.map((p) => {\n return {\n id: p,\n quantity: 1,\n };\n }));\n }\n \n return(\n <div className=\"detail__container\">\n <div className=\"detail__preInfo\">\n <div className=\"preInfo__img\">\n <CarouselDetail type={productType}/>\n </div>\n <div className=\"preInfo__text\">\n <h4>VIANDAS {productType} {product[0].quantity} PLATOS</h4>\n <h3>PLATOS DE LA SEMANA:</h3>\n {showItem()}\n <form onChange={formChange}>\n {\n superPlato.length && superPlato.map((producto,index) => {\n console.info(producto)\n return( <ItemDetail id={producto.id} key={producto.id} platos={platosFinal[index]} stock={producto.quantity} changeSelect={countSelectPlates}/> )\n })\n }\n </form>\n </div>\n </div>\n <div className=\"detail__options\">\n <h3>OPCIONES DE PEDIDO</h3>\n <div className=\"detail__options__text\">\n <p id=\"dot\">•</p>\n <p> Tomamos pedidos hasta el Lunes anterior a las 16hs.</p>\n </div>\n <div className=\"detail__options__text\">\n <p id=\"dot\">•</p>\n <p> Estas viandas saludables contienen variedad de insumos; carne, pollo, verduras y pastas.</p>\n </div>\n <div className=\"detail__options__text\">\n <p id=\"dot\">•</p>\n <p> Menú apto para hipertensos y diabéticos.</p>\n </div>\n <div className=\"detail__options__text\">\n <p id=\"dot\">•</p>\n <p> Realizamos envíos a domicilio.</p>\n </div>\n <div className=\"detail__options__text\">\n <p id=\"dot\">•</p>\n <p> Dentro de esta opción podés realizar un cambio si un plato no te gustara. Es decir, podés sacar un plato (ponerlo en \"0\") y repetir otro plato (ponerlo en \"2\"). Sólo se puede realizar un cambio.</p>\n </div>\n <div className=\"detail__options__text\">\n <p id=\"dot\">•</p>\n <p> Los pedidos se toman hasta el Sábado a las 12h. La entrega es semanal los días Lunes dentro de la franja horaria 11.30-22h.</p>\n </div>\n <div className=\"detail__options__text\">\n <p id=\"dot\">•</p>\n <p> Las viandas se entregan frescas para que vos las congeles.</p> \n </div>\n <div className=\"detail__options__text\">\n <p id=\"dot\">•</p>\n <p> ¡Cocinamos sin sal!</p>\n </div>\n <div className=\"detail__options__text\">\n <p id=\"dot\">•</p>\n <p> Métodos de pago: Podés abonar en efectivo, por transferencia o con tarjeta de crédito o débito por Mercado Pago con un 10% adicional.</p>\n </div> \n </div>\n <div className=\"detail__BtnAddCart\">\n <button onClick={handleOnAdd} disabled={isExeded.state == true || isExeded.state == false}>Agregar al carrito</button> \n </div>\n <Snackbar open={showNotificationExeded} autoHideDuration={5000} onClose={handleNotification} message={isExeded.message} action={action}/>\n </div>\n )\n}", "render () {\n let buttonText\n let wrapper\n const { exists, available, quantity = true, checkoutUrl} = this.props\n\n if (exists && available) {\n buttonText = 'Buy Now'\n } else if (exists) {\n buttonText = 'Out of Stock'\n } else {\n buttonText = 'Unavailable'\n }\n\n const classes = classnames('btn', {\n 'btn-success': exists && available,\n 'disabled btn-default': !exists || !available\n })\n\n const buyNowButton = (\n <button className={classes} onClick={this.onBuyNow} href={checkoutUrl}>{buttonText}</button>\n )\n\n const addToCartButton = (\n <button className=\"btn btn-default\"\n data-tip=\"Add To Cart is not implemented, but is here to demonstrate the use of functional handler using Fake Cart\"\n onClick={this.onAddCart}>\n Add To Cart\n </button>\n )\n\n if (quantity) {\n wrapper = (\n <div className=\"AddToCart\">\n <div className=\"input-group\">\n <input type=\"number\"\n value={this.props.quantity}\n className=\"form-control\" \n placeholder=\"Enter quantity here\" \n onChange={this.onChangeQuantity}\n />\n <span className=\"input-group-btn\">\n {buyNowButton}\n {addToCartButton}\n </span>\n </div>\n </div>\n )\n } else {\n wrapper = (\n <div className=\"AddToCart\">\n {buyNowButton}\n </div>\n )\n }\n\n return wrapper\n }", "function getOrder(){\n\n // This function requests order details from the user, using the npm inquirer package \n // variable to hold the item id\n var item_id = 0;\n // update query to update stock when order is placed\n var updateQuery = \"UPDATE products SET stock_quantity = ?, product_sales =? WHERE item_id = ?\";\n // variable to hold the unit price\n var unit_price = 0;\n // variable to hold the stock quantity \n var stock_quantity = 0;\n // variable to hold the no of units that customer is purchasing \n var noOfUnits = 0;\n // variable to hold the product sales amount\n var product_sales = 0;\n\n // prompt user to enter an order\n inquire.prompt([{\n type:\"input\",\n name :\"itemId\",\n message:\"Please enter the id of the item to purchase\"\n }\n ]).then(answer =>{\n \n\n item_id=answer.itemId;\n \n var itemQuery = \"SELECT stock_quantity,unit_price, product_sales FROM products WHERE item_id = \" + item_id;\n\n connection.query(itemQuery,function(err,results){\n if(err) throw err;\n\n unit_price = results[0].unit_price;\n stock_quantity = results[0].stock_quantity;\n product_sales = results[0].product_sales;\n\n // if stock not availabel \n if(stock_quantity === 0 ){ \n \n console.log(\"Insufficient quantity!\");\n getAllProducts();\n\n }\n else{\n inquire.prompt([{\n type:\"input\",\n name :\"noOfUnits\",\n message:\"Please enter the no of units\"\n }\n ]).then(answer =>{\n noOfUnits = parseInt(answer.noOfUnits);\n\n if (noOfUnits > stock_quantity){\n // if availble stocks less than the amount that the customer wants to buy\n console.log(\"Insufficient quantity!\");\n getAllProducts();\n }\n\n var totalCost = parseFloat(answer.noOfUnits * unit_price);\n var newQuantity = stock_quantity - answer.noOfUnits\n var newSales = product_sales + totalCost;\n \n connection.query(updateQuery,[newQuantity,newSales,item_id],\n (err,results)=>{\n if (err) throw err;\n\n console.log(\"\\nTotal cost :\" + totalCost.toFixed(2)+\"\\n\");\n\n getAllProducts();\n });\n\n });\n }\n\n \n\n }\n )\n\n });\n // connection.end();\n}", "function marketBuy () {\n\n}", "'BUY_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 // If item already exists then add to its quantity\n if (record) {\n \n record.quantity += quantity;\n \n }\n \n // If item is not in the array then add it\n else { state.shrimpInventoryData.push({\n \n id: shrimpId,\n \n quantity: quantity\n \n });\n }\n \n // Updates funds when an item is purchased\n state.funds -= shrimpPrice * quantity;\n \n }", "addToCartHandler(p) {\n const { id, name, price, quantity } = p; // destructure\n const item = this.state.cart.find(v => v.id === id);\n if (item) {\n window.alert(\"Product already exists on the cart.\");\n } else {\n const product = {\n id, name, price, quantity, amount: price * quantity\n }\n this.setState(prevState => {\n return {\n ...prevState,\n cart: [...prevState.cart, product]\n }\n });\n setTimeout(() => {\n const amount = this.state.cart.map(v => v.amount).reduce((t, c) => t += c);\n this.setState({ totalAmount: amount });\n }, 500);\n }\n }", "function buyItem(){\n var money = App[App.myRole].money;\n if(determine == 1){\n if (money < 10) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a pencil\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 10;\n //alert(\"You bought a pencil\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a pencil!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n\t\t\t\t\t\t\n }\n }\n \n else if(determine == 2){\n if (money < 20) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a pen\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 20;\n //alert(\"You bought a pen\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a pen!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 3){\n if (money < 25) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a calculator\");\n addToInventory(determine);\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n App[App.myRole].money -= 25;\n //alert(\"You bought a calculator\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a calculator!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 4){\n if (money < 45) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought books\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 45;\n //alert(\"You bought some books\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought some books!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 5){\n if (money < 75) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a laptop\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 75;\n //alert(\"You bought a laptop\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a laptop!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 6){\n if (money < 15) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought some coffee\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 15;\n //alert(\"You bought a coffee\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought some coffee!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 7){\n if (money < 25) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a candy bar\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 25;\n //alert(\"You bought a candy bar\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a candy bar!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 8){\n if (money < 45) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought some fast food\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 45;\n //alert(\"You bought some greasy fast food\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought some fast food!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 9){\n if (money < 75) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a Fuego Taco\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 75;\n //alert(\"You bought some fuego tacos\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a scrumptious Fuego taco!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n //update the inventory of the player\n updateInventoryDisplay();\n \n //update the health and money of the player on the board\n updateHeathAndMoneyDisplay();\n }", "function buy() {\n // query the database for all items\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n // once you have the items, prompt the user for which they'd like to buy\n inquirer\n .prompt([\n {\n name: \"choice\",\n type: \"input\",\n message: \"Please input the ID# of the product you want to buy?\".bgGreen.white\n },\n {\n name: \"amount\",\n type: \"input\",\n message: \"How many would you like to buy?\".bgGreen.white\n }\n ])\n .then(function(input) {\n // get the information of the chosen item\n var item = input.choice;\n var quantity = input.amount;\n\n // Query db to confirm that the given item ID exists in the desired quantity\n var queryStr = 'SELECT * FROM products WHERE ?';\n\n connection.query(queryStr, {item_id: item}, function(err, data) {\n if (err) throw err;\n\n // If the user has selected an invalid item ID, data attay will be empty\n\n if (data.length === 0) {\n console.log('ERROR: Invalid Item ID. Please select a valid Item ID.'.bgCyan.white);\n buy();\n }\n \n else {\n var productData = data[0];\n\n // If the quantity requested by the user is in stock\n if (quantity <= productData.stock_quantity) {\n console.log(' '.bgGreen.white);\n console.log(' Congratulations, the product you requested is in stock! Placing order! '.bgGreen.white);\n console.log(' '.bgGreen.white);\n // Construct the updating query string\n var updateQueryStr = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE item_id = ' + item;\n // console.log('updateQueryStr = ' + updateQueryStr);\n\n // Update the inventory\n connection.query(updateQueryStr, function(err, data) {\n if (err) throw err;\n console.log('\\n Your total is: $' + productData.price * quantity);\n console.log(' ');\n console.log(\" \".bgMagenta.white)\n console.log(\" Thanks for shopping with Bamazon. \".bgMagenta.white)\n console.log(\" \".bgMagenta.white)\n // End the database connection\n connection.end();\n })\n } \n\n else {\n console.log(' '.bgRed.white);\n console.log(' That item is out of stock :( '.bgRed.white);\n console.log(' '.bgRed.white);\n console.log(' '.bgGreen.white);\n console.log(' Would you like to buy something else? '.bgGreen.white);\n console.log(' '.bgGreen.white);\n buy();\n }\n }\n })\n })\n\t\t\n });\n}", "function applyPromotionsCart() {\n // Apply promotions to each item in the array \"cart\"\n cart.map( (product, index) => {\n if (product.name === 'cooking oil' && product.quantity > 2) {\n cart[index].subtotalWithDiscount = cart[index].quantity * 10;\n } else if (product.name === 'Instant cupcake mixture' && cart[index].quantity > 9) {\n cart[index].subtotalWithDiscount = cart[index].quantity * (cart[index].price * 0.66);\n } else {\n cart[index].subtotalWithDiscount = cart[index].quantity * cart[index].price;\n }\n })\n}", "function buyClickUpgrade(clickItem) {\n\n\n //console.log(`You purchased a(n) ${clickItem}`);\n\n player.clickInventory.push(clickUpgrades[clickItem]);\n\n //console.log(player.clickInventory);\n\n\n\n //find price\n /*\n let inv = player.clickInventory.filter(item => {\n console.log(player.clickInventory)\n console.log(item.name);\n console.log(clickItem);\n return item.name === clickItem;\n });\n */\n\n //console.log(`the inventory for ${clickItem} is ${inv}`);\n\n //update quantity and price of item\n clickUpgrades[clickItem].quantity++;\n\n let quantity = clickUpgrades[clickItem].quantity;\n\n //console.log(`The current quantity of ${clickItem}s is ${quantity}`);\n\n clickUpgrades[clickItem].newprice *= clickUpgrades[clickItem].multiplier;\n\n clickUpgrades[clickItem].newprice =\n Math.round(clickUpgrades[clickItem].newprice);\n\n let price = clickUpgrades[clickItem].price;\n let newprice = clickUpgrades[clickItem].newprice;\n\n //console.log(`The price of a ${clickItem} is ${clickUpgrades[clickItem].price}`);\n //console.log(`The new price of a ${clickItem} is ${clickUpgrades[clickItem].newprice}`);\n\n player.currentCheeseBricks -= price;\n players[0].currentCheeseBricks = player.currentCheeseBricks;\n\n document.getElementById('input-tc').value =\n player.currentCheeseBricks;\n //console.log(`in buyClickUpgrade player.cheeseBricks = ${player.cheeseBricks}`);\n\n switch (clickItem) {\n case ('shovel'):\n document.getElementById('i-shovel-count').value = quantity;\n document.getElementById('i-shovel-price').value = newprice;\n break;\n case ('excavator'):\n document.getElementById('i-excavator-count').value = quantity;\n document.getElementById('i-excavator-price').value = newprice;\n break;\n\n default:\n break;\n }\n\n\n\n turnButtonsOnOff();\n updatePrices();\n saveClickUpgrades(); //saves clickUpgrade to local storage\n savePlayer(); //any player updates are stored such as number of cheeseBricks\n\n}", "function addToInventory() {\n //\n inquirer\n .prompt({\n name: \"addMore\",\n type: \"list\",\n message: \"Which product would you like to add more to inventory ? Choose Item ID from the list.\",\n choices: [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"]\n })\n .then(function (answer) {\n\n // get the quantity customer would like to purchase\n inquirer\n .prompt({\n name: \"howMany\",\n type: \"input\",\n message: \"How much more is being stocked ? \"\n })\n .then(function (quantity) {\n\n // based on the customer item selection, quantity to purchase, price is calculated and inventory will be updated upon purchase.\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity + ? WHERE item_id= ?\", [parseFloat(quantity.howMany), answer.addMore], function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n listUpdProducts(answer.addMore);\n });\n\n });\n\n //\n\n });\n\n //\n\n}" ]
[ "0.72371185", "0.7230484", "0.7070733", "0.69941866", "0.6823645", "0.6341362", "0.62372386", "0.62057656", "0.62057656", "0.62057656", "0.62057656", "0.62057656", "0.62057656", "0.6131362", "0.60218513", "0.5882894", "0.56475824", "0.5645957", "0.5630192", "0.5627244", "0.5625591", "0.5595287", "0.559023", "0.55776423", "0.55498093", "0.55428094", "0.5534583", "0.5525746", "0.5453944", "0.54498124", "0.54498124", "0.5445323", "0.54383856", "0.5437777", "0.54240334", "0.54107195", "0.54005224", "0.53852636", "0.5383125", "0.5368097", "0.53651845", "0.53607064", "0.5358911", "0.5356075", "0.5348092", "0.53359413", "0.5335731", "0.5315987", "0.5311032", "0.52946836", "0.52883327", "0.52871066", "0.52827775", "0.5279374", "0.52786493", "0.52775514", "0.52772886", "0.5258759", "0.52578396", "0.52538264", "0.52530783", "0.5248255", "0.5244826", "0.52441734", "0.5241152", "0.5238965", "0.52342784", "0.5228889", "0.52279377", "0.52190095", "0.52154285", "0.52136475", "0.52121776", "0.5209687", "0.5206244", "0.5205961", "0.5202227", "0.5201466", "0.5198314", "0.5191854", "0.5188431", "0.518607", "0.51839536", "0.51825154", "0.51769197", "0.5173374", "0.51733583", "0.5172801", "0.5165477", "0.5162973", "0.5161091", "0.5158336", "0.5155114", "0.51508725", "0.51490515", "0.5146451", "0.5146057", "0.5140458", "0.5140213", "0.51350015" ]
0.52532417
60
& everytime we do something we wanna add to this history for example in the add item to cart at the beginning I can just say amazon dot history dot push the current user state
function addItemToCart(user, item) { amazonHistory.push(user) const updateCart = user.cart.concat(item) return Object.assign({}, user, { cart: updateCart }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "recordState() {\n this._history.push(this.getDataString());\n }", "addHistory(state, { history }) {\n history.forEach((element) => {\n state.history.push(element);\n });\n }", "saveInHistory(state) {\n let histName = state.currentHistoryName;\n\n if (histName === null) {\n // New history row\n histName = this.getNewHistoryName(state);\n state.currentHistoryName = histName;\n }\n\n state.history[histName] = {\n name: histName,\n lastModification: Date.now(),\n points: state.points,\n links: state.links,\n tooltips: state.tooltips,\n defaultPointColor: state.defaultPointColor,\n defaultLinkColor: state.defaultLinkColor,\n defaultTooltipColor: state.defaultTooltipColor,\n defaultTooltipFontColor: state.defaultTooltipFontColor\n };\n\n this.storeHistory(state.history);\n }", "function push_history() {\n\tedit_history_index++;\n\tsave_history();\n\tedit_history.length = edit_history_index+1;\n}", "keepHistory() {\n currentHistory += 1\n history.push(this.state.alasisu)\n }", "pushHistory(history) {\n superagent\n .post('/users/chathistory')\n .send(history)\n .end(function(err, res) {\n if (err) {\n console.log('error: ', err)\n } else {}\n });\n }", "function addInHistory(data){\n if(history.length > 100) history.shift();\n history.push(data);\n}", "function addHistory( data ) {\n\n if ( typeof(aio.history) != 'object' ) { aio.history = []; } // Change aio.history to array\n if ( typeof(aio.history) == 'object' && aio.history.length > 19 ) { aio.history.pop(); } // Delete oldest record if total exceeds 20\n\n // Add this new record\n aio.history.unshift( data );\n updateHistory();\n\n}", "function addQueryToHistory(query) {\n\n}", "addHistoryItem (itemKey) {\n if (this.isHistoryItemExist(itemKey)) {\n return;\n }\n \n const MAX_HISTORY_ITEM = 25;\n \n const historyItems = this.getHistoryItemKeys();\n const newHistoryItems = {[itemKey]: itemKey};\n let count = 0;\n for (let prop in historyItems) {\n if (count >= MAX_HISTORY_ITEM - 1) {\n break;\n } else {\n count++;\n }\n \n if (historyItems.hasOwnProperty(prop)) {\n newHistoryItems[prop] = historyItems[prop];\n }\n }\n \n this.store.setData('history', newHistoryItems);\n }", "saveHistory(query) {\n let searchHistory = localStorage.getItem('searchHistory');\n searchHistory = searchHistory ? JSON.parse(searchHistory) : [];\n searchHistory.push({\n query,\n time: Date.now(),\n });\n searchHistory = takeRight(searchHistory, 50); // Latest 50 searches\n this.setState({\n searchHistory: searchHistory,\n });\n localStorage.setItem('searchHistory', JSON.stringify(searchHistory));\n }", "function delegate_history(data) {\n\tif(haswebsql) {\n\t\tsstorage.lastviewed=Ext.encode(data);\n\t\tglossdb.data.addhistory(data.title,data.target);\n\t}\n\telse {\n\t\tstorage.lastviewed = Ext.encode(data);\n\t}\n}", "function addToHistory(){\n\t\tvar state = \"?v=\"+videoNamespace.getCurrentPlayerId();\n\t\twindow.history.pushState(videoNamespace.getCurrentPlayerVideo(),videoNamespace.getCurrentPlayerTitle(),state);\n\t}", "function addToHistory(id, choice, history) {\n if (!history[id]) {\n history[id] = {};\n history[id].coins = 0;\n history[id].choices = [];\n }\n history[id].choices.push(choice);\n console.log(id + choice);\n }", "function concHistory(newInput){\n history += newInput;\n setHistory(history);\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 handleAddData() {\n hashHistory.push('/sequence/add');\n}", "addToHistory({ commit }, command) {\n commit('ADD_TO_HISTORY', command)\n }", "static setHistory(history) {\n\t\n\t\tApp.me.setState({history});\n\t}", "function storeHistory() {\n\n if (search) {\n\n storageArr.unshift(search);\n localStorage.setItem('history', JSON.stringify(storageArr));\n return;\n }\n\n}", "function addToHistory(line){\n history.push(line);\n restoreText = '';\n }", "saveChange(){\n apiService.createActivity(this.props.getCurrentState()).then(()=> {this.props.history.push('/')})\n }", "addLog() {\n this.props.history.push(\"/add-log/_add\")\n }", "pushState(state, title, url) {\n this._history.push({ state, title, url });\n this._update();\n }", "memory( method, args ) { this.history.push({method, args}); }", "function addHistory(node) {\r\n history.push(node.id);\r\n }", "addProduct(){\n console.log(this.state);\n localStorage.setItem('productId',this.state.product.id);\n localStorage.setItem('productName',this.state.product.productName);\n localStorage.setItem('productPrice',this.state.product.price);\n this.props.history.push(\"/cart\");\n }", "function cartContinue() {\n console.log(history);\n if (user) {\n //lo manda a completar la compra\n } else {\n console.log(\"aqui redirect\");\n history.push(\"/\");\n }\n }", "routeChange() {\n const products = this.state.products.filter((product) => { return product.addedCount > 0});\n this.ds.setUpdatedProducts(products);\n this.props.history.push('/cart');\n }", "function buyItem(user){\n amazonHistory.push(user)\n return Object.assign({}, user, { purchases: user.cart })\n}", "function setHistory() {\n // clear undo history\n $('#undoHistoryList')\n .empty();\n\n // load new history list from server\n getHistoryFromServer(addHistList);\n}", "function insertUserHistory(db_route, history_entry){\r\n\r\n\tdb_route.once('value', (snapshot) => {\r\n\t\t\tdb_route.push(history_entry)\r\n\r\n\t})\r\n}", "saveToHistoryAndEdit({\n name,\n imageUrl,\n location,\n club,\n github,\n personal,\n description,\n receiveNewsletter,\n clubsToPreserve\n }) {\n const newHistory = {\n name,\n imageUrl,\n location,\n club,\n github,\n personal,\n description,\n receiveNewsletter,\n clubsToPreserve\n };\n\n this.setState({ history: newHistory, edit: true });\n }", "function addToHistory(location) {\n var newQueries;\n var maxHistorySize=5;\n var exists=false; //Check if location already exist in history list\n newQueries = getHistory();\n for(var u=0;u<newQueries.queries.length;u++) {\n if(location===newQueries.queries[u]) {\n exists=true;\n }\n }\n if(!exists) { //Location does not exist\n if(newQueries.queries.length>=maxHistorySize) {\n newQueries.queries.shift();\n }\n newQueries.queries.push(location);\n localStorage.setItem(storageItem, JSON.stringify(newQueries));\n }\n }", "onHistory (event) {\n\n this.form.querySelector('input').value = event.state;\n this.form.submit();\n\n }", "addNewItem() {\n console.log(this.props)\n this.props.history.push(`/item/${this.state.restId}`)\n\n // this.props.history.push(/item)\n }", "function newHistory(newWin){\n\t\t// store new url\n\t\tnew_url_temp = newWin.location.href;\n\t\t// create push to change url to new url\n\t\tnewWin.history.pushState( {page: 1}, \"title1\", pass_value);\n\t\tnewWin.history.pushState( {page: 2}, \"title2\", new_url_temp);\n\t}", "handlePendingQuizzes() {\n let path = `/instructor/pendingquizzes/${localStorage.getItem('userid')}/${localStorage.getItem('classid')}`;\n this.props.history.push(path);\n }", "push({ href, pageName }) {\n\t\tvar history = this.get();\n\t\thistory.push({ href, pageName });\n\t\tStore.setItem('history', JSON.stringify(history));\n\t}", "function addToHistory(playerMove, cpuMove) {\n const gameResult = {\n playerMove,\n cpuMove\n };\n gameHistory.push(gameResult);\n console.log(gameHistory);\n}", "function trackAddToCart() {\n EventBus.$on(\"productAddedToCart\", function(data) {\n var skuAddedToCart = data.sku;\n if ($.cookie(\"lsf-cartadds\") === undefined) {\n $.cookie(\"lsf-cartadds\", skuAddedToCart, {\n expires: 20 * 365,\n });\n } else if (!$.cookie(\"lsf-cartadds\").includes(skuAddedToCart)) {\n var currentVal = $.cookie(\"lsf-cartadds\");\n var newVal = skuAddedToCart + \",\" + currentVal;\n $.cookie(\"lsf-cartadds\", newVal, {\n expires: 20 * 365,\n });\n }\n });\n}", "handleAddCart(e, product){\n this.setState(state => {\n const cartItems = state.cartItems;\n let productAlreadyInCart = false;\n cartItems.forEach(item => {\n if(item.id === product.id){\n productAlreadyInCart= true;\n item.count++;\n }\n });\n if(!productAlreadyInCart){\n cartItems.push({...product, count:1});\n }\n localStorage.setItem(\"cartItems\",JSON.stringify(cartItems));\n return cartItems;\n })\n }", "function store(data){\n var temp=PropertiesService.getUserProperties().getProperty(\"History\");\n if (!temp)\n PropertiesService.getUserProperties().setProperty(\"History\",data);\n else if((temp.indexOf(data))== -1)\n PropertiesService.getUserProperties().setProperty(\"History\",temp+\",\"+data);\n}", "function histTransaction(history, state, dispatch, redo) {\n var preserveItems = mustPreserveItems(state), histOptions = historyKey.get(state).spec.config;\n var pop = (redo ? history.undone : history.done).popEvent(state, preserveItems);\n if (!pop) { return }\n\n var selection = pop.selection.resolve(pop.transform.doc);\n var added = (redo ? history.done : history.undone).addTransform(pop.transform, state.selection.getBookmark(),\n histOptions, preserveItems);\n\n var newHist = new HistoryState(redo ? added : pop.remaining, redo ? pop.remaining : added, null, 0);\n dispatch(pop.transform.setSelection(selection).setMeta(historyKey, {redo: redo, historyState: newHist}).scrollIntoView());\n}", "changeState(state) {\r\n\r\n\r\n if (!this.statuses.includes(state)) {\r\n throw new Error(\"yryjinug\")\r\n }\r\n this.history1.push(this.activeState);\r\n this.activeState = state;\r\n this.history2 = [];\r\n\r\n\r\n }", "function addHistory(msg, msgData, authi) {\n // var prev = (msgData.prev && msgData.prev.$msg) ? msgData.prev.$msg.toString('hex') : null\n var entry = { id: msg.id, authi: authi, seq: msgData.seq }\n var index = entry.seq - 1 // seq is 1-based\n\n // branch in history?\n if (state.history[index]) {\n if (!Array.isArray(state.history[index]))\n state.history[index] = [state.history[index]]\n \n // insert in order of author index\n for (var i=0; i < state.history[index].length; i++) {\n var other = state.history[index][i]\n if (other.id.toString('hex') == entry.id.toString('hex'))\n return // dup\n if (other.authi > entry.authi)\n return state.history[index].splice(i, 0, entry)\n }\n return state.history[index].push(entry) // append\n }\n\n // linear\n state.history[index] = entry\n }", "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 createMemoryHistory(props){if(props===void 0){props={};}var _props=props,getUserConfirmation=_props.getUserConfirmation,_props$initialEntries=_props.initialEntries,initialEntries=_props$initialEntries===void 0?['/']:_props$initialEntries,_props$initialIndex=_props.initialIndex,initialIndex=_props$initialIndex===void 0?0:_props$initialIndex,_props$keyLength=_props.keyLength,keyLength=_props$keyLength===void 0?6:_props$keyLength;var transitionManager=createTransitionManager();function setState(nextState){Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history,nextState);history.length=history.entries.length;transitionManager.notifyListeners(history.location,history.action);}function createKey(){return Math.random().toString(36).substr(2,keyLength);}var index=clamp(initialIndex,0,initialEntries.length-1);var entries=initialEntries.map(function(entry){return typeof entry==='string'?createLocation(entry,undefined,createKey()):createLocation(entry,undefined,entry.key||createKey());});// Public interface\nvar createHref=createPath;function push(path,state){ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to push when the 1st '+'argument is a location-like object that already has state; it is ignored'):undefined;var action='PUSH';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var prevIndex=history.index;var nextIndex=prevIndex+1;var nextEntries=history.entries.slice(0);if(nextEntries.length>nextIndex){nextEntries.splice(nextIndex,nextEntries.length-nextIndex,location);}else{nextEntries.push(location);}setState({action:action,location:location,index:nextIndex,entries:nextEntries});});}function replace(path,state){ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to replace when the 1st '+'argument is a location-like object that already has state; it is ignored'):undefined;var action='REPLACE';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;history.entries[history.index]=location;setState({action:action,location:location});});}function go(n){var nextIndex=clamp(history.index+n,0,history.entries.length-1);var action='POP';var location=history.entries[nextIndex];transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(ok){setState({action:action,location:location,index:nextIndex});}else{// Mimic the behavior of DOM histories by\n// causing a render after a cancelled POP.\nsetState();}});}function goBack(){go(-1);}function goForward(){go(1);}function canGo(n){var nextIndex=history.index+n;return nextIndex>=0&&nextIndex<history.entries.length;}function block(prompt){if(prompt===void 0){prompt=false;}return transitionManager.setPrompt(prompt);}function listen(listener){return transitionManager.appendListener(listener);}var history={length:entries.length,action:'POP',location:entries[index],index:index,entries:entries,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,canGo:canGo,block:block,listen:listen};return history;}", "async commitHistory() {\n // Do nothing if no history to be committed, otherwise get history\n if (this.historyBuffer.length === 0) return;\n if (this.lock) return;\n this.lock = true;\n let history = canvas.scene.getFlag(this.layername, \"history\");\n // If history storage doesnt exist, create it\n if (!history) {\n history = {\n events: [],\n pointer: 0,\n };\n }\n // If pointer is less than history length (f.x. user undo), truncate history\n history.events = history.events.slice(0, history.pointer);\n // Push the new history buffer to the scene\n history.events.push(this.historyBuffer);\n history.pointer = history.events.length;\n await canvas.scene.unsetFlag(this.layername, \"history\");\n await this.setSetting(\"history\", history);\n simplefogLog(`Pushed ${this.historyBuffer.length} updates.`);\n // Clear the history buffer\n this.historyBuffer = [];\n this.lock = false;\n }", "function updateHistory() {\n io.emit('update history', chatrooms);\n }", "function saveHistory(actionName = null, requestId = null, freelancerId = null, title = null, body = null, toWho = null, toWhotype = null, toWhoCategory = null) {\n var date = new Date();\n var time = date.getDate() + \"/\" + (parseInt(date.getMonth()) + 1) + \"/\" + date.getFullYear();\n var dateStr = (String(date.getHours()).length == 2 ? date.getHours() : \"0\" + date.getHours()) + \":\"\n + (String(date.getMinutes()).length == 2 ? date.getMinutes() : \"0\" + date.getMinutes()) + \":\"\n + (String(date.getSeconds()).length == 2 ? date.getSeconds() : \"0\" + date.getSeconds());\n if (actionName != null) {\n historyOrdersRef.push().set({\n \"actionName\": actionName,\n \"userName\": userName,\n \"date\": time,\n \"time\": dateStr,\n \"requestId\": requestId,\n \"freelancerId\": freelancerId\n });\n }\n //else {\n // historyNotificationRef.push().set({\n // \"userName\": userName,\n // \"date\": time,\n // \"time\": dateStr,\n // \"title\": title,\n // \"body\": body,\n // \"toWho\": toWho,\n // \"userCategory\": toWhotype,\n // \"toWhoCategory\": toWhoCategory\n // });\n //}\n\n}", "function History() {\n}", "handlePastQuizzes() {\n let path = `/instructor/quizzes/${localStorage.getItem('userid')}/${localStorage.getItem('classid')}`;\n this.props.history.push(path);\n }", "function recordHistoryMulti (op, id_list) {\r\n let action;\r\n if (op == \"move\") action = HNACTION_BKMKMOVE;\r\n else if (op == \"remove\") action = HNACTION_BKMKREMOVE;\r\n else if (op == \"remove_tt\") action = HNACTION_BKMKREMOVETOTRASH;\r\n// else if (op == \"create\") action = HNACTION_BKMKCREATE;\r\n historyListAdd(curHNList, action, true, id_list);\r\n}", "function createHistory() {\n var history = {\n 'subject' : string[1],\n 'date' : new Date().toString()\n };\n saveHistory(history);\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 }", "addItem() {\r\n const d = new Date();\r\n const time = d.getTime();\r\n this.props.navigation.navigate('Reward',{time:time});\r\n db.ref('users').push({\r\n posthought: this.state.posthought,\r\n mood: this.state.mood,\r\n number: this.state.number,\r\n thing: this.state.thing,\r\n place: this.state.place,\r\n negthought: this.state.negthought,\r\n label: this.state.label, \r\n month: (d.getMonth()+1),\r\n day: (d.getDate()),\r\n time: time\r\n });\r\n }", "switchHistory() {\n // display history page\n const action1 = switchHistoryPage(true);\n store.dispatch(action1);\n // get history from backend\n service.getHistoryall().then((data) => {\n const action2 = changeHistory(data.files);\n store.dispatch(action2);\n });\n }", "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 }", "voterTwitterSaveToCurrentAccount () {\n VoterActions.voterTwitterSaveToCurrentAccount();\n let redirectPathname = '/more/network';\n const signInStartPath = cookies.getItem('sign_in_start_path');\n if (signInStartPath) {\n redirectPathname = signInStartPath;\n AppActions.unsetStoreSignInStartPath();\n cookies.removeItem('sign_in_start_path', '/');\n }\n historyPush({\n pathname: redirectPathname,\n state: {\n message: 'You have successfully signed in with Twitter.',\n message_type: 'success',\n },\n });\n if (VoterStore.getVoterPhotoUrlMedium().length === 0) {\n // This only fires once, for brand new users on their very first login\n VoterActions.voterRetrieve();\n }\n }", "constructor() {\n this.history = []\n this.size = 0\n\n this.push = this.push.bind(this)\n this.pop = this.pop.bind(this)\n this.hasItem = this.hasItem.bind(this)\n }", "updateHistory(currentBoard) {\n /* add current board to history and increment history index\n *** if historyIndex is less than historyLength-1, it \n means that a move has been played after the user has \n used the jump backwards button. Therefore, all elements in history after\n where historyIndex currently is should be erased *** \n */\n const historyIndex = this.state.historyIndex;\n const historyLength = this.state.history.length;\n var history = this.state.history;\n if (historyIndex < historyLength - 1) {\n history = this.state.history.splice(0, historyIndex + 1);\n }\n\n return history.concat([{ currentBoard: currentBoard }]);\n }", "function save_history () {\n\tvar ds = currHds();\n\tedit_history [edit_history_index] = JSON.stringify(ds.toJSON());\n}", "function addHistory(name, time) {\n\n vm.histories.push({\n 'name': name,\n 'time': time,\n });\n\n\n }", "function pushChangeHistory( changeType ) {\n if ( historyPosition < changeHistory.length-1 )\n changeHistory = changeHistory.slice(0,historyPosition+1);\n\n var state = {\n type: changeType,\n svg: self.getSvgClone(true),\n panzoom: panzoom ? [ xmin, ymin, width, height, boxX0, boxY0, boxW, boxH ] : false ,\n mode: self.mode.current,\n selected: getElementPath( $(svgRoot).find('.selected') )\n };\n\n if ( changeHistory.length && changeHistory[changeHistory.length-1].type === changeType )\n changeHistory[changeHistory.length-1] = state;\n else\n changeHistory.push(state);\n\n if ( changeHistory.length > self.cfg.historySize )\n changeHistory.shift();\n\n historyPosition = changeHistory.length-1;\n //self.util.changeHistory = changeHistory;\n }", "addCart(record) {\n this.setState((prevState) => ({\n cartRecords: prevState.cartRecords.concat(record)\n }));\n this.setState({ latestCartItem: record.name })\n }", "handleAddItemToCart(item, quantity){\n var buyableItem = new BuyableItem(item, quantity);\n currentCart.push(buyableItem);\n this.setState({cartQuantity : this.calculateCartQuantity(currentCart)})\n localStorage.setItem(\"cart\", JSON.stringify(currentCart));\n this.readFromCart();\n }", "function initializeHistoryExample() {\n pubnubStocks.bind('mousedown,touchstart', loadHistoryBtn, function() {\n pubnubStocks.history({\n limit: 5,\n channel: 'MSFT',\n callback: function(msgs) {\n historyOut.innerHTML = JSON.stringify(msgs[0]);\n },\n });\n\n return false;\n });\n }", "[USERINFO](state, userInfo) {\n //save in state\n state.userInfo = userInfo \n logger('userinfo', 'save store succeed !')\n console.log(userInfo)\n //save in localStorage\n saveUserInfo(userInfo)\n }", "function addHistory(event) {\n\n //Ignores/exits function if search item is empty\n if (searchItem.value.length < 1) return;\n console.log(searchItem.value)\n\n //used to create a variable \n //that hold list of searchItems in localStorage or parses\n //stringified list of items in local storage into a list\n var saved = JSON.parse(localStorage.getItem('searchItems'));\n console.log(saved)\n\n //if saved value is null/false set value to empty list\n //since no searchItems have been added\n if (!saved) {\n saved = []\n };\n\n //if there are 3 searchItems remove the oldest\n //in order to make room for new item/limit list length\n if (saved.length === 3) {\n saved.shift()\n }\n //push new searchItem's value into list\n saved.push(searchItem.value)\n\n // Clear input\n searchItem.value = '';\n\n // saves list to localStorage as a string\n localStorage.setItem('searchItems', JSON.stringify(saved));\n\n //function to create buttons of search items\n displayHistory()\n}", "changeState(state) {\r\n if (this.states[state] == undefined) throw new ErrorEvent(\"illegal state\")\r\n this.history.push(this.state);\r\n this.state = state;\r\n this.second_history = new Array();\r\n }", "function push() {\n history.length = ++index.value;\n history.push(clone(circles.value));\n console.log(toRaw(history));\n }", "function addToHistory(user1, user2, db) {\n db.run(`INSERT INTO histories (userID, spokentoID)\n VALUES ('${user1}', '${user2}');`);\n}", "_storeState() {\n storage.set(this.itemId, JSON.stringify({\n lastVisit: Date.now(),\n commentCount: this.itemDescendantCount,\n maxCommentId: this.maxCommentId\n }))\n }", "push(value) {\n this.history = [value, ...this.history.slice(this.pointer, this.pointer + this.size)];\n this.pointer = 0;\n }", "function recentlyAddedAction(state) {\n api.setRecentlyAddedMenu(state);\n}", "getUserHistory() {\n return Api.get('/client/purchase-history');\n }", "function addHistory(group, category, type) {\n\t\tvar url = \"/dharma/\" + group;\n\t\tif (category) {\n\t\t\turl += \"/\" + category;\n\t\t}\n\t\t// The second parameter to pushState() is an ID, and the third is the URL\n\t\t// we want to display. The ID isn't currently used, but I set it to the\n\t\t// URL anyway, which uniquely identifies our browser state.\n\t\thistory.pushState({group: group, type: type, what: category}, url, url);\n\t}", "function addUserHistoryLink(){\r\n var userhistory = '<a href=\"javascript:;\" class=\"user-history-button\" title=\"view user history\" target=\"_blank\">H</a>'\r\n if( this.firstChild ) return $(this).find('a:last').append(','+userhistory);\r\n $(this).append('['+userhistory+']');\r\n }", "function setHistory(apiResponse) { \n if (apiResponse.status == 200) {\n var history = JSON.parse(localStorage.getItem(\"history\"));\n var addToHistory = true;\n\n\n // conditionals so that there are no duplicate names stored in local storage\n if (history) {\n for (var i = 0; i < history.length; i++) {\n if (history[i].data.account.name === apiResponse.data.account.name) {\n addToHistory = false;\n return;\n }\n }\n if (addToHistory == true) {\n if (history.length > 10) {\n history.pop();\n } \n history.unshift(apiResponse);\n localStorage.setItem(\"history\", JSON.stringify(history));\n }\n }\n else {\n history = [];\n history.unshift(apiResponse);\n localStorage.setItem(\"history\", JSON.stringify(history));\n }\n }\n}", "newVisitedCity(id)\n {\n // console.log(\"Pushing \" + id);\n // console.log(this.state.recentlyViewed);\n this.setState((prevSt)=>{\n if (prevSt.recentlyViewed.push(id) > this.props.maxHistory)\n prevSt.recentlyViewed.shift();\n return {recentlyViewed: prevSt.recentlyViewed};\n });\n }", "function updateHistory(cid = '', site = '', articleType = '') {\n\n}", "appendHistory() {\n if (!this.state.changed) return;\n\n const history = this.state.history.slice(0, this.state.stepNumber + 1);\n const current = this.state.current;\n\n if (current !== history[history.length - 1].squares) {\n this.setState({\n history: history.concat([\n {\n squares: current,\n }\n ]),\n stepNumber: history.length,\n changed: false,\n });\n }\n\n this.setState({\n currentHints: this.getHintNumbers(this.state.current),\n lMouseDown: false,\n rMouseDown: false,\n initialSquare: SquareValue.EMPTY,\n currentAction: SquareValue.EMPTY,\n });\n }", "onClickViewAll() {\n this.props.history.push(\"/app/history/withdraw\");\n }", "componentDidUpdate() {\n console.log(this.state.history, \"new\"); \n }", "save() {\n if (this._history.length > 9){\n this._history.shift();\n }\n this._history.push(this.internalData);\n // Make the commit to setup the index and the state\n this.commit();\n }", "onNewNoteAdd(){\r\n let new_note = {\r\n title: this.state.title,\r\n note: this.state.note\r\n };\r\n\r\n let list = this.state.list;\r\n list.push(new_note);\r\n //todo: remove session items\r\n sessionStorage.clear();\r\n\r\n localStorage.setItem('list', JSON.stringify(this.state.list));\r\n this.setState({title: '', note: '', list: list});\r\n \r\n }", "historyHandler() {\n if (sessionStorage.getItem('tweetch-resource')) {\n var resource = sessionStorage.getItem('tweetch-resource'),\n id = sessionStorage.getItem('tweetch-id'),\n query = sessionStorage.getItem('tweetch-query'),\n page = sessionStorage.getItem('tweetch-page')\n handler(resource, id, query, page)\n } else {\n handler('home')\n }\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 }", "addStateProducts(state, product) {\n\t\tstate.stateProductsList.push(product)\n\t}", "function set_history_state(page, uid, url) {\n\tif (window.history.state != null) {\n\t\tif ((window.history.state.uid == uid) && (window.history.state.page == page)) {\n\t\t\treturn\n\t\t}\n\t}\n\t//url = '' // The url feature has yet to be implemented (requires backend work as well)\n\twindow.history.pushState({page : page, uid : uid, url: url },'','')\n}", "handleQuizzesStudent() {\n let path = `/student/quizzes/${localStorage.getItem('userid')}/${localStorage.getItem('classid')}`;\n this.props.history.push(path);\n }", "function historyFunc(city) {\n var cityList = [];\n \n console.log(cityList);\n //checks if localstorage exists\n \n if (localStorage.getItem(\"cityList\") != null) {\n console.log(\"local storage test\");\n cityList = JSON.parse(localStorage.getItem(\"cityList\"));\n }\n \n cityList.push(city);\n\n let listItem = document.createElement(\"li\");\n listItem.textContent = city;\n historyList.append(listItem);\n\n\n localStorage.setItem(\"cityList\",JSON.stringify(cityList));\n\n //expand to add class to created li items, so that you can click for search history\n\n\n }", "function savePageToHistory(parameterObj) {\n\t// get saved storage first\n\tvar domianPath = getContextPathDomain();\n\tvar savedArray = $.jStorage.get(domianPath + PREVIOUS_PAGE_DATA, []);\n\t// store new value to array\n\tsavedArray.push(parameterObj);\n\t// save to storage\n\t$.jStorage.set(domianPath + PREVIOUS_PAGE_DATA, savedArray);\n}", "_setupHistory() {\n if (!this.history) {\n try{ this.history = createHistory(); }\n catch(e) { \n this.history = this.options.history || createMemoryHistory();\n this._isPhantomHistory = true; \n }\n } \n }", "add(state, product) {\n\t state.productList.push(product)\n\t}", "pushState(filter) {\n this._undoStack.push(this._generateState(filter));\n }", "trigger(event) {\r\n var tr = this.config.states[this.activeState].transitions;\r\n if (tr[event] == undefined) {\r\n throw new Error(\"yryjinug\")\r\n }\r\n this.history1.push(this.activeState);\r\n this.activeState = this.config.states[this.activeState].transitions[event];\r\n this.history2 = [];\r\n\r\n\r\n }", "viewLog(id) {\n this.props.history.push(`/view-log/${id}`)\n }", "function push(location) {\n\t history.push(appendQuery(location, location.query));\n\t }" ]
[ "0.7073374", "0.70728594", "0.7058642", "0.69189364", "0.6844427", "0.6816257", "0.6783681", "0.6746898", "0.6671639", "0.66029346", "0.6587681", "0.65237963", "0.6508683", "0.64927334", "0.6459939", "0.64535743", "0.6448391", "0.6445364", "0.6444287", "0.6443917", "0.64388865", "0.64177", "0.6408154", "0.63777125", "0.63766336", "0.6369144", "0.6358186", "0.6329716", "0.6297705", "0.629474", "0.62926996", "0.6291231", "0.62671167", "0.6264799", "0.6255076", "0.6252051", "0.6236981", "0.6231694", "0.6231443", "0.6217896", "0.6214969", "0.61995083", "0.6169575", "0.61658555", "0.6135712", "0.61193085", "0.6107121", "0.61044395", "0.6095863", "0.60858464", "0.60832995", "0.6063903", "0.6052506", "0.60397625", "0.6028317", "0.6026817", "0.6019523", "0.60150695", "0.60116184", "0.60098124", "0.60037965", "0.6001256", "0.59924024", "0.59903246", "0.59783626", "0.5969546", "0.59673464", "0.5961967", "0.59560597", "0.59508336", "0.5944146", "0.5943965", "0.59367996", "0.59289986", "0.5926282", "0.5919599", "0.59186476", "0.5905189", "0.58987373", "0.589856", "0.58973", "0.5888273", "0.5888264", "0.5879789", "0.58749706", "0.5873568", "0.5872146", "0.5871754", "0.58713067", "0.58548373", "0.5850875", "0.5846141", "0.5841642", "0.5830729", "0.58206934", "0.5810322", "0.58049816", "0.5802696", "0.5801631", "0.58000636" ]
0.606635
51
& then maybe I wanna make sure that I capture the state of the user before we apply the taxes
function applyTaxToItems(user){ amazonHistory.push(user) const {cart} = user; const taxRate = 1.3; const updatedCart = cart.map(item => { return { name: item.name, price: item.price*taxRate } }) return Object.assign({}, user, { cart: updatedCart }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyTaxToItems(user){}", "function applyTaxToItems(user){\n const\n}", "function applyTaxToItems(user){\n return user\n}", "function applyTaxToItems(user){\n return user\n}", "function applyTaxToItems(user){\n return user\n}", "function tax() {\n if (paysTax.checked) {\n return true;\n } else {\n return false;\n }\n}", "function applyTaxToItems(user){\n const {cart} = user;\n}", "function applyTaxToItems(user){\n const {cart}\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {}\n })\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n\n })\n}", "function estimateTotal(){\n\t\t\n\t\t// Make sure the user has selected a state\n\t\tif(stateQualifies()){\t\n\t\t\n\t\t\t// Make sure the user has used a correct email\n\t\t\tif(emailQualifies()){\n\t\t\t\t\n\t\t\t\t// Make sure the user has input a wine amount \n\t\t\t\tif(quantitySelected() > 0){\n\n\t\t\t\t getTaxFromUrlAjax();\n\t\t\t\t storingBottlesaAndState();\n\t\t\t\n\t\t\t\t} // End quantitySelected\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\talert(\"Please select wine amount\");\n\t\t\t\t\t// wineChecker.focus();\n\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t} // End emailQualifies\n\t\t\telse{\n\t\t\t\t\n\t\t\t\talert(\"Please enter a valid email\");\t\n\t\t\t\temailChecker.focus();\n\t\t\t}\n\t\t} // End stateQualifies\n\t\telse{\n\t\t\t\n\t\t\talert(\"Please select a shipping state\");\n\t\t\tshippingChecker.focus();\n\t\t}\n\t} // End estimateTotal", "function taxCalculator(){\n let amount = Number(document.getElementById(\"income\").value);\n taxes = 0;\n\n\n if (amount <= 47630) {\n taxes = amount * 0.15;\n\n\n } else if (amount > 47630) {\n taxes = (amount-47630) * 0.205 + 7145;\n\n\n } else if (amount > 95259) {\n taxes = (amount-95259) * 0.26 + 16908;\n\n\n } else if (amount > 147667) {\n taxes = (amount-147667) * 0.29 + 30.535;\n\n\n } else { (amount > 210371 )\n taxes = (amount -147667) * 0.33 + 48719;\n\n }\n //document.getElementById(\"canTax\").value = taxes;\n\n document.getElementById(\"canTax\").value = taxes // call the form named calculator2\n // assign value to canTax Id to get the taxes in the input.\n }", "function taxCalculator(order, state) {\n const tax = 0.55;\n const subtotal = order + tax;\n if (state === \"WI\") {\n alert(\"The total is $\" + subtotal);\n } else {\n alert(\"The total is $\" + order);\n }\n}", "function taxCalculator() {\n var amount = prompt(\"What is the order amount?\");\n var state = prompt(\"What is the state?\");\n var tax = (5.5/100) * 10\n if(state == \"WI\") {\n amount + tax\n } else {\n amount\n }\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n }\n })\n}", "function calculateTotal(basePrice, state, tax=0.05){\nlet subtotal = base_price * (1 + tax);\nlet fee = 0;\nif(state ==='CA'){\n fee = 0.03 * subtotal;\n}\nelse if(state === 'PA'){\n fee = 2;\n}\nelse if(state === 'MA'){\n if(base_price <= 100){\n fee = 1; \n }\n else{\n fee = 3;\n }\n}\nreturn subtotal + fee;\n}", "function addAccessories() {\n console.log(\"Note: I will add accessories for your phone(s).\");\n var finalCost = totalAmount + (accessoryPrice * amount);\n console.log(\"Final Cost variable \" + finalCost);\n\n \n \n \n function calculateTax() {\n var plusTaxTotal = finalCost + (finalCost * TAX_RATE);\n console.log(\"Plus Tax variable: \" + plusTaxTotal);\n \n function priceFormat() {\n var ptTotalFixed = plusTaxTotal.toFixed(2);\n console.log(\"Plus Tax w/ fixed decimal: \" + ptTotalFixed);\n }\n \n priceFormat();\n }\n \n \n \n \n var totali = calculateTax();\n \n \n // if (priceWithTax <= bankAccountBalance) {\n console.log(\"Your total amount comes to \" + totali);\n /* } else {\n console.log(\"You went over your Bank Balance.\");\n \n // fourth function calls on else condition only\n tryAgain();\n }*/\n}", "function CalculateTaxBasedOnTaxableAmt(taxpercentage, taxableAmt, discountAmt, deliveryFeeAmt, relayFeeAmt, DeliveryTaxflg, RelayTaxflg, DiscountTaxflg, SetupFeeAmt, SetupTaxflg) {\r\n var taxAmt = 0;\r\n\r\n // if (taxableAmt > 0) {\r\n if ($.trim(DeliveryTaxflg).toLowerCase() == 'yes') {\r\n\r\n taxableAmt += deliveryFeeAmt;\r\n }\r\n if ($.trim(RelayTaxflg).toLowerCase() == 'yes') {\r\n taxableAmt += relayFeeAmt;\r\n }\r\n\r\n //SetupFeeAmt, SetupTaxflg\r\n if (SetupTaxflg != undefined) {\r\n if ($.trim(SetupTaxflg).toLowerCase() == 'yes') {\r\n taxableAmt += SetupFeeAmt;\r\n }\r\n }\r\n\r\n\r\n if ($.trim(DiscountTaxflg).toLowerCase() != 'yes') {\r\n taxableAmt -= discountAmt;\r\n }\r\n\r\n if (taxpercentage > 0) {\r\n taxAmt = (taxableAmt * taxpercentage) / 100;\r\n }\r\n // }\r\n\r\n return taxAmt;\r\n}", "function luxuryTax() {\n if (turn == \"player\"){\n if(playerCash < 75){\n checkBankruptcy();\n }else{\n playerCash -= 75\n updateCash();\n playerUpdate(\"Room and board. Pay up.\")\n }\n }else if(turn == \"enemy\"){\n if(enemyCash < 75){\n checkEnemyBankruptcy();\n }else{\n enemyCash -= 75\n updateCash();\n enemyUpdate(\"Room and board. Pay up.\")\n }\n }\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n}", "function PersistTaxAndwrapup(isContinue) {\n\n if ($(\"#taxesandwrapupinfo\").valid()) {\n\n\n if ($('#radChecked').prop('checked')) {\n BankAccountTypeCode = 1;\n }\n else if ($('#radSaved').prop('checked')) {\n BankAccountTypeCode = 2;\n }\n if ($('#radIsDirectDepositYes').prop('checked')) {\n BankDetails = {\n RoutingTransitNumber: $('#txtBankRoutingNumber').val(),\n AccountNumber: $('#txtBankAccountNumber').val(),\n BankName: $('#txtBankName').val(),\n BankAccountTypeCode: BankAccountTypeCode\n }\n }\n else {\n BankDetails = null;\n }\n if ($('#radIsAllowOtherPersonYes').prop('checked')) {\n ThirdPartyDesignee =\n {\n DesigneeName: $('#txtDesignName').val(),\n PhoneNumber: $('#txtPhoneno').val(),\n PIN: $('#txtPersonalIdentificationNumber').val(),\n }\n }\n else {\n ThirdPartyDesignee = null;\n }\n\n var federalExtensionFiledDate = null;\n if ($('#chkFiledForm4868').prop('checked'))\n federalExtensionFiledDate = $('#txtFederalExtensionFiledDate').val();\n\n var federalExtensionAmount = null;\n var filingDate = null;\n if ($('#chkFederalExtensionPaid').prop('checked')) {\n federalExtensionAmount = $('#txtFederalExtensionAmount').val();\n filingDate = $('#txtDateOfFiling').val();\n }\n\n var federalExtensionAmountPaidDate = null;\n if ($('#chklateFiling').prop('checked')) {\n federalExtensionAmountPaidDate = $('#txtDatePaid').val();\n }\n\n\n if (taxWrapUpData != null) {\n taxData = {\n HasOwedHouseholdEmploymentTax: taxWrapUpData.HasOwedHouseholdEmploymentTax,\n HasAlternativeMinimumTax: taxWrapUpData.HasAlternativeMinimumTax,\n HasAdditionalSocialSecurityOrMedicareTax: taxWrapUpData.HasAdditionalSocialSecurityOrMedicareTax,\n HasFederalQuarterlyEstimatesPaid: taxWrapUpData.HasFederalQuarterlyEstimatesPaid,\n HasFiledForm4868: $('#chkFiledForm4868').prop('checked'),\n FederalExtensionFiledDate: federalExtensionFiledDate,\n HasPaidFederalExtensionWithForm4868: $('#chkFederalExtensionPaid').prop('checked'),\n FederalExtensionAmount: federalExtensionAmount,\n FederalExtensionAmountPaidDate: federalExtensionAmountPaidDate,\n IsFilingReturnAfterDueDate: $('#chklateFiling').prop('checked'),\n FilingDate: filingDate,\n HasToDepositTaxRefundsToBankAccount: $('#radIsDirectDepositYes').prop('checked'),\n HasThirdPartyDesignee: $('#radIsAllowOtherPersonYes').prop('checked'),\n InCareOf: $('#txtIncareof').val(),\n InCareOfPhoneNumber: $('#txtPhoneNumber').val(),\n BankDetails: BankDetails,\n ThirdPartyDesignee: ThirdPartyDesignee\n }\n }\n else {\n taxData = {\n HasFiledForm4868: $('#chkFiledForm4868').prop('checked'),\n FederalExtensionFiledDate: federalExtensionFiledDate,\n HasPaidFederalExtensionWithForm4868: $('#chkFederalExtensionPaid').prop('checked'),\n FederalExtensionAmount: federalExtensionAmount,\n FederalExtensionAmountPaidDate: federalExtensionAmountPaidDate,\n IsFilingReturnAfterDueDate: $('#chklateFiling').prop('checked'),\n FilingDate: filingDate,\n HasToDepositTaxRefundsToBankAccount: $('#radIsDirectDepositYes').prop('checked'),\n HasThirdPartyDesignee: $('#radIsAllowOtherPersonYes').prop('checked'),\n InCareOf: $('#txtIncareof').val(),\n InCareOfPhoneNumber: $('#txtPhoneNumber').val(),\n BankDetails: BankDetails,\n ThirdPartyDesignee: ThirdPartyDesignee\n }\n }\n\n $.ajax({\n url: serviceUrl + 'taxesandwrapup/persisttaxesandwrapupdata',\n async: false,\n dataType: \"json\",\n beforeSend: function (request) {\n request.setRequestHeader(\"X-Token\", window.sessionStorage.getItem(\"EncryptedTocken\"));\n },\n data: JSON.stringify({\n userId: userId,\n TaxReturnData:\n {\n userDataId: userDataId,\n TaxData: JSON.stringify(taxData),\n }\n }),\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n error: function (jqXHR, textStatus, errorThrown) {\n ErrorHandling(jqXHR, errorThrown);\n },\n success: function (data, textStatus) {\n window.sessionStorage.setItem(\"UserDataId\", data.m_Item1);\n if (isContinue) {\n PageNavigate(data.m_Item2);\n return false;\n }\n }\n });\n }\n}", "function updateWithNewTax(newTax = 0.15)\n{\n window.data.tax = newTax;\n for (let callback of window.data.taxCallbacks) { callback(); }\n}", "function stateTax() {\n var agi = result.agi || ( ((plan.grossAnnualIncome || 0) + (plan.spouseGrossAnnualIncome || 0)) - ((plan.user401kContribution || 0) + (plan.spouse401kContribution || 0)) );\n return ( agi * local.stateIncomeTax[plan.stateResident] );\n // TODO: Calculate state income tax marginally, rather than just by highest marginal.\n }", "function taxed(price) {\nconsole.log(window.tax_rate);\nreturn price * (1 + window.tax_rate);\n}", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({})\n}", "function taxCalculator() {\n const order = prompt(\"What is the order amount?\");\n const state = prompt(\"What is the state?\");\n const tax = 0.55;\n const subtotal = order + tax;\n if (state === \"WI\") {\n alert(\"The total is $\" + subtotal);\n } else {\n alert(\"The total is $\" + order);\n }\n}", "function taxHike() {\n if (taxRate < 0.60) {\n taxRate += 0.01;\n setTimeout(taxHike, 2*1000);\n }\n}", "function invstmntFinTaxCtrl($scope, $state, fintaxService,convertDigitsIntoWords) {\n\n $scope.finTaxInvestmentFormData = {\n taxSavingFD: 'no',\n taxSavingMF: 'no',\n taxSavingPF: 'no',\n taxSavingNSC: 'no',\n taxSavingLI: 'no',\n taxSavingSSY: 'no',\n taxSavingTutFee: 'no',\n taxSavingNPS: 'no',\n other: 'no'\n };\n $scope.formEditable = true;\n\n $scope.init = function () {\n fintaxService.getInfo().then(function (response) {\n var currentVal = response.investments;\n if (currentVal) {\n if (!IsAdmin())formStatus(response.state);\n if (currentVal.taxSavingFDAmt) {\n $scope.finTaxInvestmentFormData.taxSavingFD = 'yes';\n $scope.finTaxInvestmentFormData.taxSavingFDAmt = currentVal.taxSavingFDAmt;\n }\n if (currentVal.taxSavingMFAmt) {\n $scope.finTaxInvestmentFormData.taxSavingMF = 'yes';\n $scope.finTaxInvestmentFormData.taxSavingMFAmt = currentVal.taxSavingMFAmt;\n }\n if (currentVal.taxSavingPFAmt) {\n $scope.finTaxInvestmentFormData.taxSavingPF = 'yes';\n $scope.finTaxInvestmentFormData.taxSavingPFAmt = currentVal.taxSavingPFAmt;\n }\n if (currentVal.taxSavingNSCAmt) {\n $scope.finTaxInvestmentFormData.taxSavingNSC = 'yes';\n $scope.finTaxInvestmentFormData.taxSavingNSCAmt = currentVal.taxSavingNSCAmt;\n }\n if (currentVal.taxSavingLIAmt) {\n $scope.finTaxInvestmentFormData.taxSavingLI = 'yes';\n $scope.finTaxInvestmentFormData.taxSavingLIAmt = currentVal.taxSavingLIAmt;\n }\n if (currentVal.taxSavingSSYAmt) {\n $scope.finTaxInvestmentFormData.taxSavingSSY = 'yes';\n $scope.finTaxInvestmentFormData.taxSavingSSYAmt = currentVal.taxSavingSSYAmt;\n }\n if (currentVal.taxSavingTutFeeAmt) {\n $scope.finTaxInvestmentFormData.taxSavingTutFee = 'yes';\n $scope.finTaxInvestmentFormData.taxSavingTutFeeAmt = currentVal.taxSavingTutFeeAmt;\n }\n if (currentVal.taxSavingNPSAmt) {\n $scope.finTaxInvestmentFormData.taxSavingNPS = 'yes';\n $scope.finTaxInvestmentFormData.taxSavingNPSAmt = currentVal.taxSavingNPSAmt;\n }\n if (currentVal.otherInvst.length) {\n $scope.finTaxInvestmentFormData.other = 'yes';\n $scope.finTaxInvestmentFormData.name1 = currentVal.otherInvst[0].name;\n $scope.finTaxInvestmentFormData.amt1 = currentVal.otherInvst[0].amt;\n if (typeof(currentVal.otherInvst[1]) != \"undefined\") {\n $scope.finTaxInvestmentFormData.name2 = currentVal.otherInvst[1].name;\n $scope.finTaxInvestmentFormData.amt2 = currentVal.otherInvst[1].amt;\n }\n if (typeof(currentVal.otherInvst[2]) != \"undefined\") {\n $scope.finTaxInvestmentFormData.name3 = currentVal.otherInvst[2].name;\n $scope.finTaxInvestmentFormData.amt3 = currentVal.otherInvst[2].amt;\n }\n }\n }\n }, function(reason){\n console.log(reason);\n });\n };\n\n $scope.submitInvstmntInfo = function () {\n var investmentInfo = {};\n investmentInfo.otherInvst =[];\n if ($scope.finTaxInvestmentFormData.taxSavingFD == 'yes') {\n investmentInfo.taxSavingFDAmt = $scope.finTaxInvestmentFormData.taxSavingFDAmt;\n }\n if ($scope.finTaxInvestmentFormData.taxSavingMF == 'yes') {\n investmentInfo.taxSavingMFAmt = $scope.finTaxInvestmentFormData.taxSavingMFAmt;\n }\n if ($scope.finTaxInvestmentFormData.taxSavingPF == 'yes') {\n investmentInfo.taxSavingPFAmt = $scope.finTaxInvestmentFormData.taxSavingPFAmt;\n }\n if ($scope.finTaxInvestmentFormData.taxSavingNSC == 'yes') {\n investmentInfo.taxSavingNSCAmt = $scope.finTaxInvestmentFormData.taxSavingNSCAmt;\n }\n if ($scope.finTaxInvestmentFormData.taxSavingLI == 'yes') {\n investmentInfo.taxSavingLIAmt = $scope.finTaxInvestmentFormData.taxSavingLIAmt;\n }\n if ($scope.finTaxInvestmentFormData.taxSavingSSY == 'yes') {\n investmentInfo.taxSavingSSYAmt = $scope.finTaxInvestmentFormData.taxSavingSSYAmt;\n }\n if ($scope.finTaxInvestmentFormData.taxSavingTutFee == 'yes') {\n investmentInfo.taxSavingTutFeeAmt = $scope.finTaxInvestmentFormData.taxSavingTutFeeAmt;\n }\n if ($scope.finTaxInvestmentFormData.taxSavingNPS == 'yes') {\n investmentInfo.taxSavingNPSAmt = $scope.finTaxInvestmentFormData.taxSavingNPSAmt;\n }\n if ($scope.finTaxInvestmentFormData.other == 'yes') {\n if($scope.finTaxInvestmentFormData.name1 && $scope.finTaxInvestmentFormData.amt1) investmentInfo.otherInvst.push({name:$scope.finTaxInvestmentFormData.name1,amt:$scope.finTaxInvestmentFormData.amt1});\n if($scope.finTaxInvestmentFormData.name2 && $scope.finTaxInvestmentFormData.amt2) investmentInfo.otherInvst.push({name:$scope.finTaxInvestmentFormData.name2,amt:$scope.finTaxInvestmentFormData.amt2});\n if($scope.finTaxInvestmentFormData.name3 && $scope.finTaxInvestmentFormData.amt3) investmentInfo.otherInvst.push({name:$scope.finTaxInvestmentFormData.name3,amt:$scope.finTaxInvestmentFormData.amt3})\n }\n\n fintaxService.setInfo('investments', investmentInfo);\n $state.go(\"forms.fintax.healthInsurance\");\n };\n $scope.$watch('finTaxInvestmentFormData.taxSavingFDAmt', function (val) {\n if (val && val > 0) {\n $scope.taxSavingFDAmtInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.taxSavingFDAmtInWords = \"\";\n }\n });\n $scope.$watch('finTaxInvestmentFormData.taxSavingMFAmt', function (val) {\n if (val && val > 0) {\n $scope.mutualFundAmntInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.mutualFundAmntInWords = \"\";\n }\n });\n $scope.$watch('finTaxInvestmentFormData.taxSavingPFAmt', function (val) {\n if (val && val > 0) {\n $scope.ppfAmountInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.ppfAmountInWords = \"\";\n }\n });\n $scope.$watch('finTaxInvestmentFormData.taxSavingNSCAmt', function (val) {\n if (val && val > 0) {\n $scope.nationalSavingInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.nationalSavingInWords = \"\";\n }\n });\n $scope.$watch('finTaxInvestmentFormData.taxSavingLIAmt', function (val) {\n if (val && val > 0) {\n $scope.licAmountInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.licAmountInWords = \"\";\n }\n });\n $scope.$watch('finTaxInvestmentFormData.taxSavingSSYAmt', function (val) {\n if (val && val > 0) {\n $scope.sukanyaYojnaAmntInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.sukanyaYojnaAmntInWords = \"\";\n }\n });\n $scope.$watch('finTaxInvestmentFormData.taxSavingTutFeeAmt', function (val) {\n if (val && val > 0) {\n $scope.childFeesAmntInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.childFeesAmntInWords = \"\";\n }\n });\n $scope.$watch('finTaxInvestmentFormData.taxSavingNPSAmt', function (val) {\n if (val && val > 0) {\n $scope.pensionSchemeAmntInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.pensionSchemeAmntInWords = \"\";\n }\n });\n $scope.$watch('finTaxInvestmentFormData.amt1', function (val) {\n if (val && val > 0) {\n $scope.amountInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.amountInWords = \"\";\n }\n });\n $scope.$watch('finTaxInvestmentFormData.amt2', function (val) {\n if (val && val > 0) {\n $scope.amountdesInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.amountdesInWords = \"\";\n }\n });\n $scope.$watch('finTaxInvestmentFormData.amt3', function (val) {\n if (val && val > 0) {\n $scope.amountOtherInWords = convertDigitsIntoWords.inWords(val);\n } else {\n $scope.amountOtherInWords = \"\";\n }\n });\n\n function formStatus(state) {\n if(state == 'infoProvided'){\n $scope.formEditable = false;\n }\n if (!$scope.formEditable) {\n $(\"#finTaxInvestment :input\").attr(\"disabled\", true);\n $(\"#finTaxInvestment :submit\").attr(\"disabled\", true);\n }\n }\n\n}", "function calculateSubTot(priceTot,state){\n var tax;\n switch(state){\n case \"UT\":\n tax = 0.0665;\n break;\n case \"NV\":\n tax = 0.08;\n break;\n case \"TX\":\n tax = 0.0625;\n break;\n case \"AL\":\n tax = 0.04;\n break;\n case \"CA\":\n tax = 0.0825;\n break;\n default:\n \n break;\n }\n return priceTot+(priceTot*tax);\n}", "function calculateTotal(base_price, state, tax){\n tax=0.05;\n let subtotal = base_price * (1 + tax);\n let fee = 0;\n if (state == 'CA')\n fee = 0.03 * subtotal;\n else if (state == 'PA')\n fee = 2;\n else if (state == 'MA')\n if (base_price <= 100)\n fee = 1;\n else\n fee = 3;\n\n return subtotal + fee;\n}", "function applyTaxToItem(user) {\n const {cart} = user\n const taxRate = 0.1\n const updatedCart = cart.map(item => ({\n ...item,\n price: item.price * (1+taxRate)\n }))\n return Object.assign({}, user, {cart: updatedCart});\n}", "function CalculateRelayFeeTax(Taxpercentage, relayFeeAmt, RelayTaxflg) {\r\n var TaxableAmt = 0;\r\n var TaxAmt = 0;\r\n if (parseFloat(Taxpercentage) > 0) {\r\n if ($.trim(RelayTaxflg).toLowerCase() == 'yes') {\r\n TaxableAmt += relayFeeAmt;\r\n }\r\n if (Taxpercentage > 0) {\r\n TaxAmt = (TaxableAmt * Taxpercentage) / 100;\r\n }\r\n TaxAmt = (Math.round(TaxAmt * 100) / 100);\r\n if (TaxAmt < 0) {\r\n TaxAmt = 0;\r\n }\r\n }\r\n return TaxAmt;\r\n\r\n}", "function calculateTax (amount){\n return amount * TAX;\n}", "function PersistOtherIncome() {\n var taxData = {\n HasSsbAndRrb: hasSsbAndRrb,\n HasAlaskaPermanantFund: hasAlaskaPermanantFund,\n HasStateTaxRefund: hasStateTaxRefund,\n SSB:\n {\n TaxpayerNetBenefits: $('#txtTaxPayerNetBenefitSSB').val().trim().length == 0 ? 0 : $('#txtTaxPayerNetBenefitSSB').val(),\n TaxPayerFederalTaxWithheld: $('#txtTaxPayerFederalTaxSSB').val().trim().length == 0 ? 0 : $('#txtTaxPayerFederalTaxSSB').val(),\n SpouseNetBenefits: $('#txtSpouseNetBenefitSSB').val().trim().length == 0 ? 0 : $('#txtSpouseNetBenefitSSB').val(),\n SpouseFederalTaxWithheld: $('#txtSpouseFederalTaxSSB').val().trim().length == 0 ? 0 : $('#txtSpouseFederalTaxSSB').val()\n },\n RRB:\n {\n TaxpayerNetBenefits: $('#txtTaxPayerNetBenefitsRRB').val().trim().length == 0 ? 0 : $('#txtTaxPayerNetBenefitsRRB').val(),\n TaxPayerFederalTaxWithheld: $('#txtTaxPayerFederalRRB').val().trim().length == 0 ? 0 : $('#txtTaxPayerFederalRRB').val(),\n SpouseNetBenefits: $('#txtSpouseNetBenefitsRRB').val().trim().length == 0 ? 0 : $('#txtSpouseNetBenefitsRRB').val(),\n SpouseFederalTaxWithheld: $('#txtSpouseFederalRRB').val().trim().length == 0 ? 0 : $('#txtSpouseFederalRRB').val()\n },\n\n AlaskaPermanentFundDividend:\n {\n PrimaryTaxpayerAlaskaFundDividend: $('#txtAlaskaTaxPayer').val(),\n SpouseAlaskaFundDividend: $('#txtAlaskaSpouse').val()\n },\n StateOrLocalIncomeTaxRefunds:\n {\n HasClaimedItemizedDeductionPriorYear: ($('#radclaimItemizedYes').prop('checked') == false && $('#radclaimItemizedNo').prop('checked') == false) ? null : $('#radclaimItemizedYes').prop('checked'),\n HasStateAndLocalTaxDeductionPriorYear: ($('#radDeductStateYes').prop('checked') == false && $('#radDeductStateNo').prop('checked') == false) ? null : $('#radDeductStateYes').prop('checked')\n }\n };\n\n $.ajax({\n url: serviceUrl + 'otherincome/persistotherincome',\n async: false,\n dataType: \"json\",\n beforeSend: function (request) {\n request.setRequestHeader(\"X-Token\", window.sessionStorage.getItem(\"EncryptedTocken\"));\n },\n data: JSON.stringify({\n userId: userId,\n fromIncomeGateway: false,\n TaxReturnData:\n {\n UserDataId: userDataId,\n TaxData: JSON.stringify(taxData),\n }\n }),\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n error: function (jqXHR, textStatus, errorThrown) {\n ErrorHandling(jqXHR, errorThrown);\n },\n success: function (data, textStatus) {\n if (data != null) {\n\n isOtherIncomePersist = true;\n if (data.m_Item1 != null) {\n window.sessionStorage.setItem(\"UserDataId\", data.m_Item1);\n }\n\n //Hard Stopper\n isEligibilityCheckFailed = data.m_Item2;\n\n }\n }\n });\n return isOtherIncomePersist;\n}", "function findtax(){\n const amnt = income.value;\n if(amnt<=48535){\n const a =(amnt *.15).toFixed(2);\n ttax.textContent = '$' + a;\n rate.textContent=(a/amnt*100).toFixed(2);\n const b=(amnt-a).toFixed(2); \n earn.textContent = '$' + b; \n }\n\n else if (amnt > 48535 && amnt <=97069 ) {\n const c= ((amnt -48535 ) *.205 + 7280).toFixed(2);\n ttax.textContent = '$' + c;\n rate.textContent=(c/amnt*100).toFixed(2);\n const d=(amnt-c).toFixed(2); \n earn.textContent = '$' + d;\n\n }\n\n else if (amnt > 97069 && amnt <=150473 ) {\n const e= ((amnt - 97069) *.26 + 17230).toFixed(2);\n ttax.textContent = '$' + e;\n rate.textContent=(e/amnt*100).toFixed(2);\n const f=(amnt-e).toFixed(2); \n earn.textContent = '$' + f;\n \n }\n\n else if (amnt > 150473 && amnt <=214368 ) {\n const g= ((amnt - 150473) *.29 +31115).toFixed(2) ;\n ttax.textContent = '$' + g;\n rate.textContent=(g/amnt*100).toFixed(2);\n const h=(amnt-g).toFixed(2);\n earn.textContent = '$' + h;\n\n\n }\n \n else if (isNaN(amnt)) {\n error.textContent =\"Error: Enter a Number\";\n }\n\n else {\n \n const i= ((amnt - 214368) *.33 +49645).toFixed(2) ;\n ttax.textContent = '$' + i;\n rate.textContent=(i/amnt*100).toFixed(2);\n const j=(amnt-i).toFixed(2); \n earn.textContent = '$' + j;\n\n }\n \n \n\n \n }", "function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({}, user, { cart: updatedCart })\n}", "function calculatePaymentOrOp(price, salesTax, discount) {\n\n // let salesTax = salesTax || 0.05; //if you try to re-declare a variable inside of a function you get this - Identifier 'salesTax' has already been declared \n // salesTax = salesTax || 0.05;\n // discount = discount || 0;\n\n // same as // If you’re not familiar with ||, you can think of it like you would an if statement checking for falsy values.\n\n if (!salesTax) {\n salesTax = 0.5;\n }\n if (!discount) {\n discount = 0;\n }\n\n\n console.log(price)\n console.log('sales tax is...', salesTax)\n console.log('discount is...', discount)\n\n // math calculation of the the total price // try to figure out one day as a challenge \n\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 CalculateSalary(){\n \n var taxtwenty = 0;\n var taxfourty = 0;\n \n\n //collecting the amount \n var userinput1 = parseInt(document.getElementById(\"input1\").value) \n document.getElementById(\"GrossSalary\").innerHTML = \"your gross salary is \" + \"£\" + userinput1 ;\n\n if(userinput1 <= 10600){\n // run the code if amount is less than 10600\n document.getElementById(\"TaxFreeAllowance\").innerHTML = \"your tax free allownce is \" + \"£\" + userinput1;\n\n }\n else if(userinput1 > 10600 && userinput1 <= 31000){\n // run the code if amount is in between 10000 and 31000\n taxtwenty = (userinput1-10000) * .20;\n document.getElementById(\"Taxat20%\").innerHTML = \"Your tax at 20% is \" + \"£\" + userinput1;\n \n }\n else{\n // run the code if amount is greater than 31000 \n taxfourty = (userinput1 - taxtwenty) * .40;\n \n document.getElementById(\"Taxat40%\").innerHTML = \"Your tax at 40% is \" + \"£\" + userinput1;\n }\n totalNet = (taxfourty + taxtwenty) - userinput1;\n document.getElementById(\"NetSalary\").innerHTML = \"The total Net salary is \" + \"£\" + userinput1 ;\n}", "function prepareActivityTaxPage() {\r\n // make sure the calculation is correct.\r\n step = 5;\r\n calculateCompletion();\r\n previousAction = actions.activityGSTStep;\r\n nextAction = actions.finishedStep;\r\n\r\n $(\":checkbox\").click(function () {\r\n if (this.id !== 'ckNone') {\r\n if ($(\"#ckNone\").prop(\"checked\") && $(this).prop(\"checked\")) {\r\n $(\"#ckNone\").trigger(\"click\");\r\n }\r\n } else {\r\n {\r\n if ($(\"#ckNone\").prop(\"checked\")) {\r\n applicationType.noneOfAbove2 = true;\r\n $(\":checkbox\").each(function (i, element) {\r\n if (element.id !== \"ckNone\" && $(element).prop('checked')) {\r\n $(element).trigger('click');\r\n }\r\n });\r\n }\r\n }\r\n }\r\n });\r\n // none of the above\r\n $(\"#ckNone\").click(function () {\r\n applicationType.noneOfAbove2 = $(\"#ckNone\").prop('checked');\r\n if ($(\"#ckNone\").prop('checked')) {\r\n \t$('#div-gst-tip').hide();\r\n }\r\n \r\n });\r\n\r\n if (applicationType.noneOfAbove2 !== undefined) {\r\n setCheckBox(\"#ckNone\", applicationType.noneOfAbove2);\r\n }\r\n\r\n // wine\r\n $(\"#ckDealInWine\").click(function () {\r\n registrations.isWET = $(\"#ckDealInWine\").prop('checked');\r\n checkTaxes();\r\n });\r\n\r\n if (registrations.isWET != undefined) {\r\n setCheckBox(\"#ckDealInWine\", registrations.isWET);\r\n }\r\n\r\n // fuel\r\n $(\"#ckUseFuel\").click(function () {\r\n registrations.isFTC = $(\"#ckUseFuel\").prop('checked');\r\n checkTaxes();\r\n });\r\n\r\n if (registrations.isFTC != undefined) {\r\n setCheckBox(\"#ckUseFuel\", registrations.isFTC);\r\n }\r\n\r\n // luxury cars\r\n $(\"#ckLuxury\").click(function () {\r\n registrations.isLCT = $(\"#ckLuxury\").prop('checked');\r\n checkTaxes();\r\n });\r\n\r\n if (registrations.isLCT != undefined) {\r\n setCheckBox(\"#ckLuxury\", registrations.isLCT);\r\n }\r\n \r\n\t// set initial tip/help status:\r\n window.setTimeout(checkTaxes, 10);\r\n}", "function SalesTax(Cost) {\n \t\n \tthis.Cost1=Cost;\n \t\n \tif (RetailCustomer==true) \n \t\t\n {\n \t\n if(TownCode===\"KLA\"){\n\n var Salestax=10/100*Cost1\n \n }\n else if(TownCode===\"EBB\" ||TownCode===\"MBR\"){\n \t \tvar Salestax=5/100*Cost1\n \t\n }\n else{\n \tvar Salestax=0\n }\n }\n else{\n \tvar Salestax=0\n }\n\n this.sales_Tax=Salestax;\n document.formToyota.sales.value=sales_Tax.toFixed(2);\n \n //return sales_Tax;\n }", "function calculateTax(amount) {\n return amount * 0.10;\n}", "function sabrixAfterSubmit(eventtype) {\n\ttry {\n\t\tvar callsabrix = 0;\n\t\tif(eventtype == 'create' || eventtype == 'edit') {\n\t\t\t\n\t\t\tvar rec = nlapiLoadRecord(nlapiGetRecordType(),nlapiGetRecordId());\n\t\t\t//Do No calculate Tax\n\t\t\tvar donotcalculatetax = rec.getFieldValue('custbody_spk_donotcalculatetax');\n\t\t\tif(donotcalculatetax == 'T') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallsabrix = 1;\n\t\t\tvar string1;\n\t\t\tstring1 = '{ ';\n\t\t\t\n\t\t\tvar shiptoCustId = rec.getFieldValue('custbody_end_user');\n\t\t\tvar CustomerId = rec.getFieldValue('entity');\n\t\t\tvar ShipToCustomerId = rec.getFieldValue('custbody_spk_shiptocustomerid');\n\t\t\tvar ShipToCustomerName = rec.getFieldValue('custbody_spk_shiptocustomername');\n\t\t\tif(ShipToCustomerName) {\n\t\t\t\tShipToCustomerName = escapeChar(rec.getFieldValue('custbody_spk_shiptocustomername'));\n\t\t\t}\n\t\t\tvar CustomerCode = rec.getFieldValue('custbody_spk_billtocustomerid');\n\t\t\tvar CustomerName = rec.getFieldValue('custbody_spk_billtocustomername');\n\t\t\tif(CustomerName) {\n\t\t\t\tCustomerName = escapeChar(rec.getFieldValue('custbody_spk_billtocustomername'));\n\t\t\t}\n\t\t\t\n\t\t\tvar createdfrom = rec.getFieldValue('createdfrom');\n\t\t\tnlapiLogExecution('DEBUG','createdfrom',createdfrom);\n\t\t\n\t\t\tvar ExemptionNo = rec.getFieldValue('tranid');\n\n\t\t\tvar FxRate = rec.getFieldValue('exchangerate');\n\t\t\t//For Non-US country, we need to consider Customer Registration Number for VAT calculation\n\t\t\tvar CustomerRegistrationNumber = \"\";\n\t\t\t\n\t\t\t//Ship From : Subsidiary Address\n\t\t\tvar AddressCode1 = \"01\";\n\t\t\tvar subsidiary = rec.getFieldValue('subsidiary');\n\t\t\tvar sub = rec.getFieldValue('custbody_spk_entity_address'); // TAX ENTITY ADDRESS\n\t\t\tvar subrec = sub.split('|');\n\t\t\tvar subcity = subrec[0];\n\t\t\tvar subregion = subrec[1];\n\t\t\tvar subcountry = subrec[2];\n\t\t\tvar subprovince = '';\n\t\t\tvar subcode = subrec[3];\n\t\t\tvar subcurrency = \"USD\" ; //subrec.getFieldValue('currency');\n\t\t\tnlapiLogExecution('DEBUG','subcity :'+subcity,' subregion :'+subregion+ ' subcountry :'+subcountry+ ' subprovince :'+subprovince+ ' subcode '+subcode );\n\t\t\t\n\t\t\t//Ship TO : Customer/Invoice Shipping Address\n\t\t\tvar AddressCode2 = \"02\";\n\t\t\tvar shipaddress = rec.getFieldValue('shipaddress');\n\t\t\tvar shiptocity = '';\n\t\t\tvar shiptoregion = '';\n\t\t\tvar shiptocountry = '';\n\t\t\tvar shiptocode = '';\n\t\t\tvar shiptoprovince = '';\n\t\t\tshiptocity = rec.getFieldValue('shipcity');\n\t\t\tshiptoregion = rec.getFieldValue('shipstate');\n\t\t\tshiptocountry = rec.getFieldValue('shipcountry');\n\t\t\tshiptocode = rec.getFieldValue('shipzip');\n\t\t\tnlapiLogExecution('DEBUG','shiptocity1 :'+shiptocity,' shiptoregion :'+shiptoregion+ ' shiptocountry :'+shiptocountry+ ' shiptocode :'+shiptocode+ ' shiptoprovince '+shiptoprovince );\n\t\t\t\n\t\t\tvar CompanyCode = rec.getFieldValue('custbody_spk_subsidiary_code');\n\t\t\tif(CompanyCode) {\n\t\t\t\tCompanyCode = CompanyCode;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCompanyCode = rec.getFieldValue('subsidiary');\n\t\t\t}\n\t\t\tif(CompanyCode) { CompanyCode = '\"'+CompanyCode+'\"';}\n\t\t\telse { CompanyCode = '\"\"'; }\n\t\t\tstring1+= '\"CompanyCode\": ' +CompanyCode;\n\t\t\t\n\t\t\tvar CompanyRole = \"S\";\n\t\t\tif(CompanyRole) { CompanyRole = '\"'+CompanyRole+'\"';}\n\t\t\telse { CompanyRole = '\"\"'; }\n\t\t\tstring1+= ', \"CompanyRole\": ' +CompanyRole;\n\n\t\t\tif (ShipToCustomerId) { ShipToCustomerId = '\"'+ShipToCustomerId+'\"'; }\n\t\t\telse { ShipToCustomerId = '\"\"'; }\n\t\t\tstring1+= ', \"ShipToCustomerId\": ' +ShipToCustomerId;\n\n\t\t\tif (ShipToCustomerName) { ShipToCustomerName = '\"'+ShipToCustomerName+'\"'; }\n\t\t\telse { ShipToCustomerName = '\"\"'; }\n\t\t\tstring1+= ', \"ShipToCustomerName\": ' +ShipToCustomerName;\n\t\t\t\n\t\t\tvar DocType = nlapiGetRecordType();\n\t\t\tif (DocType) { DocType = '\"'+DocType+'\"'; }\n\t\t\telse { DocType = '\"\"'; }\n\t\t\tstring1+= ', \"DocType\": ' +DocType;\n\t\t\t\n\t\t\tif (CustomerCode) { CustomerCode = '\"'+CustomerCode+'\"'; }\n\t\t\telse { CustomerCode = '\"\"'; }\n\t\t\tstring1+= ', \"CustomerCode\": ' +CustomerCode;\n\n\t\t\tif (CustomerName) { CustomerName = '\"'+CustomerName+'\"'; }\n\t\t\telse { CustomerName = '\"\"'; }\n\t\t\tstring1+= ', \"CustomerName\": ' +CustomerName;\n\t\t\t\n\t\t\tvar DocDateold = rec.getFieldValue('trandate');\n\t\t\tvar DocDate = '';\n\t\t\tif(DocDateold){\n\t\t\t\tvar docdatesplit = DocDateold.split(\"/\");\n\t\t\t\tDocDate = docdatesplit[2]+\"-\"+docdatesplit[0]+\"-\"+docdatesplit[1];\n\t\t\t}\n\t\t\tif (DocDate) { DocDate = '\"'+DocDate+'\"'; }\n\t\t\telse { DocDate = '\"\"'; }\n\t\t\tstring1+= ', \"DocDate\": ' +DocDate;\n\t\t\t\n\t\t\t//Fiscal Date is same as DocDate\n\t\t\tstring1+= ', \"FiscalDate\": '+DocDate;\n\t\t\t\n\t\t\tvar Client = \"NetSuite\";\n\t\t\tif (Client) { Client = '\"'+Client+'\"'; }\n\t\t\telse { Client = '\"\"'; }\n\t\t\tstring1+= ', \"Client\": ' +Client;\n\t\t\t\n\t\t\t// Invoice Number\n\t\t\tvar DocCode = rec.getFieldValue('tranid'); \n\t\t\tif (DocCode) { DocCode = '\"'+DocCode+'_'+nlapiGetRecordType()+'\"'; }\n\t\t\telse { DocCode = '\"\"'; }\n\t\t\tstring1+= ', \"DocCode\": ' +DocCode;\n\t\t\t\n\t\t\tvar Discount = rec.getFieldValue('discounttotal');\n\t\t\tif (Discount) { Discount = '\"'+Discount+'\"'; }\n\t\t\telse { Discount = '\"0\"'; }\n\t\t\tstring1+= ', \"Discount\": ' +Discount;\n\t\t\t\n\t\t\tvar CurrencyCode = subcurrency;\n\t\t\tif (CurrencyCode) { CurrencyCode = '\"'+CurrencyCode+'\"'; }\n\t\t\telse { CurrencyCode = '\"\"'; }\n\t\t\tstring1+= ', \"CurrencyCode\": ' +CurrencyCode;\n\t\t\t\n\t\t\t//After Submit set Is committed to Yes, so that the Unique TranId is created and submitted in Sabrix\n\t\t\tvar IsAudited = \"commit\";\n\t\t\tstring1+= ', \"IsCommit\": ' +'\"Y\"';\n\t\t\t\n\t\t\tvar OriginalInvoiceNumber = '';\n\t\t\tvar OriginalInvoiceDate = '';\n\t\t\tnlapiLogExecution('DEBUG', 'createdfrom1 '+createdfrom, 'DocType ' +DocType);\n\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\n\t\t\t\tvar refundRec = '';\n\t\t\t\tif(createdfrom && nlapiGetRecordType() == 'creditmemo') {\n\t\t\t\t\trefundRec = nlapiLoadRecord('invoice', createdfrom);\n\t\t\t\t}\n\t\t\t\tif(createdfrom && nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\t\trefundRec = nlapiLoadRecord('cashsale', createdfrom);\n\t\t\t\t}\n\t\t\t\tnlapiLogExecution('DEBUG', 'createdfrom '+createdfrom, 'refundRec ' +refundRec);\n\t\t\t\tif(refundRec) {\n\t\t\t\t\tOriginalInvoiceNumber = refundRec.getFieldValue('tranid');\n\t\t\t\t\tvar orgtranDate = refundRec.getFieldValue('trandate');\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'createdfrom '+createdfrom, 'OriginalInvoiceNumber ' +OriginalInvoiceNumber+ ' orgtranDate '+orgtranDate);\n\t\t\t\t\tif(orgtranDate) {\n\t\t\t\t\t\tvar orgtranDateSplit = orgtranDate.split(\"/\");\n\t\t\t\t\t\tvar OrgInvDate = orgtranDateSplit[2]+\"-\"+orgtranDateSplit[0]+\"-\"+orgtranDateSplit[1];\n\t\t\t\t\t\tOriginalInvoiceDate = OrgInvDate;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (OriginalInvoiceNumber) { OriginalInvoiceNumber = '\"'+OriginalInvoiceNumber+'\"'; }\n\t\t\telse { OriginalInvoiceNumber = '\"\"'; }\n\t\t\tstring1+= ', \"OriginalInvoiceNumber\": ' +OriginalInvoiceNumber;\n\t\t\t\n\t\t\tif (OriginalInvoiceDate) { OriginalInvoiceDate = '\"'+OriginalInvoiceDate+'\"'; }\n\t\t\telse { OriginalInvoiceDate = '\"\"'; }\n\t\t\tstring1+= ', \"OriginalInvoiceDate\": ' +OriginalInvoiceDate;\n\t\t\t\n\t\t\tvar InvoiceCurrency = rec.getFieldText('currency');\n\t\t\tif (InvoiceCurrency) { InvoiceCurrency = '\"'+InvoiceCurrency+'\"'; }\n\t\t\telse { InvoiceCurrency = '\"\"'; }\n\t\t\tstring1+= ', \"InvoiceCurrency\": ' +InvoiceCurrency;\n\t\t\t\n\t\t\tif (FxRate) { FxRate = '\"'+FxRate+'\"'; }\n\t\t\telse { FxRate = '\"\"';}\n\t\t\tstring1+= ', \"FxRate\": ' +FxRate;\n\t\t\t\n\t\t\tvar InvoiceAmount = rec.getFieldValue('subtotal');\n\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\tInvoiceAmount = parseFloat(InvoiceAmount * -1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tInvoiceAmount = InvoiceAmount;\n\t\t\t}\n\t\t\tif (InvoiceAmount) { InvoiceAmount = '\"'+InvoiceAmount+'\"'; }\n\t\t\telse { InvoiceAmount = '\"0\"'; }\n\t\t\tstring1+= ', \"InvoiceAmount\": ' +InvoiceAmount;\n\t\t\t\n\t\t\tif (CustomerRegistrationNumber){ CustomerRegistrationNumber = '\"'+CustomerRegistrationNumber+'\"'; }\n\t\t\telse { CustomerRegistrationNumber = '\"\"'; }\n\t\t\tstring1+= ', \"CustomerRegistrationNumber\": ' +CustomerRegistrationNumber;\n\t\t\t\n\t\t\tstring1+= ', \"Addresses\": [{ '\n\t\t\t\n\t\t\t//Ship From : Subsidiary Address\n\t\t\tif (AddressCode1){ AddressCode1 = '\"'+AddressCode1+'\"'; }\n\t\t\telse{ AddressCode1 = '\"\"'; }\n\t\t\tstring1+= '\"AddressCode\": ' +AddressCode1;\n\t\t\t\t\n\t\t\tif (subcity){ subcity = '\"'+subcity+'\"'; }\n\t\t\telse{ subcity = '\"\"'; }\n\t\t\tstring1+= ', \"City\": ' +subcity;\n\t\t\t\n\t\t\tif (subregion){ subregion = '\"'+subregion+'\"'; }\n\t\t\telse{ subregion = '\"\"'; }\n\t\t\tstring1+= ', \"Region\": ' +subregion;\n\t\t\t\n\t\t\tif (subcountry){ subcountry = '\"'+subcountry+'\"'; }\n\t\t\telse { subcountry = '\"\"'; }\n\t\t\tstring1+= ', \"Country\": ' +subcountry;\n\t\t\t\n\t\t\tif (subcode){ subcode = '\"'+subcode+'\"'; }\n\t\t\telse { subcode = '\"\"'; }\n\t\t\tstring1+= ', \"PostalCode\": ' +subcode;\n\t\t\t\n\t\t\tstring1+= ', \"Province\": \"\" ' ;\n\t\t\tstring1+= ' }, { '\n\t\t\t\n\t\t\t//Ship To : Invoice shipping Address\n\t\t\tif (AddressCode2){ AddressCode2 = '\"'+AddressCode2+'\"'; }\n\t\t\telse{ AddressCode2 = '\"\"'; }\n\t\t\tstring1+= '\"AddressCode\": ' +AddressCode2;\n\t\t\t\n\t\t\tif (shiptocity){ shiptocity = '\"'+shiptocity+'\"'; }\n\t\t\telse{ shiptocity = '\"\"'; }\n\t\t\tstring1+= ', \"City\": ' +shiptocity;\n\t\t\t\n\t\t\tif (shiptoregion){ shiptoregion = '\"'+shiptoregion+'\"'; }\n\t\t\telse{ shiptoregion = '\"\"'; }\n\t\t\tstring1+= ', \"Region\": ' +shiptoregion;\n\t\t\t\n\t\t\tif (shiptocountry){ shiptocountry = '\"'+shiptocountry+'\"'; }\n\t\t\telse{ shiptocountry = '\"\"'; }\n\t\t\tstring1+= ', \"Country\": ' +shiptocountry;\n\t\t\t\n\t\t\tif (shiptocode){ shiptocode = '\"'+shiptocode+'\"'; }\n\t\t\telse { shiptocode = '\"\"'; }\n\t\t\tstring1+= ', \"PostalCode\": ' +shiptocode;\n\t\t\t\n\t\t\tstring1+= ', \"Province\": \"\" ' ;\n\n\t\t\tstring1+= ' }], \"Lines\": [';\n\t\t\t//Tax calls should be made for rebillable expense invoices , checking item count- if zero then do not call sabrix request : Begin\n\t\t\tvar count = rec.getLineItemCount('item');\n\t\t\tif(count == 0 ) {\n\t\t\t\tcallsabrix = 0;\n\t\t\t} // End\n\t\t\telse {\n\t\t\t\tvar isin = 0;\n\t\t\t\tfor(i = 1;i < count+1; i++) {\n\t\t\t\t\tvar TaxCode = rec.getLineItemText('item','taxcode',i);\n\t\t\t\t\t// ENHC0051967- Dynamic validation of script parameters for tax codes editable - Begin\n\t\t\t\t\tvar isparamtaxcode = 0;\n\t\t\t\t\tif(sabrixTaxcode) {\n\t\t\t\t\t\tvar paramTaxcode = sabrixTaxcode.split(\",\");\n\t\t\t\t\t\tfor(var y = 0; y<=paramTaxcode.length; y++) {\n\t\t\t\t\t\t\tif(TaxCode == paramTaxcode[y]) {\n\t\t\t\t\t\t\t\tisparamtaxcode = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// ENHC0051967- End\n\t\t\t\t\t//nlapiLogExecution('DEBUG','TaxCode '+TaxCode, ' sabrixTaxcode '+sabrixTaxcode+ ' paramAvatax '+paramAvatax+ 'paramSabtax '+paramSabtax );\n\t\t\t\t\tnlapiLogExecution('DEBUG','TaxCode '+TaxCode, ' sabrixTaxcode '+sabrixTaxcode+ ' isparamtaxcode '+isparamtaxcode);\n\t\t\t\t\tvar ItemCodevalue = rec.getLineItemText('item','item',i);\n\t\t\t\t\tvar itemintId = rec.getLineItemValue('item','item',i);\n\t\t\t\t\tvar ItemCode = '';\n\t\t\t\t\tif(ItemCodevalue) {\n\t\t\t\t\t\tvar ItemCodeId = ItemCodevalue.split(\":\")[1];\n\t\t\t\t\t\tif(ItemCodeId) {\n\t\t\t\t\t\t\tItemCode = ItemCodeId;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tItemCode = ItemCodevalue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar istax = '';\n\t\t\t\t\tif (ItemCode != \"Description\" && isparamtaxcode == 1 ) {\n\t\t\t\t\t\tvar CommodityCode = rec.getLineItemValue('item','custcol_spk_commodity_taxcode',i);\n\t\t\t\t\t\tvar AccountingCode = rec.getLineItemValue('item','custcol_spk_itemincomeaccnum',i);\n\t\t\t\t\t\tnlapiLogExecution('DEBUG','CommodityCode',CommodityCode);\n\t\t\t\t\t\tvar BundleFlag = rec.getLineItemValue('item','custcol_bundle',i);\n\t\t\t\t\t\tvar BaseBundleCode = rec.getLineItemValue('item','custcol_spk_basebundlecode',i);\n\t\t\t\t\t\tvar Description = rec.getLineItemValue('item','description',i);\n\t\t\t\t\t\tif(Description) {\n\t\t\t\t\t\t\tDescription = escapeChar(rec.getLineItemValue('item','description',i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar Qty = rec.getLineItemValue('item','quantity',i);\n\t\t\t\t\t\tvar Amount = rec.getLineItemValue('item','amount',i);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar UOM = \" \";\n\t\t\t\t\t\tif(isin == 1) {\n\t\t\t\t\t\tistax = ' ,{ ';\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tistax = ' { ';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisin = 1;\n\t\t\t\t\t\tvar LineNo = '\"'+i+'\"';\n\t\t\t\t\t\tstring1+= istax+'\"LineNo\": ' +LineNo;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (AccountingCode){ AccountingCode = '\"'+AccountingCode+'\"'; }\n\t\t\t\t\t\telse{ AccountingCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"AccountingCode\": ' +AccountingCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (CommodityCode){ CommodityCode = '\"'+CommodityCode+'\"'; }\n\t\t\t\t\t\telse{ CommodityCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"TaxCode\": ' +CommodityCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ItemCode){ ItemCode = '\"'+ItemCode+'\"'; }\n\t\t\t\t\t\telse{ ItemCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"ItemCode\": ' +ItemCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (BundleFlag == 'T') { BundleFlag = '\"Yes\"'; }\n\t\t\t\t\t\telse { BundleFlag = '\"No\"'; }\n\t\t\t\t\t\tstring1+= ', \"BundleFlag\": ' +BundleFlag;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (BaseBundleCode){ BaseBundleCode = '\"'+BaseBundleCode+'\"'; }\n\t\t\t\t\t\telse{ BaseBundleCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"BaseBundleCode\": ' +BaseBundleCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Description){ Description = '\"'+Description+'\"'; }\n\t\t\t\t\t\telse{ Description = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"Description\": ' +Description;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(Qty){ Qty = '\"'+Qty+'\"'; }\n\t\t\t\t\t\telse{ Qty = '\"0\"'; }\n\t\t\t\t\t\tstring1+= ', \"Qty\": ' +Qty;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar sfdcunitCost = rec.getLineItemValue('item','custcol_spk_sfdc_unit_cost',i);\n\t\t\t\t\t\tif(sfdcunitCost) {\n\t\t\t\t\t\t\tAmount = parseFloat(sfdcunitCost*Qty);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\t\t\t\tAmount = parseFloat(Amount * -1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tAmount = Amount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (Amount){ Amount = '\"'+Amount+'\"'; }\n\t\t\t\t\t\telse { Amount = '\"0\"'; }\n\t\t\t\t\t\tstring1+= ', \"Amount\": ' +Amount;\n\t\t\t\t\t\t\n\t\t\t\t\t\tstring1+= ', \"DiscountAmount\": \"0\" ';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (UOM){ UOM = '\"'+UOM+'\"'; }\n\t\t\t\t\t\telse{ UOM = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"UOM\": ' +UOM;\n\t\t\t\t\t\tstring1 = string1 + '}';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tstring1+= ']}'\n\t\t\t\n\t\t\tvar isSabrixError = rec.getFieldValue('custbody_spk_sabrixtaxerrorflag');\n\t\t\tvar traninternalId = ''\n\t\t\tnlapiLogExecution('DEBUG','String1',string1);\n\t\t\t\n\t\t\t//On edit call Sabrix Request to calculate tax only if certain fields are changed\n\t\t\tif(eventtype == 'edit') {\n\t\t\t\tcallsabrix = changeinFields(rec);\n\t\t\t\tif(isSabrixError == 'T') {\n\t\t\t\t\tcallsabrix = 1;\n\t\t\t\t}\n\t\t\t\tnlapiLogExecution('DEBUG','callsabrix',callsabrix);\n\t\t\t}\n\t\t\tif(DocType == 'invoice' && count == 0) {\n\t\t\t\tcallsabrix = 0;\n\t\t\t}\n\t\t\t if(callsabrix == 1) {\n\t\t\t\tnlapiLogExecution('DEBUG','After Submit current time Sabrix Request', new Date());\n\t\t\t\t//var sabrixurl = \"https://leadtoordersabrixstg.cloudhub.io/api/sabrix/calculateSalesTax\";\n\t\t\t\t//var authorizationHeader = 'Basic Y29yZXN2Y3VzZXI6Y29yZXN2Y3B3ZCEy';\t\t\n\t\t\n\t\t\t\tnlapiLogExecution('DEBUG','Auth Key '+authorizationHeader,' sabrixurl '+sabrixurl);\n\t\t\t\tvar header = new Array();\n\t\t\t\theader['Authorization'] = authorizationHeader;\n\t\t\t\theader['Accept'] = 'application/json';\n\t\t\t\theader['Content-Type'] = 'application/json';\n\t\t\t\tvar response = nlapiRequestURL(sabrixurl,string1,header,'POST');\n\t\t\t\tnlapiLogExecution('DEBUG','Response',response.getCode()+':::'+response.getBody());\n\t\t\t\tnlapiLogExecution('DEBUG','After Submit current time Sabrix Response', new Date());\n\t\t\t\tvar response_obj = JSON.parse(response.getBody());\n\t\t\t\tvar statuserrormsg = '';\n\t\t\t\tif(response.getCode() != '200'){\n\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrorflag','T');\n\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrormessage',response.getBody());\n\t\t\t\t}\n\t\t\t\tif(response.getCode() == '200'){\n\t\t\t\t\tvar successstr = response.getBody();\n\t\t\t\t\tif(successstr) {\n\t\t\t\t\t\tvar CalculationDirection = response_obj.CalculationDirection;\n\t\t\t\t\t\tnlapiLogExecution('DEBUG','CalculationDirection ', CalculationDirection);\t\n\t\t\t\t\t\tif(CalculationDirection == \"R\") {\n\t\t\t\t\t\t\trec.setFieldValue('taxamountoverride',0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar TotalTax = '';\n\t\t\t\t\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\t\t\t\t\tTotalTax = parseFloat(response_obj.TotalTax * -1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tTotalTax = response_obj.TotalTax;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar TaxRate ='';\n\t\t\t\t\t\t\tvar Taxableamt = '';\n\t\t\t\t\t\t\tif(response_obj.TaxLines) {\n\t\t\t\t\t\t\t\tfor(j=0; j < response_obj.TaxLines.length; j++) {\n\t\t\t\t\t\t\t\t\tvar taxLinesobj = response_obj.TaxLines[j];\n\t\t\t\t\t\t\t\t\tvar LineNo = taxLinesobj.LineNo;\n\t\t\t\t\t\t\t\t\tTaxRate = taxLinesobj.Rate;\n\t\t\t\t\t\t\t\t\tTaxableamt = taxLinesobj.Taxable;\n\t\t\t\t\t\t\t\t\tnlapiLogExecution('DEBUG','TaxRate '+TaxRate, ' Taxableamt '+Taxableamt);\t\n\t\t\t\t\t\t\t\t\trec.setLineItemValue('item','taxrate1',LineNo, parseFloat(TaxRate * 100));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trec.setFieldValue('taxamountoverride',TotalTax);\n\t\t\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrorflag','F');\n\t\t\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrormessage','');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttraninternalId = nlapiSubmitRecord(rec);\n\t\t\t\tnlapiLogExecution('DEBUG','traninternalId ', traninternalId);\t\n\t\t\t\t//Submit the Sabrix Integration Log Custom Record to keep track of Request and Response\n\t\t\t\tCreateSabrixLog(nlapiGetRecordType(),eventtype,string1,response.getBody(),traninternalId,response.getCode(),'T');\n\t\t\t} \n\t\t\t\n\t\t}\n\t}\n\tcatch(e) {\n\t\tvar syserror = '';\n\t\tif(e instanceof nlobjError) {\n\t\t\tnlapiLogExecution( 'ERROR', 'system error', e.getCode() + '\\n' + e.getDetails());\n\t\t\tsyserror = e.getCode() + '\\n' + e.getDetails();\n\t\t} \n\t\telse { \n\t\t\tsyserror = e.getCode() + '\\n' + e.getDetails();\n\t\t}\n\t\tnlapiSubmitField(nlapiGetRecordType(),nlapiGetRecordId(),['custbody_spk_sabrixtaxerrorflag','custbody_spk_sabrixtaxerrormessage'],['T', syserror]);\n\t\tCreateSabrixLog(nlapiGetRecordType(),eventtype,string1,response.getBody(),nlapiGetRecordId(),500, 'T');\n\t\tvar err = nlapiCreateError('Sabrix Error :', syserror);\n\t\tthrow err;\n\t}\n}", "function taxCalculator() {\n return {\n getTaxContributation: getTaxContributation,\n monthlyContributionToSector: monthlyContributionToSector,\n getAllMonthlyContributions: getAllMonthlyContributions,\n };\n}", "function CalculateTaxCommon(subTotal, discountAmt, deliveryFeeAmt, relayFeeAmt, Taxpercentage, PSTpercentage, GSTpercentage, DeliveryTaxflg, RelayTaxflg, DiscountTaxflg, IsCanadaTax, TaxState, SetupFeeAmt, SetupTaxflg, ShopID, ShopState, CalGSTflg, CalPSTflg, CalHSTflg, CalQSTflg) {\r\n\r\n // here subTotal with out discount (all taxable products sum of amount)\r\n var PSTAmount = 0;\r\n var GSTAmount = 0;\r\n var TAXAmount = 0;\r\n var HSTAmount = 0;\r\n var QSTAmount = 0;\r\n var RelayFeeTaxAmt = 0;\r\n var TaxAmounts = [];\r\n var data = {};\r\n var totalAmt = subTotal;\r\n\r\n\r\n if (IsCanadaTax == \"Y\") {\r\n\r\n var GSTpercent = 0;\r\n var PSTpercent = 0;\r\n var HSTpercent = 0;\r\n var QSTpercent = 0;\r\n\r\n var GSTRelaypercent = 0;\r\n var PSTRelaypercent = 0;\r\n var HSTRelaypercent = 0;\r\n var QSTRelaypercent = 0;\r\n\r\n var CanadaTaxDetails = getCanadaTaxList(TaxState);\r\n if (CanadaTaxDetails != undefined && CanadaTaxDetails != null && CanadaTaxDetails != '') {\r\n GSTpercent = CanadaTaxDetails[0].GST;\r\n PSTpercent = CanadaTaxDetails[0].PST;\r\n HSTpercent = CanadaTaxDetails[0].HST;\r\n QSTpercent = CanadaTaxDetails[0].QST;\r\n }\r\n\r\n // Added By nanda to get the Tax % based on the ShopState . on 060918\r\n\r\n var CanadaShopTaxDetails = getCanadaTaxList(ShopState);\r\n if (CanadaShopTaxDetails != undefined && CanadaShopTaxDetails != null && CanadaShopTaxDetails != '') {\r\n\r\n GSTRelaypercent = CanadaShopTaxDetails[0].GST;\r\n PSTRelaypercent = CanadaShopTaxDetails[0].PST;\r\n HSTRelaypercent = CanadaShopTaxDetails[0].HST;\r\n QSTRelaypercent = CanadaShopTaxDetails[0].QST;\r\n }\r\n\r\n // if (parseFloat(GSTpercent) > 0) {\r\n // updated relayfeeamount to 0 by nanda for Calculate Relay fee based on the shop state. on 060918\r\n GSTAmount = CalculateTaxBasedOnTaxableAmt(GSTpercent, totalAmt, discountAmt, deliveryFeeAmt, 0, 'yes', 'yes', DiscountTaxflg, SetupFeeAmt, SetupTaxflg);\r\n // Added By Nanda to get the relayfee tax based on the shop state on 060918\r\n var GSTRelayAmt = CalculateRelayFeeTax(GSTRelaypercent, relayFeeAmt, RelayTaxflg);\r\n RelayFeeTaxAmt = GSTRelayAmt;\r\n GSTAmount = (Math.round(GSTAmount * 100) / 100);\r\n // Hided By Nanda to remove 2 time Calc GST amount on 061718\r\n //GSTAmount += GSTAmount + GSTRelayAmt;\r\n GSTAmount = GSTAmount + GSTRelayAmt;\r\n\r\n if (GSTAmount < 0) {\r\n GSTAmount = 0;\r\n }\r\n\r\n // hided by nanda for Calculate Relay fee based on the shop state. on 060918\r\n //RelayFeeTaxAmt = CalculateTaxBasedOnTaxableAmt(GSTpercent, relayFeeAmt, 0, 0, 0, 'no', 'yes', 'no', SetupFeeAmt, SetupTaxflg);\r\n //RelayFeeTaxAmt = (Math.round(RelayFeeTaxAmt * 100) / 100);\r\n //if (RelayFeeTaxAmt < 0) {\r\n // RelayFeeTaxAmt = 0;\r\n //}\r\n // }\r\n // if (parseFloat(PSTpercent) > 0) {\r\n // updated relayfeeamount to 0 by nanda for Calculate Relay fee based on the shop state. on 060918\r\n PSTAmount = CalculateTaxBasedOnTaxableAmt(PSTpercent, totalAmt, discountAmt, deliveryFeeAmt, 0, DeliveryTaxflg, RelayTaxflg, DiscountTaxflg, SetupFeeAmt, SetupTaxflg);\r\n // Added By Nanda to get the relayfee tax based on the shop state on 060918\r\n var PSTRelayAmt = CalculateRelayFeeTax(PSTRelaypercent, relayFeeAmt, RelayTaxflg);\r\n RelayFeeTaxAmt += PSTRelayAmt;\r\n PSTAmount = (Math.round(PSTAmount * 100) / 100);\r\n PSTAmount = PSTAmount + PSTRelayAmt;\r\n if (PSTAmount < 0) {\r\n PSTAmount = 0;\r\n }\r\n // }\r\n // if (parseFloat(HSTpercent) > 0) {\r\n // updated relayfeeamount to 0 by nanda for Calculate Relay fee based on the shop state. on 060918\r\n HSTAmount = CalculateTaxBasedOnTaxableAmt(HSTpercent, totalAmt, discountAmt, deliveryFeeAmt, 0, DeliveryTaxflg, RelayTaxflg, DiscountTaxflg, SetupFeeAmt, SetupTaxflg);\r\n\r\n // Added By Nanda to get the relayfee tax based on the shop state on 060918\r\n var HSTRelayAmt = CalculateRelayFeeTax(HSTRelaypercent, relayFeeAmt, RelayTaxflg);\r\n RelayFeeTaxAmt += HSTRelayAmt;\r\n HSTAmount = (Math.round(HSTAmount * 100) / 100);\r\n HSTAmount = HSTAmount + HSTRelayAmt;\r\n if (HSTAmount < 0) {\r\n HSTAmount = 0;\r\n }\r\n // }\r\n // if (parseFloat(QSTpercent) > 0) {\r\n // updated relayfeeamount to 0 by nanda for Calculate Relay fee based on the shop state. on 060918\r\n QSTAmount = CalculateTaxBasedOnTaxableAmt(QSTpercent, totalAmt, discountAmt, deliveryFeeAmt, 0, DeliveryTaxflg, RelayTaxflg, DiscountTaxflg, SetupFeeAmt, SetupTaxflg);\r\n\r\n // Added By Nanda to get the relayfee tax based on the shop state on 060918\r\n var QSTRelayAmt = CalculateRelayFeeTax(QSTRelaypercent, relayFeeAmt, RelayTaxflg);\r\n RelayFeeTaxAmt += QSTRelayAmt;\r\n QSTAmount = (Math.round(QSTAmount * 100) / 100);\r\n QSTAmount = QSTAmount + QSTRelayAmt;\r\n if (QSTAmount < 0) {\r\n QSTAmount = 0;\r\n }\r\n // }\r\n\r\n\r\n // Added By nanda check the flag and calculate on 112718\r\n\r\n if (CalGSTflg == 'N') {\r\n GSTAmount = 0;\r\n }\r\n if (CalPSTflg == 'N') {\r\n PSTAmount = 0;\r\n }\r\n if (CalHSTflg == 'N') {\r\n HSTAmount = 0;\r\n }\r\n if (CalQSTflg == 'N') {\r\n QSTAmount = 0;\r\n }\r\n\r\n TAXAmount = parseFloat(PSTAmount) + parseFloat(GSTAmount) + parseFloat(HSTAmount) + parseFloat(QSTAmount);\r\n\r\n\r\n }\r\n else {\r\n TAXAmount = CalculateTaxBasedOnTaxableAmt(Taxpercentage, totalAmt, discountAmt, deliveryFeeAmt, relayFeeAmt, DeliveryTaxflg, RelayTaxflg, DiscountTaxflg, SetupFeeAmt, SetupTaxflg);\r\n TAXAmount = (Math.round(TAXAmount * 100) / 100)\r\n }\r\n\r\n if (TAXAmount < 0) {\r\n TAXAmount = 0;\r\n }\r\n\r\n data.PST = parseFloat(PSTAmount);\r\n data.GST = parseFloat(GSTAmount);\r\n data.HST = parseFloat(HSTAmount);\r\n data.QST = parseFloat(QSTAmount);\r\n data.TAX = parseFloat(TAXAmount);\r\n data.IsCanadaTax = IsCanadaTax;\r\n data.RelayFeeTaxAmt = parseFloat(RelayFeeTaxAmt);\r\n\r\n TaxAmounts.push(data);\r\n\r\n return TaxAmounts;\r\n}", "submitNewUser(event) {\n function _getAge(dateString) {\n var today = new Date();\n var birthDate = new Date(dateString);\n var age = today.getFullYear() - birthDate.getFullYear();\n var m = today.getMonth() - birthDate.getMonth();\n if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {\n age--;\n }\n return age;\n }\n\n event.preventDefault();\n\n if (this.state.firstName == \"\" || this.state.firstName == null) {\n alert(\"First name is a required field!\");\n return;\n }\n if (this.state.lastName == \"\" || this.state.lastName == null) {\n alert(\"Last name is a required field!\");\n return;\n }\n if (this.state.mPostCode == \"\" || this.state.mPostCode == null) {\n alert(\"PostCode is a required field!\");\n return;\n }\n if (this.state.countryId == \"\" || this.state.countryId == null) {\n alert(\"Country is a required field!\");\n return;\n }\n if (this.state.nationality == \"\" || this.state.nationality == null) {\n alert(\"Nationality is a required field!\");\n return;\n }\n if (_getAge(this.state.dateOfBirth) < 18) {\n alert(\"User must be 18 to register to vote!\");\n return;\n }\n if (this.state.fullAddress == \"\" || this.state.fullAddress == null) {\n alert(\"Full Address is a required field!\");\n return;\n }\n\n let data = {\n firstName: this.state.firstName,\n lastName: this.state.lastName,\n isAuditor: false,\n postCode: this.state.mPostCode.replace(/\\s/g, \"\").toLowerCase(),\n countryId: this.state.countryId,\n nationality: this.state.nationality,\n dateOfBirth: this.state.dateOfBirth,\n fullAddress: this.state.fullAddress\n };\n\n userAPI\n .getInstance()\n .registerUser(data)\n .then(res => {\n if (res.success == true) {\n alert(\n `Account Created! (PROTOTYPE: YOU RECEIVED THE FOLLOWING CODE IN THE MAIL... ${res.userCode.toString()})`\n );\n this.closeModal();\n } else alert(\"Something went wrong, please try again later\");\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 addTax(user){\n let updateCart = user.cart.map(item => {\n return{\n name: item.name,\n price: item.price * 1.03\n } \n });\n return Object.assign({}, user , {cart: updateCart})\n }", "function reviewTransaction()\n{\n\t$('#chk_box').removeAttr('checked');\n\t$(\"#withdraw_button\").attr(\"disabled\",\"disabled\");\n\t$(\"#withdraw_button\").css(\"opacity\",\"0.5\")\n\tvar stateSelect = resources.selectState;\n\n\tif($(\"#pickup_location option:selected\").html() == stateSelect || $(\"#pickup_location option:selected\").html() == undefined){\n\t\t$(\"#pickupError\").html(\"<sup>*</sup>\"+resources.validLocation);\n\t\t$(\"#pickupError\").show();\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\t$(\"#pickupError\").hide();\n\t}\n\tif(isNaN($(\"#receiveAmount\").val()) || $(\"#receiveAmount\").val() == \"\" || $.trim($('#receiveAmount').val()) == \"\"){\n\t\t$(\"#amountError\").html(\"<sup>*</sup>\"+resources.validAmt);\n\t\t$(\"#amountError\").show();\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\t$(\"#amountError\").hide();\n\t}\n\tif(totalAmt > availableAmt && availableAmt >= 200)\n\t{\n\t\talert(\"Withdraw amount including fee is : \" +totalAmt+ \" USD. You can only withdraw 200 dollars including fee, per transaction. \");\n\t\treturn false;\n\t}\n\telse if(totalAmt > availableAmt && availableAmt < 200){\n\t\t\talert(\"Withdraw amount including fee is : \" +totalAmt+ \" USD. You can only withdraw \"+ availableAmt + \" dollars including fee.\");\n\t\treturn false;\n\t}\n\tvar feeValue = $(\"#fee_value\").val();\n\tvar session = new Object();\n\tsession.amount = withdrawAmt;\n\tsession.feeAmount = feeValue;\n\tsession.destinationCountry = \"USA\";\n\tsession.destinationState = $(\"#pickup_location option:selected\").val();\n\tsession.receiveCurrency = \"USD\";\n\tsession.senderFirstName = loginResponse.given_name;\n\tsession.senderLastName = loginResponse.family_name;\n\tsession.senderAddress = loginResponse.address.street_address;\n\tsession.senderCity = loginResponse.address.locality;\n\tsession.senderState = loginResponse.address.region;\n\tsession.senderZipCode = loginResponse.address.postal_code;\n\tsession.senderCountry = \"USA\";\n\tsession.senderHomePhone = loginResponse.phone_number;\n\tsession.receiverFirstName = loginResponse.given_name;\n\tsession.receiverLastName = loginResponse.family_name;\n\tsession.sendCurrency = \"USD\";\n\tsession.consumerId = \"0\";\n\tsession.mgiTransactionSessionID = sessionId;\n\tsession.senderEmail = loginResponse.email;\n\tvar sessionObj = new Object();\n\tsessionObj.SendValidationInputBean = session;\n\tif(feeResponse.transactionSuccess == false){\n\t\tif(totalAmt == 0)\n\t\t{\n\t\t\t$(\"#fee_value\").val(\"USD\");\n\t\t\t$(\"#receiveAmount\").val(\"\");\n\t\t\t$(\"#totalAmount\").html(\"\");\n\t\t\talert(\"Withdraw amount including fee is : \" +totalAmt+ \" USD. You can only withdraw 200 dollars including fee.\");\n\t\t\treturn false;\n\t\t}\n\t\tif(totalAmt > 200){\n\t\t\t$(\"#fee_value\").val(\"USD\");\n\t\t\t$(\"#receiveAmount\").val(\"\");\n\t\t\t$(\"#totalAmount\").html(\"\");\n\t\t\talert(\"Withdraw amount including fee is : \" +totalAmt+ \" USD. You can only withdraw 200 dollars including fee.\");\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\t$(\"#fee_value\").val(\"USD\");\n\t\t\t$(\"#receiveAmount\").val(\"\");\n\t\t\t$(\"#totalAmount\").html(\"\");\n\t\t\talert(\"Withdraw amount including fee is : \" +totalAmt+ \" USD. You can only withdraw \"+ availableAmt + \" dollars including fee.\");\n\t\t\treturn false;\n\t\t}\t\n\t}\n\telse\n\t{\n\t\tcallService(methods.SendValidation[0], methods.SendValidation[1], sessionObj , commitSuccessHandler, commitFailureHandler);\n\t}\n}", "function Taxer(){\n const [tax, setTax] = useState(0);\n return(\n <div>\n <h1>Testing Mouse event n State!</h1>\n <h2>Value:{tax}</h2>\n <button onClick={() => setTax(tax+1)}> MORE </button>\n <button onClick={() => setTax(tax-1)}> Less </button>\n </div>\n )\n }", "function verTax () {\n\t\t\tif (product.tax == 1){\n\t\t\t\t$scope.vistaTax = 'Iva Incluido';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$scope.vistaTax = product.tax;\n\t\t\t}\n\t\t}", "function loan(income, customer) {\n let interestRate = .04\n let special = false \n if ((customer[\"Melon\"] === 'Casaba') || (customer[\"Pets\"] > 5)) {\n special = true\n }\n if (income < 100000 && special === false){\n interestRate = .08\n }\n if (income < 100000 && special === true){\n interestRate = .05 \n }\n if (200000 > income > 100000 && special === false){\n interestRate = .07 \n }\n if (200000 > income > 100000 && special === true){\n interestRate = .04 \n }\n customer.set(\"special\", special);\n // Function to return loan rate\n return interestRate\n}", "function set_entityusecode() {\n var STATES = get_states_map(); //use state map to get state abbreviations based on states internal ids\n var USECODES = create_usecodes_map();\n var length_of_address_list = nlapiGetLineItemCount('addressbook'); //find length of address book so we can sort through it\n var tax_exempt_states = nlapiGetFieldValues('custentity_tax_exempt_states'); //grab array of internal ids where the customer is tax exempt\n if (tax_exempt_states) {\n for (var i = 1; i <= length_of_address_list; i++) { //loop through each address line\n nlapiSelectLineItem('addressbook', i);\n var state = nlapiGetCurrentLineItemValue('addressbook', 'state'); //grab state on the line\n nlapiLogExecution('DEBUG', 'state', state);\n if(STATES[state]){\n var state_id = STATES[state].toString(); //need to compare to string for comparison\n if (tax_exempt_states.indexOf(state_id) !== -1) { //if state on address is in tax exempt states\n nlapiSetCurrentLineItemValue('addressbook', 'custpage_ava_entityusecode', USECODES.G); //set entity use code to 2\n } else {\n nlapiSetCurrentLineItemValue('addressbook', 'custpage_ava_entityusecode', USECODES.TAXABLE); // else set it to 1\n }\n nlapiCommitLineItem('addressbook');\n }\n }\n }\n window.entityusecode_needs_to_be_set = false; //this is a global used to tell if this function should be called. Set to true on click of adding or editing an address\n\n function create_usecodes_map() {\n return {\n Z: '2'\n , G: '3'\n , TAXABLE: '1'\n };\n }\n function get_states_map() {\n return {\n AL: 1,\n AK: 2,\n AZ: 3,\n AR: 4,\n CA: 5,\n CO: 6,\n CT: 7,\n DE: 8,\n FL: 9,\n GA: 10,\n HI: 11,\n ID: 12,\n IL: 13,\n IN: 14,\n IA: 15,\n KS: 16,\n KY: 17,\n LA: 18,\n ME: 19,\n MD: 20,\n MA: 21,\n MI: 22,\n MN: 23,\n MS: 24,\n MO: 25,\n MT: 26,\n NE: 27,\n NV: 28,\n NH: 29,\n NJ: 30,\n NM: 31,\n NY: 32,\n NC: 33,\n ND: 34,\n OH: 35,\n OK: 36,\n OR: 37,\n PA: 38,\n RI: 39,\n SC: 40,\n SD: 41,\n TN: 42,\n TX: 43,\n UT: 44,\n VT: 45,\n VA: 46,\n WA: 47,\n WV: 48,\n WI: 49,\n WY: 50\n };\n }\n}", "function blockHandler (state, context) {\n // TODO: in the future we won't disburse every time there is a withdrawal,\n // we will wait until we're ready to make a checkpoint (e.g. a few\n // times a day or when the signatory set has changed)\n if (state.withdrawals.length === 0) return\n if (state.signingTx != null) return\n\n let inputs = state.utxos\n state.utxos = []\n\n let outputs = state.withdrawals\n state.withdrawals = []\n\n state.signingTx = {\n inputs,\n outputs,\n signatures: [],\n signedVotingPower: 0\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 applySalesTax(taxRate, price) {\n return price + price * taxRate;\n}", "sendTotalAdjustCoinChange(coin) {\n var send_amount = this.state.send_amount;\n var send_total = parseFloat(send_amount);\n\n //if this.state.average_fee > 0 send_fee == fast. Set active fee selection fastest.\n if (coin === 'safex') {\n get_utxos(this.state.send_public_key)\n .then(utxos => {\n const rawtx = generateSafexBtcTransaction(\n utxos,\n BURN_ADDRESS,\n this.state.send_private_key,\n 1,\n this.state.average_fee * 100000000\n );\n this.setState({\n send_amount: 1,\n send_total: 1,\n send_fee: (parseFloat(rawtx.fee / 100000000) + 0.00000700).toFixed(8),\n });\n }).catch(err => {\n console.log(\"generate safex transaction error\" + err);\n this.openMainAlertPopup(\"Safex Transaction Error; You may have a 0 balance \\n\" + err);\n })\n .catch(err => {\n console.log(\"error getting UTXOs \" + err);\n this.openMainAlertPopup(\"error getting UTXOs; You may have a connectivity issue \" + err);\n });\n } else {\n get_utxos(this.state.send_public_key)\n .then(utxos => {\n const rawtx = generate_btc_transaction(\n utxos,\n BURN_ADDRESS,\n this.state.send_private_key,\n 0.00000001.toFixed(8),\n this.state.average_fee * 100000000\n );\n this.setState({\n send_amount: 0.00000001.toFixed(8),\n send_fee: parseFloat(rawtx.fee / 100000000).toFixed(8),\n send_total: parseFloat(parseFloat(0.00000001) + parseFloat(rawtx.fee / 100000000)).toFixed(8)\n });\n }).catch(err => {\n console.log(\"generate btc transaction error you might have no money \" + err);\n this.openMainAlertPopup(\"BTC Transaction Error; You may have a 0 balance \\n\" + err);\n })\n .catch(err => {\n console.log(\"error getting UTXOs \" + err);\n this.openMainAlertPopup(\"error getting UTXOs; You may have a connectivity issue \" + err);\n });\n }\n }", "function statement (obj)\n\t { \n \n let total_amount = 0;\n\t\t\t\n\n\t\tfor (let order of Object.keys(obj)) {\n\t\t\tlet amount = obj[order];\n \n total_amount += calculate_order_amount(amount);\n \n }\n \n //console.log(\"Total amount is equal to: \", total_amount, \" before application of tax\");\n \n if (total_amount > VALUE_ON_WHICH_TO_APPLY_VAT) \n return calculate_final_order_amount_with_VAT(total_amount,VAT);\n else\n return calculate_final_order_amount_with_VAT(total_amount,0); // VAT won't apply\n \n }//end of function statement", "function taxCalc(salary) {\n if(salary < 5000000){\n return 0 * salary;\n }else if(salary >= 5000000) {\n return 5/100 * salary;\n }else if(salary >= 10000000) {\n return 10/100 * salary;\n }else if(salary >= 20000000) {\n return 20/100 * salary;\n }\n}", "setFee(state) {\n document.getElementById(\n \"en__field_supporter_transaction_fee\"\n ).checked = !!state;\n }", "handleChangePaymentAmount(value) {\n let amountPaid;\n if (this.state.isStoreCredit) {\n let {amountPaidMax} = this.state;\n amountPaid = StoreCreditService.calculateAmountPaid(parseFloat(value), amountPaidMax);\n this.setState({useMaxCredit: StoreCreditService.checkUseMaxCredit(amountPaid, amountPaidMax)});\n } else {\n amountPaid = this.handleCannotDue(value);\n }\n amountPaid = CurrencyHelper.validateAndConvertCurrency(amountPaid);\n this.setState({\n amountPaid\n });\n }", "handleUserSelect(item) {\n let username = item.username;\n let user1 = item.userid;\n let user2 = cookie.load(\"user_id\");\n let type = item.FavourType;\n\n\n let responseData = [];\n this.setState({\n userloginName: username,\n allOWedTransaction: [],\n allOwesTransaction: []\n })\n if (type === \"Owes\") {\n\n let FavourQt = item.FavourQty;\n this.setState({\n SumOfOwes: FavourQt,\n SumOfOwed: 0\n });\n\n }\n else {\n let FavourQt = item.FavourQty;\n\n this.setState({\n SumOfOwed: FavourQt,\n SumOfOwes: 0\n });\n }\n\n // For login(user1) owes users2\n axios.get(`https://aip-v1.ts.r.appspot.com/api/favours/transaction?user_owes=${user2}&user_owed=${user1}`)\n .then(response => {\n if (response.status === 200) {\n responseData = response.data.transactions;\n\n this.setState({\n allOwesTransaction: responseData\n });\n }\n })\n .catch((e) => {\n console.log(e);\n })\n\n // For users2 owes login(user1) \n axios.get(`https://aip-v1.ts.r.appspot.com/api/favours/transaction?user_owes=${user1}&user_owed=${user2}`)\n .then(response => {\n if (response.status === 200) {\n responseData = response.data.transactions;\n\n this.setState({\n allOWedTransaction: responseData\n });\n\n }\n })\n .catch((e) => {\n console.log(e);\n })\n\n\n\n\n }", "function calculateTax (salary) {\n let tax = 0;\n\n if (salary >= 42705 && salary < 85405){\n tax = (salary - 42705) * 0.2;\n }\n else if (salary >= 85405 && salary < 103915) {\n tax = (salary - 85405) * 0.24 + (85405 - 42705) * 0.2;\n }\n else if (salary >= 103915) {\n tax = (85405 - 42705) * 0.2 +(103915 - 85405) * 0.24 + (salary - 103915) * 0.2575;\n }\n return tax;\n}", "get salesTax() {\n return parseFloat(\n (super.getSalesTax() + this.itemPrice() * IMPORT_DUTY).toFixed(2)\n );\n }", "function calculateSalesTax(salesTax) {\n return salesTax = (20 / 100) * price\n}", "setUser(user) {\n this.discountingUser = user;\n\n this.getCurrentDiscountForUser(user);\n }", "function CheckPaid(){\n if (store.state.generalData){\n // redirect to account page if the user has not paid, and they are not super\n if (store.state.superUser != true && store.state.paidMember == false && store.state.currentPage != 'account'){\n store.commit('updatePage', 'account')\n app.$toast.error(\"Please submit payment.\", {icon: 'warning'});\n return redirect('/account')\n }\n }\n }", "function estimateTotal(event) {\n //prevent default form submit behaviour\n event.preventDefault()\n\n //check if state is selected\n if (state.value === '') {\n alert('Please chose your shipping state')\n state.focus()\n return\n }\n\n //gt all quantity from input and parse it into integer\n var itemBBall =\n parseInt(document.getElementById('txt-q-bball').value, 10) || 0,\n itemJersy =\n parseInt(document.getElementById('txt-q-jersey').value, 10) || 0,\n itemPower =\n parseInt(document.getElementById('txt-q-power').value, 10) || 0\n //calculate total quantity and total price\n\n var totalQty = itemBBall + itemJersy + itemPower,\n totalPrice = itemBBall * 90 + itemJersy * 25 + itemPower * 30\n var shippingCost = 0,\n shippingCostPer = 0,\n taxFactor = 1,\n estimate,\n shippingState = state.value\n\n //select shipping method and set tax factor\n if (shippingState === 'CA') {\n taxFactor = 1.075\n }\n\n //get shipping method and calculate shipping cost\n var shippingMethod = document.querySelector('[name=r_method]:checked').value\n switch (shippingMethod) {\n case 'usps':\n shippingCostPer = 2\n break\n case 'ups':\n shippingCostPer = 3\n break\n default:\n shippingCostPer = 0\n break\n }\n shippingCost = totalQty * shippingCostPer\n //final estimate cost\n estimate = totalPrice * taxFactor + shippingCost\n\n //show the cost\n document.getElementById('txt-estimate').value = '$' + estimate.toFixed(2)\n}", "function getTaxRate(shoppingCart){\n //takes in the above shopping cart as input\n //returns the tax rate\n var taxRate = shoppingCart.tax;// grabs shopping cart object and pulls tax information out of it\n return taxRate;// return the tax value\n}", "function calculateSalesTax(price, taxRate = 0.15){\n\treturn price*taxRate;\n}", "function getTax(data) {\n var tax = ( getStockCost(data) * ( Number(data['tax_rate']) / 100 ) );\n if(true === debug) {\n console.log('tax');\n console.log(tax);\n }\n return tax;\n}", "function getTax(roomFinalCosts) {\n let taxRate = .12;\n return roomFinalCosts * taxRate;\n}", "function validateTaxID(){\n\tvar input = jQuery(\"#tax_id\").val();\n\tif(validWord(input) == false){\n\t\trequiredAction('#tax_id', false, 'You must enter a valid Tax ID.');\n\t\treturn false;\n\t}else {\n\t\trequiredAction('#tax_id', true);\n\t\treturn true;\n\t}\n\n\n\tvar retval = jQuery('#distributor-signup').is(':checked');\n\tvar input = jQuery('#tax-id').val();\n\tif(retval == true || enrollmentitem == true) {\n\t\t\n\t}else {\n\t\treturn true;\n\t}\n}", "submitBudget() {\n // State values\n const {\n income,\n outcome,\n incomeModifier,\n savings,\n firstTime,\n update,\n id,\n } = this.state;\n\n // Determine if the submition is for first time setup or update\n if (firstTime) { // Submit a new budget\n axios.post(`http://${deployment}:8080/tool/budget/${id}`, {\n income,\n outcome,\n incomeModifier,\n savings,\n })\n .then(() => {\n this.setState({ firstTime: false });\n });\n } else if (update) { // Update a budget\n axios.patch(`http://${deployment}:8080/tool/budget/${id}`, {\n income,\n outcome,\n incomeModifier,\n savings,\n })\n .then(() => {\n this.setState({ update: false });\n });\n }\n }", "function propertyTax() {\n return ( plan.mortgage.homeValue * local.statePropertyTax[plan.stateResident] );\n }", "function totalTaxCost(){\n\t\t\n\t\treturn totalPrice * taxPercentage;\n\t} // End totalTaxCost.", "function form_postSourcing(type, name)\n{\n if (name == 'entity') { // Client field has changed\n hasClientAgreedToTerms();\n }\n}", "invest(amount, { rrsp_allowance }) {\n if (!amount || amount <= 0) return;\n\n if (rrsp_allowance > 0) {\n // Now for RRSP.\n const [rrsp_amount, remainder] = (amount > rrsp_allowance) ?\n [rrsp_allowance, amount - rrsp_allowance] :\n [amount, 0];\n\n this.rrsp.invested += rrsp_amount; // more money invested\n this.rrsp.profit = tick(this.rrsp, this.stock_return); // the new profit\n\n // Personal account\n if (remainder) {\n this.personal.invested += remainder; // more money invested\n }\n this.personal.profit = tick(this.personal, this.stock_return); // the new profit\n\n // Tax credit goes into personal account.\n this.rrsp.credit += rrsp_amount;\n } else {\n // Personal account only.\n this.personal.invested += amount; // more money invested\n this.personal.profit = tick(this.personal, this.stock_return); // the new profit\n }\n }", "checkChargeStatus(event) {\n let { data } = this.state;\n data.facilitationCharge.type = event.target.id;\n data.facilitationCharge.amount = 0;\n if (data.facilitationCharge.type && data.facilitationCharge.amount <= 0) {\n data.finalAmount = parseFloat(data.servicePayment.tasksDerived);\n if (data.servicePayment.discountValue > 0) {\n if (data.servicePayment.discountType === 'amount') {\n let value = data.finalAmount - parseFloat(data.servicePayment.discountValue);\n data.finalAmount = value ? parseFloat(value).toFixed(2) : null;\n } else if (data.servicePayment.discountType === 'percent') {\n let prevAmount = (parseFloat(data.servicePayment.tasksDerived) * parseFloat(data.servicePayment.discountValue) / 100);\n let value = data.finalAmount - prevAmount;\n data.finalAmount = value ? parseFloat(value).toFixed(2) : null;\n }\n }\n }\n this.setState({ data: data });\n }", "function TaxEngine() {\n this.initialized_ = false;\n this.earningsRecords = [];\n this.cutoffIndexedEarnings = 0;\n this.totalIndexedEarnings = 0;\n this.monthlyIndexedEarnings = 0;\n this.futureEarningsYears = 0;\n this.futureEarningsWage = 0;\n\n this.birthDate = {year: 1970, month: 'Jan'};\n this.fullRetirement = FULL_RETIREMENT_AGE[FULL_RETIREMENT_AGE.length - 1];\n}", "function askUser(){\n setRatingVars();\n checkEvents();\n if(outChooseVal == 1){\n console.log(chalk.cyan(\"\\nYour task has been completed. Select the a validator to continue...\\n\"));\n }\n if(canRate == true){\n giveRating();\n }\n else{\n if(prov == 0)\n inquirer.prompt([questions]).then(answers => {choiceMade(answers.whatToDo)});\n else\n inquirer.prompt([questions1]).then(answers => {choiceMade(answers.whatToDo1)});\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 getsDiscount() {\n if ((productsBought > 2) || (membership = premium)); }", "function checkTaxi(taxis, location) {\n let distance = 1000000;\n let maxDistance = 200;\n let choosenTaxi;\n const data = {\n state: 'hired'\n };\n\n // Checks every taxi and calculates its distance to the user's location\n taxis.forEach(taxi => {\n if (taxi.state === 'free') {\n let _calcDistance = calcDistance(taxi.location, location);\n if (_calcDistance < distance) {\n distance = _calcDistance;\n choosenTaxi = distance < maxDistance ? taxi : `There's no free taxi near you right now`;\n }\n }\n });\n\n // Try to change taxi's state to hired\n fetch(`http://35.204.38.8:4000/api/v1/taxis/${choosenTaxi.city}/${choosenTaxi.name}`,{\n method: 'post',\n body: JSON.stringify(data),\n headers: { 'Content-Type': 'application/json' },\n })\n .then(response => {\n if (response.status !== 200) {\n choosenTaxi = `There was an error trying to hire your taxi, please try again`;\n }\n })\n .catch(error => console.log(error));\n\n\n // Bot post a message in Slack\n if (choosenTaxi !== `There's no free taxi near you right now`) {\n bot.say({\n text: `Your taxi is on it's way!`,\n channel\n });\n bot.say({\n text: JSON.stringify(choosenTaxi),\n channel\n });\n }\n else {\n bot.say({\n text: choosenTaxi,\n channel\n });\n }\n}", "function tax_percent() {\n var hoursTi = /^\\d+$/;\n var tax = \"\";\n var dep = new Array(5);\n dep[0] = .2;\n dep[1] = .17;\n dep[2] = .15;\n dep[3] = .12;\n dep[4] = .10;\n dep[5] = .10;\n var txt = \" %\";\n for (i = 0; i < 6; i++) {\n if (document.paycheck['tax' + i].checked) {\n var newtax = new Number(dep[i]);\n taxrate = newtax * 100;\n var h = eval(document.paycheck.hours.value);\n var r = eval(document.paycheck.payrate.value);\n document.paycheck.feedback.value = taxrate + txt;\n var total = document.paycheck.feedback3.value = r * (1 - newtax) * h;\n dollars(total);\n // document.paycheck.feedback3.value = (\"$ \" + dollars(r * (1 - newtax) * h));\n //document.paycheck.feedback3.value = dollars(r * (1 - newtax) * h);\n //return fase;\n\n }\n }\n }", "setItemsInCartTaxes(state, taxes) {\n state.itemsInCartTaxes = taxes;\n }", "function calc(){\n\n//User input 1 convert in JS to a number and the value is stored into a variable usersalary\nvar grsalary = parseInt(document.getElementById(\"input1\").value);\n \n//Declaring number variables\nvar taxrate = 0;\nvar taxrate20 = 0;\nvar taxrate40 = 0;\nvar taxfree = 10600;\nvar netsalary = 0;\n\n//Using if condition to check and calculate users tax rate and netsalary\nif (grsalary <= taxfree){\n taxrate = 0;\n netsalary = grsalary - taxrate;\n}\nelse if(grsalary >= taxfree && grsalary <= 31000){\n taxrate20 = 0.2 * (grsalary - taxfree);\n netsalary = grsalary - taxrate20;\n}\nelse {\n taxrate40 = 0.4 * (grsalary - 31000);\n taxrate20 = 0.2 * (31000 - taxfree);\n netsalary = grsalary - (taxrate20 + taxrate40);\n} \n \n//Writing the output results into DOM \ndocument.getElementById(\"demo\").innerHTML = \"<br>Your Gross Annual Salary: $\" + grsalary + \"<br><br>Tax free allowance: $\" + taxfree + \"<br>Tax at 20%: $\" + taxrate20 + \"<br>Tax at 40%: $\" + taxrate40 + \"<br><br>Net Salary: $\" + netsalary+ \"<br>\"; \n\n}", "function calculateBill(billAmount, taxRate = 0.13, tipRate = 0.15) { // paramaters\n // this is the function body\n // console.log('Running Calculate Bill!!');\n const total = billAmount + (billAmount * taxRate) + (billAmount * tipRate); // variable is only available in function\n return total;\n}", "function processTxn(tx, meta, is_historic)\n\t {\n\t var processedTxn = rewriter.processTxn(tx, meta, account);\n\n\t if (processedTxn) {\n\t var transaction = processedTxn.transaction;\n\n\t // Update account\n\t if (processedTxn.accountRoot) {\n\t handleAccountEntry(processedTxn.accountRoot);\n\t }\n\n\t // Show status notification\n\t if (processedTxn.tx_result === \"tesSUCCESS\" &&\n\t transaction &&\n\t !is_historic) {\n\t $scope.$broadcast('$appTxNotification', transaction);\n\t }\n\n\t // Add to recent notifications\n\t if (processedTxn.tx_result === \"tesSUCCESS\") {\n\t $scope.events.unshift(processedTxn);\n\t }\n\n\t // Add to history\n\t $scope.history.unshift(processedTxn);\n\n\t // Update Ripple lines\n\t if (processedTxn.effects && !is_historic) {\n\t updateLines(processedTxn.effects);\n\t }\n\n\t // Update my offers\n\t if (processedTxn.effects && !is_historic) {\n\t // Iterate on each effect to find offers\n\t processedTxn.effects.forEach(function (effect) {\n\t // Only these types are offers\n\t if (_.contains([\n\t 'offer_created',\n\t 'offer_funded',\n\t 'offer_partially_funded',\n\t 'offer_cancelled'], effect.type))\n\t {\n\t var offer = {\n\t seq: +effect.seq,\n\t gets: effect.gets,\n\t pays: effect.pays,\n\t deleted: effect.deleted,\n\t flags: effect.flags\n\t };\n\n\t updateOffer(offer);\n\t }\n\t });\n\t }\n\t }\n\t }", "function calculateGoldBonus(userState) {\n // TODO: account for terrain, race, connected cities (count of cities other than the non-primary), etc\n const tradeBonus = 50;\n\n const buildingBonus = 0\n + (userState.construction.isCompleted(Buildings.MARKETPLACE) ? 50 : 0)\n + (userState.construction.isCompleted(Buildings.BANK) ? 50 : 0)\n + (userState.construction.isCompleted(Buildings.MERCHANTS_GUILD) ? 100 : 0);\n\n return (tradeBonus + buildingBonus) / 100.0;\n}", "function calculateTaxContibution(rest){\n return rest.taxesDue / rest.cityTaxes\n}", "sendTotalAdjustCoinChange(coin) {\n var send_amount = this.state.send_amount;\n if (this.state.average_fee > 0) {\n var send_fee = this.state.average_fee;\n } else {\n var send_fee = this.state.send_fee;\n }\n\n //if this.state.average_fee > 0 send_fee == fast. Set active fee selection fastest.\n if (coin === 'safex') {\n send_amount = parseFloat(this.state.send_amount).toFixed(0);\n var send_total = parseFloat(send_amount);\n this.setState({\n send_amount: 1,\n send_fee: parseFloat(this.state.average_fee).toFixed(8),\n send_total: 1,\n active_fee: 'fast'\n });\n } else {\n var send_total = parseFloat(this.state.average_fee) / 4 + 0.00001;\n this.setState({\n send_amount: 0.00001.toFixed(8),\n send_fee: parseFloat(parseFloat(this.state.average_fee) / 4).toFixed(8),\n send_total: send_total.toFixed(8),\n active_fee: 'fast'\n });\n }\n\n }", "function calculateTax(amount) {\n let result = amount * 0.025\n return result\n}", "isPaymentSufficient() {\n if (this.cashTendered >= this.amountDue) {\n console.log(\"Payment complete\")\n\n } else {\n this.insertCoin(type);\n }\n }", "setAuctionReserve(props) {\n const { web3, auction, auctionInstance, ended } = props;\n\n // Auction balance in WEI\n web3.eth.getBalance(auction.address, (err, res) => {\n if(err) {\n console.log('setAuctionReserve', err);\n }\n if(res) {\n let auctionReserve, estimatedTKNBough;\n \n auctionReserve = res.toNumber();\n estimatedTKNBough = auctionReserve / this.auctionPrice();\n //this.setState({ auctionReserve, estimatedTKNBough });\n console.log('auctionReserve, estimatedTKNBough', auctionReserve, estimatedTKNBough);\n }\n });\n }", "function processRent() {\r\n createOrUpdateRent()\r\n .then(addRentForUser)\r\n .then(addRentForCar);\r\n\r\n function createOrUpdateRent(){\r\n // creéé la location ou ajoute à la location existante si covoiturage\r\n }\r\n\r\n function addRentForUser(){\r\n\r\n }\r\n\r\n function addRentForCar(){\r\n\r\n }\r\n }", "function federalTax() {\n // calculations based off of result.taxableIncome\n // federal.bracketRate = [ 0.1, 0.15, 0.25, 0.28, 0.33, 0.35, 0.396 ];\n // federal.bracketLimit.single = [ 0, 9225, 37450, 90750, 189750, 411500, 413200 ];\n\n var bracketRate = getVar(federal.bracketRate);\n var bracketLimit = getVar(federal.bracketLimit);\n var income = result.taxableIncome;\n\n // Marginal tax calculations.\n var taxLiability = 0;\n for (var i=0; i<bracketRate.length; i++) {\n if (income >= bracketLimit[i] && i < bracketRate.length-1) {\n var temp = Math.min( bracketLimit[i+1], income ) - bracketLimit[i];\n taxLiability += (temp * bracketRate[i]);\n }\n // Catches cases where income is greater than the highest bracket.\n else if (income >= bracketLimit[i] && i === bracketRate.length-1) {\n var temp = income - bracketLimit[i];\n taxLiability += (temp * bracketRate[i]);\n }\n }\n return taxLiability;\n }", "rate(time, balance) {\n this.mortgage_rate = this.opts.mortgage_rate();\n this.bought = time; // rate is for 5 years\n\n // Has part of the mortgage been paid up?\n if (balance) {\n this.mortgage = balance;\n this.mortgage_term -= 5;\n }\n }", "checkActivateCure(){\n if(this.cureRate == 0 && this.state == countryStates[0]){\n if(this.alertLevel == alertLevels[2] || this.alertLevel == alertLevels[1]){\n this.cureRate = 1/generateRandomIntegerInRange(58,300);\n }\n }\n }", "function payVirtuo() {\n rentals.forEach(element => {\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.commission = element.price * 0.3\n element.insurance = element.commission / 2\n element.treasury = duration\n element.virtuo = element.commission - element.insurance - element.treasury\n });\n}" ]
[ "0.71665764", "0.69283986", "0.6824644", "0.6824644", "0.6824644", "0.6514695", "0.6489362", "0.64564246", "0.6449419", "0.640856", "0.63412637", "0.63382673", "0.62944937", "0.62597966", "0.6229813", "0.62088215", "0.61874354", "0.614564", "0.6008244", "0.59829456", "0.595157", "0.5946856", "0.5928778", "0.59084517", "0.5872507", "0.58563673", "0.5854738", "0.58479714", "0.5820186", "0.58191234", "0.5811842", "0.5808351", "0.5778649", "0.57766145", "0.57726324", "0.5768754", "0.5767517", "0.5751136", "0.5732388", "0.57249486", "0.5692078", "0.5690861", "0.5682504", "0.56388295", "0.56005013", "0.5595066", "0.55727386", "0.55677366", "0.55534536", "0.5550525", "0.5546449", "0.5543305", "0.55319446", "0.5530201", "0.5516147", "0.54756707", "0.5461141", "0.54606754", "0.5457324", "0.54357064", "0.5434467", "0.5422336", "0.5417384", "0.5389748", "0.53885967", "0.53864866", "0.53764355", "0.5373851", "0.5369788", "0.5348719", "0.53407854", "0.5340342", "0.5324849", "0.53239924", "0.5316667", "0.5316569", "0.5314747", "0.5313348", "0.5311505", "0.5310432", "0.5308806", "0.5301323", "0.5299208", "0.5297912", "0.5296281", "0.5294859", "0.5290805", "0.5290797", "0.52885246", "0.5281825", "0.52812636", "0.52798504", "0.52531654", "0.5249333", "0.5248067", "0.52478033", "0.5244763", "0.5232001", "0.52310055", "0.52293503" ]
0.6083801
18
maybe here when we buy the item
function buyItem(user){ amazonHistory.push(user) return Object.assign({}, user, { purchases: user.cart }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function buyItem() {\n\n}", "buyItem(item) {\n console.log(\"Buying Item:\", item.name);\n }", "function buyItem() {\n\taddArmor();\n\t$('#alerts').append(\"<br />An item has being bought<br />\");\n\tremoveMoneyI();\n}", "function purchaseItem() {\n return\n}", "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}", "async buy() {\n const character = this.character;\n let title = '';\n let color;\n\n // If spell\n if (_.isDefined(this.info.spell)) {\n [color, title] = this.buySpell(character, this.info.spell);\n }\n else {\n const buyItem = Items.new(this.info.item);\n\n // If equipment\n if (buyItem.equipType) {\n [color, title] = this.buyEquipment(character, buyItem);\n }\n\n // If inventory item\n else {\n [color, title] = this.buyItem(character, buyItem, this.info.quantity);\n }\n }\n\n await this.updateLast({\n attachments: Attachments.one({ title, color }),\n fields: [],\n doLook: true\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 buyItem(guid) {\n print(\"Trying to buy item \" + guid);\n\n var inventory = getInventory(currentMerchant);\n\n for (var i = 0; i < inventory.length; ++i) {\n var item = inventory[i];\n if (item.id == guid) {\n // Pay for it and only if that succeeds, move it\n if (Party.money.getTotalCopper() < item.worth) {\n print(\"Player doesn't have enough money.\");\n return;\n }\n Party.money.addCopper(- item.worth);\n\n inventory.splice(i, 1); // Remove from container\n\n if (!currentPlayer.content)\n currentPlayer.content = [];\n\n currentPlayer.content.push(item);\n\n // Refresh the UI\n MerchantUi.refresh();\n\n return;\n }\n }\n\n print(\"Unknown item guid: \" + guid);\n }", "function bidItem() { }", "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 }", "buyItemFromVendor(x, y, item, client, clientPub, vendorChannel){\n\t\tlet temp = this.findVendor(x, y, client);\n\t\tlet bought = false;\n\t\tlet vendorID = null;\n\t\tif(temp.type === \"vendor\" && temp !== false){\n\t\t\tlet foundVendor = temp.vendor;\n\t\t\tvendorID = foundVendor.vendorID;\n\t\t\tfor(let i = 0, j = foundVendor.items.length; i<j; i++){\n\t\t\t\tif(foundVendor.items[i].item === item){\n\t\t\t\t\tif(this.vendors[vendorID].items[i].quantity === 1){\n\t\t\t\t\t\tthis.vendors[vendorID].items.splice(i, 1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis.vendors[vendorID].items[i].quantity--;\n\t\t\t\t\t}\n\t\t\t\t\t(async () => {\n\t\t\t\t\t\tclientPub.publish(vendorChannel, JSON.stringify({\n\t\t\t\t\t\t\titems: this.vendors[vendorID].items,\n\t\t\t\t\t\t\tvendor: vendorID\n\t\t\t\t\t\t}));\n\t\t\t\t\t})();\n\t\t\t\t\t(async () => {\n\t\t\t\t\t\tclient.hset('vendor', vendorID, JSON.stringify(this.vendors[vendorID].items));\n\t\t\t\t\t})();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function onClickActionBuyItem(){\n\t\tconst itemlist = CashShop.cartItem;\n\t\tCashShop.cartItemLen = itemlist.length;\n\n\t\tCashShop.ui.find('#purchase-btn').prop('disabled', true);\n\t\tUIManager.showPromptBox( 'Are you sure you want to buy this items?', 'ok', 'cancel', function(){\n\t\t\tif(CashShop.cartItem.length > 0){\n\t\t\t\tvar pkt \t= new PACKET.CZ.SE_PC_BUY_CASHITEM_LIST();\n\t\t\t\tpkt.kafraPoints \t= 0;\n\t\t\t\tpkt.item_list \t\t= CashShop.cartItem;\n\t\t\t\tNetwork.sendPacket(pkt);\n\t\t\t} else {\n\t\t\t\tUIManager.showMessageBox( 'No item in cart!', 'ok');\n\t\t\t\tChatBox.addText( 'No item in cart!', ChatBox.TYPE.INFO);\n\t\t\t\tCashShop.ui.find('#purchase-btn').prop('disabled', false);\n\t\t\t}\n\t\t}, function(){\n\t\t\tCashShop.ui.find('#purchase-btn').prop('disabled', false);\n\t\t});\n\t}", "async buy(item, quantity) {\n const res = await this.client.action(\"buy\", { itemName: item, quantity: quantity, storeName: this.store });\n if (res.success) {\n this.editCache(item, -quantity);\n await this.client.update(res.playerStringified);\n }\n return { success: res.success, msg: res.msg };\n }", "function buyItem(id) {\n\titem = items[id];\n\tvar index = game.frat.items.indexOf(item.name);\n\tif (index != -1) {\n\t\talert(\"You already have this item!\");\n\t\treturn false;\n\t}\n\telse if (game.frat.cash < item.price) {\n\t\tconsole.log('you have: '+ game.frat.items);\n\t\talert(\"You don't have enough cash!\");\n\t\treturn false;\n\t}\n\telse {\n\t\tconsole.log('you used to have $' +game.frat.cash);\n\t\t\n\t\tgame.frat.cash -= item.price;\n\t\tgame.frat.items.push(item.name);\n\t\t\n\t\tgame.frat.itemMult.party += item.mult.party;\n\t\tgame.frat.itemMult.cs += item.mult.cs;\n\t\tgame.frat.itemMult.rush += item.mult.rush;\n\t\tgame.frat.itemMult.study += item.mult.study;\n\t\t\n\t\tconsole.log('Item ' + item.name + ' is bought');\n\t\tconsole.log('now you have: '+ game.frat.items);\n\t\tconsole.log('the new itemMult.party is '+ game.frat.itemMult.party);\n\n\t\treturn true;\n\t}\n}", "sellItemtoVendor(x, y, item, client, clientPub, vendorChannel, itemsObj){\n\t\tlet temp = this.findVendor(x, y, client);\n\t\tlet vendorID = null;\n\t\tif(temp.type === \"vendor\" && temp !== false){\n\t\t\tlet vendorID = temp.vendor.vendorID;\n\t\t\tlet found = false;\n\t\t\tfor(let i = 0, j = this.vendors[vendorID].items.length; i<j; i++){\n\t\t\t\tif(item.item === this.vendors[vendorID].items[i].item){\n\t\t\t\t\t//if vendor already has this item, increase quantity\n\t\t\t\t\tthis.vendors[vendorID].items[i].quantity++;\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!found){\n\t\t\t\t//else give quantity 1 and add to vendor items\n\t\t\t\tlet temp = item;\n\t\t\t\ttemp.quantity = 1;\n\t\t\t\tthis.vendors[vendorID].items.push(temp);\n\t\t\t}\n\t\t\t(async () => {\n\t\t\t\tclientPub.publish(vendorChannel, JSON.stringify({\n\t\t\t\t\titems: this.vendors[vendorID].items,\n\t\t\t\t\tvendor: vendorID\n\t\t\t\t}));\n\t\t\t})();\n\t\t\t(async () => {\n\t\t\t\tclient.hset('vendor', vendorID, JSON.stringify(this.vendors[vendorID].items));\n\t\t\t})();\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function buy (item) {\n if (game.fire === false) {\n if (item === 'ore' && game.gold >= settings.oreCost){\n game.ore += 1\n game.gold -= settings.oreCost\n return \"You bought 1 piece of ore!\" \n } else if(item === 'wood' && game.gold >= settings.woodCost){\n game.wood += 1\n game.gold -= settings.woodCost\n return \"You bought 1 piece of wood!\"\n } else {\n return `You cannot buy ${item}`\n }\n } else {\n return \"You must put out the fire.\"\n }\n }", "function marketBuy () {\n\n}", "buyItem(req, res) {\n db.items.getById(req.params.id)\n .then((product) => {\n // Product returns an array of 1 item, so need to access that item, and change the buyer of that item to be the current request maker\n db.transactions.updateTransaction(product[0].id, { buyer_id: req.user.user.id })\n .then(() => {\n db.items.sold(Number(req.params.id));\n //Creates a new client with coinbase which allows user to purchase the item from coinbase\n const client = new coinbase.Client({ accessToken: req.user.accessToken, refreshToken: req.user.refreshToken });\n const args = {\n name: `Order for ${product[0].title}`,\n amount: /* (Number(product[0].price))*/ 0.01,\n metadata: {\n customer_id: client.id,\n customer_name: 'test'\n },\n currency: 'USD',\n type: 'order',\n style: 'custom_small',\n success_url: `http://${req.headers.host}/items/${req.params.id}/confirm`,\n cancel_url: `http://${req.headers.host}/items/${req.params.id}`,\n customer_defined_amount: false,\n collect_shipping_address: false,\n description: `Purchasing: ${product[0].title} on BitBargain`\n };\n //Create a checkout button with those args, and sends it back to BB which embeds it in a button\n client.createCheckout(args, (err, checkout) => {\n console.log(err, checkout);\n if (err) {\n res.json(`Error buying ${product[0].title}`);\n }\n res.json(checkout.embed_code);\n });\n });\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 buyItem(e) {\n\te.preventDefault();\n\n\t// find item was added\n\tif (e.target.classList.contains('add-to-cart')) {\n\t\tconst item = e.target.parentElement.parentElement.parentElement;\n\n\t\t// get item info\n\t\tgetItemInfo(item);\n\t}\n}", "function buy(){\n \n}", "function purchaseItem(...fns)\n\n\n{} // & these spreads functions", "async function BuyItem(receivedMessage)\r\n{\r\n\tvar authorID = receivedMessage.author.id; // Get user's ID\r\n\tvar balanceUnits = await GetBalance(authorID);\t// Get user's balance\r\n\r\n\t// Get the price the player's willing to pay\r\n\tvar price = receivedMessage.content.slice(6);\r\n\r\n\tif (price < 20)\r\n\t{\r\n\t\treceivedMessage.channel.send('Потратить можно только не менее 20-ти Юнитов!');\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (price <= balanceUnits) // If there's enough money\r\n\t{\r\n\t\tvar item = await AddItem(receivedMessage, Math.floor(price / 2));\r\n\t\tawait SetBalance(authorID, balanceUnits - price); // Deduct money\r\n\t\treceivedMessage.channel.send('Покупка успешна, новый баланс ' + (balanceUnits - price) + ' Юнитов!'); // Show it was successful\r\n\t\treceivedMessage.channel.send(await GetItemString(receivedMessage, item, false, true, true));\r\n\t}\r\n\telse // If not enough funds\r\n\t{\r\n\t\treceivedMessage.channel.send('Недостаточно средств, нужно на ' + (price - balanceUnits) + 'Ю больше!'); // Show there was not enough funds\r\n\t}\r\n}", "function buyItem(user){\n return user\n}", "function buy()\n{\n\t//query the databse for all items being sold\n\tconnection.query(\"SELECT * FROM products\", function(err, res)\n\t{\n\t\t\n\t\tif(err) throw err;\n\n\t\t//Prompt the user to input data\n\t\tinquirer.prompt([\n\n\t\t\t{\n\t\t\t\t//Ask for id of the product the user wants to buy\n\t\t\t\tname: \"id\",\n\t\t\t\ttype: \"list\",\n\t\t\t\tchoices: function()\n\t\t\t\t{\n\t\t\t\t\tvar idChoiceArray = [];\n\n\t\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t//push all items_ids into (idChoiceArray) in order to display all ids to choose from\n\t\t\t\t\t\t//NOTE: For rawlist cannot use type(INT) only (string) hence convert int to string by JSON.stringify\n\t\t\t\t\t\tidChoiceArray.push(JSON.stringify(res[i].item_id));\n\t\t\t\t\t}\n\n\t\t\t\t\t//display all item_id's to choose from\n\t\t\t\t\treturn idChoiceArray;\n\t\t\t\t},\n\t\t\t\tmessage: \"Enter the id of the product you want to purchase\"\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t//Ask customer for how many units they'd like to buy\n\t\t\t\ttype: \"input\",\n\t\t\t\tname: \"quantity\",\n\t\t\t\tmessage: \"How many units would you like to buy?\"\n\t\t\t}\n\n\t\t\t]).then(function(answer)\n\t\t\t{\n\t\t\t\t//get the entire item object & store in variable\n\t\t\t\tvar chosenItem;\n\n\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t{\n\t\t\t\t\t//if id == user id choice then store entire object\n\t\t\t\t\tif(res[i].item_id === parseInt(answer.id) )\n\t\t\t\t\t{\n\t\t\t\t\t\tchosenItem = res[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t//call the checkQuantity function & update the table if the quantity entered is sufficient\n\t\t\t\tcheckQuantity(chosenItem, answer, err);\n\n\t\t\t});\n\n\t});\n}", "function checkBuy() {\n\tif (money <= 99) {\n\t\t$('#alerts').append(\"<br />You do not have enough\" + \"<br />\" + \"money to buy this item <br />\");\n\t} else {\n\t\tbuyItem();\n\t}\n}", "function purchase(itemId, neededQuant) {\n connection.query(`SELECT * FROM products WHERE id = ${itemId}`, function (err, res) {\n if (err) throw err;\n if(res[0].stock_quantity < neededQuant) {\n console.log(\"Insufficient stock! Sorry. Please check again.\")\n } else {\n connection.query(`UPDATE products SET stock_quantity = ${res[0].stock_quantity} - ${neededQuant} WHERE id = ${itemId}`);\n //sets price to a variable for easy use\n var total = res[0].price * neededQuant;\n console.log(`\nYour total today comes up to ${total}. Thank you for shopping and please come again.\n `)\n }\n connection.end();\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}", "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}", "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 buyEggStock() {\r\n\tdemand += 0.001;\r\n\teggs++;\r\n\tgold -= currentEggPrice;\r\n\r\n\tcheckAllPrices();\r\n\taddEggs();\r\n\taddGold();\r\n}", "function buyItem () {\n inquirer.prompt([\n {\n type:\"input\",\n name:\"itemSelected\",\n message:\"Please type an item id to purchase.\"\n },\n {\n type:\"input\",\n name:\"quantity\",\n message:\"How many would you like to purchase?\"\n }\n ]).then(function (results) {\n itemSelected = results.itemSelected;\n quantity = Number(results.quantity);\n \n if (itemSelected > 10) {\n console.log(\"Invalid item, please select a new item.\")\n buyItem();\n }\n \n checkItemStock();\n });\n}", "function buyUpgrade(array, arrayItem) {\r\n\tsubtractGold(arrayItem.cost);\r\n\tarrayItem.level++;\r\n\tarrayItem.cost = Math.pow(arrayItem.multiplier, arrayItem.level) * arrayItem.baseCost;\r\n\r\n\tcheckAllPrices();\r\n\tdrawSkyScraperItem(arrayItem);\r\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 getAndSetSellingPriceforEachItem()\r\n{\r\n\tvar submittedItemRecord = 0;\r\n\r\n\ttry\r\n\t{\r\n\t\t//if items are available\r\n\t\tif(itemRecords != null)\r\n\t\t{\r\n\r\n\r\n\t\t\t//looping through each item record\r\n\t\t\tfor(var itemIndex = 0; itemIndex <= itemRecords.length; itemIndex++)\r\n\t\t\t{\r\n\t\t\t\titemCausedError = false;\r\n\t\t\t\tnlapiLogExecution('audit', 'context.getRemainingUsage()', context.getRemainingUsage());\r\n\r\n\t\t\t\tif(context.getRemainingUsage() <= scriptUsageLimit || (itemIndex == itemRecords.length))\r\n\t\t\t\t{\r\n\t\t\t\t\tnlapiLogExecution('audit', 'rescheduling context.getRemainingUsage()', context.getRemainingUsage());\r\n\r\n\t\t\t\t\t//reschedule this script.\r\n\t\t\t\t\tnlapiScheduleScript(context.getScriptId(), context.getDeploymentId());\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\titemIntID = itemRecords[itemIndex].getValue(itemColumns[0]);\t\t\t\t//getting Item's internal id\r\n\t\t\t\t\titemType = itemRecords[itemIndex].getRecordType();\t\t\t\t\t\t\t//getting Item's type\r\n\t\t\t\t\tbasePrice = itemRecords[itemIndex].getValue(itemColumns[1]);\t\t\t\t//getting Item's base price\r\n\t\t\t\t\titemName = itemRecords[itemIndex].getValue(itemColumns[2]);\t\t\t\t\t//getting Item's name\r\n\t\t\t\t\tvolumetricWeight = itemRecords[itemIndex].getValue(itemColumns[4]);\t\t\t//getting Item's volumetric weight\r\n\t\t\t\t\tdimension1 = itemRecords[itemIndex].getValue(itemColumns[6]);\t\t\t\t//getting Item's dimension1\r\n\t\t\t\t\tdimension2 = itemRecords[itemIndex].getValue(itemColumns[7]);\t\t\t\t//getting Item's dimension2\r\n\t\t\t\t\tdimension3 = itemRecords[itemIndex].getValue(itemColumns[8]);\t\t\t\t//getting Item's dimension3\r\n\r\n\t\t\t\t\t//if the item is a Kit/package (Reason : kit package has no standard average cost, hence a custom field has been used)\r\n\t\t\t\t\tif(itemType == 'kititem')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taverageCost = itemRecords[itemIndex].getValue(itemColumns[5]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse //if the item is not a kit/package \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taverageCost = itemRecords[itemIndex].getValue(itemColumns[3]);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(averageCost == '')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taverageCost = 0.1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//The item price calculation is done only for following item types \r\n\t\t\t\t\t//(Reason : the multi - currency,multi - pricing and quantity pricing is affecting the following types of items )\t\t\t\r\n\t\t\t\t\t//switch (itemType) \r\n\t\t\t\t\t//{\r\n\t\t\t\t\t//case 'inventoryitem':\r\n\t\t\t\t\t//case 'kititem':\r\n\t\t\t\t\t//case 'noninventoryitem':\r\n\t\t\t\t\t//\tcase 'otherchargeitem':\r\n\t\t\t\t\t//case 'paymentitem':\r\n\r\n\t\t\t\t\t// NOTE : (basePrice != null) is not working\r\n\t\t\t\t\t//if those records are not empty (NOTE : Without those the SOAP request will not work)\r\n\t\t\t\t\tif(basePrice != '' && (dimension1 != '' && dimension2 != '' && dimension3 != '' && volumetricWeight != '')) \t\t\t\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbasePrice = convertToFloat(basePrice);\t\t\t\t//converting the base price to float value with two decimal points\r\n\r\n\t\t\t\t\t\titemRecord = nlapiLoadRecord(itemType,itemIntID);\t//loading the particular item record\r\n\r\n\t\t\t\t\t\tgetPriceLevelAndCurrencyRateForEachDestination();\t//calling the getPriceLevelAndCurrencyRateForEachDestination function\r\n\r\n\t\t\t\t\t\t//if no error in creating shipping lookup record\r\n\t\t\t\t\t\tif(submittedShippingLookupRecord >0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//update the field\r\n\t\t\t\t\t\t\titemRecord.setFieldValue('custitem_itemprice_lastupdated', nsToday);\r\n\t\t\t\t\t\t\titemCausedError = false;\r\n\t\t\t\t\t\t\t//submitting the item record after setting all the item prices for each destination and for particular price levels \r\n\t\t\t\t\t\t\tsubmittedItemRecord = nlapiSubmitRecord(itemRecord);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\titemCausedError = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\titemCausedError = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//calling updateItemErrorFlag function\r\n\t\t\t\t\tupdateItemErrorFlag();\r\n\r\n\t\t\t\t\t//\tbreak;\r\n\t\t\t\t\t//}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler(\"getAndSetSellingPriceforEachItem : \" , e);\r\n\t} \r\n\r\n}", "handleBuyPress() {\n\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 buy() {\n // query the database for all items\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n // once you have the items, prompt the user for which they'd like to buy\n inquirer\n .prompt([\n {\n name: \"choice\",\n type: \"input\",\n message: \"Please input the ID# of the product you want to buy?\".bgGreen.white\n },\n {\n name: \"amount\",\n type: \"input\",\n message: \"How many would you like to buy?\".bgGreen.white\n }\n ])\n .then(function(input) {\n // get the information of the chosen item\n var item = input.choice;\n var quantity = input.amount;\n\n // Query db to confirm that the given item ID exists in the desired quantity\n var queryStr = 'SELECT * FROM products WHERE ?';\n\n connection.query(queryStr, {item_id: item}, function(err, data) {\n if (err) throw err;\n\n // If the user has selected an invalid item ID, data attay will be empty\n\n if (data.length === 0) {\n console.log('ERROR: Invalid Item ID. Please select a valid Item ID.'.bgCyan.white);\n buy();\n }\n \n else {\n var productData = data[0];\n\n // If the quantity requested by the user is in stock\n if (quantity <= productData.stock_quantity) {\n console.log(' '.bgGreen.white);\n console.log(' Congratulations, the product you requested is in stock! Placing order! '.bgGreen.white);\n console.log(' '.bgGreen.white);\n // Construct the updating query string\n var updateQueryStr = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE item_id = ' + item;\n // console.log('updateQueryStr = ' + updateQueryStr);\n\n // Update the inventory\n connection.query(updateQueryStr, function(err, data) {\n if (err) throw err;\n console.log('\\n Your total is: $' + productData.price * quantity);\n console.log(' ');\n console.log(\" \".bgMagenta.white)\n console.log(\" Thanks for shopping with Bamazon. \".bgMagenta.white)\n console.log(\" \".bgMagenta.white)\n // End the database connection\n connection.end();\n })\n } \n\n else {\n console.log(' '.bgRed.white);\n console.log(' That item is out of stock :( '.bgRed.white);\n console.log(' '.bgRed.white);\n console.log(' '.bgGreen.white);\n console.log(' Would you like to buy something else? '.bgGreen.white);\n console.log(' '.bgGreen.white);\n buy();\n }\n }\n })\n })\n\t\t\n });\n}", "function buyStorage() {\n if (AutoBuyStorage()) {\n var packMod = 1 + window.game.portal.Packrat.level * window.game.portal.Packrat.modifier;\n var Bs = {\n 'Barn': 'food',\n 'Shed': 'wood',\n 'Forge': 'metal'\n };\n for (var B in Bs) {\n if (window.game.resources[Bs[B]].owned > window.game.resources[Bs[B]].max * packMod * 0.9) {\n // debug('Buying ' + B + '(' + Bs[B] + ') at ' + Math.floor(window.game.resources[Bs[B]].owned / (window.game.resources[Bs[B]].max * packMod * 0.99) * 100) + '%');\n if (AutoBuyStorage() && window.canAffordBuilding(B)) {\n debug('Wanna buy ' + B);\n window.buyBuilding(B);\n window.tooltip('hide');\n }\n }\n }\n }\n }", "function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}", "function recordBuyone(e) {\n var stuff=this.getAttribute('href');\n var stuffs=stuff.substr(stuff.indexOf('?')+1).split('&');\n var item,price,store,hash,quant;\n for (var j=0;j<stuffs.length;j++) {\n var kv = stuffs[j].split('=');\n switch (kv[0]) {\n case 'whichitem':\n var s = kv[1];\n item = Math.floor(s/1000000000);\n price = s - item*1000000000;\n break;\n case 'whichstore':\n store = kv[1];\n break;\n case 'pwd':\n hash = kv[1];\n break;\n case 'quantity':\n quant = kv[1];\n break;\n }\n }\n if (!item || !price || !store || !hash || !quant)\n return true;\n // now find descid and item information\n var descitem='';\n var itemimage;\n var textdesc='thing';\n\n var p = this.parentNode;\n while(p && p.tagName!='TR')\n p = p.parentNode;\n if (p) {\n var me = p.rowIndex;\n while(p && p.tagName!='TABLE')\n p = p.parentNode;\n var rows=p.rows;\n for (me=me-1;me>=0;me--) {\n var row=p.rows[me];\n var imgs=row.getElementsByTagName('img');\n for (var i=0;i<imgs.length;i++) {\n var onc=imgs[i].getAttribute('onclick');\n if (onc) {\n descitem=onc.replace(/[a-z()]/g,'');\n itemimage=imgs[i];\n var pi = imgs[i].parentNode.nextSibling;\n if (pi) {\n var pia = pi.getElementsByTagName('A');\n textdesc = pia[0].innerHTML;\n }\n me=-1;\n break;\n } \n }\n }\n }\n // create the selling form\n createSellBar(item,price,quant,store,descitem,hash,itemimage,textdesc);\n var player = GM_getValue(\"currentPlayer\",\"\");\n // and record the purchase--bit optimistic, but no other solution\n if (player!=\"\")\n addNewAmount(player,quant*price,quant+\" \"+textdesc,store);\n return true;\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 placeBuyOrder (p) {\n\n}", "function postBuy() {\n game.global.buyAmt = preBuyAmt;\n game.global.firing = preBuyFiring;\n game.global.lockTooltip = preBuyTooltip;\n game.global.maxSplit = preBuymaxSplit;\n}", "function obtainItem() {\n if (itemObtainingOK) {\n //Is Thor next to an item?\n if (thor.nextToType == \"Item\") {\n //work out which item\n for (var i = 0; i < thor.currentTile.items.length; i++) {\n //find the item within the currentTile.items array\n if (thor.currentTile.items[i].id == thor.nextToID) {\n // increase health to 100 if powerup taken\n if (thor.nextToID == \"powerup\") {\n thor.health = 100;\n console.log(\"Yummy powerup!\");\n\n underText1 = \"Yummy powerup!\";\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n } else {\n //add it to Thors inventory\n thor.items.push(thor.currentTile.items[i]);\n console.log(thor.currentTile.items[i].name + \": added to Thors inventory\");\n underText1 = (thor.currentTile.items[i].name + \": added to Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n //change NPC chat if required, loop through each and update a required\n for (var k = 0; k < thor.currentTile.npcs.length; k++) {\n if (typeof thor.currentTile.npcs[k].dialogueList[1] !== 'undefined') {\n thor.currentTile.npcs[k].currentDialogue = thor.currentTile.npcs[k].dialogueList[2];\n thor.currentTile.npcs[k].chatPosition = 0;\n }\n }\n //if its a key, unlock door key is for\n if (thor.currentTile.items[i].id == \"key\") {\n thor.currentTile.items[i].unlocks.locked = false;\n }\n }\n\n //remove it from the current tile\n thor.currentTile.items.splice(i, 1);\n\n //enable inventory to be shown directly after pick up, without need to move\n thor.nextToID = \"nothing\";\n thor.nextToType = \"nothing\";\n\n //No need to complete redundent cycles of for loop\n break;\n\n }\n }\n }\n //Is Thor next to an NPC?\n else if (thor.nextToType == \"NPC\") {\n //work out which NPC\n for (var j = 0; j < thor.currentTile.npcs.length; j++) {\n //find the npc within the currentTile.items array\n if (thor.currentTile.npcs[j].id == thor.nextToID) {\n //does the NPC have a questItem\n\n if (thor.currentTile.npcs[j].questItem === undefined) {\n console.log(thor.currentTile.npcs[j].name.toUpperCase() + \": Sorry, nothing to give you, onwards with your quest!\");\n underText1 = (thor.currentTile.npcs[j].name.toUpperCase() + \": Sorry, nothing to give you, onwards with your quest!\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n //NPC - nothing to give convo\n } else if (thor.items.indexOf(thor.currentTile.npcs[j].questItem) == -1) {\n //if Thor doesn't already have item, add the whole object\n thor.items.push(thor.currentTile.npcs[j].questItem);\n console.log(thor.currentTile.npcs[j].questItem.name + \": added to Thors inventory\");\n underText1 = (thor.currentTile.npcs[j].questItem.name + \": added to Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n if (thor.currentTile.npcs[j].questItem.id == \"key\") {\n //console.log(\"State 1: \" + thor.currentTile.npcs[j].questItem.id); \t\t\t\t\t\n thor.currentTile.npcs[j].questItem.unlocks.locked = false;\n //console.log(\"State 2: \" + thor.currentTile.items[m].unlocks.locked);\t \n }\n\n\n /*\n \t\t\t\tconsole.log(\"current tile id: \" +thor.currentTile.id + \" length: \" + thor.currentTile.items.length);\n //if thor is being given a key, unlock door{\n \t\t\tfor (var m = 0; m < thor.currentTile.items.length; m++) { \t\n \t\t\t\tconsole.log(\"All items: \" + thor.currentTile.items[m].id);\n \tif (thor.currentTile.items[m].id == \"key\") {\n \t\t\t\t\tconsole.log(\"State 1: \" + thor.currentTile.items[m].unlocks.locked);\n \t thor.currentTile.items[m].unlocks.locked = false;\n \t\t\t\t\tconsole.log(\"State 2: \" + thor.currentTile.items[m].unlocks.locked);\t \n \t }\n }\n */\n\n\n\n //Updating the NPC's conversation array based on\n if (thor.currentTile.npcs[j].convoStatus == \"Initial\") {\n //Make sure the NPC has a secondary conversation set up, if so use it\n if (thor.currentTile.npcs[j].dialogueList.length > 1) {\n //Move the array to point to the next item\n thor.currentTile.npcs[j].currentDialogue = thor.currentTile.npcs[j].dialogueList[1];\n //start at the beginning of the array\n thor.currentTile.npcs[j].chatPosition = 0;\n //Update NPC for next convo\n thor.currentTile.npcs[j].convoStatus = \"Given\";\n }\n }\n /*\n else if (convoStatus == \"Given\" && thor.currentTile.npcs[i].id == <specificNPC> ){\n Specific use cases for setting NPC conversation can be put in here\n }\n */\n } else {\n console.log(thor.currentTile.npcs[j].questItem.name + \": already in Thors inventory\");\n underText1 = (thor.currentTile.npcs[j].questItem.name + \": already in Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n }\n\n //No need to complete redundent cycles of for loop\n break;\n }\n }\n } else if (thor.nextToType == \"Obstacle\") {\n //Work out which obstacle\n //The Obstacle array contains wall obstacles as well as game obstacles\n //Need to filter out the wall obstacles\n var replacementObstacleArray = [];\n for (var a = 0; a < thor.currentTile.obstacles.length; a++) {\n if (thor.currentTile.obstacles[a].id != \"wall\") {\n replacementObstacleArray.push(thor.currentTile.obstacles[a]);\n }\n }\n for (var m = 0; m < replacementObstacleArray.length; m++) {\n\n //find the npc within the currentTile.items array\n if (replacementObstacleArray[m].id == thor.nextToID) {\n //does the obstacle have a questItem\n if (replacementObstacleArray[m].questItem === undefined) {\n console.log(\"I'm a mere obstacle, move along!\");\n } else if (thor.items.indexOf(replacementObstacleArray[m].questItem) == -1) {\n //if Thor doesn't already have item, add the whole object\n thor.items.push(replacementObstacleArray[m].questItem);\n console.log(replacementObstacleArray[m].questItem.name + \": added to Thors inventory\");\n underText1 = (replacementObstacleArray[m].questItem.name + \": added to Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n } else {\n console.log(replacementObstacleArray[m].questItem.name + \": already in Thors inventory\");\n underText1 = (replacementObstacleArray[m].questItem.name + \": already in Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n }\n\n //No need to complete redundent cycles of for loop\n break;\n }\n }\n } else if (thor.nextToType == \"PuzzlePeice\") {\n\n //Is Thor next to an puzzle Obstacle?\n if (thor.nextToType == \"PuzzlePeice\" && !thor.currentTile.PuzzleComplete) {\n //work out which obstacle\n for (var i = 0; i < thor.currentTile.PuzzlePeices.length; i++) {\n //find the item within the currentTile.items array\n if (thor.currentTile.PuzzlePeices[i].id == thor.nextToID) {\n\n //If a colour is defined in original instantiation of object, it is assumed colour is to be cycled\n if (thor.currentTile.PuzzlePeices[i].colour != undefined) {\n thor.currentTile.PuzzlePeices[i].colour = thor.currentTile.PuzzlePeices[i].allPossibleVals[thor.currentTile.PuzzlePeices[i].puzzlePointer];\n } else if (1 === 0) {\n //A deliberate false above as this is just a placeholder for expected future code.\n //This is the code to cater for cycling images if puzzle obstacle instantiated with an image.\n }\n\n\n if (thor.currentTile.PuzzlePeices[i].puzzleCompleteVal == thor.currentTile.PuzzlePeices[i].allPossibleVals[thor.currentTile.PuzzlePeices[i].puzzlePointer]) {\n thor.currentTile.PuzzlePeices[i].puzzleSuccess = true;\n //Now go over all of the title puzzle items, if they are all set correctly then perform action!\n var puzzleCompleted = true;\n for (var j = 0; j < thor.currentTile.PuzzlePeices.length; j++) {\n if (thor.currentTile.PuzzlePeices[j].puzzleSuccess === false) {\n puzzleCompleted = false;\n }\n }\n\n\n if (puzzleCompleted) {\n thor.currentTile.PuzzleComplete = true;\n //console.log(\"PUZZLE COMPLETED! - KICKING OFF SUPPLIED PUZZLE FUNCTION!\");\n\n //Wall alert flash to let player know puzzle complete\n var backgroundAlert = thor.currentTile.colour;\n thor.currentTile.colour = \"#ffff\";\n window.setTimeout(function(){\n thor.currentTile.colour = backgroundAlert;\n }, 250);\n\n //Is an item being placed?\n if (thor.currentTile.hasOwnProperty(\"itemToPlace\")) {\n thor.currentTile.targetMapTile.items.push(thor.currentTile.itemToPlace);\n \n\n } \n //Does NPC chat need to be updated?\n if (thor.currentTile.hasOwnProperty(\"newChatNPC_id\")) {\n //find out which NPC\n for (var k = 0; k < thor.currentTile.npcs.length; k++) {\n if (thor.currentTile.npcs[k].id == thor.currentTile.newChatNPC_id) {\n thor.currentTile.npcs[k].currentDialogue = thor.currentTile.npcs[k].dialogueList[2];\n //start any new dialogue from beginning, irrispective of where last one finished\n thor.currentTile.npcs[k].chatPosition = 0;\n }\n }\n } \n \n //Is key being issued? Then unlock the door on the given tile\n for (var m = 0; m < thor.currentTile.items.length; m++) {\n //if its a key, unlock door key is for\n if (thor.currentTile.items[m].id == \"key\") {\n thor.currentTile.items[m].unlocks.locked = false;\n }\n }\n }\n } else {\n //ensure that value is correct is used if user cycles past correct value\n thor.currentTile.PuzzlePeices[i].puzzleSuccess = false;\n }\n\n //If the puzzle is complete then don't let obstacles cycle through anymore\n if (!thor.currentTile.PuzzleComplete) {\n thor.currentTile.PuzzlePeices[i].puzzlePointer += 1;\n\n //Ensure the pointer doesn't get incremented beyond array length\n if (thor.currentTile.PuzzlePeices[i].puzzlePointer == (thor.currentTile.PuzzlePeices[i].allPossibleVals.length)) {\n thor.currentTile.PuzzlePeices[i].puzzlePointer = 0;\n }\n }\n\n //No need to complete redundent cycles of for loop\n break;\n }\n }\n }\n //Not near anything? Then just list inventory.\n else {\n //As the thor items is list of objects, need to iterate through and add names to a new array to be output\n\n var thorInventoryOutput = [];\n for (var k = 0; k < thor.items.length; k++) {\n thorInventoryOutput.push(thor.items[k].name);\n }\n console.log(\"Thor's Swag Bag: \" + thorInventoryOutput);\n\n }\n }\n itemObtainingOK = false;\n}\n}", "'BUY_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 // If item already exists then add to its quantity\n if (record) {\n \n record.quantity += quantity;\n \n }\n \n // If item is not in the array then add it\n else { state.shrimpInventoryData.push({\n \n id: shrimpId,\n \n quantity: quantity\n \n });\n }\n \n // Updates funds when an item is purchased\n state.funds -= shrimpPrice * quantity;\n \n }", "function buyButtonClickHandler(evt) {\r\n\t evt.preventDefault();\r\n\t var id = product.selectedVariant.id;\r\n\t var quantity;\r\n\t var cartLineItem = findCartItemByVariantId(id);\r\n\r\n\t quantity = cartLineItem ? cartLineItem.quantity + 1 : 1;\r\n\r\n\t addOrUpdateVariant(product.selectedVariant, quantity);\r\n\t setPreviousFocusItem(evt.target);\r\n\t $('#checkout').focus();\r\n\t }", "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}", "async forceSell(item, quantity) {\n const res = await this.client.action(\"forceSell\", {\n itemName: item,\n quantity: quantity,\n storeName: this.store,\n });\n if (res.success) {\n this.editCache(item, quantity);\n await this.client.update(res.playerStringified);\n }\n return { success: res.success, msg: res.msg };\n }", "function buyProducts(id, quantity)\n {\n connection.query(\"SELECT * FROM products WHERE item_id = \"+id,\n function(err, res) \n {\n if (err) throw err;\n if(quantity > res[0].stock_quantity)\n {\n console.log(\"Quantity Requested: \"+quantity);\n console.log(\"Quantity In Stock: \"+res[0].stock_quantity);\n console.log(\"SORRY! We don't have enough to fill your order\");\n connection.end();\n }\n else\n {\n var inventory = parseInt(res[0].stock_quantity) - quantity;\n var newid = res[0].item_id;\n var newname = res[0].product_name;\n console.log(\"Product name: \"+newname+ \" , Product ID: \"+newid);\n\n console.log(\"Stock Inventory BEFORE your Purchase: \"+res[0].stock_quantity);\n console.log(\"Units you are purchasing: \"+quantity);\n console.log(\"Stock Inventory AFTER your Purchase: \"+inventory);\n updateQuantity(res[0].stock_quantity, newid, inventory );\n priceIt(quantity, res[0].price);\n } \n });\n }", "function BUYPOTIONSMove(p) {\r\n if (CoreState.state == \"Battle\") {PlanStack.push({op:\"WINBATTLE\"}); return;}\r\n if (GameState.FrameNum % RT) {return;}\r\n if (TownState.state == \"\") {SeekName(TownMenu,\"Buy Items\");}\r\n if (TownState.state == \"BuyItem\") {\r\n SeekCursor(BuyitemMenu,1);\r\n if (GameState.Stats.Gold <= p.target) {PlanStack.pop(); return;}\r\n }\r\n}", "buyProduct(product) {\n if (product.price > this.game.mario.coins) {\n this.notify('Not enough money', 'negative');\n return false;\n }\n\n this.game.mario.coins -= product.price;\n this.game.mario[product.item] += +product.qty;\n this.notify(`Bought ${product.qty} x ${product.item}`, 'positive');\n\n this.game.mario.updateWeight();\n this.refreshStats();\n return true;\n }", "getMarketItems() {\n return [\n {\n action: \"Deposit Gold\",\n cost: 10,\n info: \"Deposits remaining gold in the bank. Gain 1% interest every 5 adventure days.\",\n onBuy: (ns) => {\n ns.message = \"You deposit \" + ns.gold + \" gold into your bank account.\"\n ns.bank += ns.gold;\n ns.gold = 0; \n return ns;\n },\n },\n {\n action: \"Healing Potion\",\n cost: 2 * ((5 * (this.state.potion + 1)) ** 2),\n info: \"Carry +1 Potion that gets spent to prevent defeat and recovers 25% of your Health.\",\n onBuy: (ns) => {\n ns.message = \"You aquire a Healing Potion. It will be used automatically when needed.\"\n ns.potion++;\n return ns;\n },\n },\n {\n action: \"Purchase Sword\",\n cost: ((this.state.sword || 0) + 1) * 50,\n info: \"Grants +1 Sword, which increases damage per round. Upkeep +\" + \n (this.state.sword) * 2 + \".\",\n onBuy: (ns) => {\n ns.message = \"You buy a new armor. Gain +1 Armor.\"\n ns.upkeep += ++ns.armor * 5;\n ns.hp = ns.hpMax += 2;\n return ns;\n },\n },\n {\n action: this.state.armor < 1 ? \"Purchase Armor\" : \"Improve Armor\",\n cost: ((this.state.armor || 0) + 1) * 200,\n info: \"Grants +1 Armor, which prevents some damage per round, and +2 Health. Upkeep +\" + \n ((this.state.armor || 0) + 1) * 5 + \".\",\n onBuy: (ns) => {\n ns.message = \"You buy a new sword. Gain +1 Sword.\"\n ns.upkeep += ns.sword++ * 2;\n return ns;\n },\n },\n {\n action: this.state.mount < 1 ? \"Purchase Mount\" : \"Train Mount\",\n cost: ((this.state.mount || 0) + 1) * 500,\n info: \"Skip rooms with \" + \n (this.state.mount ? this.state.mount + \" encounters or less\" : \"no encounters\") + \n \". Reduced travel time. Upkeep +\" + ((this.state.armor || 0) + 1) * 4 + \".\",\n onBuy: (ns) => {\n ns.message = \"You \" + (ns.mount ? \"train your \" : \"buy a new\") + \" mount.\";\n ns.upkeep += ++ns.mount * 4;\n return ns;\n },\n },\n {\n action: \"Improve Lifestyle\",\n cost: ((this.state.regen * 100) ** 2),\n info: \"Grants +0.5 Regen, and +1 Health per Level.\",\n onBuy: (ns) => {\n ns.message = \"You improve your lifestyle, gain +0.5 Regen and +\" + ns.lv + \" Health\";\n ns.regen += 0.5;\n ns.hpBonus++;\n ns.hpMax += ns.lv;\n return ns;\n }\n },\n ];\n }", "function pickUpItem(tempItem){\n if(bagInventory.length < bagSize) {\n var item = { \"Description\": tempItem.description, \"ItemName\": tempItem.itemName, \"ItemType\":tempItem.itemType, \"Attribute\":tempItem.attributeNumber,\"BagImage\":tempItem.bagImage };\n bagInventory.push(item);\n tempItem.destroy();\n }else{\n //todo: the bag is full, display a message to let the player know they need to drop/ use something to empty a spot.\n console.log('bag is full, drop or use a held item to add this item.');\n }\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 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}", "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 itemLoaded(event) {\n BD18.loadCount--;\n if (BD18.doneWithLoad === true && BD18.loadCount <= 0) {\n BD18.stockMarket = new StockMarket(BD18.mktImage,BD18.bx.market);\n makeTrays();\n makeMktTokenList();\n canvasApp();\n delayCheckForUpdate();\n }\n}", "takeItem(item) {\n if (!item) return false;\n this.inventory.addItem(item);\n return true;\n }", "function purchase() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.table(res);\n inquirer.prompt([{\n name: \"itemId\",\n type: \"number\",\n message: \"Enter the item ID of the item you want to buy.\".brightYellow\n },\n {\n name: \"itemQuantity\",\n type: \"number\",\n message: \"Excellent Choice! How many would you like?\".brightYellow\n }]).then(function (answer) {\n saleItem = answer.itemId - 1;\n saleQuantity = answer.itemQuantity;\n checkInv()\n\n });\n\n });\n\n}", "function addItemToCart() {}", "function addItemToCart() {}", "function purchasedItem(listItem) {\n listItem.hide();\n purchased.append(listItem);\n listItem.show('slow');\n }", "bag(currentPlayer, channel, itemName){\n if(itemName){\n let item = this.utils.resolveNamable(itemName, currentPlayer.inventory.items)\n if(item){\n channel.send(`**${item.name.name}:**\\n`+\n `\\`\\`\\`${item.description}\\`\\`\\``\n ).catch(err =>{\n console.error(err);\n })\n return;\n }\n }\n let answer = `You have **${currentPlayer.inventory.gold}** gold in your inventory, as well as:\\n`\n currentPlayer.inventory.items.forEach(item => {\n answer += `*-${item.name.name}*\\n`\n })\n channel.send(answer).catch(err =>{\n console.error(err);\n })\n }", "function marketSell () {\n}", "function buyItem(item){\r\n var playerMoney = parseInt($('#pMoney').text());\r\n var playerHealth = parseInt($('#pHealth').text());\r\n switch(item){\r\n case 'potion':\r\n playerMoney -= 5;\r\n playerHealth += 10;\r\n $('#pMoney').html(playerMoney);\r\n $('#pHealth').html(playerHealth);\r\n break;\r\n case 'bronzeChain':\r\n playerMoney -= (100 - parseInt($('#aValue').text));\r\n $('#aName').html(\"Bronze Chainmail\");\r\n $('#aDef').html(10);\r\n $('#aValue').html(25);\r\n $('#playerMoney').html(playerMoney);\r\n break;\r\n case 'longsword':\r\n playerMoney -= (75 - parseInt$('#wValue').text());\r\n $('#wName').html(\"LongSword\");\r\n $('#wAtk').html(10);\r\n $('#wValue').html(18);\r\n $('#pMoney').html(playerMoney);\r\n break;\r\n }\r\n checkIfCanBuy();\r\n}", "function buyClickUpgrade(clickItem) {\n\n\n //console.log(`You purchased a(n) ${clickItem}`);\n\n player.clickInventory.push(clickUpgrades[clickItem]);\n\n //console.log(player.clickInventory);\n\n\n\n //find price\n /*\n let inv = player.clickInventory.filter(item => {\n console.log(player.clickInventory)\n console.log(item.name);\n console.log(clickItem);\n return item.name === clickItem;\n });\n */\n\n //console.log(`the inventory for ${clickItem} is ${inv}`);\n\n //update quantity and price of item\n clickUpgrades[clickItem].quantity++;\n\n let quantity = clickUpgrades[clickItem].quantity;\n\n //console.log(`The current quantity of ${clickItem}s is ${quantity}`);\n\n clickUpgrades[clickItem].newprice *= clickUpgrades[clickItem].multiplier;\n\n clickUpgrades[clickItem].newprice =\n Math.round(clickUpgrades[clickItem].newprice);\n\n let price = clickUpgrades[clickItem].price;\n let newprice = clickUpgrades[clickItem].newprice;\n\n //console.log(`The price of a ${clickItem} is ${clickUpgrades[clickItem].price}`);\n //console.log(`The new price of a ${clickItem} is ${clickUpgrades[clickItem].newprice}`);\n\n player.currentCheeseBricks -= price;\n players[0].currentCheeseBricks = player.currentCheeseBricks;\n\n document.getElementById('input-tc').value =\n player.currentCheeseBricks;\n //console.log(`in buyClickUpgrade player.cheeseBricks = ${player.cheeseBricks}`);\n\n switch (clickItem) {\n case ('shovel'):\n document.getElementById('i-shovel-count').value = quantity;\n document.getElementById('i-shovel-price').value = newprice;\n break;\n case ('excavator'):\n document.getElementById('i-excavator-count').value = quantity;\n document.getElementById('i-excavator-price').value = newprice;\n break;\n\n default:\n break;\n }\n\n\n\n turnButtonsOnOff();\n updatePrices();\n saveClickUpgrades(); //saves clickUpgrade to local storage\n savePlayer(); //any player updates are stored such as number of cheeseBricks\n\n}", "function buyItems(name, amt, price) {\n //finally works!!!!\n let exist = playerInv.some(playerInv => playerInv.name === name);\n if (exist === false) {\n if (player.money >= price) {\n player.money -= price;\n player.playerInv += 1; //add to player bag\n playerInv.push({\n //add item to the player inventory if it doesn't exist\n name: name,\n amount: amt\n });\n player.invNum += 1; //testing removal and bagspace\n }\n } else {\n for (i = 0; i < playerInv.length; i++) {\n if (playerInv[i].name == name) {\n if (player.money >= price) {\n playerInv[i].amount += amt;\n player.money -= price;\n }\n }\n }\n }\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}", "async showConfirm() {\n const character = this.character;\n const buyItem = Items.new(this.info.item);\n\n // If item is equipment, and character already has the item equipped\n if (buyItem.equipType && character[buyItem.equipType].type === buyItem.type) {\n await this.updateLast({\n attachments: Attachments.one({\n title: \"You already own that!\",\n color: COLORS.WARNING\n }),\n doLook: true,\n });\n\n // If item is equipment, and character isn't high enough level to equip it\n }\n else if (buyItem.equipType && character.level < buyItem.level) {\n await this.updateLast({\n attachments: Attachments.one({\n title: `You're only level ${character.level}, and not high enough to equip that!`,\n color: COLORS.WARNING\n }),\n doLook: true,\n });\n\n // If character can't afford the item\n }\n else if ( ! buyItem.canBePurchasedBy(character, this.info.quantity)) {\n await this.updateLast({\n attachments: Attachments.one({\n title: \":warning: You can't afford that.\",\n color: COLORS.WARNING\n }),\n doLook: true,\n });\n\n // If character can afford the item\n }\n else {\n const oldItem = character[buyItem.equipType];\n let actions = new Actions();\n let description = `Fantastic choice. And did you want to sell your old ${oldItem.getDisplayName(character)} for *${oldItem.getSellPriceDescription(character)}*`;\n actions.addButton(\"Sell\", COMMAND_NAME, { params: { action: ACTION_BUY, item: this.info.item, confirm: CONFIRM_SELL }});\n\n if (character.equipment.hasFreeSlot(buyItem.equipType, character)) {\n description += \" or keep it\";\n actions.addButton(\"Keep\", COMMAND_NAME, { params: { action: ACTION_BUY, item: this.info.item, confirm: CONFIRM_KEEP }});\n }\n\n description += \"?\";\n actions.addButton(\"Cancel\", \"look\", { params: { resetDescription: \"true\" } });\n\n await this.updateLast({\n description,\n attachments: Attachments.one({\n actions,\n fields: character.getFields(),\n color: COLORS.INFO\n })\n });\n }\n }", "'BUY_STOCK' (state, {stockId, quantity, stockPrice}) {\n // check to see if I already own the stock, to increase instead of create\n const record = state.stocks.find(element => element.id === stockId);\n if (record) {\n record.quantity += quantity;\n } else {\n let currentStock = { id: stockId, quantity: quantity };\n state.stocks.push(currentStock);\n }\n state.funds -= stockPrice * quantity;\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 onBuy (event) {\n event.preventDefault();\n var productObj = getProductObj(this.id, products);\n postMiniCart(productObj);\n }", "async _sell() {\n\t\tif (this.state.items_to_sell.length < 1) {\n\t\t\tLogging.warn('Nothing to sell?');\n\t\t\treturn;\n\t\t}\n\n\t\tawait movement.pathfind_move('basics');\n\n\t\tfor (let item of this.state.items_to_sell) {\n\t\t\tconst index = Item.find(item);\n\t\t\tif (index !== -1) {\n\t\t\t\twindow.sell(index, item.q ?? 1);\n\t\t\t}\n\t\t}\n\n\t\tthis.state.items_to_sell = [];\n\t}", "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}", "do_buy(name) {\n var tt = this;\n var w = tt.world;\n\t//try to buy the tower\n if (w.buy_tower(this.yparent, name)) {\n tt.remove_children();//remove buy btns\n this.tower_stats();//show tower stats\n this.phase = \"stats\";//change state (also disables buy btns)\n } else {\n return;//failed to buy (not enough credits)\n }\n\n tt.hide();\n }", "static sellItem(data = null, itemID) {\n if (data !== null) {\n if (!data.error) {\n swal('Success!', 'Sucessfully sold your Item!', 'success')\n equipment.reload();\n } else {\n swal('Error!', data.error_msg, 'error');\n equipment.reload();\n }\n } else {\n $(\".loading-screen\").show();\n let params = {\n 'ITEM_ID': itemID,\n };\n equipment.sendRequest('sellItem', 'sell_item', params);\n }\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}", "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 }", "vendItem(productIndex) {\n //check if valid\n let product = vm.products[productIndex]\n // IF Exists we have some you have enough money\n if (product && product.quantity > 0 && vm.currentTransaction >= product.price) {\n this.processTransaction(product)\n return JSON.parse(JSON.stringify(product))\n }\n return false\n }", "function checkIfAvailable() {\n // query bamazon DB for the entered item and available quantity\n connection.query(\"SELECT stock_quantity, product_name, price FROM products WHERE id=?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // if quantity entered is higher than quantity available, alert user there is insufficient stock then call viewAll function to start over\n else if (quantityToBuy > parseInt(res[0].stock_quantity)) {\n console.log(chalk.bgRed(\"Insufficient stock!\"));\n console.log('\\n*******************');\n viewAll();\n } else {\n // if quantity entered is equal or lower than quantity available, alert user of the purchase and total cost\n console.log(\"You successfully purchased \" + quantityToBuy + \" \" + res[0].product_name);\n console.log(chalk.bgYellow.red(\"The total cost was: $\" + (quantityToBuy * res[0].price)));\n console.log('\\n*******************');\n // call update Quantity function\n updateQuantity();\n }\n });\n}", "buy() {\n this.amount --;\n this.price ++;\n }", "async function SellItem(receivedMessage, index)\r\n{\r\n\tvar authorID = receivedMessage.author.id; // Get user's id\r\n\tconst AllItems = await Items.findAll({ where: { UID: authorID } }); // Get user's items\r\n\r\n\tif (index >= AllItems.length) // If the item index is out of bounds\r\n\t{\r\n\t\treceivedMessage.channel.send(\"Предмета под таким номером нет в вашем инвентаре!\"); // Say it's out of bounds\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (AllItems[index]) // If the item's ok\r\n\t{\r\n\t\tvar thisItem = AllItems[index]; // Put it in a variable for shits and giggles\r\n\t\tvar itemPrice = Math.floor(thisItem.price / 2); // Get its price\r\n\t\tvar balanceUnits = await GetBalance(authorID); // Get user's balance\r\n\r\n\t\tif (thisItem.place == 1)\r\n\t\t{\r\n\t\t\tif (await GetDataArray(\"defarg1\")[0] < await GetMechEnergy(receivedMessage))\r\n\t\t\t{\r\n\t\t\t\treceivedMessage.channel.send(\"У вашего меха не хватит энергоёмкости, не могу продать!\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (await GetDataArray(\"defarg2\")[0] < await GetMechWeight(receivedMessage))\r\n\t\t\t{\r\n\t\t\t\treceivedMessage.channel.send(\"У вашего меха не хватит грузоподъёмности, не могу продать!\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Successful sell\r\n\t\tawait thisItem.destroy(); // Remove the item\r\n\t\tawait SetBalance(authorID, balanceUnits + itemPrice); // Add the funds\r\n\t\treceivedMessage.channel.send('Успешно продано за ' + itemPrice + ' Юнитов, новый баланс - ' + (balanceUnits + itemPrice) + 'Ю!'); // Say it was successful\r\n\t}\r\n}", "function buyItem() {\n // prompt for info about the item being put up for auction\n inquirer.prompt([\n {\n name: \"quitOption\",\n type: \"input\",\n message: \"Would you would like to buy an item or quit?\",\n choices: [\"buy an item\", \"quit\"]\n }])\n .then(function (res) {\n console.log(res.quitOption);\n if (res.quitOption === \"quit\") {\n endBamazon()\n }\n else {\n inquirer.prompt([\n {\n name: \"name\",\n \n type: \"input\",\n message: \"What item would you buy?\"\n },\n {\n name: \"amount\",\n type: \"input\",\n message: \"How many would you like to purchase?\"\n }]).then(function (res) {\n var selection = res.name;\n var amount = parseInt(res.amount)\n connection.query(\"SELECT * FROM products WHERE name = ?\", [selection], function (err, response) {\n if (err) { throw err }\n console.log(response);\n if (amount > response[0].quantity) {\n console.log(\"That is more quantity than we currently have in stock. Please try again later.\")\n buyItem();\n }\n else {\n var newQuantity = response[0].quantity - amount;\n updateProducts(selection, newQuantity);\n buyItem();\n }\n })\n\n })\n }\n })\n\n}", "function buyRealestatestore(){\n\t\t\tbuyClick(\"realestatestore\");\n\t\t}", "function purchaseItem(quantity, id) {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: quantity--\n },\n {\n id: id\n }\n ],\n function (err, res) {\n // console.log(res);\n if (err) throw err;\n // console.log(\"Product updated.\");\n buyItem();\n }\n )\n return buyItem();\n\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 pickUpItem(item) {\n inventory.push(items[currentLocation].name);\n updateDisplay(\"Taken \" + items[currentLocation].name + \".\");\n items[currentLocation].isTaken = true;\n }", "function orderItem(id, quantNeeded) {\n connection.query('Select * FROM products WHERE item_id = ' + id, function(err,res){\n if(err){\n console.log(err);\n };\n if (quantNeeded <= res[0].stock_quantity)\n {\n var totalCost = res[0].price * quantNeeded;\n console.log(\"Sufficient quantity is available for your order.\");\n console.log(\"Total cost for \" + quantNeeded + \"s \" + res[0].product_name + \" is \" + totalCost);\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - \" + quantNeeded + \" WHERE item_id = \" + id);\n }\n else\n {\n console.log(\"We don't have that many \"+ res[0].product_name + \"s in stock!\")\n }\n productList();\n });\n}", "async showItemsForSale() {\n const character = this.character;\n\n let description = character.location.getDescription(character)\n + character.location.getShopDescription(character, this.info.type);\n\n let attachments = new Attachments().add({\n title: \"What do you want to buy?\",\n fields: character.getFields(),\n color: COLORS.INFO\n });\n\n [description, attachments] = this.getEquipmentForSale(character, description, attachments);\n [description, attachments] = this.getSpellsForSale(character, description, attachments);\n [description, attachments] = this.getItemsForSale(character, description, attachments);\n\n attachments.addButton(\"Cancel\", \"look\", { params: { resetDescription: \"true\" } });\n\n await this.updateLast({ description, attachments });\n }", "function buyThis(){\n inqurier.prompt([\n {\n message: \"What is the ITEM ID of the PRODUCT you would like to buy?\",\n name: \"id\"\n },\n { \n message: \"How many UNITS would you like to buy?\",\n name: \"purchase\",\n },\n ]).then(function(answer){\n //convert to integers\n var id = parseInt(answer.id);\n var quantity = parseInt(answer.purchase)\n\n //purcahse logic\n\n if (isNaN(answer.id) == true || id <=0 || id > resultArray.length) {\n //error message for invalid number entry \n console.log(\"Error: INVALID ITEM ID\")\n }\n else if (isNan(answer.purcahse) == true || quantity <= 0){\n //error for purchasing zero items\n console.log(\"You must order more than one\")\n }\n else if (quantity > resultArray[id -1].stock_quantity){\n //error for not enough stock \n console.log(\"WE ARE OUT OF THAT\")\n }\n else {\n //for a sucessful order\n purchaes.push(resultArray[id - 1].product_name);\n amounts.push(quantity);\n\n //total of curent order and total order\n var orderCost = quantity * resultArray[id-1].price;\n orderCost = parseFloat(orderCost.toFixed(2));\n total += orderCost;\n total = parseFloat(total.toFixed(2))\n\n sales = resultArray[id - 1].product_sales + orderCost;\n\n console.log(\"You have selected ITEM\" + id + \",\" + resultArray[id - 1].product_name + \".\" )\n console.log(\"This item costs $\" + resultArray[id - 1].price + \" per unit. You have ordered \" + quantity + \" units.\");\n console.log(\"This purchase costs $\" + orderCost + \".\");\n \n //display quantites and ordered as well as cost\n console.log(\"YOU HAVE ORDERED\")\n for (var i = 0; i < purchaes.length; i++){\n console.log(amounts[i] + \"|\" + purchaes[i]);\n }\n console.log(\"mYour total cost is \" + total + \".\");\n\n\t\t\t// query to update the database\n\t\t\tupdate = \"UPDATE products SET stock_quantity = \" + (resultArray[id - 1].stock_quantity - quantity) + \", product_sales = \" + sales + \" WHERE item_id = \" + id;\n\n\t\t\t// updates the database\n\t\t\tconnection.query(update, function (error, results, fields) {\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t};\n });\n keepGoing();\n }\n })\n}", "function checkPurchase(itemID, qty) {\n\n connection.query(\"SELECT * FROM products WHERE ?\",\n {\n id: itemID\n },\n function (err, res) {\n if (err) throw err;\n\n let stock = res[0].stock_quantity;\n let price = res[0].price;\n\n if (stock >= qty) {\n console.log(\"You can buy that!\");\n finalizePurchase(itemID, qty, stock, price);\n } else {\n console.log(\"There aren't enough units to purchase that! Let's start over...\");\n startPrompt();\n\n }\n\n });\n}", "function BuyPickaxe() {\n let price = clickUpgrades.pickaxes.price;\n if (cheese >= price) {\n cheese -= price;\n clickUpgrades.pickaxes.quantity++;\n clickUpgrades.pickaxes.price += Math.floor(price * 0.2);\n // Updates Rover Items\n document.getElementById('pickaxe-Count').innerText = clickUpgrades.pickaxes.quantity.toString();\n document.getElementById('pickaxe-Price').innerText = clickUpgrades.pickaxes.price.toString();\n update();\n } else {\n alert('You need more cheese');\n }\n}", "function gameBuySpecial(product, amount){\n if (gameSubtract(game[product.buyCurrency], (product.cost*amount)) ){\n gameAdd(game.notes, product.buys);\n } else {\n return false;\n }\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}" ]
[ "0.79187906", "0.79187906", "0.79187906", "0.79187906", "0.79187906", "0.79187906", "0.7769632", "0.75005263", "0.74575", "0.7396091", "0.7283617", "0.7227057", "0.7210392", "0.7182856", "0.71780926", "0.714833", "0.69720185", "0.6955359", "0.69443524", "0.69295746", "0.69281536", "0.69252545", "0.67973185", "0.6772886", "0.67128783", "0.6656298", "0.66219217", "0.6610221", "0.6589776", "0.6587238", "0.6583428", "0.6580714", "0.6578248", "0.65758073", "0.65723914", "0.6562445", "0.6556084", "0.653735", "0.652321", "0.649238", "0.648907", "0.64844894", "0.6481463", "0.6468336", "0.644988", "0.6447604", "0.6446383", "0.642446", "0.64124656", "0.6407483", "0.6405028", "0.63953924", "0.637212", "0.6370472", "0.636827", "0.6360631", "0.6358655", "0.6357917", "0.63528025", "0.6351919", "0.6351916", "0.63468957", "0.6342291", "0.6333849", "0.6326409", "0.6322201", "0.6315225", "0.6315225", "0.63124186", "0.6310634", "0.63045806", "0.63034683", "0.6302882", "0.62988454", "0.62977827", "0.6294929", "0.6292451", "0.6286094", "0.62842345", "0.627846", "0.6278155", "0.6246988", "0.6243985", "0.6237613", "0.62365097", "0.62232006", "0.6222648", "0.6220448", "0.6216433", "0.6213477", "0.62071216", "0.6202306", "0.62002474", "0.619905", "0.6196785", "0.61926955", "0.6179919", "0.61794853", "0.6163264", "0.6159356", "0.6156266" ]
0.0
-1
I have the entire history of Kim & what she did now, this doesnt look very pretty right now but I hope you can see that we have Kim initialy no purchases, nothing in the cart & all untill the end where she has purchases & right now she has still things in the cart because we havent capture history after we empty cart but we can go back in time now as an amazon employee I can go back in time & say where Kim made her purchases when she added things to the cart when we added taxes to the items now behind the scenes maybe amazon can create new functions like user state
function getUserState() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buyItem(user){\n amazonHistory.push(user)\n return Object.assign({}, user, { purchases: user.cart })\n}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function trackAddToCart() {\n EventBus.$on(\"productAddedToCart\", function(data) {\n var skuAddedToCart = data.sku;\n if ($.cookie(\"lsf-cartadds\") === undefined) {\n $.cookie(\"lsf-cartadds\", skuAddedToCart, {\n expires: 20 * 365,\n });\n } else if (!$.cookie(\"lsf-cartadds\").includes(skuAddedToCart)) {\n var currentVal = $.cookie(\"lsf-cartadds\");\n var newVal = skuAddedToCart + \",\" + currentVal;\n $.cookie(\"lsf-cartadds\", newVal, {\n expires: 20 * 365,\n });\n }\n });\n}", "function purchaseItem() {\n return\n}", "function currentQuantityCart() {\n\n}", "function finnishCustomerSession(){\n\n clearCart();\n updateCartTotal();\n\n currentCart = {};\n\n undostack = [];\n redostack = [];\n\n}", "function storingCartItem() {\n \n /**\n * TODO: Create Product Object\n */\n let cartItem = product;\n cartItem.quantity = 1;\n cartItem.lensOption = updatePersonalizedFeatures();\n\n /**\n * TODO: Get \"cartItems\" value \n */\n let cartItems = JSON.parse(localStorage.getItem('cartItems'));\n\n\n /**\n * TODO: Update \"cartItems\" value with new Product Object (Push to the Array)\n */\n cartItems.push(cartItem);\n localStorage.setItem('cartItems', JSON.stringify(cartItems));\n\n // update cart badge\n let cartItemsQuantity = document.getElementById('cartItemQuantity');\n cartItemsQuantity.style.display = \"inline-block\";\n updateCartBadge();\n \n /**\n * TODO: Further \"Add to cart\" stuff....\n */\n //goToCartPage();\n \n console.log(cartItems);\n\n}", "cartSaleItems(state){\n return state.cart.filter( item => {\n return (item.head.onSale || item.leftArm.onSale || item.torso.onSale || item.rightArm.onSale || item.base.onSale);\n })\n }", "function viewCart() {\n //console.log(cart)\n var message = \"In your cart, you have\";\n if (cart.length === 0) {\n console.log(\"Your shopping cart is empty.\")\n }\n else if (cart.length === 1) {\n console.log(message + \" \" + Object.keys(cart[0]) + \" at $\" + cart[0][Object.keys(cart[0])] + \".\")\n }\n else if (cart.length >= 2) {\n var items = []\n for (var i = 0; i < cart.length; i++) {\n var itemName = Object.keys(cart[i])\n var price = cart[i][itemName]\n items.push(itemName + \" at $\" + price)\n if (i != cart.length-1) {\n cart.length === 2 ? message += \" \" + items[i] : message += (\" \" + items[i] + \",\")\n }\n else {\n message += (\" and \" + items[i] + \".\")\n }\n }\n console.log(message)\n }\n}", "verifyCartPage() {\n let householdIndex = (global.updateDataJson.households.length === 0) ? 0 : global.updateDataJson.households.length-1;\n commonfunc.verifyCartDetails(global.updateDataJson.households[householdIndex].healthPlan, global.updateDataJson.households[householdIndex].dentalPlan);\n }", "getMarketItems() {\n return [\n {\n action: \"Deposit Gold\",\n cost: 10,\n info: \"Deposits remaining gold in the bank. Gain 1% interest every 5 adventure days.\",\n onBuy: (ns) => {\n ns.message = \"You deposit \" + ns.gold + \" gold into your bank account.\"\n ns.bank += ns.gold;\n ns.gold = 0; \n return ns;\n },\n },\n {\n action: \"Healing Potion\",\n cost: 2 * ((5 * (this.state.potion + 1)) ** 2),\n info: \"Carry +1 Potion that gets spent to prevent defeat and recovers 25% of your Health.\",\n onBuy: (ns) => {\n ns.message = \"You aquire a Healing Potion. It will be used automatically when needed.\"\n ns.potion++;\n return ns;\n },\n },\n {\n action: \"Purchase Sword\",\n cost: ((this.state.sword || 0) + 1) * 50,\n info: \"Grants +1 Sword, which increases damage per round. Upkeep +\" + \n (this.state.sword) * 2 + \".\",\n onBuy: (ns) => {\n ns.message = \"You buy a new armor. Gain +1 Armor.\"\n ns.upkeep += ++ns.armor * 5;\n ns.hp = ns.hpMax += 2;\n return ns;\n },\n },\n {\n action: this.state.armor < 1 ? \"Purchase Armor\" : \"Improve Armor\",\n cost: ((this.state.armor || 0) + 1) * 200,\n info: \"Grants +1 Armor, which prevents some damage per round, and +2 Health. Upkeep +\" + \n ((this.state.armor || 0) + 1) * 5 + \".\",\n onBuy: (ns) => {\n ns.message = \"You buy a new sword. Gain +1 Sword.\"\n ns.upkeep += ns.sword++ * 2;\n return ns;\n },\n },\n {\n action: this.state.mount < 1 ? \"Purchase Mount\" : \"Train Mount\",\n cost: ((this.state.mount || 0) + 1) * 500,\n info: \"Skip rooms with \" + \n (this.state.mount ? this.state.mount + \" encounters or less\" : \"no encounters\") + \n \". Reduced travel time. Upkeep +\" + ((this.state.armor || 0) + 1) * 4 + \".\",\n onBuy: (ns) => {\n ns.message = \"You \" + (ns.mount ? \"train your \" : \"buy a new\") + \" mount.\";\n ns.upkeep += ++ns.mount * 4;\n return ns;\n },\n },\n {\n action: \"Improve Lifestyle\",\n cost: ((this.state.regen * 100) ** 2),\n info: \"Grants +0.5 Regen, and +1 Health per Level.\",\n onBuy: (ns) => {\n ns.message = \"You improve your lifestyle, gain +0.5 Regen and +\" + ns.lv + \" Health\";\n ns.regen += 0.5;\n ns.hpBonus++;\n ns.hpMax += ns.lv;\n return ns;\n }\n },\n ];\n }", "function applyTaxToItems(user){\n const {cart}\n}", "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\n });\n }", "function buyRealestatestore(){\n\t\t\tbuyClick(\"realestatestore\");\n\t\t}", "function addItemToCart() {}", "function addItemToCart() {}", "function updateCart(flavors) {\n //Creating a variable to store the flavors selected.\n //If no flavors were selected (in the case of Single count), an empty array is created.\n var extraFlavors = flavors || [];\n var quantity=$('#product-qty').val(); \n var itemName=$('#product-name').text();\n if(extraFlavors.length) {\n itemName = itemName+\" - \"+extraFlavors.join(\", \");\n }\n var itemFound = false;\n //Iterate through the cart to see if the desired item exists already\n for(var i=0; i<cart.length; i++){\n //If the item already exists, update the quantity and subtotal\n if(cart[i].rollName === itemName){\n var existingQty = parseInt(cart[i].numQty);\n cart[i].numQty = parseInt(quantity) + existingQty;\n cart[i].subtotal = parseInt(cart[i].rollPrice) * parseInt(cart[i].numQty);\n //Update the changes in local storage\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n localStorage.setItem(\"cartCount\", cart.length);\n itemFound = true;\n break;\n }\n }\n //If the item doesn't exist yet, add the item\n if(!itemFound) {\n var itemImage=$('#roll-image').attr('src');\n var price=$('#product-price').text();\n var subtotal=parseInt(price)*parseInt(quantity);\n var bakeryRoll = new newCartItem(itemImage, itemName, quantity, price, subtotal);\n cart.push(bakeryRoll);\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n localStorage.setItem(\"cartCount\", cart.length);\n $('#cartCount').show();\n $('#cartCount').html(cart.length).css('display', 'block');\n }\n }", "handleAddCart(e, product){\n this.setState(state => {\n const cartItems = state.cartItems;\n let productAlreadyInCart = false;\n cartItems.forEach(item => {\n if(item.id === product.id){\n productAlreadyInCart= true;\n item.count++;\n }\n });\n if(!productAlreadyInCart){\n cartItems.push({...product, count:1});\n }\n localStorage.setItem(\"cartItems\",JSON.stringify(cartItems));\n return cartItems;\n })\n }", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "function buyUpdate(id, quantity) {\n var isDupicate = false;\n\n //checks to see if the item is already in the cart\n for (var i in cart) {\n\n if (cart[i].id == id) {\n //if the item is already in the cart, it adds the quantity of the purchase to the quantity already in the cart\n cart[i].quantity += parseInt(quantity);\n isDupicate = true;\n\n //removes the quantity from the amount in stock\n for (var j in stock) {\n if (cart[i].id == stock[j].ItemID) {\n stock[j].StockQuantity -= quantity;\n }\n }\n }\n }\n\n //if not already in the cart\n if (!isDupicate) {\n\n //find the id in the stock array\n for (var k in stock) {\n if (stock[k].ItemID == id) {\n //push the item to the cart\n cart.push({\n id: id,\n name: stock[k].ProductName,\n quantity: parseInt(quantity),\n price: stock[k].Price\n });\n //subtract the user quantity wanted from the quantity in stock\n stock[k].StockQuantity -= quantity;\n }\n }\n }\n\n //display the updated stock\n displayStock();\n //display the shopping cart\n shoppingCart();\n //prompt the user to continue shopping or checkout\n promptOptions();\n}", "function viewCart() {\nvar list = [];\nif (cart.length === 0) {\n return 'Your shopping cart is empty.'\n}\nfor (var i = 0; i < cart.length; i++) {\n\n if (cart.length === 1) {\n list.push(`In your cart, you have ${cart[0].itemName} at $${cart[0].itemPrice}.`) \n}\n\n else if (cart.length === 2) {\n list.push(`In your cart, you have ${getCart()[0].itemName} at $${getCart()[0].itemPrice}, and ${getCart()[1].itemName} at $${getCart()[1].itemPrice}.`)\n}\n\nelse{\n list.push(`In your cart, you have ${getCart()[0].itemName} at $${getCart()[0].itemPrice}, ${getCart()[1].itemName} at $${getCart()[1].itemPrice}, and ${getCart()[2].itemName} at $${getCart()[2].itemPrice}.`)\n}\nreturn list;\n}\n}", "function loadCart(){\n cart = JSON.parse(sessionStorage.getItem('revonicCart')); // fetching original object items using JSON parse. \n }", "function cartstate(state) {\n /*\n * = redundant and will be replaced / removed \n\n 1 = show cart product details\n 2 = show customer details screen\n 3 = customer detals back*\n 4 = custmer details pay click\n 5 = bitcoin details back click*\n 6 = shipping button clicked\n 7 = check payment result\n 8 = show lightning view\n */\n switch (state) {\n case 1:\n stopPaymentCheck()\n //hide the pay button\n hideClass(document.getElementById('sr-pay'));\n //hide the paid view\n hideClass(document.getElementById('sr-paid'));\n //hide the shipping view\n hideClass(document.getElementById('sr-shipping'));\n //hide the address\n hideClass(document.getElementById('sr-addresswrapper'));\n //hide the check out button\n showClass(document.getElementById('sr-checkout'));\n //hide btc stuff\n hideClass(document.getElementById('sr-bitcoinaddresswrapper'));\n //hide lightning view\n hideClass(document.getElementById('sr-lightningwrapper'));\n //hide the payment toggle, not necessary but may clear up some odd ux flows and costs us nothing. \n hideClass(document.getElementById('sr-choosepaymenttype'));\n //hide the customer details\n hideClass(document.getElementById('sr-customerdetailswrapper'));\n //hide back button\n hideClass(document.getElementById('sr-back-button'));\n //open it\n addClass(document.querySelector('.sr-cart-container'), 'cart-open');\n //show the product details\n showClass(document.getElementById('sr-cartlistitems'));\n break;\n case 2:\n //show the pay button\n showClass(document.getElementById('sr-pay'));\n //check address\n checkAddressState();\n //hide btc stuff\n hideClass(document.getElementById('sr-checkout'));\n //hide the product details\n hideClass(document.getElementById('sr-cartlistitems'));\n //show the customer details\n showClass(document.getElementById('sr-customerdetailswrapper'));\n showClass(document.getElementById('sr-back-button'));\n //hide btc stuff\n hideClass(document.getElementById('sr-bitcoinaddresswrapper'));\n break;\n case 3: //btc address cart mode 0\n //set the amount to pay in the btc address screen\n //hide the pay button\n hideClass(document.getElementById('sr-pay'));\n //hide the product details\n hideClass(document.getElementById('sr-cartlistitems'));\n //show btc stuff \n showClass(document.getElementById('sr-bitcoinaddresswrapper'));\n //hide the customer details \n showClass(document.getElementById('sr-back-button'));\n hideClass(document.getElementById('sr-customerdetailswrapper'));\n checkLightning();\n //call the check payment\n //note in serverless mode we will have to make it move to the payment successful page. \n if (serverless == 0) {\n checkpaymentres = setInterval(startPaymentCheck, 3000)\n }\n break;\n case 4:\n //stop payment timer\n stopPaymentCheck()\n //hide back button\n hideClass(document.getElementById('sr-back-button'));\n //hide payment details\n hideClass(document.getElementById('sr-bitcoinaddresswrapper'))\n //hide lightning view\n hideClass(document.getElementById('sr-lightningwrapper'));\n //hide the payment toggle, not necessary but may clear up some odd ux flows and costs us nothing. \n hideClass(document.getElementById('sr-choosepaymenttype'));\n //show paid screeb\n showClass(document.getElementById('sr-paid'));\n break;\n case 5: //donaton mode (cart mode 2)\n //get the total no product so this is just the amount in the sr button\n carttotal();\n checkLightning();\n //sto the payment checker\n stopPaymentCheck();\n //hide the pay button\n hideClass(document.getElementById('sr-pay'));\n //hide the paid view\n hideClass(document.getElementById('sr-paid'));\n //hide the shiping view\n hideClass(document.getElementById('sr-shipping'));\n //hide the cart header\n hideClass(document.getElementById('sr-cart-header'));\n //hide the customer details\n hideClass(document.getElementById('sr-customerdetailswrapper'));\n //hide back button\n hideClass(document.getElementById('sr-back-button'));\n //hide the product details\n hideClass(document.getElementById('sr-cartlistitems'));\n //hide the check out button\n hideClass(document.getElementById('sr-checkout'));\n //show btc stuff \n showClass(document.getElementById('sr-bitcoinaddresswrapper'));\n //hide lightning view\n hideClass(document.getElementById('sr-lightningwrapper'));\n //open it\n addClass(document.querySelector('.sr-cart-container'), 'cart-open');\n break;\n case 8: //lightning view\n //debug\n //console.log(lightningaddress);\n //set address type to lightning\n addresstype = 1;\n //show lightning view\n showClass(document.getElementById('sr-lightningwrapper'));\n //hide the btc view\n hideClass(document.getElementById('sr-bitcoinaddresswrapper'));\n //start the payment checker again\n if (serverless == 0) {\n checkpaymentres = setInterval(startPaymentCheck, 3000)\n }\n break;\n }\n }", "function Cart({ currentUser, products, cart, updateCart }) {\n\tconst [ cartProducts, setCartProducts ] = useState([]);\n\tconst [ totalamt, setTotalamt ] = useState(0);\n\tconst [ taxamt, setTaxamt ] = useState(0);\n\tconst [ grandTotal, setGrandTotal ] = useState(0);\n\n\tlet subTotal = 0,\n\t\ttax,\n\t\ttotal;\n\n\tuseEffect(\n\t\t() => {\n\t\t\tif (currentUser === undefined) {\n\t\t\t\tconsole.log(cart);\n\t\t\t\tconst tempCartProducts = [];\n\t\t\t\tconst sessionProducts = cart;\n\n\t\t\t\tconsole.log('products', products);\n\t\t\t\tsessionProducts.forEach((sp) => {\n\t\t\t\t\tproducts.forEach((p) => {\n\t\t\t\t\t\tif (sp.id === p.id) {\n\t\t\t\t\t\t\tp.size = sp.qty;\n\t\t\t\t\t\t\tp.product_id_id = p.id;\n\t\t\t\t\t\t\tp.name = p.title;\n\t\t\t\t\t\t\tp.image = p.imgUrl;\n\t\t\t\t\t\t\ttempCartProducts.push(p);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tconsole.log(tempCartProducts);\n\n\t\t\t\tsetCartProducts(tempCartProducts);\n\t\t\t} else {\n\t\t\t\tconst getCartProducts = async () => {\n\t\t\t\t\tawait fetch('https://testecmr.herokuapp.com/cart/', {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t\t// 'Authorization': '858f0d32c05f88b6375b0d8dbd36b2e10f518738'\n\t\t\t\t\t\t\t// 'Authorization': TOKEN\n\t\t\t\t\t\t\tAuthorization: authHeader()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// data: JSON.stringify({user_name: 'madhu'})\n\t\t\t\t\t})\n\t\t\t\t\t\t.then((res) => res.json())\n\t\t\t\t\t\t// .then(data => console.log(data))\n\t\t\t\t\t\t.then((data) => setCartProducts(data))\n\t\t\t\t\t\t// .then(data => calcTotal())\n\t\t\t\t\t\t.catch((err) => console.log(err));\n\t\t\t\t};\n\n\t\t\t\tgetCartProducts();\n\t\t\t}\n\n\t\t\t// const calcTotal = () => {\n\t\t\t// // total = 0, subTotal = 0, tax = 0;\n\t\t\t// cartProducts.forEach((prod) => {\n\t\t\t// subTotal = subTotal + (prod.size * prod.price)\n\t\t\t// console.log(prod.size, prod.price);\n\t\t\t// })\n\t\t\t// tax = 5 / 100 * subTotal;\n\t\t\t// total = subTotal + tax;\n\t\t\t// console.log(subTotal);\n\t\t\t// }\n\t\t\t// calcTotal();\n\t\t},\n\t\t[ cart, products, currentUser ]\n\t);\n\n\tuseEffect(\n\t\t() => {\n\t\t\tconst calcTotal = () => {\n\t\t\t\t// total = 0, subTotal = 0, tax = 0;\n\t\t\t\tcartProducts.forEach((prod) => {\n\t\t\t\t\tsubTotal = subTotal + prod.size * prod.price;\n\t\t\t\t\tconsole.log(prod.size, prod.price);\n\t\t\t\t});\n\t\t\t\ttax = parseInt(5 / 100 * subTotal);\n\t\t\t\ttotal = parseInt(subTotal + tax);\n\t\t\t\t// console.log(subTotal, tax, total);\n\t\t\t\tsetTotalamt(subTotal);\n\t\t\t\tsetTaxamt(tax);\n\t\t\t\tsetGrandTotal(total);\n\t\t\t};\n\n\t\t\tcalcTotal();\n\t\t},\n\t\t[ cartProducts ]\n\t);\n\n\treturn (\n\t\t<Container style={{ marginBottom: '20px' }}>\n\t\t\t<Grid container>\n\t\t\t\t{cartProducts.length > 0 ? (\n\t\t\t\t\tcartProducts.map((product) => (\n\t\t\t\t\t\t<CartItem key={product.id} cartProduct={product} updateCart={updateCart} />\n\t\t\t\t\t))\n\t\t\t\t) : (\n\t\t\t\t\t<h3>Your Shopping Cart is Empty</h3>\n\t\t\t\t)}\n\t\t\t</Grid>\n\n\t\t\t{cartProducts.length > 0 ? (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<Grid container direction=\"column\" spacing={2} style={{ marginTop: '10px' }}>\n\t\t\t\t\t\t<Grid item container spacing={6} justify=\"flex-end\" alignItems=\"center\">\n\t\t\t\t\t\t\t<Grid item>SubTotal</Grid>\n\t\t\t\t\t\t\t<Grid item>\n\t\t\t\t\t\t\t\tRs.<span>{totalamt}</span>\n\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t</Grid>\n\n\t\t\t\t\t\t<Grid item container spacing={6} justify=\"flex-end\" alignItems=\"center\">\n\t\t\t\t\t\t\t<Grid item>Tax 5%</Grid>\n\t\t\t\t\t\t\t<Grid item>\n\t\t\t\t\t\t\t\tRs.<span>{taxamt}</span>\n\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t</Grid>\n\n\t\t\t\t\t\t<Grid item container spacing={6} justify=\"flex-end\" alignItems=\"center\">\n\t\t\t\t\t\t\t<Grid item>Shipping</Grid>\n\t\t\t\t\t\t\t<Grid item>Free</Grid>\n\t\t\t\t\t\t</Grid>\n\n\t\t\t\t\t\t<Grid item container spacing={4} justify=\"flex-end\" alignItems=\"center\">\n\t\t\t\t\t\t\t<Grid item>\n\t\t\t\t\t\t\t\t<Typography variant=\"h5\" color=\"primary\">\n\t\t\t\t\t\t\t\t\tTotal\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t<Grid item>\n\t\t\t\t\t\t\t\t<Typography variant=\"h5\" color=\"primary\">\n\t\t\t\t\t\t\t\t\tRs.<span>{grandTotal}</span>\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t</Grid>\n\t\t\t\t\t</Grid>\n\n\t\t\t\t\t<Grid container justify=\"flex-end\">\n\t\t\t\t\t\t<Box mt={4}>\n\t\t\t\t\t\t\t<Link to=\"/checkout/cart?prevPage=cart\" style={{ textDecoration: 'none' }}>\n\t\t\t\t\t\t\t\t<Button variant=\"contained\" color=\"primary\">\n\t\t\t\t\t\t\t\t\tProceed to checkout\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t</Grid>\n\t\t\t\t</Fragment>\n\t\t\t) : null}\n\t\t</Container>\n\t);\n}", "function addToCart(event) {\n console.log(event);\n\n if (cart.length == 0) {\n // if there is nothing in the cart \n console.log(\"there was nothing in the cart, lets add this product: \", event.data.added.title);\n\n cart.push(event.data.added);\n\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n\n } else {\n\n let foundProduct = false;\n\n $.each(cart, function (index, product) {\n\n if (product.id === event.data.added.id) {\n console.log(\"something similar!\", product.title, product.quantity);\n product.quantity++;\n product.price = product.pricePerUnit * product.quantity;\n foundProduct = true;\n }\n });\n\n // add of a loop over the order array to add total price?\n if (!foundProduct) {\n console.log(\"new product! we simply add it\");\n cart.push(event.data.added);\n }\n\n localStorage.setItem(\"cart\", JSON.stringify(cart));\n }\n\n createCart();\n showBadge();\n}", "function viewCart() {\n\n if (cart.length === 0) {\n return \"Your shopping cart is empty.\"\n\n } else if (cart.length === 1) {\n return \"In your cart, you have \" + `${cart[0].itemName} at $${cart[0].itemPrice}.`;\n\n } else if (cart.length === 2){\n return \"In your cart, you have \" + `${cart[0].itemName} at $${cart[0].itemPrice}, and ${cart[1].itemName} at $${cart[1].itemPrice}.`;\n\n } else {\n var allItemsPriceToView = \"In your cart, you have\";\n for (var i=0; i < cart.length-1; i++) {\n allItemsPriceToView += ` ${cart[i].itemName} at $${cart[i].itemPrice},`;\n }\n }\n return allItemsPriceToView.concat(` and ${cart[cart.length-1].itemName} at $${cart[cart.length-1].itemPrice}.`) ;\n\n}", "function updateCart(){if(window.Cart&&window.Cart.updateCart){window.Cart.updateCart();}}", "addToCart(item) {\n const nameKey = item.name;\n // If the item that is being added to the cart is already in the cart,\n // we increment the numInCart variable to show that an additional unit\n // is being added\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 this.setState({\n aggregatedItems: currAggregatedItems\n })\n // If it is not already in the cart, we need to add this key-value pair to the \n // aggregatedItems state variable. We do so using the setState function\n } else {\n let currAggregatedItems = this.state.aggregatedItems;\n currAggregatedItems[nameKey] = {\n numInCart: 1,\n price: item.price,\n image: item.image,\n shelf_life: item.shelf_life,\n type: item.type\n\n }\n this.setState({\n aggregatedItems: currAggregatedItems\n })\n }\n }", "addToCart(productData) {\n\n //1. create a productObj object from the data attributes in 'productData' variable\n let productObj = this.createProductObj(productData);\n\n //2. check if the product is already in cart\n let productInCart = this.productAlreadyInCart(productObj.productId);\n\n \n if(productInCart) {\n\n //2.1.) product is IN cart and IN stock \n // productObj.productCurrentCount = ++productInCart.productCurrentCount;\n let success = this.increaseProductCount(productInCart);\n if(!success) {\n console.log(\"Product is out of stock\");\n }\n return true;\n \n } else {\n \n //3.) product not in cart => set its count to 1 \n productObj.productCurrentCount = 1;\n \n //add this new product to cart\n this.addNewProduct(productObj);\n return true;\n }\n\n }", "function updateCart() {\n emptyCart();\n let items = JSON.parse(localStorage.getItem('items'));\n if(items !== null) {\n if(typeof items.forEach !== \"function\") {\n items = [items];\n }\n items.forEach(function(item) {\n $('#shoppingcart-items').append(\n \"<li class='cart-item'>\" +\n \"<span>\" + item.name + \"</span>\" +\n \"<span>\" + item.size + \"</span>\" +\n \"<span>\" + item.color + \"</span>\" +\n \"<span>\" + item.amount + \"</span>\" +\n \"<span class='cart-item-price'>\" + item.price + \"</span>\" +\n \"<a class='remove-item' href='#' data-item='\" + item.name + \"'><i class='fa fa-times' aria-hidden='true'></i></a>\" +\n \"</li>\");\n });\n localStorage.setItem('items-timestamp', (+ new Date() / 1000) );\n }else {\n removeAllStorage();\n \n }\n updateCounter();\n updateTotal();\n }", "handleAddItemToCart(item, quantity){\n var buyableItem = new BuyableItem(item, quantity);\n currentCart.push(buyableItem);\n this.setState({cartQuantity : this.calculateCartQuantity(currentCart)})\n localStorage.setItem(\"cart\", JSON.stringify(currentCart));\n this.readFromCart();\n }", "addCarting({commit, state}, products) {\n // verify if the 'product' is or not add in the 'carting'. This 'hasOwnProperty' method returns \n // a boolean indicating whether the object has the specified property\n hasOwnProperty.call(state.carting, products.id) \n ? products.amount = state.carting[products.id].amount + 1\n : products.amount = 1;\n //console.log(products.amount);\n // pushing to \"mutation\"\n commit('setCarting', products);\n }", "function buy(title, description, colour, value) {\n cart = JSON.parse(sessionStorage.getItem(\"price\"));\n vinylObject = JSON.parse(sessionStorage.getItem(\"object\"));\n let newVinyl = new vinyl(\n title,\n description,\n colour,\n value,\n );\n vinylObject.push(newVinyl)\n let prices = parseInt(value);\n cart.push(prices);\n $(\".fas\").css(\"color\", \"#ff5200\");\n sessionStorage.setItem(\"price\", JSON.stringify(cart));\n sessionStorage.setItem(\"object\", JSON.stringify(vinylObject));\n}", "function getCart() {\n return cart;\n}", "function Cart1() {\r\n\r\n let vneck = clothingPrices.clothes1;\r\n sessionStorage.setItem(\"vneck\", vneck);\r\n\r\n}", "function saveCart(){\n sessionStorage.setItem('revonicCart', JSON.stringify(cart)); // saving data after converting it to JSON strings using JSON stingify. \n \n }", "function quanitityToCart(product) {\n let value = parseInt($(\"#amountOfBeer\").val());\n let isProductInCart = 0;\n for (let i = 0; i < cart.length; i++) {\n if (product.id === cart[i].id) {\n cart[i].inCart += value;\n isProductInCart++;\n }\n }\n if (isProductInCart == 0) {\n product.inCart = value;\n cart.push(product);\n }\n saveToLS();\n renderCart();\n}", "function stringifyCartMetadata(cart) {\n var cartMeta = [];\n for (var i = 0; i < cart.length; i++) {\n cartMeta.push({\n id: cart[i].product.id,\n q: cart[i].quantity\n });\n }\n\n var cartMetaStr = JSON.stringify(cartMeta);\n var chargeMeta = null;\n\n switch ( Math.ceil(cartMetaStr.length / 500) ) {\n case (1):\n chargeMeta = {\n cartItems1: cartMetaStr\n };\n break;\n case (2) :\n chargeMeta = {\n cartItems1: cartMetaStr.substring(0, 500),\n cartItems2: cartMetaStr.substring(500, 1000)\n };\n break;\n case (3):\n chargeMeta = {\n cartItems1: cartMetaStr.substring(0, 500),\n cartItems2: cartMetaStr.substring(500, 1000),\n cartItems3: cartMetaStr.substring(1000, 1500)\n };\n break;\n case (4):\n chargeMeta = {\n cartItems1: cartMetaStr.substring(0, 500),\n cartItems2: cartMetaStr.substring(500, 1000),\n cartItems3: cartMetaStr.substring(1000, 1500),\n cartItems4: cartMetaStr.substring(1500, 2000)\n };\n break;\n case (5):\n chargeMeta = {\n cartItems1: cartMetaStr.substring(0, 500),\n cartItems2: cartMetaStr.substring(500, 1000),\n cartItems3: cartMetaStr.substring(1000, 1500),\n cartItems4: cartMetaStr.substring(1500, 2000),\n cartItems5: cartMetaStr.substring(2000, 2500)\n };\n break;\n case (6):\n chargeMeta = {\n cartItems1: cartMetaStr.substring(0, 500),\n cartItems2: cartMetaStr.substring(500, 1000),\n cartItems3: cartMetaStr.substring(1000, 1500),\n cartItems4: cartMetaStr.substring(1500, 2000),\n cartItems5: cartMetaStr.substring(2000, 2500),\n cartItems6: cartMetaStr.substring(2500, 3000)\n };\n break;\n case (7):\n chargeMeta = {\n cartItems1: cartMetaStr.substring(0, 500),\n cartItems2: cartMetaStr.substring(500, 1000),\n cartItems3: cartMetaStr.substring(1000, 1500),\n cartItems4: cartMetaStr.substring(1500, 2000),\n cartItems5: cartMetaStr.substring(2000, 2500),\n cartItems6: cartMetaStr.substring(2500, 3000),\n cartItems7: cartMetaStr.substring(3000, 3500)\n };\n break;\n default:\n chargeMeta = {\n cartItems1: cartMetaStr.substring(0, 500),\n cartItems2: cartMetaStr.substring(500, 1000),\n cartItems3: cartMetaStr.substring(1000, 1500),\n cartItems4: cartMetaStr.substring(1500, 2000),\n cartItems5: cartMetaStr.substring(2000, 2500),\n cartItems6: cartMetaStr.substring(2500, 3000),\n cartItems7: cartMetaStr.substring(3000, 3500),\n cartItems8: cartMetaStr.substring(3500, 4000)\n };\n break;\n }\n\n return chargeMeta;\n}", "function displayCartItems(){\n\n //get cart from local storage\n let cart = localStorage.getItem(\"cart\"); \n \n // split contents of cart local storage into 1d array\n let bookList = cart.split('@@@');\n var quantity = [];\n var cList = \"\";\n \n // Change the 1 outer array into 2 dim array\n // and create a HTML list\n for (let z = 0; z<bookList.length;z++)\n {\n bookList[z] = bookList[z].split('$$$');\n quantity[z] = bookList[z][1]; //count\n let currentBook = StringToJSON(bookList[z][0]);\n cList += \"<p>\";\n cList += currentBook.title;\n cList += \"<span class = 'price'>\"\n cList += quantity[z];\n cList += \" x $\"\n cList += currentBook.price;\n cList += \"</span></p>\"; \n }\n \n // Get total price\n var cartTotal = parseInt(localStorage.getItem(\"cartTotal\"));\n var tax = 0.0635;\n var shipping = 4.99\n \n\t// Display the table\n\tdocument.getElementById(\"checkoutList\").innerHTML = cList; \n document.getElementById(\"checkoutSubtotal\").innerHTML = \"$\" + cartTotal.toFixed(2);\n document.getElementById(\"taxes\").innerHTML = \"$\" + (cartTotal * tax).toFixed(2);\n document.getElementById(\"shipping\").innerHTML = \"$\" + 4.99;\n document.getElementById(\"checkoutTotalPrice\").innerHTML = \"$\" + totalCost();\n localStorage.setItem(\"totalPrice\",((parseInt(cartTotal)* 1.0635)+4.99).toFixed(2));\n \n}", "function updateCart(){\n reset();\n cart.forEach(product =>{\n appendProduct(product);\n }); \n}", "handleAddToCard (e, products) {\n this.setState(state => {\n const cartItems = state.cartItems;\n let productAlreadyInCart = false;\n cartItems.forEach(item => {\n console.log('dentro de forEach')\n if (item._id === products._id) {\n productAlreadyInCart = true;\n item.count++;\n }\n });\n if (!productAlreadyInCart) {\n console.log('dentro de cartItem push')\n cartItems.push({...products, count: 0});\n }\n localStorage.setItem(\"cartItems\", JSON.stringify(cartItems));\n console.log(this.state.cartItems, \"cart item\")\n return cartItems;\n })\n }", "ADD_TO_CART(state, product) {\n // Check if cart is empty\n if (Object.keys(state.cart).length != 0) {\n for (const [key, value] of Object.entries(state.cart)) {\n // Check if product already in cart, then change quantity \n if (key === product.reference) {\n product.qty = value.qty + state.qty\n state.cart[key].qty = product.qty\n } else {\n state.cart[product.reference] = product\n }\n }\n } else {\n state.cart[product.reference] = product\n }\n }", "function addItemToCart(user, item) {\n amazonHistory.push(user)\n const updateCart = user.cart.concat(item)\n return Object.assign({}, user, { cart: updateCart })\n}", "function generate(title, description, colour, value) {\n cart = JSON.parse(sessionStorage.getItem(\"price\"));\n vinylObject = JSON.parse(sessionStorage.getItem(\"object\"));\n discountLock = JSON.parse(sessionStorage.getItem(\"discLock\"));\n let newVinyl = new vinyl(\n title,\n description,\n colour,\n value,\n );\n vinylObject.push(newVinyl)\n let prices = parseInt(value);\n cart.push(prices);\n let total = cart.reduce(function(a, b) {\n return a + b\n }, 0)\n if (deliveryLock[0] !== 1 && deliveryLock[0] !== 2) {\n alert(\"Cart Total: R\" + (total - discountLock));\n $(\".cart\").animate({ height: \"+= 50%\" });\n }\n if (deliveryLock[0] == 1 && total !== 0) {\n alert(\"Cart Total: R\" + (total + 99.99 - discountLock));\n $(\".cart\").animate({ height: \"+= 50%\" });\n }\n if (deliveryLock[0] == 2 && total !== 0) {\n alert(\"Cart Total: R\" + (total + 49.99 - discountLock));\n $(\".cart\").animate({ height: \"+= 50%\" });\n }\n $(\".fas\").css(\"color\", \"#ff5200\");\n\n sessionStorage.setItem(\"price\", JSON.stringify(cart));\n sessionStorage.setItem(\"object\", JSON.stringify(vinylObject));\n sessionStorage.setItem(\"discLock\", JSON.stringify(discountLock));\n}", "function displayCartItems () {\r\n // get cart items div and clear it\r\n const cartItemsDiv = document.getElementById('cartItems')\r\n cartItemsDiv.innerHTML = ''\r\n\r\n // retrive the cart and the catalogue fro storage\r\n const cart = JSON.parse(sessionStorage.getItem('cart'))\r\n const catalogue = JSON.parse(sessionStorage.getItem('catalogue'))\r\n\r\n // check if the cart is not empty\r\n if (cart.length !== 0) {\r\n let id = 0 // initiaise the id\r\n // iterate through the cart list\r\n cart.forEach(index => {\r\n // retrive the item object based on the index\r\n const item = catalogue[Number(index)]\r\n // display the item\r\n displayItem(item, id)\r\n // increment the id\r\n id++\r\n })\r\n\r\n // display the checkout div\r\n $('#checkoutDiv').css({ visibility: 'visible' })\r\n // get the total div and clear it\r\n const divTotal = document.getElementById('divTotal')\r\n divTotal.innerHTML = ''\r\n\r\n // create a h5 elemnt for the sub-total\r\n const subTotal = document.createElement('h5')\r\n subTotal.setAttribute('id', 'subtotalCartPrice')\r\n subTotal.style.textAlign = 'right'\r\n\r\n // create a h5 elemnt for the VAT\r\n const VATtotal = document.createElement('h5')\r\n VATtotal.setAttribute('id', 'VAT')\r\n VATtotal.style.textAlign = 'right'\r\n\r\n // create a h5 elemnt for the discount\r\n const discount = document.createElement('h5')\r\n discount.setAttribute('id', 'discount')\r\n discount.style.textAlign = 'right'\r\n discount.style.color = 'green'\r\n\r\n // create a h4 elemnt for the total\r\n const total = document.createElement('h4')\r\n total.setAttribute('id', 'totalCartPrice')\r\n total.style.textAlign = 'right'\r\n\r\n // create a check-out button\r\n const checkOutButton = document.createElement('button')\r\n checkOutButton.setAttribute('class', 'btn btn-outline-secondary')\r\n checkOutButton.setAttribute('onclick', 'checkout()') // handler function on click\r\n checkOutButton.setAttribute('id', 'checkOutButton')\r\n checkOutButton.style.float = 'right'\r\n checkOutButton.style.color = 'green'\r\n\r\n // create a cart icon\r\n const cartIcon = document.createElement('i')\r\n cartIcon.setAttribute('class', 'fas fa-shopping-cart')\r\n cartIcon.innerHTML = ' CHECKOUT'\r\n\r\n // add the icon the button\r\n checkOutButton.appendChild(cartIcon)\r\n\r\n // apped to the total div\r\n divTotal.appendChild(subTotal)\r\n divTotal.appendChild(VATtotal)\r\n divTotal.appendChild(discount)\r\n divTotal.appendChild(total)\r\n divTotal.appendChild(checkOutButton)\r\n\r\n // calculate the total & display it\r\n getCartTotal()\r\n } else {\r\n // hide notification and checkout div if cart is empty\r\n $('#checkoutDiv').css({ visibility: 'hidden' })\r\n $('#cartCounter').css({ visibility: 'hidden' })\r\n\r\n // if cart empty, clear the cart items div\r\n cartItemsDiv.innerHTML = ''\r\n // create a h4 element to display the 'cart empty' text\r\n const text = document.createElement('h4')\r\n text.setAttribute('class', 'text-center')\r\n text.innerHTML = 'Cart Empty'\r\n // add the text to the cart items div\r\n cartItemsDiv.appendChild(text)\r\n }\r\n}", "function purchase1() {\n\tvar h = parseInt(localStorage.getItem(\"Amount\"));\n\tvar k = JSON.parse(localStorage.getItem(\"Items\"));\n\n\tlocalStorage.setItem(\"Amount\", 0)\n\tlocalStorage.setItem(\"Items\", JSON.stringify([]));\n// create function to generate reference number\n\tvar l = (Math.random() * 0xFFFFFF).toString(16)\n\talert(\"The reference number for your order is \" + l)\n}", "function details() {\n return transformRawCartData();\n }", "function printBill(purchasedShirts, purchasedPants, purchasedShoes, discount) {\n\n console.log('Purchased Stock');\n console.log('Shirts:' + purchasedShirts);\n console.log('pants:' + purchasedPants);\n console.log('Shoes:' + purchasedShoes);\n\n console.log('Remining Stock');\n console.log(`remaining stock ${stockShirts.quantity-purchasedShirts}`);\n console.log(`remaining stock ${stockPants.quantity-purchasedPants}`);\n console.log(`remaining stock ${stockShoes.quantity-purchasedShoes}`);\n\n console.log('total price');\n\n let shirtsPrice = purchasedShirts * stockShirts.price;\n let pantsPrice = purchasedPants * stockPants.price;\n let shoesPrice = purchasedShoes * stockShoes.price;\n let totalPrice = shirtsPrice + pantsPrice + shoesPrice;\n let discountPrice = totalPrice * discount / 100;\n\n console.log(`shirts price ${purchasedShirts * stockShirts.price}`);\n console.log(`pants price ${purchasedPants * stockPants.price}`);\n console.log(`shoes price ${purchasedShoes * stockShoes.price}`);\n console.log(`toatal price:${shirtsPrice + pantsPrice + shoesPrice}`);\n console.log(`discount:${totalPrice*discount/100}`);\n console.log(`payable Amount ${totalPrice-discountPrice}`);\n\n}", "addToCart(newItem) {\n let itemExisted = false\n let updatedCart = this.state.cart.map(item => {\n if (newItem === item.sku) {\n itemExisted = true\n return { sku: item.sku, quantity: ++item.quantity }\n } else {\n return item\n }\n })\n if (!itemExisted) {\n updatedCart = [...updatedCart, { sku: newItem, quantity: 1 }]\n }\n this.setState({ cart: updatedCart })\n // Store the cart in the localStorage.\n // localStorage.setItem('stripe_checkout_items', JSON.stringify(updatedCart))\n }", "function addToCartAndStore(id) {\n //if item in storage already dont add again\n let amount = sessionStorage.getItem(id);\n if (amount) {\n changeQuantity(id);\n } else {\n addToCart(id);\n }\n Storage(id);\n}", "addToCart (productt) {\n checkRepeated(productt) \n added()\n console.log(productt)\n }", "function applyTaxToItems(user){\n amazonHistory.push(user)\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price*taxRate\n }\n })\n return Object.assign({}, user, { cart: updatedCart })\n}", "function roll(name, glaze, img, qty, price, cartNum){\n item = {name, glaze, img, qty, price, cartNum}\n let inCart = JSON.parse(localStorage.getItem('inCart'));\n if (inCart != null) { \n if (inCart[item.glaze] === undefined) {\n inCart = {\n ...inCart,\n [item.glaze]: item\n }\n }\n } \n else {\n inCart = {\n [item.glaze]: item\n } \t\n }\n localStorage.setItem(\"inCart\", JSON.stringify(inCart));\n updatePrice()\n}", "function applyTaxToItems(user){\n const {cart} = user;\n}", "function carttotal() {\n //multipily the price by the number of items in the cart\n producttotal = price * itemcount;\n var formatproducttotal = currencyFormat(producttotal);\n //note we are updating the BTC and Lightning totals here we will have to refactor this code is we ever\n // have a lightning only version of the cart (as stated elsewhere in the notes)\n changeClassText(document.getElementById('sr-lightningtotal'), 'Pay '+formatproducttotal + ' satoshi');\n changeClassText(document.getElementById('sr-bitcointotal'), 'Pay '+formatproducttotal + ' satoshi');\n changeClassText(document.getElementById('sr-checkouttotal'), formatproducttotal);\n //update counter\n changeClassText(document.querySelector('.sr-count'), itemcount);\n //store product\n if (serverless == 0) {\n var url = serverurl + \"api/storeproduct?name=\" + name + \"&quantity=\" + itemcount + \"&btcaddress=\" + btcaddress + \"&price=\" + price;\n //call the store produt endpoint\n fetchurl(url, 'storeproduct')\n }\n }", "function marketBuy () {\n\n}", "handleCheckout() {\n let postedCart = [];\n let userID;\n for (let i = 0; i < this.state.cart.length; i++) {\n postedCart.push({\n item: this.state.cart[i],\n count: this.state.cart[i].quantity\n });\n }\n callBackendAPI('/api/verify', 'post', {}).then(response => {\n userID = response.user._id;\n callBackendAPI('/api/getAllClients', 'get').then(response => {\n let i = 0;\n let searching = true;\n while(i < response.length && searching) {\n if (response[i].alienNumber === Number(this.state.clientId)) {\n callBackendAPI('/api/transactions/addTransaction', 'post', {\n transaction: {\n volunteerItems: [],\n shopItems: postedCart,\n authorizedUser: userID,\n clientId: response[i]._id,\n type: 'SHOP'\n }\n }).then(response => {\n if (response) { console.log(response); }\n });\n searching = false;\n }\n i++;\n }\n if (searching) {\n this.setState({\n open: true,\n message: 'Invalid Client Id!'\n });\n }\n });\n });\n }", "function buyItem(user) {\n return {\n ...user,\n purchases: [...user.cart]\n };\n}", "function roll(name, glaze, img, qty, price, cartNum){\n item = {\n name,\n glaze,\n img,\n qty,\n price,\n cartNum,\n }\n let inCart = JSON.parse(localStorage.getItem('inCart'));\n if (inCart != null) { \n if (inCart[item.glaze] === undefined) {\n inCart = {\n ...inCart,\n [item.glaze]: item\n }\n }\n } \n else {\n inCart = {\n [item.glaze]: item\n } \t\n }\n localStorage.setItem(\"inCart\", JSON.stringify(inCart));\n updatePrice()\n}", "function loadMyCart() {\n let userId = sessionStorage.getItem('userId');\n marketService.getUser(userId)\n .then((userInfo) => {\n displayMyCart(userInfo);\n }).catch(handleError);\n }", "function bamazon() {\n connection.query('SELECT * FROM products', function (err, res) {\n if (err) throw err;\n\n // Cli-Table display code with Color\n var table = new Table(\n {\n head: [\"Product ID\".cyan.bold, \"Product Name\".cyan.bold, \"Department Name\".cyan.bold, \"Price\".cyan.bold, \"Quantity\".cyan.bold],\n colWidths: [12, 75, 20, 12, 12],\n });\n\n // Set/Style table headings and Loop through entire inventory\n for (var i = 0; i < res.length; i++) {\n table.push(\n [res[i].id, res[i].product_name, res[i].department_name, parseFloat(res[i].price).toFixed(2), res[i].stock_quantity]\n );\n }\n\n console.log(table.toString());\n // END Display Inventory\n\n // Prompt Customers Input\n inquirer.prompt([\n {\n type: \"number\",\n message: \"Please enter the Product ID of the item that you would like to buy?\".yellow,\n name: \"id\"\n },\n {\n type: \"number\",\n message: \"How many would you like to buy?\".yellow,\n name: \"quantity\"\n },\n ])\n\n // Ordering function\n .then(function (cart) {\n\n var quantity = cart.quantity;\n var itemID = cart.id;\n\n connection.query('SELECT * FROM products WHERE id=' + itemID, function (err, selectedItem) {\n if (err) throw err;\n\n // Varify item quantity desired is in inventory\n if (selectedItem[0].stock_quantity - quantity >= 0) {\n\n console.log(\"INVENTORY AUDIT: Quantity in Stock: \".green + selectedItem[0].stock_quantity + \" Order Quantity: \".green + quantity.yellow);\n\n console.log(\"Congratulations! Bamazon has suffiecient inventory of \".green + selectedItem[0].product_name.yellow + \" to fill your order!\".green);\n\n \n\n // Calculate total sale, and fix 2 decimal places\n console.log(\"Thank You for your purchase. Your order total will be \".green + (cart.quantity * selectedItem[0].price).toFixed(2).yellow + \" dollars.\".green, \"\\nThank you for shopping at Bamazon!\".magenta);\n\n // Query to remove the purchased item from inventory. \n connection.query('UPDATE products SET stock_quantity=? WHERE id=?', [selectedItem[0].stock_quantity - quantity, itemID],\n\n function (err, inventory) {\n if (err) throw err;\n\n bamazon(); // Runs the prompt again, so the customer can continue shopping.\n }); // Ends the code to remove item from inventory.\n\n }\n // Low inventory warning\n else {\n console.log(\"INSUFFICIENT INVENTORY ALERT: \\nBamazon only has \".red + selectedItem[0].stock_quantity + \" \" + selectedItem[0].product_name.cyan + \" in stock at this moment. \\nPlease make another selection or reduce your quantity.\".red, \"\\nThank you for shopping at Bamazon!\".magenta);\n\n bamazon(); // Runs the prompt again, so the customer can continue shopping.\n }\n });\n });\n });\n} // Closes bamazon function", "function updateNumberToCart() {\n let currentUser = sessionStorage.getItem(\"successLogin\") \n let productList = JSON.parse(localStorage.getItem(\"userList\"))\n\n for (let i = 0; i < productList.length; i++) {\n const cart = productList[i].cart\n\n if(currentUser == productList[i].name)\n document.getElementById(\"purchase\").innerText = cart.length\n else {\n document.getElementById(\"purchase\").innerText = null\n }\n } \n}", "function addItemToCart(user, item) {\n\n}", "function addToCart(item) {\n var newItem = {}; // this object contains the item name and price.\n\n var newItem = {\n itemName: item,\n itemPrice: Math.floor(Math.random()*100)\n }\n //newItem.itemName = item;\n //newItem.itemPrice = Math.floor(Math.random()*100)\n cart.push(newItem); // it was pop(newItem)\n return `${newItem.itemName} has been added to your cart.`\n}", "function setCart(){\n\t\tstorage.set({ \n\t\t\titems: 0, \n\t\t\tsubtotal: 0\n\t\t}, function(){\n\t\t\tupdateCart();\n\t\t});\n\t}", "function addToCart(id) {\n var troba=false;\n if(cart.length==0){\n cart.push(products[id-1]);\n cart[0].quantity=1;\n }\n else if(cart.length>0){\n for(var i=0; i<cart.length; i++){\n if(products[id-1].name==cart[i].name){\n troba=true;}\n if(troba){\n cart[i].quantity++;}\n }\n if(troba==false){\n cart.push(products[id-1]);\n cart[cart.length-1].quantity=1;\n }\n }\n for( let i=0; i<cart.length; i++){\n cart[i].subtotal=cart[i].quantity*cart[i].price;\n }applyPromotionsCart();\n \n}", "async function reviewCart() {\r\n if (token === \"\" || typeof token === 'undefined') {\r\n addAgentMessage(\"Sorry I cannot perform that. Please login first!\")\r\n return;\r\n }\r\n\r\n await navigateTo('/cart-review');\r\n addAgentMessage('Here are items in your cart. Would you like to place an order?')\r\n\r\n }", "function getCart() {\n // api call to retrieve items in shopping cart\n API.getCart()\n .then(res=> {\n // save how many cart items to the store for updating the cart total number in navbar from the store\n dispatch({\n type: \"numCartItems\",\n numItems: res.data.length\n })\n })\n}", "function updateCart(productId, quantity, discount) {\n //var newquantity = document.getElementById(\"item_\" + productId).value;\n var newquantity = parseInt(quantity);\n var newdiscount = parseInt(discount);\n if (newquantity > -1) {\n if (newquantity < 1) {\n //Nếu cập nhật số lượng < 1 thì coi như là xóa sản phẩm khỏi cart\n deleteFromCart(productId, newquantity, discount);\n DeleteDetail(productId);\n } else {\n var current_cart = readCookie('quick_shopping_cart');\n var newCart = current_cart.split('$$');\n for (i = 0; i < newCart.length; i++) {\n var str = newCart[i].split(\"#\");\n if (str[0] == productId)\n str[1] = newquantity;\n newCart[i] = str.join(\"#\");\n }\n var newC = newCart.join(\"$$\");\n createCookie('quick_shopping_cart', newC, 1);\n }\n }\n checkPId(productId);\n if (newdiscount > -1) {\n var current_cart = readCookie('quick_shopping_cart');\n var newCart = current_cart.split('$$');\n for (i = 0; i < newCart.length; i++) {\n var str = newCart[i].split(\"#\");\n if (str[0] == productId)\n str[2] = newdiscount;\n newCart[i] = str.join(\"#\");\n }\n var newC = newCart.join(\"$$\");\n createCookie('quick_shopping_cart', newC, 1);\n }\n}", "addToShoppingCart() {\n\n // units is greater than zero\n if (this.state.units != 0){\n\n // validate stock\n if (this.state.units <= this.state.product.saleFormats[this.state.formatIndex].stock) {\n \n // get shpping cart\n var productsArrayCart = JSON.parse(localStorage.getItem('productsArrayCart'));\n \n // console.log(productsArrayCart);\n if (productsArrayCart == null) {\n productsArrayCart = [];\n };\n \n \n // validate if product with specific format already is in cart\n var productIsInCart = false;\n var formatIsInCart = false;\n var indexProduct = 0;\n productsArrayCart.forEach((product, idx) => {\n // validate if product is in array\n if (product.product.id == this.state.product.id) {\n productIsInCart=true;\n indexProduct= idx;\n\n // validate if format is in array\n if (product.formatIndexList.includes(this.state.formatIndex)) {\n formatIsInCart = true;\n }\n }\n });\n\n // if product is not\n // add product to cart\n if (!productIsInCart) {\n\n // alert(\"Product isn't in cart\");\n\n // add new product\n productsArrayCart.push({\n \"product\": this.state.product,\n \"formatIndexList\": [this.state.formatIndex],\n \"unitsList\": [this.state.units],\n });\n \n // console.log(productsArrayCart);\n \n // save new array\n localStorage.setItem('productsArrayCart', JSON.stringify(productsArrayCart));\n \n // console.log(productsArrayCart);\n \n // console.log(localStorage);\n alert(\"Producto agregado al carrito de compra\");\n \n // redirect\n this.props.history.push('/store/' + this.props.match.params.store_id);\n }\n\n // if product is in cart but no format\n // add format to product cart\n else if (productIsInCart & !formatIsInCart) {\n\n // alert(\"Product is in cart but format is not\");\n\n // add format index to list\n var formatIndexList = productsArrayCart[indexProduct][\"formatIndexList\"];\n formatIndexList.push(this.state.formatIndex);\n\n // add units\n var unitsList = productsArrayCart[indexProduct][\"unitsList\"];\n unitsList.push(this.state.units);\n\n // update item on product cart array\n productsArrayCart[indexProduct][\"formatIndexList\"] = formatIndexList\n productsArrayCart[indexProduct][\"unitsList\"] = unitsList;\n\n // save new array\n localStorage.setItem('productsArrayCart', JSON.stringify(productsArrayCart));\n\n // console.log(productsArrayCart);\n\n // console.log(localStorage);\n alert(\"Producto agregado al carrito de compra\");\n\n // redirect\n this.props.history.push('/store/' + this.props.match.params.store_id);\n\n\n }\n\n // if product and format is in cart\n else if (productIsInCart & formatIsInCart) {\n\n // get index of format index\n const indexFormatIndex = productsArrayCart[indexProduct][\"formatIndexList\"].indexOf(this.state.formatIndex);\n\n // get product format stock\n const productFormatStock = this.state.product.saleFormats[this.state.formatIndex].stock;\n\n // get products availables (dif between stock and units )\n const availableProducts = productFormatStock - productsArrayCart[indexProduct][\"unitsList\"][indexFormatIndex]\n\n // if it can add all units, so add to the cart\n if (this.state.units <= availableProducts) {\n\n\n // alert(\"product is in car and can add these units\");\n\n // add units to element in units array\n productsArrayCart[indexProduct][\"unitsList\"][indexFormatIndex] = productsArrayCart[indexProduct][\"unitsList\"][indexFormatIndex] + this.state.units;\n\n // save new array\n localStorage.setItem('productsArrayCart', JSON.stringify(productsArrayCart));\n\n // console.log(productsArrayCart);\n\n // console.log(localStorage);\n alert(\"Producto agregado al carrito de compra\");\n\n // redirect\n this.props.history.push('/store/' + this.props.match.params.store_id);\n\n \n }\n \n else if (availableProducts == 0) {\n // alert(\"product is in car but cann't add more units\");\n\n alert(\"Ya has agregado el máximo de unidades de este formato. Revisa tu carrito de compra para confirmar\");\n }\n // else, alert message with differecen available\n else {\n // alert(\"product is in cart but cann't add that number of units\");\n alert(\"Solo puedes agregar hasta \" + availableProducts + \" unidades de este formato\");\n };\n\n }\n\n }\n \n else{\n alert(\"Sólo puedes ordenar \" + this.state.product.saleFormats[this.state.formatIndex].stock + \" unidades de este formato\");\n };\n }\n \n else {\n alert(\"Debes elegir al menos una unidad de este producto\");\n };\n\n }", "function addBasket() {\n if (basket.length === 0 || (basket.find(x => x.name === item.name)) === undefined) {\n item.quantity = updatedQuantity\n basket.push(item)\n } else {\n for (let i=0; i < basket.length; i++) {\n if (basket[i].name === item.name) {\n basket[i].quantity = basket[i].quantity + updatedQuantity\n } \n }\n }\n productTotal();\n basketCount();\n localStorage.setItem(\"savedBasket\", JSON.stringify(basket));\n}", "handleCartQtyChanges(qty, cart) {\n if (this.state.cartQty !== qty) {\n this.setState({cartQty: qty, cart: cart})\n localStorage.setItem(\"shoppingCart\", JSON.stringify(this.state.cart));\n }\n }", "function buyThis(){\n inqurier.prompt([\n {\n message: \"What is the ITEM ID of the PRODUCT you would like to buy?\",\n name: \"id\"\n },\n { \n message: \"How many UNITS would you like to buy?\",\n name: \"purchase\",\n },\n ]).then(function(answer){\n //convert to integers\n var id = parseInt(answer.id);\n var quantity = parseInt(answer.purchase)\n\n //purcahse logic\n\n if (isNaN(answer.id) == true || id <=0 || id > resultArray.length) {\n //error message for invalid number entry \n console.log(\"Error: INVALID ITEM ID\")\n }\n else if (isNan(answer.purcahse) == true || quantity <= 0){\n //error for purchasing zero items\n console.log(\"You must order more than one\")\n }\n else if (quantity > resultArray[id -1].stock_quantity){\n //error for not enough stock \n console.log(\"WE ARE OUT OF THAT\")\n }\n else {\n //for a sucessful order\n purchaes.push(resultArray[id - 1].product_name);\n amounts.push(quantity);\n\n //total of curent order and total order\n var orderCost = quantity * resultArray[id-1].price;\n orderCost = parseFloat(orderCost.toFixed(2));\n total += orderCost;\n total = parseFloat(total.toFixed(2))\n\n sales = resultArray[id - 1].product_sales + orderCost;\n\n console.log(\"You have selected ITEM\" + id + \",\" + resultArray[id - 1].product_name + \".\" )\n console.log(\"This item costs $\" + resultArray[id - 1].price + \" per unit. You have ordered \" + quantity + \" units.\");\n console.log(\"This purchase costs $\" + orderCost + \".\");\n \n //display quantites and ordered as well as cost\n console.log(\"YOU HAVE ORDERED\")\n for (var i = 0; i < purchaes.length; i++){\n console.log(amounts[i] + \"|\" + purchaes[i]);\n }\n console.log(\"mYour total cost is \" + total + \".\");\n\n\t\t\t// query to update the database\n\t\t\tupdate = \"UPDATE products SET stock_quantity = \" + (resultArray[id - 1].stock_quantity - quantity) + \", product_sales = \" + sales + \" WHERE item_id = \" + id;\n\n\t\t\t// updates the database\n\t\t\tconnection.query(update, function (error, results, fields) {\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t};\n });\n keepGoing();\n }\n })\n}", "checkout(){\n\n let total = 0\n this.products.forEach(item =>{\n GRAPHQL.decrementQuantity(item.id)\n total += item.price\n })\n\n return total\n }", "function updateCartQuantity() {\n\tvar quantityChange = [];\n\tvar count = 0;\n\tfor (var item in product) {\n\t\tif (cart[item] > product[item].quantity) {\n\t\t\tquantityChange[count] = product[item].name + \":\" + space + product[item].quantity + \"\\n\";\n\t\t\tcart[item] = product[item].quantity;\n\t\t\tproduct[item].quantity = 0;\n\t\t\tcount++;\n\t\t\t\n\t\t}\n\t}\n\tvar msg = \"(If Some Items Are Out Of Stock, They Will Be Automatically Removed From Your Cart)\\n\";\n\tif(quantityChange.length != 0){\n\t\twindow.alert(\"Some Items In Your Cart Have Changed Stock:\\n\" + msg + \"\\n\" + quantityChange.join(\"\"));\n\t}\n\t\n}", "constructor(props){\n super(props)\n this.state = {\n ownID: 13, //hardcode first; will change later\n transactionDetails: [] //should be the finalised product with finalised json of each product\n /* within each json for each transactions in the transaction details\n name: string, // need to track the first name from the id in view account details api \n amount: string, // add a plus or minus\n category: string, //get from the \n date: string, // need to deserialise the date type for each data \n eGift: boolean, // boolean format for the \n */\n }\n }", "function getCart() {\r\n if (sessionStorage.getItem(\"vneck\") != null) {\r\n let cartItem1 = document.createElement(\"p\");\r\n whatsInCart.appendChild(cartItem1);\r\n cartItem1.innerHTML = sessionStorage.getItem(\"vneck\");\r\n ItemStyler();\r\n }\r\n\r\n if (sessionStorage.getItem(\"African\") != null) {\r\n let cartItem2 = document.createElement(\"p\");\r\n whatsInCart.appendChild(cartItem2);\r\n cartItem2.innerHTML = sessionStorage.getItem(\"African\");\r\n ItemStyler();\r\n }\r\n\r\n if (sessionStorage.getItem(\"kapi\") != null) {\r\n let cartItem3 = document.createElement(\"p\");\r\n whatsInCart.appendChild(cartItem3);\r\n cartItem3.innerHTML = sessionStorage.getItem(\"kapi\");\r\n ItemStyler();\r\n }\r\n\r\n if (sessionStorage.getItem(\"formal\") != null) {\r\n let cartItem4 = document.createElement(\"p\");\r\n whatsInCart.appendChild(cartItem4);\r\n cartItem4.innerHTML = sessionStorage.getItem(\"formal\");\r\n ItemStyler();\r\n }\r\n\r\n if (sessionStorage.getItem(\"fiasco\") != null) {\r\n let cartItem5 = document.createElement(\"p\");\r\n whatsInCart.appendChild(cartItem5);\r\n cartItem5.innerHTML = sessionStorage.getItem(\"fiasco\");\r\n ItemStyler();\r\n }\r\n\r\n if (sessionStorage.getItem(\"nice\") != null) {\r\n let cartItem6 = document.createElement(\"p\");\r\n whatsInCart.appendChild(cartItem6);\r\n cartItem6.innerHTML = sessionStorage.getItem(\"nice\");\r\n ItemStyler();\r\n }\r\n\r\n if (sessionStorage.getItem(\"design\") != null) {\r\n let choicesTotal = document.createElement(\"p\");\r\n cartPrice.appendChild(choicesTotal);\r\n choicesTotal.innerHTML = \"Total: R\" + myPrice;\r\n PriceStyler();\r\n\r\n } else { //Should the cart be empty, display the following message in a pragraph that is appended to the selected ID\r\n let empty = document.createElement(\"p\");\r\n empty.innerHTML = \"Your Cart is currently empty\";\r\n whatsInCart.appendChild(empty);\r\n ItemStyler();\r\n $(\"#orderOptions\").hide();\r\n $(\".firstBigHeading\").hide();\r\n }\r\n\r\n}", "function cartNoti() {\n\t\tvar shop_str = localStorage.getItem('shop_list');\n\t\tif (shop_str) {\n\t\t\tvar shop_arr = JSON.parse(shop_str);\n\t\t\tvar count = 0;\n\t\t\t$.each(shop_arr, function(i,v) {\n\t\t\t\tvar qty = v.qty;\n\t\t\t\tcount += qty;\n\t\t\t})\n\n\t\t\t$('.cartnoti').html(count);\n\t\t}\n\t\telse {\n\t\t\t$('.cartnoti').html('');\n\t\t}\n\t}", "function productsForSale() {\n // console.log(\"Here are the items in stock: \");\n connection.query(\"SELECT * FROM products\", function(err, response) {\n //if there is an error, console log the error\n if (err) {throw err;\n } else {\n // if no error log all results of the SELECT statement\n console.table(response);\n }\n //calls function that prompts customer request\n likeToBuy();\n });\n}", "function updateCart() {\n\n}", "function purchaseMM(){\n if(!cookie.count >= cookie.upgradesPurchased[0]){\n \n if(cookie.count >= cookie.upgradeCosts[0]) {\n cookie.cookieType = \"Chocolate Chip\";\n cookie.logMessage = \"New Upgrade: \" + cookie.cookieType;\n addLogText();\n cookie.upgradesPurchased[0] = true; // Change the boolean of the first index Chocolate Chip to true\n increaseUpgradeCount();\n showUpgrades(); // refreshes the boolean array\n }\n \n else {\n alert(\"You must have \" + cookie.upgradeCosts[0] + \"clicks!\");\n }\n }\n else {\n alert(\"You have already purchaed this upgrade!\");\n \n }\n \n }", "function addtocart1() {\n\tvar a = JSON.parse(sessionStorage.getItem(\"Catalogue\"));\n\tvar b = JSON.parse(localStorage.getItem(\"Items\"));\n\tvar c = parseInt(localStorage.getItem(\"Amount\"));\n\n\tif (b == null) {\n\t\tb = [a[0]];\n\t} else {\n\t\tb.push(a[0]);\n\t};\n\n\tlocalStorage.setItem(\"Items\", JSON.stringify(b));\n\n\tlocalStorage.setItem(\"Amount\", c += a[0].price);\n\talert(\"The current total of the items is R\" + c);\n}", "calculateTotal(price, skuId, qty) {\n let cartListArr = this.props.elcStore.cartList.length ? JSON.parse(this.props.elcStore.cartList) : {};\n if (Object.keys(cartListArr).length && cartListArr[skuId] !== undefined) {\n for (let x in cartListArr) {\n if (x === skuId) {\n cartListArr[skuId] = {qty: cartListArr[skuId].qty + qty};\n }\n }\n } else {\n cartListArr[skuId] = {qty: qty};\n }\n const total = this.state.total + (price * qty);\n const cartList = cartListArr;\n this.props.elcStore.cartListUpdate(total, cartList);\n }", "function loadClickUpgrades() {\n let storedClickInventory = JSON.parse(window.localStorage.getItem('player.clickInventory'));\n console.log(storedClickInventory);\n\n if (storedClickInventory.length !== 0) {\n console.log('inside loadClickUpgrades');\n console.log(storedClickInventory);\n player.clickInventory = storedClickInventory;\n console.log(player.clickInventory);\n\n\n let shovelCount = 0;\n let excavatorCount = 0;\n player.clickInventory.forEach(item => {\n if (item.name === 'shovel') {\n shovelCount++;\n excavatorCount++;\n }\n\n });\n\n console.log(shovelCount);\n\n clickUpgrades['shovel'].quantity = shovelCount;\n clickUpgrades['excavator'].quantity = excavatorCount;\n\n let shovels = [];\n let excavators = [];\n\n storedClickInventory.forEach(item => {\n if (item.name === 'shovel') {\n shovels.push(item);\n }\n\n if (item.name === 'excavator') {\n excavators.push(item);\n }\n });\n\n //console.log(shovels);\n //console.log(shovels.length);\n //console.log(shovels.length - 1);\n //console.log(shovels[shovels.length -1].price);\n\n if (shovels.length !== 0) {\n\n\n\n let shovelPrice = shovels[shovels.length - 1].price;\n let shovelNewPrice = shovels[shovels.length - 1].newprice;\n\n clickUpgrades['shovel'].price = shovelPrice;\n clickUpgrades['shovel'].newprice = shovelNewPrice;\n\n }\n\n if (excavators.length !== 0) {\n\n let excavatorPrice = excavators[excavators.length - 1].price;\n let excavatorNewPrice = excavators[excavators.length - 1].newprice;\n\n clickUpgrades['excavator'].price = excavatorPrice;\n clickUpgrades['excavator'].newprice = excavatorNewPrice;\n\n }\n\n }\n else {\n loadInitialSettings();\n }\n\n}", "function addItemToCart(user, item) {}", "function loadCart() {\n productsInCart = JSON.parse(sessionStorage.getItem('shoppingCart'));\n }", "function storeFront() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"Item # \" + res[i].item_id + \n \" \" + res[i].product_name +\n \" Qty: \" + res[i].stock_quantity + \n \" Price: $\" + res[i].price \n );\n }\n purchaseReqeust();\n });\n}", "function add_to_cart(event) {\n let title = $(event).data('title');\n let data = $(event).attr('data-json');\n data = JSON.parse(data);\n data['title'] = title;\n $(event).children(\"i\").attr('class', 'fas fa-spinner fa-spin fa-1x fa-fw');\n setTimeout(function () {\n $(event).children(\"i\").attr('class', 'fas fa-check fa-1x');\n let check = in_cart(data['key'], cart.products);\n if (cart.products.length < 1 || check == 'insert') cart.products.push(data);\n if (check != 'insert') cart.products[check]['quantily'] = Number(cart.products[check]['quantily']) + Number(data['quantily']);\n if (Number(data['quantily']) > 0) {\n update_cart(cart.products);\n }\n }, 2000)\n\n}", "function checkOut(itemCart, cartQuant) {\n var orderTotal = 0;\n console.log(\"<-------------------- CHECKOUT----------------->\");\n for (var i = 0; i < itemCart.length; i++) {\n console.log(\"\\n\\nProduct: \" + itemCart[i].product_name + \"\\n\\nQuantity: x\" + cartQuant[i]);\n orderTotal += parseFloat((itemCart[i].price * cartQuant[i]).toFixed(2));\n updateStock(itemCart, cartQuant, i);\n }\n var salesTax = parseFloat((orderTotal * .0625).toFixed(2));\n\n var orderWithTax = parseFloat((orderTotal + salesTax).toFixed(2));\n\n console.log(\"\\nSale Price: $\" + orderTotal);\n console.log(\"\\nSales Tax: +$\" + salesTax);\n console.log(\"_____________________\")\n console.log(\"\\nOrder Total: $\" + orderWithTax);\n console.log(\"\\nStock Updated!\");\n console.log(\"\\nThank you for your purchase!\");\n console.log(\"\\nCtrl + C to exit store.\")\n}", "function shopProduct(productId,toggleCount){\n //Find if this particular product has already been added in the cart\n var result = shoppingCart.find(x => x.id == productId);\n\n /*If the product has not been added to the cart before and is being added now\n then push the new item to the cart else simply increase the count of the corresponding\n item in the cart */\n if (result == undefined && toggleCount == 1){\n shoppingCart.push({\"id\": productId, \"count\": toggleCount});\n }\n else if (result != undefined){\n result.count = result.count + toggleCount;\n /* if the item is being removed from the cart multiple times, then\n item count becomes negative and hence simply reset its value to zero */\n if (result.count < 0){\n result.count = 0;\n }\n }\n\n //set the total to zero every time an addition or removal is made so the total count is calculated right\n total = 0;\n shoppingCart.forEach(calcTotalCart); //For every object in the shoppingCart, call calcTotalCart()\n\n //Function to calculate total number of products in the cart\n function calcTotalCart(item){\n //console.log(\"item count\" + item.count);\n total = total + item.count;\n var productName = products.find(y => y.id == item.id).name;\n //Display each individual item name and it's individual count\n console.log(productName + \" - Quantity = \" + item.count);\n }\n\n //Display total number of items in the cart\n console.log(\"Total number of items in your cart = \" + total);\n //Display total number of items in the cart next to the shopping cart icon in the nav bar\n document.getElementById(\"cartCount\").innerHTML = \" (\" + total + \")\";\n}", "function cart(){\n let cart=localStorage.getItem(\"cart\");\n (cart)? showCart(cart) :alert(\"you don't have a cart yet!\")\n }", "function addAnotherProductToCart(event) {\n let productname = event.dataset.productname;\n let product = myCart.find(element => element.product === productname);\n product.amount++;\n //update the amount html\n updateProductAmountHtml(productname, product.amount);\n //also update the storage\n saveToStorage(productname, JSON.stringify(product));\n}", "function proceed(count) {\n\t\t\t\t\t\tif(count > 0) return; // Not done yet\n\n\t\t\t\t\t\t// Save items to final purchase\n\t\t\t\t\t\tfinal.items = items;\n\n\t\t\t\t\t\tif(preview)\n\t\t\t\t\t\t\treturn callback(null, { items: items });\n\n\t\t\t\t\t\t// Stringify data\n\t\t\t\t\t\tvar payMethod = connection.escape(final.payMethod);\n\t\t\t\t\t\tvar address = connection.escape(JSON.stringify(final.address));\n\t\t\t\t\t\tvar products = connection.escape(JSON.stringify(final.items));\n\n\t\t\t\t\t\t// Save final purchase to database\n\t\t\t\t\t\tvar _sql = sql.purchases.add(user.id, payMethod, address, products);\n\t\t\t\t\t\tconnection.query(_sql, function(err, result) {\n\t\t\t\t\t\t\tif(err) throw err;\n\n\t\t\t\t\t\t\tcallback(null, { id: result.insertId });\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "'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 }", "function addToCartClicked(event) {\n document.querySelector(\".custom\").style.display = \"block\";\n var button = event.target;\n var shopItem = button.parentElement.parentElement;\n var title = shopItem.getElementsByClassName(\"shop-item-title\")[0].innerText;\n var price = shopItem.getElementsByClassName(\"shop-item-price\")[0].innerText;\n var imageSrc = shopItem.getElementsByClassName(\"shop-item-image\")[0].src;\n items = {\n title,\n price,\n imageSrc,\n };\n\n // check if the total is updating\n}", "'BUY_STOCK' (state, {stockId, quantity, stockPrice}) {\n // check to see if I already own the stock, to increase instead of create\n const record = state.stocks.find(element => element.id === stockId);\n if (record) {\n record.quantity += quantity;\n } else {\n let currentStock = { id: stockId, quantity: quantity };\n state.stocks.push(currentStock);\n }\n state.funds -= stockPrice * quantity;\n }" ]
[ "0.63574064", "0.61856747", "0.61856747", "0.61856747", "0.61856747", "0.61856747", "0.61856747", "0.60266846", "0.5997815", "0.5989271", "0.59656394", "0.59552443", "0.5932503", "0.5930405", "0.5910026", "0.5877828", "0.5869807", "0.5864504", "0.5859745", "0.582038", "0.582038", "0.581778", "0.5815763", "0.57747936", "0.5774296", "0.5766403", "0.57511455", "0.57277846", "0.5726788", "0.5724346", "0.57164633", "0.5710331", "0.5699926", "0.56971073", "0.5694761", "0.56943727", "0.5689827", "0.5665017", "0.5657255", "0.56543845", "0.5652708", "0.5651603", "0.564443", "0.564142", "0.5640491", "0.5636117", "0.5624916", "0.5621813", "0.5620289", "0.5618473", "0.56167215", "0.56140864", "0.5609726", "0.56097245", "0.560608", "0.56047183", "0.5603898", "0.5601248", "0.5593228", "0.55891764", "0.5586016", "0.5581246", "0.5580776", "0.5580085", "0.5577614", "0.5574667", "0.55716634", "0.55710864", "0.55687124", "0.5564129", "0.5563282", "0.55629456", "0.5562237", "0.555805", "0.5556576", "0.55563426", "0.5552565", "0.5549301", "0.55485517", "0.5547186", "0.55466133", "0.55400425", "0.55385417", "0.55321795", "0.5531732", "0.5531582", "0.55298096", "0.552832", "0.55219555", "0.5520276", "0.5518457", "0.5515718", "0.55094564", "0.55070245", "0.54998034", "0.54953754", "0.5495059", "0.5490986", "0.54872227", "0.54861367", "0.54858065" ]
0.0
-1
uses the $.data collection to set the current mode of operation 0 is for new 1 is for edit
function setEditOrCreateMode(mode) { $(invoke_button).data("mode", mode) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@action initCategoryEditing(editingData) {\n this.isEditingCategory = true;\n this.editingCategoryData = {...editingData, mode: 'edit'};\n }", "function fhArrival_editMode() {\n\n\tjQuery('.fhArrival_viewMode').hide();\n\t\n\tjQuery('.fhArrival_viewField').each(function () {\n\t\tvar editField = jQuery(this).attr('data-view-for');\n\t\tjQuery('#' + editField).val(jQuery(this).html());\n\t})\n\t\n\tjQuery('.fhArrival_editMode').show();\n\t\n\tfhArrival_data.currentMode = \"EDIT\";\n\t\n}", "doEditMode() {\n\n }", "function isCollectionEditing(){\r\n\t\t\treturn loadingData.EDITING_COLLECTION;\r\n\t\t}", "function editModel(data) {\n /// start edit form data prepare\n /// end edit form data prepare\n dataSource.one('sync', function(e) {\n /// start edit form data save success\n /// end edit form data save success\n\n app.mobileApp.navigate('#:back');\n });\n\n dataSource.one('error', function() {\n dataSource.cancelChanges(itemData);\n });\n\n dataSource.sync();\n app.clearFormDomData('edit-item-view');\n }", "setEditMode(mode){\n if(mode && mode===this._lastEditMode){\n return;\n }\n this._lastEditMode=mode;\n this.detachSelectionControllers();\n this.currentSelectionModeControllers=[this.getSelectionControllersDict()[mode]];\n const selectedModelController = this.getSelectedModelController();\n if(selectedModelController){\n this.attachSelectionControllers(selectedModelController);\n }\n }", "edit() {\n this._enterEditMode();\n }", "change_mode(){\n this.setState({isEditMode: !this.state.isEditMode, resultMode: false, index: 0});\n }", "function Op_Mod_Set(op, data, rowDef) {\n switch (op) {\n case \"format\":\n return \"OMS\";\n\n default:\n };\n}", "function editingMode() {\n if (!editing) {\n setEditing(true);\n setIfEditing(true);\n setInEditMode(true);\n } else {\n setInEditMode(false);\n setEditing(false);\n setIfEditing(false);\n }\n }", "function CriticismDialogSetUIByMode(Mode) {\n var dialog = $(\"#CriticismdialogData\");\n var gridDataList = $(\"#CriticismgridDataList\");\n switch (Mode) {\n case \"c\": //Create\n $(\"#CriticismdialogDataToolBar\").hide();\n var RowId = gridDataList.jqGrid('getGridParam', 'selrow');\n var dataRow = gridDataList.jqGrid('getRowData', RowId);\n dialog.attr('ItemRowId', RowId);\n dialog.attr('CriticismID', dataRow.CriticismID);\n\n $(\"#ddlCriticismCategoryD\").change();\n $(\"#ddlCriticismCategoryD\").removeAttr('disabled');\n \n $(\"#ddlCriticismUnitD\").removeAttr('disabled');\n\n $(\"#ddlItemNOD\").removeAttr('disabled');\n $(\"#txtItemPartition\").val(\"\");\n $(\"#txtItemPartition\").removeAttr('disabled');\n $(\"#txtFitnessScore\").val(\"\");\n $(\"#txtFitnessScore\").removeAttr('disabled');\n $(\"#txtScoringRatio\").val(\"\");\n $(\"#txtScoringRatio\").attr(\"disabled\", \"disabled\");\n $(\"#txtActualScore\").val(\"\");\n $(\"#txtActualScore\").removeAttr('disabled');\n $(\"#txtEvaluation\").val(\"\");\n $(\"#txtEvaluation\").removeAttr('disabled');\n\n\n $(\"#lblCriticismDiaErrMsg\").html(\"\");\n\n break;\n case \"v\": //View\n $(\"#btnCriticismdialogEditData\").button(\"option\", \"disabled\", false);\n $(\"#btnCriticismdialogCancelEdit\").button(\"option\", \"disabled\", true);\n $(\"#CriticismdialogDataToolBar\").show();\n\n var RowId = gridDataList.jqGrid('getGridParam', 'selrow');\n var dataRow = gridDataList.jqGrid('getRowData', RowId);\n dialog.attr('ItemRowId', RowId);\n dialog.attr('CriticismID', dataRow.CriticismID);\n\n $(\"#ddlCriticismCategoryD\").val(dataRow.CriticismCategory.trim());\n $(\"#ddlCriticismCategoryD\").attr(\"disabled\", \"disabled\");\n $(\"#ddlCriticismUnitD\").val(dataRow.CriticismUnit.trim());\n $(\"#ddlCriticismUnitD\").attr(\"disabled\", \"disabled\");\n $(\"#ddlItemNOD\").val(dataRow.ItemNO.trim());\n $(\"#ddlItemNOD\").attr(\"disabled\", \"disabled\");\n $(\"#txtItemPartition\").val(dataRow.ItemPartition);\n $(\"#txtItemPartition\").attr(\"disabled\", \"disabled\");\n $(\"#txtFitnessScore\").val(dataRow.FitnessScore);\n $(\"#txtFitnessScore\").attr(\"disabled\", \"disabled\");\n $(\"#txtScoringRatio\").val(dataRow.ScoringRatio);\n $(\"#txtScoringRatio\").attr(\"disabled\", \"disabled\");\n $(\"#txtActualScore\").val(dataRow.ActualScore);\n $(\"#txtActualScore\").attr(\"disabled\", \"disabled\");\n $(\"#txtEvaluation\").val(dataRow.Evaluation);\n $(\"#txtEvaluation\").attr(\"disabled\", \"disabled\");\n \n\n $(\"#lblCriticismDiaErrMsg\").html(\"\");\n\n break;\n //default: //Edit(\"e\")\n // $(\"#btndialogEditData\").button(\"option\", \"disabled\", true);\n // $(\"#btndialogCancelEdit\").button(\"option\", \"disabled\", false);\n // $(\"#dialogDataToolBar\").show();\n\n // var RowId = gridDataList.jqGrid('getGridParam', 'selrow');\n // var dataRow = gridDataList.jqGrid('getRowData', RowId);\n // dialog.attr('ItemRowId', RowId);\n // dialog.attr('CriticismID', dataRow.CriticismID);\n\n // $(\"#ddlCriticismCategoryD\").val(dataRow.CriticismCategory.trim());\n // $(\"#ddlCriticismCategoryD\").attr(\"disabled\", \"disabled\");\n // $(\"#ddlCriticismUnitD\").val(dataRow.CriticismUnit.trim());\n // $(\"#ddlCriticismUnitD\").attr(\"disabled\", \"disabled\");\n // $(\"#ddlItemNOD\").val(dataRow.ItemNO.trim());\n // $(\"#ddlItemNOD\").attr(\"disabled\", \"disabled\");\n // $(\"#txtItemPartition\").val(dataRow.ItemPartition);\n // $(\"#txtItemPartition\").removeAttr('disabled');\n // $(\"#txtFitnessScore\").val(dataRow.FitnessScore);\n // $(\"#txtFitnessScore\").removeAttr('disabled');\n // $(\"#txtScoringRatio\").val(dataRow.ScoringRatio);\n // $(\"#txtScoringRatio\").removeAttr('disabled');\n // $(\"#txtActualScore\").val(dataRow.ActualScore);\n // $(\"#txtActualScore\").removeAttr('disabled');\n // $(\"#txtEvaluation\").val(dataRow.Evaluation);\n // $(\"#txtEvaluation\").removeAttr('disabled');\n\n // $(\"#lblDiaErrMsg\").html(\"\");\n\n //break;\n }\n}", "function changeStyleOnMode(isEdit) {\n if (isEdit) {\n $('#editable-mode').addClass('selected');\n $(\"#sortable-mode\").removeClass('selected');\n $('#page-preview').css('cursor', 'text');\n } else {\n $('#editable-mode').removeClass('selected');\n $(\"#sortable-mode\").addClass('selected');\n $('#page-preview').css('cursor', 'move');\n }\n}", "viewEditModel(data, type) {\n if (type != \"checkbox\") {\n if (data) {\n this.setState({\n showEditModal: true, itemEdit: data,\n selectedExpensesTypeItemEdit: { label: data.expenseTypeName, value: data.expenseTypeId }\n });\n }\n }\n }", "function MapDialogSetUIByMode(Mode) {\n var dialog = $(\"#MapdialogData\");\n var gridDataList = $(\"#CriticismgridDataList\");\n switch (Mode) {\n case \"c\": //Create\n $(\"#MapdialogDataToolBar\").hide();\n dialog.attr('ItemRowId', \"\");\n dialog.attr('CriticismID', \"\");\n \n $(\"#txtCriticmName\").val(\"\");\n $(\"#txtCriticmName\").removeAttr('disabled');\n\n $(\"#lblMapDiaErrMsg\").html(\"\");\n\n break;\n case \"v\": //View\n $(\"#btnMapdialogEditData\").button(\"option\", \"disabled\", false);\n $(\"#btnMapdialogCancelEdit\").button(\"option\", \"disabled\", true);\n $(\"#MapdialogDataToolBar\").show();\n\n var RowId = gridDataList.jqGrid('getGridParam', 'selrow');\n var dataRow = gridDataList.jqGrid('getRowData', RowId);\n dialog.attr('ItemRowId', RowId);\n dialog.attr('CriticismID', dataRow.CriticismID);\n\n $(\"#txtCriticmName\").val(dataRow.CriticismName);\n $(\"#txtCriticmName\").attr(\"disabled\", \"disabled\");\n\n\n $(\"#lblMapDiaErrMsg\").html(\"\");\n\n break;\n default: //Edit(\"e\")\n $(\"#btnMapdialogEditData\").button(\"option\", \"disabled\", true);\n $(\"#btnMapdialogCancelEdit\").button(\"option\", \"disabled\", false);\n $(\"#MapdialogDataToolBar\").show();\n\n var RowId = gridDataList.jqGrid('getGridParam', 'selrow');\n var dataRow = gridDataList.jqGrid('getRowData', RowId);\n dialog.attr('ItemRowId', RowId);\n dialog.attr('CriticismID', dataRow.CriticismID);\n\n $(\"#txtCriticmName\").val(dataRow.CriticismName);\n $(\"#txtCriticmName\").removeAttr('disabled');\n\n $(\"#lblMapDiaErrMsg\").html(\"\");\n\n break;\n }\n}", "function updateData(data) {\n // data.selectedGen++;\n // model.provider.updateField(data.name, { active: data.selected });\n model.provider.toggleFieldSelection(data.name);\n }", "toggleEditMode() {\n event.preventDefault();\n this.editMode = !this.editMode;\n }", "function edit(){\n\t\treturn M.status == 'edit';\n\t}", "_setToEditingMode() {\n this._hasBeenEdited = true\n this._setUiEditing()\n }", "edit() {\n\t\tthis.mode = \"Edit Schedule\";\n\t\tthis.transaction = this.schedule;\n\t}", "function edit_current_meal()\n{\n // Toggle edit mode\n is_edit_mode = true;\n\n // Save the current meal before we edit it so we can recover if the user\n // decides to cancel their changes\n meal_before_edit = copy_meal(current_meal);\n\n // Show the edit mode controls in the meal editor pane.\n show_edit_mode_controls();\n}", "function updateOperation (operation, model) {\n model.operator = operation.operator;\n model.percentage = operation.percentage;\n }", "function editMode() {\n name.html('<input value=\"' + name.html() + '\"></input>');\n details.html('<input value=\"' + details.html() + '\"></input>');\n actions.html('<button type=\"button\" class=\"btn btn-default btn-xs submit-btn\"><span title=\"Submit\" class=\"glyphicon glyphicon-ok\"></span></button>'\n + '<button type=\"button\" class=\"btn btn-default btn-xs cancel-btn\"><span title=\"Cancel\" class=\"glyphicon glyphicon-remove\"></span></button>');\n }", "@action changeCategoryData(data) {\n this.editingCategoryData = {\n ...this.editingCategoryData,\n ...data,\n };\n }", "function setEditable(data) {\n var currentDate = new Date();\n var currentYear = currentDate.getFullYear().toString();\n var tmfColDefList = data;\n var MainKey = [];\n var MainValue = \"\";\n var columnDef = [];\n for (var k in tmfColDefList)\n MainKey.push(k);\n for (var i = 0; i < MainKey.length; i++) {\n MainValue = tmfColDefList[MainKey[i]];\n for (var property in MainValue) {\n if ($scope.yearSelected == currentYear) {\n if ((property == 'editable' && MainValue.headerName != 'Project Name' && MainValue.headerName != 'Action') && (monthsArray.indexOf(MainValue.headerName) <= currentMonth)) {\n MainValue[property] = true;\n } else if ((property == 'editable' && MainValue.headerName != 'Project Name' && MainValue.headerName != 'Action') && (monthsArray.indexOf(MainValue.headerName) > currentMonth)) {\n MainValue[property] = false;\n }\n } else {\n if ((property == 'editable' && MainValue.headerName != 'Project Name' && MainValue.headerName != 'Action') && (!$scope.disableEdit)) {\n MainValue[property] = true;\n }\n\n };\n\n };\n columnDef.push(MainValue);\n };\n return columnDef;\n }", "changeMode(mode, current = false) {\n\t\t\tthis.setState(prev => {\n\t\t\t\tprev.mode = mode;\n\t\t\t\tprev.current = current;\n\t\t\t\treturn prev;\n\t\t\t})\n\t\t\tthis.seeResult = this.seeResult.bind(this)\n\t\t}", "function setEditMode(controlMode, dimMode) {\n if (controlMode) {\n $(\"#txtName\").prop('disabled', false);\n // Update the background color since this does not happen by default\n $(\"#txtName\").removeClass('disabledTextBox');\n $(\"#txtName\").addClass('basicTextBox');\n $(\"#txtDescription\").prop('disabled', false);\n $(\"#txtDescription\").removeClass('disabledTextBox');\n $(\"#txtDescription\").addClass('basicTextBox');\n\n // Disable the active flag\n $(\"#activeFlag\").prop('disabled', false);\n // Enable the save/update buttons\n $(\"#btnSave\").prop('disabled', false);\n $(\"#btnUpdate\").prop('disabled', false);\n\n// $(\"#activeFlag\").prop('checked', true);\n }\n else {\n $(\"#txtName\").prop('disabled', true);\n $(\"#txtName\").removeClass('basicTextBox');\n $(\"#txtName\").addClass('disabledTextBox');\n $(\"#txtDescription\").prop('disabled', true);\n $(\"#txtDescription\").removeClass('disabledTextBox');\n $(\"#txtDescription\").addClass('disabledTextBox');\n // Enable the active flag\n $(\"#activeFlag\").prop('disabled', true);\n // Enable the save/update buttons\n $(\"#btnSave\").prop('disabled', true);\n $(\"#btnUpdate\").prop('disabled', true);\n }\n\n if (dimMode) {\n // Enable the dimension rows\n $('#DimensionRow :input').prop('disabled', false);\n $('#DimensionRow').css({ 'pointer-events': 'all' });\n }\n else\n {\n // Disable the dimension rows\n // $('#DimensionRow : input').prop('disabled', false);\n $('#DimensionRow :input').prop('disabled', true);\n $('#DimensionRow').css({ 'pointer-events': 'all' });\n }\n }", "@computed get isCategoryEditing() {\n return this.editingCategoryData.mode === 'edit';\n }", "function editable($el, data) {\n \n $el.data('cms', data);\n\n $el.on('render', function () {\n var $el = $(this);\n var data = $el.data('cms');\n elements[data.type].render($el, data.data);\n $el.trigger('rendered');\n });\n\n //add css edit styles\n $el.addClass('cms-edit-' + data.type);\n\n $el.on('click', function (e) {\n e.preventDefault();\n e.stopPropagation();\n var $el = $(this);\n var data = $el.data('cms');\n elements[data.type].edit($el, data);\n });\n\n }", "haxeditModeChanged(val) {\n this.editMode = val;\n }", "_editModeChanged(newValue, oldValue) {\n if (typeof newValue !== typeof undefined) {\n this._itemsChanged(this.items);\n for (var i in this.items) {\n if (this.items[i].metadata) {\n this.items[i].metadata.canEdit = newValue;\n this.notifyPath(`items.${i}.metadata.canEdit`);\n }\n }\n }\n }", "changeStatusEdit(state) {\n state.statusEditData = !this.state.statusEditData\n }", "async update () {\n\t\t// do the update\n\t\tif (!this.ops) {\n\t\t\tthis.ops = {\n\t\t\t\t$set: this.attributes\n\t\t\t};\n\t\t\tdelete this.ops.$set.id;\n\t\t}\n\t\tthis.updateOp = await this.collection.applyOpById(\n\t\t\tthis.id,\n\t\t\tthis.ops,\n\t\t\t{ version: this.modelVersion }\n\t\t);\n\t}", "function updateSelectAllValue(data) {\n if (data.view && data.edit && data.add && data.delete)\n data.selectAll = true;\n else data.selectAll = false;\n }", "function setFormMode(mode) {\n\n var org;\n\n org = new Organization();\n // reset the form content prior to loading a new organiation\n clearDetailContent();\n\n if (mode == \"new\") {\n // Change the save button title to \"Update\"\n $(\"#btnSave\").show();\n $(\"#btnUpdate\").hide();\n\n $(\"#txtName\").prop('disabled', false);\n $(\"#txtName\").removeClass('disabledTextBox');\n $(\"#txtName\").addClass('basicTextBox');\n\n // Disable the Role control since you cannot specify Roles on org creation\n $('#roleInput :input').prop('disabled', true);\n $('#roleInput').css({ 'pointer-events': 'none' });\n\n $(\"#activeFlag\").prop('checked', true);\n $(\"#txtWorkDay\").val(\"8\");\n\n // reset the role collection\n roleCollection.length = 0;\n // Initialize the org ID\n org.ID = -1;\n }\n else {\n // Clear the current results\n clearDetailContent();\n // get the organization associated with the current selected org ID\n org = getCurrentOrganization($(\"#formOrgList\").find('option:selected').val());\n // Change the save button title to \"Update\"\n $(\"#btnSave\").hide();\n $(\"#btnUpdate\").show();\n\n // Enable the Role control \n $('#roleInput :input').prop('disabled', false);\n $('#roleInput').css({ 'pointer-events': 'all' });\n\n // Populate the controls with the current org values\n $(\"#txtName\").val(org.Name);\n $(\"#txtDescription\").val(org.Description);\n $(\"#activeFlag\").prop('checked', org.isActive);\n // Update the Work Day value\n $(\"#txtWorkDay\").val(org.WorkDay);\n // Load the role data for the current org\n var targetUrl = RoleUrl + \"?Id=\" + org.ID;\n var myOrg = new Organization();\n // Load the role data for the current organization\n loadRolesByOrganization(org.ID, populateCurrentRoles, pmmodaErrorHandler);\n enableOrgControls(true);\n\n /*\n $.ajax({\n url: targetUrl,\n type: 'GET',\n dataType: 'json',\n success: function (data, txtStatus, xhr) {\n populateCurrentRoles(data);\n // updateRoles(org.id);\n // closeOrganizationForm();\n },\n error: function (xhr, textStatus, errorThrown) {\n var response = xhr.getResponseHeader(\"Location\");\n alert(\"error2: \" + response);\n }\n });\n */\n }\n // Set the class variable containing the current organization\n currentOrg = org;\n }", "function toggleEditMode() {\n for (var i = 0; i < a.length; i++) {\n \n a[i].classList.toggle(\"hidden\");\n a[i].classList.toggle(\"whatBox\"[i]);\n b[i].toggleAttribute('contenteditable');\n \n }\n //EDITMODE ON CUSTOMER DATA INDEPENDENT OF COMMENTS:\n for (var i = 0; i < c.length; i++) {\n c[i].toggleAttribute('contenteditable');\n }\n }", "function updateViewMenuValue(data) {\n if (data.view || data.edit || data.add || data.delete)\n data.viewMenu = true;\n else data.viewMenu = false;\n }", "function setMode( mode ) {\n // Error handler\n var validModes = ['add', 'remove', 'none'];\n if ( validModes.indexOf( mode ) == -1 ) {\n console.error( 'Invalid mode name:', mode );\n return false;\n }\n \n if ( mode == 'add' || mode == 'none' ) {\n modeDict.add = true;\n modeDict.remove = false;\n } else if ( mode == 'remove' ) {\n modeDict.add = false;\n modeDict.remove = true;\n } else {\n console.error( 'Unexcepted mode:', mode);\n }\n}", "function setAddMode() {\n vm.setToDefaultMode();\n vm.addMode = true;\n vm.currentOutcomeMeasure = {};\n $scope.om_form.$setPristine();\n }", "function addModeSwitcher() {\n /* editable vs sortable mode */\n $(\"#editable-mode\").click(function() {\n console.log(\"editable mode on\");\n editMode = \"editable\";\n $(\".sortable\").sortable(\"option\", \"disabled\", true);\n changeStyleOnMode(true);\n })\n $(\"#sortable-mode\").click(function() {\n console.log(\"sortable mode on\");\n editMode = \"sortable\";\n $(\".sortable\").sortable(\"option\", \"disabled\", false);\n changeStyleOnMode(false);\n })\n}", "function changeMode(mode) {\n\t// Mathml mode.\n\tif (mode == 'xml') {\n\t\t_wrs_conf_saveMode = 'xml';\n\t}\n\t// Image mode.\n\telse if (mode == 'image') {\n\t\t_wrs_conf_saveMode = 'image';\n\t}\n\t// Base64 mode.\n\telse if (mode == 'base64') {\n\t\t_wrs_conf_saveMode = 'base64';\n\t\t// With this variable, formulas are stored as a base64 image on the database but showed with\n\t\t// a showimage src on the editor.\n\t\t_wrs_conf_editMode = \"image\";\n\t}\n\t// Updating Preview and HTML tabs.\n\tupdateFunction();\n}", "function fhArrival_viewMode() {\n\n\tjQuery('.fhArrival_editMode').hide();\n\tjQuery('.fhArrival_viewMode').show();\n\tif (fhArrival_data.arrival.arrival_archived == 1) {\n\t jQuery('#fhArrival_labelArchived').show();\n\t jQuery('#fhArrival_btnArchivedToggle').html('Annulla archiviazione');\n\t} else {\n\t\tjQuery('#fhArrival_labelArchived').hide();\n\t\tjQuery('#fhArrival_btnArchivedToggle').html('Archivia lista di carico');\n\t}\n\t\n\tfhArrival_data.currentMode = \"VIEW\";\n\t\n}", "onEditComplete_() {\n this['editing'] = false;\n }", "onClickEditMode() {\n\t\teventEmitter.emit(EVENTS.ToggleEditMode, this.Controls.EDIT_MODE);\n\t}", "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "setMode(mode) {\n this._mode = mode;\n }", "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "async setDeveloperFlag(collection, mode) {\n\n await this.getApiLock();\n\n let result = null;\n\n if (!this.isAuthenticated()) {\n console.error(\"reference_to_mongo_db.setDeveloper\", \"user is not authenticated.\");\n } else {\n console.info(\"Setting developer flag to: \" + mode);\n\n try {\n result = await this.promiseTimeout(this.reference_to_mongo_db.collection(collection).updateOne({\n user_id: this.stitch_actual_client.auth.user.id\n }, {\n $set: {\n is_developer: mode\n }\n }, {\n upsert: true\n }));\n localStorage.setItem(\"__stitch_dev_flag\", mode);\n } catch (e) {\n result = e;\n console.error(\"reference_to_mongo_db.setDeveloper\", e);\n }\n }\n\n this.apiUnlock();\n\n return result;\n }", "function setModeCreationProjet() {\n $(\"#operationControleur\").val(\"creationProjet\");\n}", "set(mode) {\n this.oldMode = this.mode;\n this.mode = mode;\n this.updateUITools();\n }", "function _filterOperations(data) {\n var updateOps = [];\n var createOps = [];\n for(var i=0; i<data.length; i++) {\n var queryJSON = {};\n //var element = _parseProperty(queryJSON, view_model.primaryKeyProperty);\n //element = _parseProperty(data[i], view_model.primaryKeyProperty);\n\n _.set(queryJSON, view_model.primaryKeyProperty, _.get(data[i], view_model.primaryKeyProperty));\n\n var query = _.findIndex(view_model.serviceDB, queryJSON);\n if( query > -1 ) updateOps.push(data[i]);\n else createOps.push(data[i]);\n }\n return { updateOperations: updateOps, createOperations: createOps };\n }", "function isEditAllowed()\n {\n return activeInitData.editAllowed === true;\n }", "function setAddEdit(data){\n\t\t$cookies.put(IS_ADD_EDIT_TAG, data);\n\t}", "function setMode(newMode) {\r\n if (_self.mode !== newMode) {\r\n _self.mode = newMode;\r\n if (!_self.current.parent) {\r\n _self.browseCurrent = _self.current;\r\n }\r\n else {\r\n _self.browseCurrent = _self.current.parent;\r\n }\r\n _self.emit('statusUpdate', _self.browseCurrent);\r\n return true;\r\n }\r\n return false;\r\n }", "function getInputData(operacao) {\r\n\r\n\t\t\t\t\t\tvar descModelo = $('#tf_Descricao').val();\r\n\t\t\t\t\t\t// alert(nomeEstado);\r\n\r\n\t\t\t\t\t\t// Pega O Valor Do Option Sigla\r\n\t\t\t\t\t\t// var idEstado = $('#slc_Estado').attr('selected',\r\n\t\t\t\t\t\t// true).val();\r\n\r\n\t\t\t\t\t\tvar idMarca = $('#slc_Marca').children(\r\n\t\t\t\t\t\t\t\t\"option:selected\").val();\r\n\r\n\t\t\t\t\t\tvar idTipoV = $('#slc_TipoVeiculo').children(\r\n\t\t\t\t\t\t\t\t\"option:selected\").val();\r\n\r\n\t\t\t\t\t\t// Pega O Valor Do Option Status Selecionado\r\n\t\t\t\t\t\tvar statusModelo = $('#slc_Status').attr('selected',\r\n\t\t\t\t\t\t\t\ttrue).val();\r\n\t\t\t\t\t\t// alert(statusEstado);\r\n\r\n\t\t\t\t\t\tif (operacao == \"update\") {\r\n\t\t\t\t\t\t\tvar idModelo = $('#tf_Id').val();\r\n\r\n\t\t\t\t\t\t\tvar modelo = {\r\n\t\t\t\t\t\t\t\t\"idModelo\" : idModelo,\r\n\t\t\t\t\t\t\t\t\"descModelo\" : descModelo,\r\n\t\t\t\t\t\t\t\t\"idMarca\" : idMarca,\r\n\t\t\t\t\t\t\t\t\"idTipoV\" : idTipoV,\r\n\t\t\t\t\t\t\t\t\"statusModelo\" : statusModelo\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t} else if (operacao == \"insert\") {\r\n\t\t\t\t\t\t\tvar modelo = {\r\n\t\t\t\t\t\t\t\t\"descModelo\" : descModelo,\r\n\t\t\t\t\t\t\t\t\"idMarca\" : idMarca,\r\n\t\t\t\t\t\t\t\t\"idTipoV\" : idTipoV,\r\n\t\t\t\t\t\t\t\t\"statusModelo\" : statusModelo\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// console.log(estado.idEstado);\r\n\t\t\t\t\t\treturn modelo;\r\n\t\t\t\t\t}", "switchMode(newMode: Mode) {\n this.mode = newMode;\n }", "function edit(val) {\n try {\n var data = JSON.parse(val[1]);\n cancel();\n if (val[0] != \"0\") {\n\n $(\"input[name=radio-btn][value=\" + data[0].from_type_id + \"]\").prop('checked', true);\n // get_fromdep(data[0].from_type_id);\n get_fromdep_replay(data[0].from_type_id, data[0].from_dep);\n $(\"input[name=radio-btn2][value=\" + data[0].to_type_id + \"]\").prop('checked', true);\n // get_todep(data[0].to_type_id);\n get_todepreplay(data[0].to_type_id, data[0].to_dep);\n\n fillControlsFromJson(data[0]);\n fillImages(val[2]);\n $(\"#txtTemId\").val($(\"#lblyearId\").html());\n $(\"#divdate1 #txtDateh\").val(data[0].date_hj);\n $(\"#divdate1 #txtDatem\").val(data[0].date);\n $(\"#imgItemURL\").prop(\"src\", data[0].logo);\n $(\"#cmdSave\").prop(\"CommandArgument\", \"Update\");\n $(\"#cmdUpdate\").removeAttr('disabled');\n $(\"#cmdDelete\").removeAttr('disabled');\n $('.action-btns').css('display', 'none');\n if (data[0].type == 1) {\n $(\"#div_print\").show();\n // $(\"#txtname_ar\").prop('disabled', false);\n }\n else {\n $(\"#div_print\").hide();\n // $(\"#txtname_ar\").prop('disabled', false);\n }\n showSuccessMessage(\"\");\n if (formOperation == \"update\") {\n setformforupdate();\n formOperation = \"\";\n }\n } else {\n showErrorMessage(\"No data found !!\");\n }\n } catch (err) {\n alert(err);\n }\n}", "function adjustCurrentMode()\n{\n var isEditable = Dom.isEditable(document.activeElement);\n if (isEditable && Mode.isNormalMode()) {\n Mode.changeMode(ModeList.INSERT_MODE);\n }\n if (!isEditable && Mode.isInsertMode()) {\n Mode.changeMode(ModeList.NORMAL_MODE);\n }\n}", "function setModeInitListeEquipe() {\n $(\"#operationControleur\").val(\"initListeEquipes\");\n}", "function handlerCRUD(fullObject, operationType) {\n\n\n //console.log(fullObject); // OK\n //console.log(operationType); // OK\n\n let helpers = {\n statusID: function (valueNeeded) {\n\n let newStatus;\n\n statuses.forEach(function (currentValue) {\n if (currentValue.Status == valueNeeded) {\n newStatus = currentValue.ID;\n }\n });\n\n return newStatus.toString();\n },\n internalID: function (fullObjId, fullObjInternalId) {\n\n console.log(fullObjId, fullObjInternalId);\n\n if (fullObjInternalId == '0') {\n return fullObjId;\n } else {\n return fullObjInternalId;\n }\n }\n };\n\n\n if (operationType == \"Update\") {\n\n\n\t let valuepairs = [\n\t\t\t[\"Title\", fullObject.RequestCodeSAP],\n\t\t\t[\"Date\", new Date(fullObject.StartDate).toISOString()],\n\t\t\t[\"Approver\", fullObject.ApproverID],\n\t\t\t[\"Reason\", fullObject.Reason],\n\t\t\t[\"WorkSchedule\", fullObject.WorkScheduleID],\n\t\t\t[\"OvertimeNo\", fullObject.OvertimeNo],\n\t\t\t[\"HolidaysNo\", fullObject.HolidaysNo],\n\t\t\t[\"End_x0020_Date\", new Date(fullObject.EndDate).toISOString()],\n\t\t\t[\"ChildrenCareHours\", fullObject.ChildrenCareHours],\n\t\t\t[\"TimeAdmin\", fullObject.IdTimeAdmin],\n\t\t];\n\n\n\n /* this operation make sens only if update */\n\n let statusChanged = helpers.statusID(\"Changed\");\n let statusHistory = helpers.statusID(\"History\");\n\n //console.log(\"statusy pierwszy changed: \", statusChanged, statusHistory);\n console.log(\"inside update\");\n //console.log(fullObject);\n console.log(fullObject.ID, fullObject.InternalID);\n\n let internalID = \"\" + helpers.internalID(fullObject.ID, fullObject.InternalID);\n console.log(\"internal ID \", internalID);\n\n\n\n valuepairs.push([\"InternalID\", '' + internalID]);\n valuepairs.push([\"Status\", helpers.statusID(\"Changed\")]);\n\n console.log(valuepairs);\n\n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"New\",\n listName: \"Requests\",\n valuepairs: valuepairs,\n completefunc: function (xData, Status) {\n console.log(\"New Changed!\" + \" \" + Status);\n }\n });\n\n\n\n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"Update\",\n listName: \"Requests\",\n ID: fullObject.ID,\n valuepairs: [\n [\"InternalID\", internalID],\n [\"Status\", statusHistory]\n ],\n completefunc: function (xData, Status) {\n console.log(\"History Request!\" + \" \" + Status);\n }\n });\n\n } else if (operationType == \"Accepted\") {\n \n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"Update\",\n listName: \"Requests\",\n ID: fullObject.ID,\n valuepairs: [[\"Status\", helpers.statusID(operationType)]],\n completefunc: function (xData, Status) {\n console.log(\"Request Approved!\" + \" \" + Status);\n }\n });\n\n } else if (operationType == \"Declined\") {\n \n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"Update\",\n listName: \"Requests\",\n ID: fullObject.ID,\n valuepairs: [[\"Status\", helpers.statusID(operationType)]],\n completefunc: function (xData, Status) {\n console.log(\"Request Declined!\" + \" \" + Status);\n }\n });\n\n } else if (operationType == \"Create\") {\n \n \n\t let valuepairs = [\n\t\t\t[\"Title\", fullObject.RequestCodeSAP],\n\t\t\t[\"Date\", new Date(fullObject.StartDate).toISOString()],\n\t\t\t[\"Approver\", fullObject.ApproverID],\n\t\t\t[\"Reason\", fullObject.Reason],\n\t\t\t[\"WorkSchedule\", fullObject.WorkScheduleID],\n\t\t\t[\"OvertimeNo\", fullObject.OvertimeNo],\n\t\t\t[\"HolidaysNo\", fullObject.HolidaysNo],\n\t\t\t[\"End_x0020_Date\", new Date(fullObject.EndDate).toISOString()],\n\t\t\t[\"ChildrenCareHours\", fullObject.ChildrenCareHours],\n\t\t\t[\"TimeAdmin\", fullObject.IdTimeAdmin],\n\t\t];\n\n valuepairs.push([\"InternalID\", '0']);\n valuepairs.push([\"Status\", helpers.statusID(\"Submitted\")]);\n\n\n console.log(valuepairs);\n\n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"New\",\n listName: \"Requests\",\n valuepairs: valuepairs,\n completefunc: function (xData, Status) {\n console.log(\"Request Sent for Approval!\" + \" \" + Status);\n let tmpstr = xData.responseText;\n let arr = tmpstr.split(\" \");\n // console.log(arr);\n let ktory = 29; \n arr.forEach( function(item, indx) {\n \tif(item.indexOf(\"ows_ID=\") == 0 ) {\n \t\tktory = indx;\n \t\t\n \t\tconsole.log(item);\n \t}\n });\n // always 29? - i masz odpowiedz, ze nie zawsze jest to 29!!!\n\n //console.log( arr[ktory].replace('\"','').replace('\"','').split(\"=\")[1] );\n // return parseInt( arr[29].replace('\"','').replace('\"','').split(\"=\")[1] );\n let newAjdi = arr[ktory].replace('\"','').replace('\"','').split(\"=\")[1];\n fullObject.ID = newAjdi;\n }\n });\n } else {\n\n\n\n let statusDelete;\n if (fullObject.Status == helpers.statusID(\"Accepted\")) {\n statusDelete = helpers.statusID(\"Removing Accepted\");\n } else if (fullObject.Status == helpers.statusID(\"Completed\")) {\n statusDelete = helpers.statusID(\"Removing Completed\");\n } else {\n statusDelete = helpers.statusID(\"Deleted\");\n }\n $().SPServices({\n operation: \"UpdateListItems\",\n async: false,\n batchCmd: \"Update\",\n listName: \"Requests\",\n ID: fullObject.ID,\n valuepairs: [\n\t\t\t\t[\"Status\", statusDelete]\n\t\t\t],\n completefunc: function (xData, Status) {\n console.log(\"Data Deletion Done!\");\n }\n });\n }\n \n \n}", "mode(val) {\n this._mode = val;\n return this;\n }", "switchMode(arg) {\n let mode = arg;\n // if force mode not provided, switch to opposite of current mode\n if (!mode || mode instanceof MouseEvent)\n mode = this.currentView === 'source' ? 'preview' : 'source';\n if (arg instanceof MouseEvent) {\n if (obsidian.Keymap.isModEvent(arg)) {\n this.app.workspace.duplicateLeaf(this.leaf).then(() => {\n var _a, _b;\n const viewState = (_a = this.app.workspace.activeLeaf) === null || _a === void 0 ? void 0 : _a.getViewState();\n if (viewState) {\n viewState.state = Object.assign(Object.assign({}, viewState.state), { mode: mode });\n (_b = this.app.workspace.activeLeaf) === null || _b === void 0 ? void 0 : _b.setViewState(viewState);\n }\n });\n }\n else {\n this.setState(Object.assign(Object.assign({}, this.getState()), { mode: mode }), {});\n }\n }\n else {\n // switch to preview mode\n if (mode === 'preview') {\n this.currentView = 'preview';\n obsidian.setIcon(this.changeModeButton, 'pencil');\n this.changeModeButton.setAttribute('aria-label', 'Edit (Ctrl+Click to edit in new pane)');\n this.renderPreview(this.recipe);\n this.previewEl.style.setProperty('display', 'block');\n this.sourceEl.style.setProperty('display', 'none');\n }\n // switch to source mode\n else {\n this.currentView = 'source';\n obsidian.setIcon(this.changeModeButton, 'lines-of-text');\n this.changeModeButton.setAttribute('aria-label', 'Preview (Ctrl+Click to open in new pane)');\n this.previewEl.style.setProperty('display', 'none');\n this.sourceEl.style.setProperty('display', 'block');\n this.editor.refresh();\n }\n }\n }", "function updateOperItem() {\r\n var model = createObjectModel();\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: bars.config.urlContent(\"/api/admin/oper/operitemupdate\"),\r\n contentType: \"application/json\",\r\n dataType: \"json\",\r\n data: JSON.stringify(model),\r\n traditional: true\r\n }).done(function (result) {\r\n bars.ui.alert({ text: result });\r\n $(\"#OperList\").data(\"kendoGrid\").dataSource.read();\r\n //$(\"#OperList\").data(\"kendoGrid\").refresh();\r\n });\r\n }", "toggleEdit() {\n this.editing = !this.editing;\n }", "get mode() { return this._mode; }", "get mode() { return this._mode; }", "showEdit() {\n this.closeFoldersInputs.closeAllInputs();\n // set Manage checkbox\n if (this.folderUser.get('access') === 2) {\n this.set('access', true);\n } else {\n this.set('access', false);\n }\n\n this.folderUser.set('isEdit', true);\n }", "onBtnEditClick() {\n\t\tthis.changeTripReportMode('edit');\n\t}", "function enableEdit(curr){\r\n // pause refreshing\r\n clearInterval(livedata);\r\n livedata = null;\r\n document.getElementById(\"row\"+curr).setAttribute(\"contenteditable\", true)\r\n document.getElementById(\"saveBtn\"+curr).style.visibility = \"visible\"\r\n document.getElementById(\"cancelBtn\"+curr).style.visibility = \"visible\"\r\n document.getElementById(\"editBtn\"+curr).style.visibility = \"hidden\"\r\n}", "function initEdit() {\n $scope.income.transactionId = mainService.incomesData[mainService.itemIndex].transactionId;\n $scope.income.payer = mainService.incomesData[mainService.itemIndex].payer;\n $scope.income.payee = mainService.incomesData[mainService.itemIndex].payee;\n $scope.income.category = mainService.incomesData[mainService.itemIndex].category;\n $scope.income.amount = parseFloat(mainService.incomesData[mainService.itemIndex].amount);\n $scope.income.date = new Date(mainService.incomesData[mainService.itemIndex].date);\n $scope.income.modeOfPayment = mainService.incomesData[mainService.itemIndex].modeOfPayment;\n $scope.income.noteType = mainService.incomesData[mainService.itemIndex].noteType;\n }", "function EditHandler() {\n fetch(GetApi, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(GetData),\n }).then((res) => {\n if (res.status === 200) {\n fetch(GetApi)\n .then((res) => res.json())\n .then((data) => SetstatusApi(data));\n }\n });\n\n SetEditdata(!EditData);\n }", "selectModel(){\n var estado=$(this).attr('data-estado');\n var id=$(this).attr('data-id');\n if(estado=='inactivo'){\n homeFunctions.modelosSeleccionados.push(id);\n $(this).attr('data-estado','activo');\n }else{\n homeFunctions.modelosSeleccionados.splice(homeFunctions.modelosSeleccionados.indexOf(id),1);\n $(this).attr('data-estado','inactivo');\n }\n homeFunctions._checkControlButtons();\n console.log(homeFunctions.modelosSeleccionados);\n }", "get _isOperation () { return true }", "function editClicked() {\n edit = true;\n}", "editShape () {\n this.shapeStyle = EDIT_SHAPE_STYLE\n this.edit = true\n this.freeDraw._updateModel('edit', this.id)\n this.freeDraw._refreshShapesInCanvas()\n this._backupData()\n return this\n }", "function save_main_options() {\n chrome.storage.sync.set({ operationMode: this.value}, function (items) {\n try_update_status('status', 'Options saved', 1300);\n });\n}", "function setCommitChangesBtnEditMode() {\n if (!editModeCommandErrors && editModeCommandNew) {\n $(\"#commitChanges\").prop(\"disabled\", false);\n } else {\n $(\"#commitChanges\").prop(\"disabled\", true);\n }\n}", "function enterPlanMode(){\n vm.permission.planMode = true;\n vm.permission.endHint = false;\n angular.copy(vm.model.data,vm.plan.current);\n\n for(var i = 0;i < vm.plan.current.length;i++)\n {\n vm.plan.current[i].id = i;\n vm.plan.current[i].isSelected = false;\n }\n\n angular.element('.plan-overlay').css('visibility','visible');\n\n }", "function save() {\n\t\t\t\t\t\t$rootScope.$broadcast(\"modal:blockAllOperations\");\n\t\t\t\t\t\tDataTypesPageService.save($scope.dataType);\n\t\t\t\t\t}", "'click .js-change' (event) {\n event.preventDefault();\n\n const updatedPoints = EditPoints.find({}).fetch();\n\n // add edit to the edit collection\n Meteor.call('insertEdits', updatedPoints, flagsHash[selectedFlag.get()].val, note.get());\n\n // update the edited points with the selected flag and note on the server\n updatedPoints.forEach(function(point) {\n Meteor.call('insertUpdateFlag', point.site, point.x, point.instrument, point.measurement, flagsHash[selectedFlag.get()].val, note.get());\n });\n\n // Clear note field\n $('#editNote').val('');\n }", "function SwitchToEditableMode(iGroupID) {\n if (IsEmpty(iGroupID)) iGroupID = -1;\n\n var c;\n for (var index in aCtrls) {\n oInfo = aCtrls[index];\n\n if (iGroupID > -1 && oInfo.iGroupID != iGroupID) {\n continue;\n }\n\n if (oInfo.sCtrlType == 'lbl') {\n continue;\n }\n\n if (aCtrlGroups[oInfo.iGroupID] !== undefined && (aCtrlGroups[oInfo.iGroupID].bAllowToSwitchMode == false || aCtrlGroups[oInfo.iGroupID].sWorkMode == 'W')) {\n continue;\n }\n\n if (!IsNull(oInfo.oOtherProp) && !IsNull(oInfo.oOtherProp.bPreventWOChange) && oInfo.oOtherProp.bPreventWOChange == true) {\n continue;\n }\n\n if (oInfo.sCtrlType == 'chk' || oInfo.sCtrlType == 'rad') {\n $('#' + oInfo.sClientID).prop(\"disabled\", false);\n oInfo.oOtherProp.bPrevState = GetValue(oInfo.sClientID, oInfo.sCtrlType, oInfo);\n }\n else if (oInfo.sCtrlType == 'rgbtn') {\n $('input[name=' + oInfo.sClientID + ']').prop(\"disabled\", false);\n oInfo.oOtherProp.sPrevValue = GetValue(oInfo.sClientID, oInfo.sCtrlType, oInfo);\n }\n else if (oInfo.sCtrlType == 'ddl') {\n\n $('#' + oInfo.oOtherProp.sClientIDR).hide();\n if ($.browser.msie && $.browser.version <= 7) { $('#' + oInfo.oOtherProp.sClientIDR).css({ 'float': 'left' }); }\n\n c = $('#' + oInfo.sClientID);\n c.removeClass('read-only');\n c.show();\n\n oInfo.oOtherProp.sPrevValue = oInfo.oOtherProp.sValue;\n oInfo.oOtherProp.sPrevText = oInfo.oOtherProp.sText;\n\n if (IsDDLLoaded(index)) {\n c.val(oInfo.oOtherProp.sValue);\n }\n else if (oInfo.oOtherProp.bLoadOnDemand == true) {\n LoadDropDownList(oInfo.sClientID, oInfo.oOtherProp.sOnDemandUrl, GetDDLExtraParams(index), false,\n oInfo.oOtherProp.sValue, oInfo.oOtherProp.sText, false, false,\n -1, true, null);\n }\n }\n else if (oInfo.sCtrlType == 'txt' || oInfo.sCtrlType == 'txt_auto') {\n c = $('#' + oInfo.sClientID);\n c.prop(\"readonly\", false);\n c.removeClass('read-only');\n if (c.hasClass('hasDatepicker')) {\n $(c).datepicker(\"enable\");\n }\n if (c.hasClass('hasTimepicker')) {\n $(c).timepicker(\"enable\");\n }\n\n if (oInfo.sCtrlType == 'txt_auto') {\n oInfo.oOtherProp.sPrevValue = oInfo.oOtherProp.sValue;\n oInfo.oOtherProp.sPrevText = oInfo.oOtherProp.sText;\n }\n else {\n oInfo.oOtherProp.sPrevText = c.val();\n }\n\n if (!IsEmpty(oInfo.oOtherProp.sInputMask)) {\n $(c).mask(oInfo.oOtherProp.sInputMask);\n }\n }\n }\n\n for (var gid in aCtrlGroups) {\n if (iGroupID > -1 && gid != iGroupID) continue;\n aCtrlGroups[gid].sWorkMode = 'W';\n }\n}", "edit() {\n return this._isAdmin();\n }", "edit() {\n }", "mode ( n, o ) {\n if ( n !== o ) {\n\n // For view mode create a non-existent handle to disable DnD\n const disable = n === 'view';\n\n this.setModeClass();\n\n this.rows.forEach ( row => {\n\n const $comp = this.$refs[ `row_${ row._id }` ];\n if ( $comp.length === 0 ) {\n throw new Error ( `Unable to locate DOM element for row ${ row._id }.` );\n }\n\n Sortable\n .get ( $comp[ 0 ] )\n .option ( 'disabled', disable )\n ;\n\n } );\n\n Sortable\n .get ( this.$el.firstChild )\n .option ( 'disabled', disable );\n\n }\n }", "function edit(val) {\n resetAll();\n try {\n var data = JSON.parse(val[1]);\n if (val[0] != \"0\") {\n fillControlsFromJson(data[0]);\n \n if (data[0].image != \"\" && data[0].image != null) {\n $(\"#divuploadimage img\").prop(\"src\", data[0].image);\n $(\"#imgItemURL\").prop(\"src\", data[0].image);\n } else {\n $(\"#divuploadimage img\").prop(\"src\", \"\");\n $(\"#imgItemURL\").prop(\"src\", \"\");\n }\n $(\"#cmdSave\").prop(\"CommandArgument\", \"Update\");\n $(\"#lblmainid\").val( data[0].id);\n if (formOperation == \"update\") {\n setformforupdate();\n formOperation = \"\";\n }\n //implementers.GetWorkerInfo(data[0].id, function (val) {\n // if (val[0] == \"1\") {\n // var data = JSON.parse(val[1]);\n // $(\"#user_nm\").val(data[0].User_Name);\n // $(\"#password\").val(data[0].User_Password);\n // } else {\n // $(\"#user_nm\").val(\"\");\n // $(\"#password\").val(\"\");\n // }\n //});\n } else {\n showErrorMessage(\"No data found !!\");\n }\n } catch (err) {\n alert(err);\n }\n}", "function editModeOn() {\n\tif(document.getElementById(\"editorTextInputField\")){\n\t\talert(\"Egyszerre egy mezot szerkeszthetsz!\");\n\t\treturn;\n\t}\n\thiddenMenusOff();\n\tif(!editMode) {\n\t\t$('#edit-mode').addClass(\"active\");\n\t\teditMode = true;\n\t\tonclickToTexts();\n\t} else {\n\t\tif(document.getElementById(\"editorTextInputField\")){\n\t\t\talert(\"Fejezd be a szerkesztest mielott kilepsz a szerkesztesmodbol!\");\n\t\t\treturn;\n\t\t}\n\t\thiddenMenusOff();\n\t\teditMode = false;\n\t}\n}", "ModifyListItem (Mode) \n\t{\n\t\tvar NewTodo = this.state.TodoItems;\n\t\tvar NKey = this.state.NextKey;\n\t\t\n\t\tif (this.state.Mode){\n\t\t\tNewTodo[NKey] = {id: NKey.toString(), Item: this.state.value};\n\t\t\tNKey = NKey + 1;\n\t\t\tthis.setState({NextKey: NKey});\n\t\t\t\n\t\t\talert(\"Item Added.\");\n\t\t}\n\t\telse {\n\t\t\t\t\t\n\t\t\tNewTodo[this.state.ActiveKey].Item = this.state.value;\n\t\t\t\n\t\t\talert(\"Change Confirmed.\");\n\t\t\tthis.setState({Mode: true});\n\t\t}\n\t\tthis.setState({TodoItems: NewTodo});\n\t\tthis.setState({value: \"\"});\n\t}", "function openModel(context) {\n document.getElementById(\"editData\").disabled = false\n Context = context;\n console.log(\"Context id :\", Context.id);\n alert(\" Now Press \\\"Enter Data\\\" button \\n It is enabled \")\n\n}", "setMode(mode) {\n this.mode.current = mode;\n this.$location.search('mode', mode);\n return this.setFilters();\n }", "function checkCommandInEditMode() {\n var editCommand = new Object();\n editCommand[openCommand] = new Object();\n\n //add each default answer\n $(\".oldAnswerEdit\").each(function(i, e) {\n var answerName = $(e).val();\n var answerOutput = $(e).closest(\".row\").next(\"div\").children(\"div\").eq(0).children(\"div\").eq(0).children(\"textarea\").val();\n var lastChangedText = $(e).closest(\".row\").next(\"div\").children(\"div\").eq(0).children(\"div\").eq(1).children(\"small\").text();\n\n editCommand[openCommand][answerName] = new Object();\n //add answer key and value to answer object\n editCommand[openCommand][answerName][\"answer\"] = answerOutput;\n editCommand[openCommand][answerName][\"lastChangedAnswer\"] = lastChangedText;\n //add variables object\n editCommand[openCommand][answerName][\"variables\"] = new Object();\n //add each variable object\n $(\".availableVariable\", $(e).closest(\".row\").next(\"div\").children(\"div\").eq(1).children(\"div\")).each(function(i, e) {\n var variableName = e.innerHTML;\n var variableIdentifier = $(e).attr(\"data-original-title\");\n editCommand[openCommand][answerName][\"variables\"][variableName] = variableIdentifier;\n\n })\n });\n\n //add each new answer\n $(\".newAnswerEdit\").each(function(i, e) {\n var answerName = $(e).val();\n var answerOutput = $(e).closest(\".row\").next(\"div\").children(\"div\").eq(0).children(\"textarea\").val();\n var lastChangedText = $(e).closest(\".row\").next(\"div\").children(\"div\").eq(0).children(\"div\").eq(1).children(\"small\").text();\n\n editCommand[openCommand][answerName] = new Object();\n //add answer key and value to answer object\n editCommand[openCommand][answerName][\"answer\"] = answerOutput;\n editCommand[openCommand][answerName][\"lastChangedAnswer\"] = lastChangedText;\n //add variables object\n editCommand[openCommand][answerName][\"variables\"] = new Object();\n\n //add each variable object\n $(\".availableVariable\", $(e).closest(\".row\").next(\"div\").children(\"div\").eq(1)).each(function(i, e) {\n var variableName = e.innerHTML;\n var variableIdentifier = $(e).attr(\"data-original-title\");\n editCommand[openCommand][answerName][\"variables\"][variableName] = variableIdentifier;\n\n })\n });\n\n if (JSON.stringify(editCommand[openCommand]) !== JSON.stringify(botCommandObject[openCommand])) {\n editModeCommandNew = true;\n } else {\n editModeCommandNew = false;\n }\n\n setCommitChangesBtnEditMode();\n}", "function changeMode() {\n\tif (editMode) {\n\t\teditMode = false;\n\t\tdrawingManager.setMap(null);\n\t\tdocument.getElementById ( \"editAreaMenu\" ).style.display = \"none\";\n\t\tdocument.getElementById ( \"viewMenu\" ).style.display = \"block\";\n\n\t\tselectedArea = null;\n\t\tdocument.getElementById(\"textInputAreaName\").oninput = null;\n\t} else {\n\t\teditMode = true;\n\t\tdrawingManager.setMap(map);\n\t\tdocument.getElementById ( \"editAreaMenu\" ).style.display = \"block\";\n\t\tdocument.getElementById ( \"viewMenu\" ).style.display = \"none\";\n\n\t\tdocument.getElementById(\"textInputAreaName\").oninput = function(){\n\t\t\tselectedArea.label.set('text', document.getElementById(\"textInputAreaName\").value);\n\t\t\tselectCircle(selectedArea.circle);\n\t\t\tif(selectedArea.status == 'old'){\n\t\t\t\tselectedArea.status = 'changed';\n\t\t\t}\n\t\t};\n\t}\n\t\n\tfor(i = 0; i < sizeListArea; ++i){\n\t\tlistArea[i].circle.setEditable(editMode);\n\t}\n}", "function toggleTableEdit(e){\n\tif($.editBtn.title=='Edit'){\n\t\t$.editBtn.title='Done';\n\t\t$.objectList.editing = true;\t\t\n\t}\n\telse{\n\t\t$.editBtn.title='Edit';\n\t\t$.objectList.editing = false;\t\t\t\t\n\t}\n}", "function setectionModeClick() {\n if (document.getElementById(\"rbSetectionModeAdd\").checked) {\n gImageInfoViewer.setSelectionMode(SelectionModeEnum.ADD);\n } else {\n gImageInfoViewer.setSelectionMode(SelectionModeEnum.REMOVE);\n }\n}", "setActualState(autoModeIdx) { \r\n if(autoModeIdx >= 0 && autoModeIdx < this.modeTitleList.length){\r\n this.actValText = this.modeTitleList[autoModeIdx];\r\n } else {\r\n this.actValText = \"????\";\r\n }\r\n this.hasData = true;\r\n }", "view() {\n this.dialogCreateEditView.option(resource.ref.RefView);\n $(\"#btnDlHelp\").removeClass(\"button-disable\");\n $(\"#btnDlClose\").removeClass(\"button-disable\");\n $(\"#btnDlAdd\").removeClass(\"button-disable\");\n $(\"#btnDlUpdate\").removeClass(\"button-disable\");\n $(\"#btnDlPrev\").removeClass(\"button-disable\");\n $(\"#btnDlNext\").removeClass(\"button-disable\");\n $(\"#btnDlPrint\").removeClass(\"button-disable\");\n $(\"#btnDlDelete\").removeClass(\"button-disable\");\n $(\"#goFirst\").removeClass(\"button-disable\");\n $(\"#goLast\").removeClass(\"button-disable\");\n this.checkButtonViewDisable();\n this.checkSave = true;\n this.getRefByID(1);\n $(\"#dialogCreateEditView input:visible\").attr(\"disabled\", \"disabled\");\n $(\"#dialogCreateEditView input:visible\").parent().addClass(\"disable\");\n }", "function getOp(event){\n\tvar op = operation.options[operation.selectedIndex].value;\n\t//define qual operacao sera realizada na curva\n\tif(op == \"add\"){\n\t\taddPoint(event);\n\t}else if(op == \"del\"){\n\t\tdeletePoint(event);\n\t}else if(op == \"edit\"){\n\t\teditPoint(event);\n\t}\n}", "[consts.VIS_EDIT_CATEGORY](state, obj) {\n state.visEditCategory = obj.vis;\n }", "function EditEntry(editid, view) {\n\n\n $(\"#lblError\").hide();\n var $select = $('#lblStatusText');\n\n\n if (view == 1) {\n\n $(\"#lblentrymode\").html(\"View\");\n $(\"#frmMaster :input\").prop(\"disabled\", true);\n $(\"#btnSubmit\").hide();\n $select.show();\n $('#StatusShow').show();\n $(\"#btnCancel\").prop(\"disabled\", false)\n $(\"#mdlCreate\").attr(\"data-edit\", \"view\");\n $(\"#btnCancel\").html(\"Close\");\n \n\n }\n else {\n $(\"#lblentrymode\").html(\"Modify\");\n $(\"#frmMaster :input\").prop(\"disabled\", false);\n $select.hide();\n $('#StatusShow').hide();\n $(\"#btnSubmit\").show();\n $(\"#EntryMode\").val('Edit');\n $(\"#mdlCreate\").attr(\"data-edit\", \"edit\");\n\n\n }\n\n $(\"#mdlCreate\").attr(\"data-id\", '');\n $(\"#mdlCreate\").attr(\"data-id\", editid);\n $(\"[name='chkPayC']\").bootstrapSwitch('disabled', false);\n $(\"[name='chkStatus']\").bootstrapSwitch('disabled', false);\n // New added for NStatus\n\n $select.text('Status');\n\n var json;\n $.ajax({\n type: \"POST\",\n url: \"CouponTypes.aspx/GetCouponCategoryById\",\n dataType: \"json\",\n data: JSON.stringify({ 'CatId': editid }),\n contentType: \"application/json; charset=utf-8\",\n async: true,\n cache: false,\n success: function (res) {\n\n json = JSON.parse(res.d);\n\n $(\"#txtCatCode\").val(json[0].Category.trim());\n $(\"#txtCouponPrefix\").val(json[0].CouponPrefix.trim());\n $(\"#txtDescription\").val(json[0].Description.trim());\n\n $(\"[name='chkStatus']\").bootstrapSwitch('state', json[0].Status == '1' ? true : false);\n $(\"[name='chkStatus']\").bootstrapSwitch('disabled', true);\n $(\"[name='chkPayC']\").bootstrapSwitch('state', json[0].PayC == '1' ? true : false);\n if (view == 1) {\n $(\"[name='chkPayC']\").bootstrapSwitch('disabled', true);\n }\n\n }\n\n });\n\n $('#mdlCreate').modal('show');\n\n}", "setEditMode(value) {\n this.setState({ editMode: value });\n }", "function editSucursal(item) {\n this.editing = false;\n item.enterprise = item.enterprise._id;\n for (var i in item.cajas) {\n item.cajas[i] = item.cajas[i]._id;\n };\n item.$update(function() {\n console.log('todo ok');\n }, function(errorResponse) {\n console.log('error');\n });\n }", "function setDataReqFromInModify(data){\n\t\n\t$('#requestNo').val(data.requestNo);\n\t$('#requestStatus').val(data.status);\n\t$('#lastUpdate').val(setDate(data.created));\n\tif(data.formType == \"IN\"){\n\t\t$('#receipt').prop(\"checked\",true);\n\t\t$('#issue').prop(\"checked\",false);\n\t}else{\n\t\t$('#receipt').prop(\"checked\",false);\n\t\t$('#issue').prop(\"checked\",true);\n\t}\n\tsetCompanyAll(\"companyCode\",\"\",data.companyCode);\n\tsetBank(\"bankCode\",\"\",data.bankCode);\n\t\t\tsetDocType(\"docType\",\"\",data.docType);\n\t\t\t$('#docTypeName').val(data.docTypeName);\n\t\t\t$('#requestorName').text(data.requestorName);\n\t\t\t$('#bgNo').val(data.bgNo);\n\t\t\t$('#amendNo').text(data.amendNo);\n\t\t\t\n\t\t\tif(data.amendType == \"DECREASE\" || data.amendType == undefined){\n\t\t\t\t$('#amendment').prop(\"checked\",true);\n\t\t\t}else{\n\t\t\t\t$('#amentEdit').prop(\"checked\",true);\n\t\t\t}\n\t\t\t\n\t\t\t$('#amountTbody').empty();\n\t\t\tfor(var i=0 ; i<data.amounts.length ; i++){\n\t\t\t\taddAmount(0,data.amounts[i].amount,data.amounts[i].currencyCode);\n\t\t\t\t$('#amontTr1').remove();\n\t\t\t}\n\t\t\t\n\t\t\t$('#openEnd').val(data.openEnd);\n\t\t\tif(data.openEnd == \"CLOSE\"){\n\t\t\t\t$('#formExpiredDate').show();\n\t\t\t}\n\t\t\t\n\t\t\t$('#effectiveDate').val(setDate(data.effectiveDate));\n\t\t\tif(data.expiredDate == \"\" || data.expiredDate == undefined){\n\t\t\t\t$('#expiredDate').val(null);\n\t\t\t}else{\n\t\t\t\t$('#expiredDate').val(setDate(data.expiredDate));\n\t\t\t}\n\t\t\t$('#periodYear').val(data.periodYear);\n\t\t\t$('#periodMonth').val(data.periodMonth);\n\t\t\t$('#periodDay').val(data.periodDay);\n\t\t\t$('#issueDate').val(setDate(data.issueDate));\n\t\t\t\n\t\t\tif(data.vendorType.toUpperCase() == \"VENDOR\"){\n\t\t\t\t$('#vender').prop(\"checked\",true);\n\t\t\t}else{\n\t\t\t\t$('#customer').prop(\"checked\",true);\n\t\t\t}\n\t\t\t$.when(ajaxTaskDocType).done(function() {\n\t\t\t\tgetSearchName(data.vendorCode);\n\t\t\t\t$.when(ajaxTaskSearchName).done(function() {\n\t\t\t\t\tsetDataVenCus();\n\t\t\t\t});\n\t\t\t});\n\t\t\t$('#ownerId').val(data.ownerId);\n\t\t\t$('#owner').val(data.owner);\n\t\t\t$('#ownerLastName').val(data.ownerLastName);\n\t\t\t$('#ownerContactInfo').val(data.ownerContactInfo);\n\t\t\t\n\t\t\t$('#poSoNo').val(data.poSoNo);\n\t\t\t$('#buyerName').val(data.buyerName);\n\t\t\t$('#buyerEmployeeID').val(data.buyerEmployeeID);\n\t\t\t$('#contractNo').val(data.contractNo);\n\t\t\t\n\t\t\t$('#conAmountTbody').empty();\n\t\t\tfor(var i=0 ; i<data.contractAmounts.length ; i++){\n\t\t\t\taddConAmount(0,data.contractAmounts[i].contractAmount,data.contractAmounts[i].contractCurrencyCode,data.contractAmounts[i].percentOfGuarantee);\n\t\t\t\t$('#conAmontTr1').remove();\n\t\t\t}\n\t\t\t\n\t\t\t$('#projectJob').val(data.projectJob);\n\t\t\t$('#expectedDueDate').val(setDate(data.expectedDueDate));\n\t\t\t\n\t\t\t\n\t\t\tvar reqType = [];\n \t\tif(loadFirst == 0){\n \t\t\tvar selected = sessionStorage.getItem('requestTypeSession');\n \t\t\tif(selected == \"null\"){\n \t\t\t\tsetRequestTypeModify(data.status,data.requestType);\n \t\t\t}else{\n \t\t\t\tsetRequestTypeModify(data.status,selected);\n \t\t\t}\n \t\t\tloadFirst++;\n \t\t}else{\n \t\t\tvar selected = sessionStorage.getItem('requestTypeSession');\n \t\t\tsetRequestTypeModify(data.status,selected);\n \t\t}\n \t\tsessionStorage.setItem('requestTypeSession', null);\n \t\t$.when(ajaxTaskRequestTypeModify).done(function() {\n \t\t\tstatusEvent = data.status;\n \t\t\tvar readOnly = data.readOnly;\n \t\tif(readOnly == \"N\" || readOnly == undefined){\n \t\t\tif(data.status.toUpperCase() == \"NEW\" || data.status.toUpperCase() == \"RETURN\"){\n \t\t\t\t\n \t \t\t\t\tdisabledAll();\n \t \t\t\t\t$('#requestType').prop(\"disabled\",true);\n \t\t\t\t\t\t$('#remarkHistory').show();\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\n \t\t\t}else if(data.status.toUpperCase() == \"DRAFT\" && data.requestType.toUpperCase() == \"CREATE\"){\n\t \t\t\t\t$('#requestType').prop(\"disabled\",true);\n\t\t\t\t\t\t\t$('#remarkHistory').hide();\n\t\t\t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t}\n \t\t\t}else if(data.status.toUpperCase() == \"REJECT\"){\n \t\t\t\tdisabledAll();\n \t\t\t\t$('#remarkHistory').show();\n \t\t\t}else{\n \t\t\t\tvar type = $('#requestType').val();\n \t\t\t\tif(type == \"DECREASE\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\tif(data.status.toUpperCase() == \"VALID\"){\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",false);\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",true);\n \t\t\t\t\t}\n \t\t\t\t\t// $('#remarkHistory').toggle();\n \t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t\t$('#buttonCreate').hide();\n \t\t\t\t\t//$('#issueDate').prop(\"disabled\",false);\n \t\t\t\t\t//$('#effectiveDate').prop(\"disabled\",false);\n \t\t\t\t\t//$('#expiredDate').prop(\"disabled\",false);\n \t\t\t\t\t//$('#formEffectiveDate .border-left-0').show();\n \t\t\t\t\t//$('#formExpiredDate .border-left-0').show();\n \t\t\t\t\t//$('#formIssueDate .border-left-0').show();\n \t\t\t\t\t$('#amountTbody .btnEvent').show();\n \t\t\t\t\t$('#amountTbody input').prop(\"disabled\",false);\n \t\t\t\t\t$('#amountTbody select').prop(\"disabled\",false);\n \t\t\t\t\t$('#remarkHistory').hide();\n \t\t\t\t\t$('.amountCurreny').prop(\"disabled\",true);\n \t\t\t\t\t$('.botSellingRate').prop(\"disabled\",true);\n \t\t\t\t\t$('.btnEvent').hide();\n \t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}else if(type == \"EXTEND\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\tif(data.status.toUpperCase() == \"VALID\"){\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",false);\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",true);\n \t\t\t\t\t}\n \t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t\t// $('#buttonCreate').hide();\n \t\t\t\t\t$('#issueDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#effectiveDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#expiredDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#formEffectiveDate .border-left-0').show();\n \t\t\t\t\t$('#formExpiredDate .border-left-0').show();\n \t\t\t\t\t$('#formIssueDate .border-left-0').show();\n \t\t\t\t\t$('#remarkHistory').hide();\n \t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t}\n \t\t\t\t}else if(type == \"INCREASE\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\t$('#buttonCreate').hide();\n \t\t\t\t\t$('.amountCurreny').prop(\"disabled\",true);\n \t\t\t\t\t$('.btnEvent').hide();\n \t\t\t\t\t$('#amountTbody .btnEvent').hide();\n \t\t\t\t\t$('#amountTbody select').prop(\"disabled\",true);\n \t\t\t\t\tif(data.status.toUpperCase() == \"VALID\"){\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",false);\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",true);\n \t\t\t\t\t}\n \t\t\t\t\t$('#remarkHistory').hide();\n \t\t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t\t\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t\t$('#formEffectiveDate .border-left-0').show();\n \t\t\t\t\t$('#formExpiredDate .border-left-0').show();\n \t\t\t\t\t$('#formIssueDate .border-left-0').show();\n \t\t\t\t\t$('#issueDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#effectiveDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#expiredDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#amountTbody input').prop(\"disabled\",false);\n \t\t\t\t\t$('.botSellingRate').prop(\"disabled\",true);\n \t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}else if(type == \"RETURN\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\t$('#returnContactInfo').show();\n \t\t\t\t\tif(data.status.toUpperCase() == \"VALID\"){\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",false);\n \t\t\t\t\t\t$('#returnContactInfo input').prop(\"disabled\",false);\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",true);\n \t\t\t\t\t}\n \t\t\t\t\t$('#remarkHistory').hide();\n \t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}else{\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\t$('.btnEvent').hide();\n \t\t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t\t$('#remarkHistory').show();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(data.status.toUpperCase() == \"COMPLETE\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\tif(type == \"RETURN\"){\n \t\t\t\t\t\t$('#returnContactInfo').show();\n \t\t\t\t\t}\n \t\t\t\t\t$('#remarkHistory').show();\n \t\t\t\t\t$('#buttonModify').hide();\n// $('#fileBrowsBox').hide();\n// $('.btnRemoveFile').hide();\n// $('#remarkCreate').hide();\n \t\t\t\t\t\n \t\t\t\t}else if(data.status.toUpperCase() == \"WAITING_SUBMIT\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n\n \t\t}else{\n \t\t\tdisabledAll();\n \t\t\t$('#remarkHistory').show();\n \t\t}\n \t\t\tif (data.status.toUpperCase() == \"WAITING_ACCEPT\"){\n \t\t\t\tdisabledAll();\n \t\t\t\t$('#fileBrowsBox').show();\n\t\t\t\t\t$('.btnRemoveFile').show();\n\t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\t$('#spinner').hide();\n \t\t});\n \t\t\n}" ]
[ "0.6250643", "0.62061447", "0.6168037", "0.61565536", "0.60810053", "0.58429164", "0.58047915", "0.5736389", "0.5726355", "0.5716586", "0.56958395", "0.5654687", "0.56344986", "0.56238943", "0.5603323", "0.5582353", "0.55768484", "0.556819", "0.55554056", "0.5552621", "0.55426556", "0.5514146", "0.5506199", "0.5492428", "0.54753923", "0.5460779", "0.54454863", "0.5444591", "0.5421726", "0.5419417", "0.5400057", "0.53979164", "0.53904814", "0.5380119", "0.5378553", "0.53667367", "0.53478134", "0.53387016", "0.53165483", "0.5311397", "0.52980095", "0.52964073", "0.5290255", "0.5279414", "0.52679735", "0.526231", "0.52564025", "0.52509105", "0.5250785", "0.525069", "0.5243661", "0.52347463", "0.52290666", "0.52175343", "0.5213724", "0.5211021", "0.51965886", "0.51953626", "0.5194601", "0.5192845", "0.5185005", "0.5184988", "0.5182662", "0.51792735", "0.51792735", "0.5175953", "0.5163479", "0.5159782", "0.51561564", "0.5154822", "0.5154305", "0.515168", "0.5147168", "0.5134696", "0.51281464", "0.5123442", "0.5116578", "0.5115707", "0.50985414", "0.5096085", "0.50938606", "0.508495", "0.50819796", "0.50803137", "0.5079527", "0.5078343", "0.5076362", "0.50695693", "0.5067316", "0.5061049", "0.5040688", "0.50376546", "0.50319725", "0.50268584", "0.50201756", "0.5016364", "0.5016018", "0.50148904", "0.50066024", "0.5003781" ]
0.67604053
0
get the values added in the fancybox and add them to the flex grid
function populateValuesInGrid(event) { //value of 1 means affiliated with LUMS event.field.find(".configName").text($("#configNamePopUp").val()) event.field.find("*[id*=name]").val($("#configNamePopUp").val()) event.field.find(".editConfigLink").click(function() { //set edit mode setEditOrCreateMode("1") //set the row currently being edited editRow = $(this).closest('tr'); //set the closest flex table currentFlexTable=$(this).closest('table') //set values in the fancybox for edit mode setValuesForEditBeforeOpen() }).fancybox() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initFancyGallery()\n\t{\n\t\tvar $slides = $('.more-views__fancy-item');\n\t\t\n\t\tif ( $slides.length > 0 )\n\t\t{\n\t\t\t$slides.fancybox({\n\t\t\t\tkeyboard: true,\n\t\t\t\tloop: true,\n\t\t\t\tarrows: true,\n\t\t\t\tinfobar: true,\n\t\t\t\tsmallBtn: \"auto\",\n\t\t\t\ttoolbar: \"auto\",\n\t\t\t\tbaseClass: \"configurator-product__gallery-fancybox\",\n\t\t\t\ttitle: \"Gaming PC Konfigurator Intel (9. Gen.) (So. 1151)\"\n\t\t\t});\n\t\t}\n\t}", "function appendImages(matches){\n //matches is the same number of items clicked !!!!\n var foundImages = [];\n // console.log(matches.length);\n for (var i = 0; i < matches.length; i++) {\n\n var found = $(document).find('img#' + matches[i]);\n foundImages.push(found);\n }\n\n var $cells = $('#' + chosenGrid).children(':lt('+ matches.length + ')');\n // console.log($cells);\n\n for (var i = 0; i < $cells.length; i++) {\n $($cells[i]).append(foundImages[i]);\n\n\n var gardenPlotArr = [];\n var myGardenPlot = $($cells[i]).append(foundImages[i]);\n gardenPlotArr.push(myGardenPlot);\n console.log(myGardenPlot);\n console.log(gardenPlotArr);\n function addToLocalStorage(){\n data = JSON.stringify(myGardenPlot);\n window.localStorage.myGardenPlot = data\n console.log(data);\n }\n addToLocalStorage();\n // getMyPlotFromLocalStorage();\n //\n function getMyPlotFromLocalStorage(){\n if (window.localStorage.myGardenPlot) {\n var myGardenPlot = JSON.parse(window.localStorage.myGardenPlot);\n console.log(myGardenPlot);\n // for(var key in myGardenPlot){\n // //$(\"#\" + key).val(colorData[key]);\n // document.getElementById(key).value = myGardenPlot[key];\n // }\n }\n }\n // gardenPlotArr.push(gardenPlot);\n // console.log(gardenPlotArr);\n\n\n\n // addRecipeToPopupDiv();\n\n }\n}", "function addlag(){\r\n lagcounter = lagcounter + 1;\r\n var lagdiv = $('div[name=\"lagcontent\"]');\r\n var lagcountdiv = $('<div class=\"w3-col\" name=\"'+ lagcounter +'\"></div>');\r\n var content = '\t<div class=\"w3-col m10 s9 w3-padding\"> \\\r\n <a href=\"javascript:void(0)\" onclick=\"removelag('+ lagcounter +')\"> \\\r\n <h5 class=\"w3-margin-bottom\"><b> \\\r\n <span class=\"glyphicon glyphicon-asterisk\"></span> LAG ITEM ' +\r\n lagcounter +'</b></h5></a> \\\r\n </div> \\\r\n <div class=\"w3-col m10 s9 w3-padding\"> \\\r\n\t\t\t\t\t\t<p class=\"w3-padding\"> \\\r\n\t\t\t\t\t\t\t<label>Category:</label> \\\r\n\t\t\t\t\t\t\t<select class=\"w3-select w3-round w3-light-grey\" name=\"b_cat\"> \\\r\n\t\t\t\t\t\t\t</select> \\\r\n\t\t\t\t\t\t</p> \\\r\n\t\t\t\t\t</div> \\\r\n\t\t\t\t\t<div class=\"w3-col m10 s9 w3-padding\"> \\\r\n\t\t\t\t\t\t<p class=\"w3-padding\"> \\\r\n\t\t\t\t\t\t\t<label>Item: </label> \\\r\n\t\t\t\t\t\t\t<input class=\"w3-input w3-round w3-light-grey\" name=\"b_opt\" type=\"text\"> \\\r\n\t\t\t\t\t\t</p> \\\r\n\t\t\t\t\t</div> \\\r\n\t\t\t\t\t<div class=\"w3-col m10 s9\"> \\\r\n\t\t\t\t\t\t<div class=\"w3-col s4 w3-padding\"> \\\r\n\t\t\t\t\t\t\t<p class=\"w3-padding\"> \\\r\n\t\t\t\t\t\t\t\t<label class=\"w3-margin-bottom\">Source:</label> \\\r\n\t\t\t\t\t\t\t\t<input class=\"w3-input w3-round w3-light-grey\" name=\"b_src\" type=\"text\"> \\\r\n\t\t\t\t\t\t\t</p> \\\r\n\t\t\t\t\t\t</div> \\\r\n\t\t\t\t\t\t<div class=\"w3-col s4 w3-padding\"> \\\r\n\t\t\t\t\t\t\t<p class=\"w3-padding\"> \\\r\n\t\t\t\t\t\t\t\t<label class=\"w3-margin-bottom\">Order Placement Date:</label> \\\r\n\t\t\t\t\t\t\t\t<input class=\"w3-input w3-border w3-light-grey w3-round\" name=\"b_ord_d\" type=\"date\"> \\\r\n\t\t\t\t\t\t\t</p> \\\r\n\t\t\t\t\t\t</div> \\\r\n\t\t\t\t\t\t<div class=\"w3-col s4 w3-padding\"> \\\r\n\t\t\t\t\t\t\t<p class=\"w3-padding\"> \\\r\n\t\t\t\t\t\t\t\t<label class=\"w3-margin-bottom\">Expected Delivery Date:</label> \\\r\n\t\t\t\t\t\t\t\t<input class=\"w3-input w3-border w3-light-grey w3-round\" name=\"b_del_d\" type=\"date\"> \\\r\n\t\t\t\t\t\t\t</p> \\\r\n\t\t\t\t\t\t</div> \\\r\n\t\t\t\t\t</div> \\\r\n\t\t\t\t\t<div class=\"w3-col m10 s9 w3-padding\"> \\\r\n\t\t\t\t\t\t<div class=\"w3-col w3-half\"> \\\r\n\t\t\t\t\t\t\t<p class=\"w3-padding w3-margin-right\"> \\\r\n\t\t\t\t\t\t\t\t<label class=\"w3-left\">Contact Info:</label> \\\r\n\t\t\t\t\t\t\t\t<input class=\"w3-input w3-round w3-light-grey\" name=\"b_cont\" type=\"text\"> \\\r\n\t\t\t\t\t\t\t</p> \\\r\n\t\t\t\t\t\t</div> \\\r\n\t\t\t\t\t\t<div class=\"w3-col w3-quarter\"> \\\r\n\t\t\t\t\t\t\t<div class=\"w3-half\"> \\\r\n\t\t\t\t\t\t\t\t<p class=\"w3-padding\"> \\\r\n\t\t\t\t\t\t\t\t\t<label class=\"w3-left\">Quantity:</label> \\\r\n\t\t\t\t\t\t\t\t\t<input class=\"w3-input w3-border w3-light-grey w3-round\" name=\"b_qty\" type=\"number\" min=\"0\" onchange=\"updateCostNew()\"> \\\r\n\t\t\t\t\t\t\t\t</p> \\\r\n\t\t\t\t\t\t\t</div> \\\r\n\t\t\t\t\t\t\t<div class=\"w3-half\"> \\\r\n\t\t\t\t\t\t\t\t<p class=\"w3-padding\"> \\\r\n\t\t\t\t\t\t\t\t\t<label class=\"w3-left\">Unit:</label> \\\r\n\t\t\t\t\t\t\t\t\t<input class=\"w3-input w3-round w3-light-grey\" name=\"b_unit\" type=\"text\"> \\\r\n\t\t\t\t\t\t\t\t</p> \\\r\n\t\t\t\t\t\t\t</div> \\\r\n\t\t\t\t\t\t</div> \\\r\n\t\t\t\t\t\t<div class=\"w3-col w3-quarter\"> \\\r\n\t\t\t\t\t\t\t<div class=\"w3-quarter\"> \\\r\n\t\t\t\t\t\t\t\t<label>&nbsp;</label> \\\r\n\t\t\t\t\t\t\t\t<p class=\"w3-padding w3-center w3-large\">x</p> \\\r\n\t\t\t\t\t\t\t</div> \\\r\n\t\t\t\t\t\t\t<div class=\"w3-rest\"> \\\r\n\t\t\t\t\t\t\t\t<p class=\"w3-padding\"> \\\r\n\t\t\t\t\t\t\t\t\t<label class=\"w3-left\">Price/Unit:</label> \\\r\n\t\t\t\t\t\t\t\t\t<input class=\"w3-input w3-round w3-light-grey\" name=\"b_price\" onchange=\"updateCostNew()\" type=\"text\"> \\\r\n\t\t\t\t\t\t\t\t</p> \\\r\n\t\t\t\t\t\t\t</div> \\\r\n\t\t\t\t\t\t</div> \\\r\n\t\t\t\t\t</div> \\\r\n\t\t\t\t\t<div class=\"w3-col m2 s3\" style=\"margin-top:33px\"> \\\r\n\t\t\t\t\t\t<span class=\"w3-right w3-padding\" name=\"total\"></span> \\\r\n </div> \\\r\n <div class=\"w3-col m10 s9 w3-padding\"> \\\r\n <p class=\"w3-padding\"> \\\r\n <label>Memo:</label> \\\r\n <input class=\"w3-input w3-light-grey\" placeholder=\"Write purpose here ...\" name=\"b_memo\" type=\"text\"> \\\r\n </p> \\\r\n </div>'\r\n lagcountdiv.append(content);\r\n lagcountdiv.appendTo(lagdiv);\r\n $('a[name=\"lagTog\"]').empty();\r\n $('a[name=\"lagTog\"]').append('Do you want to add more dependencies?');\r\n\r\n popCat(lagcounter); //populate options\r\n}", "function populateComponents(){\n $('.component').each(function () {\n components.add($(this));\n });\n}", "function populatePage() {\n var boxes = document.createDocumentFragment();\n\n for (var i=0; i < appdata.app_id.length; i++){\n var boxdiv = document.createElement('div');\n boxdiv.draggable = 'true';\n boxdiv.className = 'box';\n boxdiv.innerHTML = \"<a href=\\'\"+appdata.link[i]+\"\\'>\"+appdata.name[i]+\" (\" + appdata.description[i] + \")</a>\";\n boxdiv.style = 'background-color:'+appdata.color[i];\n boxes.appendChild(boxdiv);\n }\n var cont = document.getElementById('boxcontainer');\n cont.appendChild(boxes);\n }", "function displayElements(data) {\n var containerGrid = $('#feed');\n var containerVideo = $('#videos');\n var thumbGrid = '<div class=\"thumbs\">';\n var videoOverlay = '<div class=\"videoSlider\">';\n var len = data.length,\n i = 0;\n for (i; i < len; i++) {\n item = data[i];\n var thUrl = item.thumbnail[0].url;\n var videoObj = item.content[0].url;\n     thumbGrid += '<article><a tabindex=\"1\" id=\"slide-'+i+'\" class=\"fancybox\" href=\"#popup\">';\n thumbGrid += '<figure class=\"is-loading\">';\n thumbGrid += '<img src=\"' + thUrl + '\" alt=\"' + item.title + '\" title=\"' + item.title + '\"/>';\n if ( ( typeof(item.credit) !== 'undefined') && (item.credit[0].role == 'client') ){\n thumbGrid += '<div><figcaption>';\n thumbGrid += '<h4>' + item.credit[0].content + '</h4>';\n thumbGrid += '</figcaption></div>';\n } else {\n thumbGrid += '<div><figcaption>';\n thumbGrid += '<h4>'+ item.title +'</h4>';\n thumbGrid += '</figcaption></div>';\n }\n thumbGrid += '</figure></a></article>';\n videoOverlay += '<div>';\n videoOverlay += '<h4 class=\"rsCaption\">' + item.title + '</h4>';\n videoOverlay += '<video preload=\"none\" id=\"video-'+i+'\" class=\"video-js vjs-sublime-skin vjs-big-play-centered\"';\n videoOverlay += 'poster=\"' +thUrl+'\" src=\"' + videoObj + '\"></video>';\n videoOverlay += '</div>';\n }\n containerGrid.append(thumbGrid+ \"</div>\").imagesLoaded().progress(onProgress);\n containerVideo.append(videoOverlay+ \"</div>\");\n }", "function populateGalleries(data) {\r\n document.querySelector(\"#loader\").style.display = \"none\";\r\n const list = document.querySelector(\"#galleries\");\r\n data.forEach(d => {\r\n let li = document.createElement(\"li\");\r\n li.textContent = d.GalleryName;\r\n\r\n li.addEventListener(\"click\", function () {\r\n galleryInfo(d);\r\n createMap(d);\r\n generatePaintings(d);\r\n });\r\n\r\n list.appendChild(li);\r\n });\r\n \r\n /* controls the toggle functionality of the galleryList section and makes more space for the other information */\r\n let button = document.querySelector(\"#toggleListButton\");\r\n let gList = document.querySelector(\"#galleryList\");\r\n let gInfo = document.querySelector(\"#galleryInfo\");\r\n let paintings = document.querySelector(\"#paintingsList\");\r\n let map = document.querySelector('#map')\r\n\r\n //have to double click on the button to work \r\n button.addEventListener('click', () => {\r\n if (gList.style.display == \"block\") {\r\n gList.style.display = \"none\";\r\n gInfo.style.gridColumn = \"1/2\";\r\n paintings.style.gridColumn = \"2/4\";\r\n map.style.gridColumn = \"1/5\";\r\n\r\n } else {\r\n gList.style.display = \"block\";\r\n gList.style.gridColumn = \"1/2\";\r\n gInfo.style.gridColumn = \"2/3\";\r\n paintings.style.gridColumn = \"3/5\";\r\n map.style.gridColumn = \"2/5\";\r\n }\r\n });\r\n }", "function galleryGrid() {\n //ISOTOPE media\n var $container = $('.work1').isotope({\n itemSelector: '.thumbnail',\n masonry: {\n columnWidth: '.thumbnail.small'\n }\n });\n // filter items on button click\n $('.filters').on( 'click', 'li', function() {\n var filterValue = $(this).attr('data-filter');\n $container.isotope({ filter: filterValue });\n });\n\n // change is-checked class on buttons\n $('.filters').each( function( i, buttonGroup ) {\n var $buttonGroup = $( buttonGroup );\n $buttonGroup.on( 'click', 'li', function() {\n $buttonGroup.find('.is-checked').removeClass('is-checked');\n $( this ).addClass('is-checked');\n });\n });\n\n // load more\n $('#append').on('click', function(e) {\n var newItems = $('#more-items').appendTo('.thumbnails');\n $(\".thumbnails\").isotope('insert', newItems );\n $(this).hide();\n return false;\n });\n}", "function createItems() {\n for (var i = 0; i <= 5; i++) {\n gridWrapper.append('<div class=\"gallery_mars__item___hide\"></div>');\n }\n }", "function updateGallery() {\n log.debug(\"[Gallery] : Updating Gallery\");\n // If gallery doesn't exist create it\n if (!galleryExists) {\n if (todoItem.get('photoCount') !== 0) {\n createGallery();\n galleryExists = true;\n }\n return\n }\n\n // If gallery does exist add the first item\n var imageView = getPictureView(1, 150, 150);\n\n $.tdg.addGridItems({\n view: imageView,\n data: {\n caption: 'Test'\n }\n });\n\n}", "function displayRecipe(data) {\n var Recipe = data.meals[0];\n var RecipeDiv = document.getElementById(\"event-list-group\");\n \n var recipeContainer = document.createElement(\"div\");\n $(recipeContainer).addClass(\"recipe-container columns\");\n\n var RecipeImg = document.createElement(\"img\");\n RecipeImg.id = \"::img\";\n RecipeImg.style.cssText = \"width:300px;height:300px;\";\n $(RecipeImg).addClass(\"inline-img col-auto\");\n RecipeImg.src = Recipe.strMealThumb;\n recipeContainer.appendChild(RecipeImg);\n\n var contentDiv = document.createElement(\"div\");\n $(contentDiv).addClass(\"col-auto\");\n\n var RecipeIngredients = document.createElement(\"ul\");\n $(RecipeIngredients).addClass(\"inline-ul\");\n contentDiv.appendChild(RecipeIngredients);\n\n recipeContainer.appendChild(contentDiv);\n\n RecipeDiv.appendChild(recipeContainer);\n\n $(\"<label>\")\n .addClass(\"form-checkbox\")\n .html(\"<input class='recipe-checkbox' type='checkbox'><i class='form-icon'></i> Add Recipe\")\n .appendTo(contentDiv);\n\n\n var getIngredients = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strMeal\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getArea = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strArea\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getCategory = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strCategory\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getSource = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strSource\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getVideo = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strYoutube\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n let value = getIngredients[\"strMeal\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = value;\n RecipeIngredients.appendChild(listItem);\n\n let area = getArea[\"strArea\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = area;\n RecipeIngredients.appendChild(listItem);\n\n let category = getCategory[\"strCategory\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = category;\n RecipeIngredients.appendChild(listItem);\n\n let recipeSource = getSource[\"strSource\"];\n if (recipeSource) {\n var link = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe Link\")\n .attr(\"href\", `${recipeSource}`)\n .attr(\"target\", \"_blank\")\n .appendTo(link);\n }\n\n let recipeVideo = getVideo[\"strYoutube\"];\n if (recipeVideo) {\n var videolink = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe YouTube Video\")\n .attr(\"href\", `${recipeVideo}`)\n .attr(\"target\", \"_blank\")\n .appendTo(videolink);\n }\n}", "function init_fancy() {\n\t$('.fancy').fancybox({\n\t\tbuttons: ['close'],\n\t\tbackFocus: false,\n\t\tanimationEffect: \"zoom-in-out\",\n\t\tanimationDuration: 300,\n\t\ttransitionEffect: \"slide\"\n\t});\n\t$('.fancy-map').fancybox({\n\t\ttoolbar: false,\n\t\tsmallBtn: true,\n\t\tbackFocus: false,\n\t\tanimationEffect: \"zoom-in-out\",\n\t\tanimationDuration: 300,\n\t\ttransitionEffect: \"slide\"\n\t});\n}", "function update_galleries($gallery){\n if ($gallery.find('.script-feature-content a').length > 0){\n var height_feature = $gallery.find('.script-feature-content a').outerWidth() * 0.66 +'px';\n $gallery.find('.script-feature-content a').css({height: height_feature});\n $gallery.find('.__st_gallery_feature_content').css({height: height_feature });\n }\n $gallery.find('li').css({height: ($gallery.find('li').outerWidth() * 0.66) +'px'});\n // this is the best way to use these two heights to determine height\n resize_page_to_fit_gallery(($gallery.find('.script-feature-content a').outerWidth() * 0.66)+($gallery.find('li').outerWidth() * 0.66));\n }", "function call_sel_mt_props() {\n\n $('#pg').propertygrid({\n url: '../../../../jsinline/props.json',\n showGroup: true,\n scrollbarSize: 0\n });\n}", "function addData() {\n // resets all info on the page\n resetTeamPage();\n // adds in images\n addImagesToPage();\n // adds in pit data\n addPitDataToPage();\n // adds in prescout data\n if (Object.keys(prescout_data).length !== 0) {\n addPrescoutDataToPage();\n }\n // adds in stand data\n addStandDataToPage();\n // adding average/mean/max to btn-div (non match-specific)\n addOverallStatsToPage();\n // adds in notes data\n addNotesToPage();\n // view data button functionality\n addDataToViewDataButton();\n // hides sensitive info if applicable\n displaySensitiveInfo();\n}", "function initWPGallery(){\n\tjQuery(\".gallery\").each(function(){\n\t\tvar rel = jQuery(this).attr('id');\n\t\tjQuery(this).find('.gallery-item').each(function(){\n\t\t\tvar link = jQuery(this).find('a');\n\t\t\tlink.attr('rel', rel);\n\t\t\tlink.colorbox({rel: rel});\n\t\t});\n\t});\n}", "function onClickAddMoreWidgets(){\n\t\tcount++;\t\t\n\t\tfrmDynamicJS.hBoxOuterId.vBoxOuterId.add(hBoxMain());\n\t}", "function _addFieldGroups() {\n var dialog = $('#perc-folder-props-dialog');\n var fieldGroups = [\n { groupName : \"perc-folder-general-properties-container\", groupLabel : I18N.message(\"perc.ui.folder.properties.dialog@General\")},\n { groupName : \"perc-user-permissions-container\", groupLabel : I18N.message(\"perc.ui.folder.properties.dialog@Permissions\")},\n { groupName : \"perc-asset-folder-sites-container\", groupLabel : I18N.message(\"perc.ui.folder.properties.dialog@Security\")}\n ];\n\n $.each(fieldGroups, function(index) {\n // Create HTML markup with the groupName minimizer/maximizer and\n // insert it before the 1st field in each group\n var minmaxClass = (index === 0) ? \"perc-section-items-minimizer\" : \"perc-section-items-maximizer\";\n var groupHtml =\n \"<div class='perc-section-header'>\" +\n \"<div class='perc-section-label' data-group='\" + this.groupName + \"'>\" +\n \"<span class='perc-min-max \" + minmaxClass + \"' ></span>\" + this.groupLabel +\n \"</div>\" +\n \"</div>\";\n\n dialog.find('#' + this.groupName).before(groupHtml);\n\n // The first group will be the only one expanded (hide all others)\n index !== 0 && dialog.find('#' + this.groupName).hide();\n });\n\n // Bind collapsible event\n dialog.find(\".perc-section-label\").off(\"click\").on(\"click\",function() {\n var self = $(this);\n self.find(\".perc-min-max\")\n .toggleClass('perc-section-items-minimizer')\n .toggleClass('perc-section-items-maximizer');\n\n dialog.find('#' + self.attr('data-group')).toggle();\n });\n }", "function dynamicSummary(){\n fieldArray = [];\t//\tclear array so everytime this is called we update the data\n window.guideBridge.visit(function(cmp){\n var name = cmp.name;\n if(name && isVisible(cmp)){\n var grouped = isGrouped(cmp);\n var hideLabel = isHideLabel(cmp);\n var hideLink = isHideLink(cmp);\n\n if(name.indexOf(\"block_heading_\") == 0){//\tcheck if block heading (like for the address block fields)\n fieldArray.push({\"type\":\"block_heading\",\"size\":size(cmp),\"name\":cmp.name,\"value\":$(cmp.value).html(),\"grouped\":grouped, \"hideLink\":hideLink, \"className\":cmp.className, \"cssClassName\":cmp.cssClassName,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n else if(name.indexOf(\"block_\") == 0) {//\tcheck if object is a group panel\n fieldArray.push({\"type\":\"block\",\"size\":size(cmp),\"name\":cmp.name,\"title\":cmp.title, \"grouped\":grouped, \"className\":cmp.className, \"id\":cmp.id,\"som\":cmp.somExpression});\n }\n else if(name.indexOf(\"heading_\") == 0){//\tcheck if heading\n fieldArray.push({\"type\":\"heading\",\"size\":size(cmp),\"name\":cmp.name,\"value\":$(cmp.value).html(),\"grouped\":grouped, \"hideLink\":hideLink, \"className\":cmp.className, \"cssClassName\":cmp.cssClassName,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n else{\n //if(cmp.value != null){\n if(cmp.className == \"guideTextBox\"){\n fieldArray.push({\"type\":\"field\",\"name\":cmp.name,\"title\":cmp.title,\"grouped\":grouped,\"hideLabel\":hideLabel, \"hideLink\":hideLink, \"value\":((cmp.value)?cmp.value:\"Not provided\"),\"className\":cmp.className,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n if(cmp.className == \"guideRadioButton\" ||\n cmp.className == \"guideCheckBox\" ){\n fieldArray.push({\"type\":\"option\",\"name\":cmp.name,\"title\":cmp.title,\"grouped\":grouped,\"hideLabel\":hideLabel,\"hideLink\":hideLink, \"value\":((cmp.value)?cmp.value:\"Not provided\"), \"obj\":cmp,\"className\":cmp.className,\"id\":cmp.id,\"som\":cmp.somExpression});\n }\n //}\n }\n }\n });\n\n renderHTML();\t//\tthis generates the html inside the summary component\n}", "function runGridMain(opt,newelementadded) {\n\n\n\n\t// BASIC VARIABLES\n \tvar container = opt.container,\n \t\t items = container.find('.itemtoshow, .isvisiblenow').not('.ui-sortable-helper'),\n \t \t p = new Object,\n\t \t ul = container.find('ul').first(),\n\t \t esgo = container.find('.esg-overflowtrick').first(),\n\t \t ar = opt.aspectratio,\n\t \t aratio,\n\t \t coh = 0;\n\n\t \topt.aspectratioOrig = opt.aspectratio;\n\n\n\tcontainer.find('.mainul').addClass(\"gridorganising\");\n\t// CALCULATE THE ASPECT RATIO\n\n\n\tar = ar.split(\":\");\n \taratio=parseInt(ar[0],0) / parseInt(ar[1],0);\n\n\n\n\n\tp.item = 0;\n\tp.pagetoanimate=0-opt.currentpage;\t\t\t// Page Offsets\n\tp.col=0;\t\t\t\t\t\t\t\t\t// Current Col\n\tp.row=0;\t\t\t\t\t\t\t\t\t// Current Row\n\tp.pagecounter=0;\t\t\t\t\t\t\t// Counter\n\tp.itemcounter=0;\n\n\tp.fakecol=0;\n\tp.fakerow=0;\n\tp.maxheight=0;\n\n\tp.allcol =0;\n\tp.allrow = 0;\n\tp.ulcurheight = 0;\n\tp.ulwidth = ul.width();\n\n\tp.verticalsteps = 1;\n\n\n\n\n\tp.currentcolumnheight = new Array;\n\tfor (var i=0;i<opt.column;i++)\n\t\tp.currentcolumnheight[i] = 0;\n\n\tp.pageitemcounterfake=0;\n\tp.pageitemcounter=0;\n\n\t// GET DELAY BASIC\n\tif (opt.delayBasic!=undefined)\n\t\tp.delaybasic = opt.delayBasic;\n\telse\n\t\tp.delaybasic = 0.08;\n\n\n\tp.anim = opt.pageAnimation;\n\n\tp.itemtowait=0;\n\tp.itemouttowait=0;\n\n\tp.ease = \"punchgs.Power1.easeInOut\";\n\tp.easeout = p.ease;\n\tp.row=0;\n\tp.col=0;\n\n\t// MULTIPLIER SETTINGS\n\tvar mp = opt.rowItemMultiplier,\n\t\tmpl = mp.length,\n\t\torigcol = opt.column;\n\n\n\tp.y = 0;\n\tp.fakey = 0;\n\tcontainer.find('.esg-overflowtrick').css({width:\"100%\"});\n\tif (container.find('.esg-overflowtrick').width()==100)\n\t\tcontainer.find('.esg-overflowtrick').css({width:container.find('.esg-overflowtrick').parent().width()});\n\tp.cwidth = container.find('.esg-overflowtrick').width()-(opt.overflowoffset*2)\t\t\t// Current Width of Parrent Container\n\n\topt.inanimation = true;\n\n\tp.cwidth_n_spaces = p.cwidth - ((opt.column-1)*opt.space);\n\n\tp.itemw = Math.round(p.cwidth_n_spaces/opt.column);\t// Current Item Width in PX\n\tp.originalitemw = p.itemw;\n\n\n\t// CHANGE ASPECT RATIO IF FULLSCREEN IS SET\n\tif (opt.forceFullScreen==\"on\") {\n\t\tcoh = jQuery(window).height();\n\t\tif (opt.fullScreenOffsetContainer!=undefined) {\n\t\t\ttry{\n\t\t\t\tvar offcontainers = opt.fullScreenOffsetContainer.split(\",\");\n\t\t\t\tjQuery.each(offcontainers,function(index,searchedcont) {\n\t\t\t\t\tcoh = coh - jQuery(searchedcont).outerHeight(true);\n\t\t\t\t\tif (coh<opt.minFullScreenHeight) coh=opt.minFullScreenHeight;\n\t\t\t\t});\n\t\t\t} catch(e) {}\n\t\t}\n\t}\n\n\n\n\tif (opt.layout==\"even\") {\n\n\t\t\tp.itemh = Math.round(coh) == 0 ? Math.round((p.cwidth_n_spaces / opt.column) / aratio) : Math.round(coh/opt.row);\n\t\t\topt.aspectratio = coh == 0 ? opt.aspectratio : p.itemw+\":\"+p.itemh;\n\n\t\t\tif (mpl>0)\n\t\t\t\tpunchgs.TweenLite.set(items,{display:\"block\",visibility:\"visible\",overwrite:\"auto\"});\n\t\t\telse\n\t\t\t\tpunchgs.TweenLite.set(items,{display:\"block\",width:p.itemw,height:p.itemh,visibility:\"visible\",overwrite:\"auto\"});\n\n\t} else {\n\t\tpunchgs.TweenLite.set(items,{display:\"block\",width:p.itemw,height:\"auto\",visibility:\"visible\",overwrite:\"auto\"});\n\t}\n\tif (!newelementadded) {\n\n\t\tpunchgs.TweenLite.killTweensOf(items);\n\t}\n\n\tp.originalitemh = p.itemh;\n\n\t// PREPARE A GRID FOR CALCULATE THE POSITIONS OF COBBLES\n\tvar thegrid = new Array(),\n\t\tmaxcobblerow = opt.row*opt.column*2;\n\n\tfor (var rrr = 0 ; rrr<maxcobblerow; rrr++) {\n\t\tvar newrow = new Array();\n\t\tfor (var ccc = 0; ccc<opt.column;ccc++) {\n\t\t\t\tnewrow.push(0);\n\t\t}\n\t\tthegrid.push(newrow);\n\t}\n\n\tvar cobblepatternindex = 0;\n\n\n\tif (items.length==0) container.trigger('itemsinposition');\n\t// REPARSE THE ITEMS TO MAKE\n \tjQuery.each(items,function(index,$item) {\n\t\tvar item = jQuery($item);\n\t\tp.itemw = \tp.originalitemw;\n\n\t\t//fixCenteredCoverElement(item);\n\n\n\n\n\t\t//! COBBLES\n\t\tif (opt.evenCobbles == \"on\" && !item.hasClass(\"itemonotherpage\") && !item.hasClass(\"itemishidden\")) {\n\t\t\t\tvar cobblesw = item.data('cobblesw'),\n\t\t\t\t\tcobblesh = item.data('cobblesh');\n\n\t\t\t\tif (opt.cobblesPattern!=undefined && opt.cobblesPattern.length>2) {\n\n\t\t\t\t\tvar newcobblevalues = getCobblePat(opt.cobblesPattern,cobblepatternindex);\n\t\t\t\t\tcobblesw = parseInt(newcobblevalues.w,0);\n\t\t\t\t\tcobblesh = parseInt(newcobblevalues.h,0);\n\t\t\t\t\tcobblepatternindex++;\n\t\t\t\t}\n\n\n\t\t\t\tcobblesw = cobblesw==undefined ? 1 : cobblesw;\n\t\t\t\tcobblesh = cobblesh==undefined ? 1 : cobblesh;\n\n\n\t\t\t\tif (opt.column < cobblesw) cobblesw = opt.column;\n\n\t\t\t\tp.cobblesorigw = p.originalitemw;\n\t\t\t\tp.cobblesorigh = p.originalitemh;\n\t\t\t\tp.itemw = p.itemw * cobblesw + ((cobblesw-1) * opt.space);\n\t\t\t\tp.itemh = p.originalitemh;\n\n\t\t\t\tp.itemh = p.itemh * cobblesh + ((cobblesh-1) * opt.space);\n\n\t\t\t\tvar cobblepattern = cobblesw+\":\"+cobblesh\t,\n\t\t\t\t\tspacefound = false,\n\t\t\t\t\tr = 0,\n\t\t\t\t\tc = 0;\n\n\t\t\t\tswitch (cobblepattern) {\n\t\t\t\t\t\t\t\tcase \"1:1\":\n\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\tif (thegrid[r][c]==0) {\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c] = \"1:1\";\n\t\t\t\t\t\t\t\t\t\t\tspacefound = true;\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesx = c;\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesy = r;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tc++;\n\t\t\t\t\t\t\t\t\t\tif (c==opt.column) {\n\t\t\t\t\t\t\t\t\t\t\tc=0;r++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (r>=maxcobblerow) spacefound= true;\n\t\t\t\t\t\t\t\t\t} while (!spacefound);\n\t\t\t\t\t\t\t\tbreak;\n\n\n\n\t\t\t\t\t\t\t\tcase \"1:2\":\n\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\tif (thegrid[r][c]==0 && r<maxcobblerow-1 && thegrid[r+1][c]==0) {\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c] = \"1:2\";\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c] = \"1:2\";\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesx = c;\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesy = r;\n\n\t\t\t\t\t\t\t\t\t\t\tspacefound = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tc++;\n\t\t\t\t\t\t\t\t\t\tif (c==opt.column) {\n\t\t\t\t\t\t\t\t\t\t\tc=0;r++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (r>=maxcobblerow) spacefound= true;\n\t\t\t\t\t\t\t\t\t} while (!spacefound);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"1:3\":\n\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\tif (thegrid[r][c]==0 && r<maxcobblerow-2 && thegrid[r+1][c]==0 && thegrid[r+2][c]==0) {\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c] = \"1:3\";\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c] = \"1:3\";\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c] = \"1:3\";\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesx = c;\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesy = r;\n\n\t\t\t\t\t\t\t\t\t\t\tspacefound = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tc++;\n\t\t\t\t\t\t\t\t\t\tif (c==opt.column) {\n\t\t\t\t\t\t\t\t\t\t\tc=0;r++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (r>=maxcobblerow) spacefound= true;\n\t\t\t\t\t\t\t\t\t} while (!spacefound);\n\t\t\t\t\t\t\t\tbreak;\n\n\n\t\t\t\t\t\t\t\tcase \"2:1\":\n\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\tif (thegrid[r][c]==0 && c<opt.column-1 && thegrid[r][c+1]==0) {\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c] = \"2:1\";\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+1] = \"2:1\";\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesx = c;\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesy = r;\n\t\t\t\t\t\t\t\t\t\t\tspacefound = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tc++;\n\t\t\t\t\t\t\t\t\t\tif (c==opt.column) {\n\t\t\t\t\t\t\t\t\t\t\tc=0;r++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (r>=maxcobblerow) spacefound= true;\n\t\t\t\t\t\t\t\t\t} while (!spacefound);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"3:1\":\n\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\tif (thegrid[r][c]==0 && c<opt.column-2 && thegrid[r][c+1]==0 && thegrid[r][c+2]==0) {\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c] = \"3:1\";\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+1] = \"3:1\";\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+2] = \"3:1\";\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesx = c;\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesy = r;\n\t\t\t\t\t\t\t\t\t\t\tspacefound = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tc++;\n\t\t\t\t\t\t\t\t\t\tif (c==opt.column) {\n\t\t\t\t\t\t\t\t\t\t\tc=0;r++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (r>=maxcobblerow) spacefound= true;\n\t\t\t\t\t\t\t\t\t} while (!spacefound);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"2:2\":\n\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\tif (c<opt.column-1 && r<maxcobblerow-1 && thegrid[r][c]==0 && thegrid[r][c+1]==0 && thegrid[r+1][c]==0 && thegrid[r+1][c+1]==0) {\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c] = \"2:2\";\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c] = \"2:2\";\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+1] = \"2:2\";\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+1] = \"2:2\";\n\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesx = c;\n\t\t\t\t\t\t\t\t\t\t\tp.cobblesy = r;\n\n\t\t\t\t\t\t\t\t\t\t\tspacefound = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tc++;\n\t\t\t\t\t\t\t\t\t\tif (c==opt.column) {\n\t\t\t\t\t\t\t\t\t\t\tc=0;r++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (r>=maxcobblerow) spacefound= true;\n\t\t\t\t\t\t\t\t\t} while (!spacefound);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"3:2\":\n\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\tif (c<opt.column-2 && r<maxcobblerow-1 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+1]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+2]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+1]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+2]==0\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c] = \"3:2\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+1] = \"3:2\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+2] = \"3:2\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c] = \"3:2\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+1] = \"3:2\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+2] = \"3:2\";\n\n\t\t\t\t\t\t\t\t\t\t\t\tp.cobblesx = c;\n\t\t\t\t\t\t\t\t\t\t\t\tp.cobblesy = r;\n\n\t\t\t\t\t\t\t\t\t\t\t\tspacefound = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tc++;\n\t\t\t\t\t\t\t\t\t\tif (c==opt.column) {\n\t\t\t\t\t\t\t\t\t\t\tc=0;r++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (r>=maxcobblerow) spacefound= true;\n\t\t\t\t\t\t\t\t\t} while (!spacefound);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"2:3\":\n\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\tif (c<opt.column-1 && r<maxcobblerow-2 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+1]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+1]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c+1]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c+1]==0\n\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c] = \"2:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+1] = \"2:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c] = \"2:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+1] = \"2:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c] = \"2:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c+1] = \"2:3\";\n\n\t\t\t\t\t\t\t\t\t\t\t\tp.cobblesx = c;\n\t\t\t\t\t\t\t\t\t\t\t\tp.cobblesy = r;\n\n\t\t\t\t\t\t\t\t\t\t\t\tspacefound = true;\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tc++;\n\t\t\t\t\t\t\t\t\t\tif (c==opt.column) {\n\t\t\t\t\t\t\t\t\t\t\tc=0;r++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (r>=maxcobblerow) spacefound= true;\n\t\t\t\t\t\t\t\t\t} while (!spacefound);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"3:3\":\n\t\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\t\tif (c<opt.column-2 && r<maxcobblerow-2 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+1]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+2]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+1]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+2]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c+1]==0 &&\n\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c+2]==0\n\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c] = \"3:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+1] = \"3:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r][c+2] = \"3:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c] = \"3:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+1] = \"3:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+1][c+2] = \"3:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c] = \"3:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c+1] = \"3:3\";\n\t\t\t\t\t\t\t\t\t\t\t\tthegrid[r+2][c+2] = \"3:3\";\n\n\t\t\t\t\t\t\t\t\t\t\t\tp.cobblesx = c;\n\t\t\t\t\t\t\t\t\t\t\t\tp.cobblesy = r;\n\n\t\t\t\t\t\t\t\t\t\t\t\tspacefound = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tc++;\n\t\t\t\t\t\t\t\t\t\tif (c==opt.column) {\n\t\t\t\t\t\t\t\t\t\t\tc=0;r++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (r>=maxcobblerow) spacefound= true;\n\t\t\t\t\t\t\t\t\t} while (!spacefound);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\topt.aspectratio = p.itemw+\":\"+p.itemh;\n\n\t\t\t\tpunchgs.TweenLite.set(item,{width:p.itemw,height:p.itemh,overwrite:\"auto\"});\n\t\t\t\tvar img = item.find('.esg-entry-media').find('img');\n\t\t\t\tif (img.length>0) {\n\t\t\t\t\t\tevenImageRatio(img,opt,true)\n\t\t\t\t}\n\n\n\t\t} else {\n\n\t\t\t\t//IF ITEMW IS DIFFERENT BASED ON MULTIPLIER, WE NEED TO RESET SIZES\n\t\t\t\tvar cle = p.row - (mpl*Math.floor(p.row/mpl));\n\n\t\t\t\tif (opt.layout==\"even\" && mpl>0) {\n\t\t\t\t\t/*if (origcol!=1)*/ opt.column = mp[cle][opt.columnindex];\n\t\t\t\t\tp.cwidth = container.find('.esg-overflowtrick').width()-(opt.overflowoffset*2)\t\t\t// Current Width of Parrent Container\n\t\t\t\t\tp.cwidth_n_spaces = p.cwidth - ((opt.column-1)*opt.space);\n\t\t\t\t\tp.itemw = Math.round(p.cwidth_n_spaces/opt.column);\t// Current Item Width in PX\n\n\t\t\t\t\tp.itemh = coh == 0 ? (p.cwidth_n_spaces / opt.column) / aratio : coh/opt.row;\n\t\t\t\t\topt.aspectratio = coh == 0 ? opt.aspectratio : p.itemw+\":\"+p.itemh;\n\n\n\n\n\t\t\t\t\tpunchgs.TweenLite.set(item,{width:p.itemw,height:p.itemh,overwrite:\"auto\"});\t\t\t// KRIKI KRIKI\n\t\t\t\t}// END OF MULTIPLIER CALCULATION#\n\t\t}\n\n\n\t\tif (opt.layout==\"even\") {\n\t\t\tvar img = item.find('.esg-entry-media').find('img');\n\t\t\tif (img.length>0)\n\t\t\t\t\tevenImageRatio(img,opt,true)\n\t\t} else {\n\n\n\n\t\t\tif (item.hasClass(\"itemtoshow\"))\n\t\t\t\tif (item.width() != p.itemw || item.css(\"opacity\")==0 || item.css(\"visibility\")==\"hidden\")\n\t\t\t\t\t\tp = prepareItemToMessure(item,p,container);\n\t\t\t\telse {\n\t\t\t\t\tadjustMediaSize(item,true,p,opt);\n\t\t\t\t\tp.itemh = item.height();\n\n\t\t\t\t}\n\t\t else {\n\t\t \tadjustMediaSize(item,true,p,opt);\n\t\t \tp.itemh = item.height();\n\t\t }\n\n\n\t\t}\n\n\t\t//adjustMediaSize(item,true,p);\n\n\t\tp = animateGrid($item,opt,p);\n\t\tp.itemcounter++;\n\n\t\tif (ul.height()<p.maxheight) container.trigger('itemsinposition');\n\n\n\t});\n\n\topt.aspectratio = opt.aspectratioOrig;\n\n\n\n\tif (p.itemtowait==0) {\n\t\topt.container.trigger('itemsinposition');\n\t\tcontainer.find('.mainul').removeClass(\"gridorganising\");\n\t}\n\n\tvar gbfc = getBestFitColumn(opt,jQuery(window).width(),\"id\");\n\topt.column = gbfc.column;\n\topt.columnindex = gbfc.index;\n\n\topt.maxheight = p.maxheight;\n\topt.container.trigger('itemsinposition');\n\topt.inanimation = true;\n\n\t// RESET FILTER AND STARTER VALUES\n\topt.started = false;\n\topt.filterchanged=false;\n\topt.silent=false;\n\topt.silentout=false;\n\topt.changedAnim = \"\";\n\tsetOptions(container,opt);\n\n\tvar esgloader = container.parent().parent().find('.esg-loader');\n\tif (esgloader.length>0)\n\t\tpunchgs.TweenLite.to(esgloader,0.2,{autoAlpha:0});\n\n }", "function prepairNewEntries(container, opt) {\n\n container.find('>.mega-entry-added').each(function (i) {\n var ent = $(this);\n if (!ent.hasClass('tp-layout')) {\n\n ent.removeClass('tp-layout-first-item').removeClass('tp-layout-last-item').removeClass('very-last-item');\n ent.addClass(\"tp-notordered\")\n ent.wrapInner('<div class=\"mega-entry-innerwrap\"></div>');\n //ent.find('.mega-socialbar').appendTo(ent)\n var iw = ent.find('.mega-entry-innerwrap')\n /*if (opt.ie) {\n iw.append('<img class=\"ieimg\" src='+ent.data(\"src\")+'>');\n } else {*/\n iw.css({\n 'background': 'url(' + ent.data(\"src\") + ')',\n 'backgroundPosition': '50% 49%',\n 'backgroundSize': 'cover',\n 'background-repeat': 'no-repeat'\n });\n //}\n\n // LET ACT ON THE CLICK ON ITEM SOMEWAY\n ent.find('.mega-show-more').each(function () {\n var msm = $(this);\n\n // SAVE THE ID OF THE mega-entry WHICH IS CORRESPONDING ON THE BUTTON\n msm.data('entid', ent.attr('id'));\n\n // HANDLING OF THE CLICK\n msm.click(function () {\n var msm = $(this);\n var ent = container.find('#' + msm.data('entid'));\n ent.addClass(\"mega-in-detailview\");\n opt.detailview = \"on\";\n\n });\n\n });\n }\n });\n\n\n }", "function set_infoBoxes(data) {\n let slider = document.querySelector(\".glide__slides\");\n let loader = document.querySelector(\"#infoBox_loader\");\n let infoHtml = \"\";\n\n data.forEach((item, index) => {\n if (!data.thumbnail_url) {\n infoHtml = `\n <li class=\"relative w-full glide__slide\">\n <img class=\"cursor-pointer object-cover w-full h-64 IB_popup\" src=\"${item.url}\" alt=\"${item.url}\">\n <button class=\"white-button\" onclick=\"moreInfo('slide-${index}')\">More Info</button>\n </li>\n `;\n } else {\n infoHtml = `\n <li class=\"relative w-full glide__slide\">\n <a href=\"${item.url}\">\n <img src=\"${item.thumbnail_url}\" class=\"object-cover w-full h-full\">\n <a/>\n </li>\n `;\n }\n\n // let infoHtml = `\n // <li class=\"relative w-full glide__slide\">\n // <img class=\"cursor-pointer object-cover w-full h-64 IB_popup\" src=\"${item.url}\" alt=\"${item.url}\">\n // <button class=\"white-button\" onclick=\"moreInfo('slide-${index}')\">More Info</button>\n // </li>\n // `;\n\n slider.insertAdjacentHTML(\"beforeend\", infoHtml);\n });\n\n // ADD EVENTS TO IMAGES\n const popup = document.querySelector(\".popup-window\");\n let images = document.querySelectorAll(\".IB_popup\");\n images.forEach((image) => {\n image.addEventListener(\"click\", (event) => {\n popup.classList.toggle(\"-inset-x-full\");\n popup.classList.toggle(\"opacity-0\");\n let url = event.target.src;\n popup.innerHTML = `\n <img class=\"popup-image object-contain inset-center w-full h-full popup-close cursor-pointer transition-all duration-1000\" src=\"${url}\" />\n `;\n const close = document.querySelector(\".popup-close\");\n close.addEventListener(\"click\", function () {\n popup.classList.toggle(\"opacity-0\");\n window.setTimeout(function () {\n popup.classList.toggle(\"-inset-x-full\");\n }, 700);\n console.log(\"close\");\n popup.innerHTML = \"\";\n });\n });\n });\n\n // REMOVE LOADER\n loader.parentNode.removeChild(loader);\n\n // CAROUSEL OPTIONS\n var glide = new Glide(\".glide\", {\n type: \"carousel\",\n perView: 4,\n focusAt: \"center\",\n breakpoints: {\n 800: {\n perView: 2,\n },\n 480: {\n perView: 1,\n },\n },\n });\n\n glide.mount();\n}", "function populateGrid(){\n $('#plotChoices2 option').on('click', function(e){\n\n if ($(e.target).text() === 'One Row'){\n chosenGrid = 'grid';\n var result = compareVeggieArrays();\n appendImages(result);\n $('#grid').show();\n $('.grid').show();\n $('aside').show();\n\n }\n if ($(e.target).text() === 'Two Rows') {\n chosenGrid = 'grid2';\n var result = compareVeggieArrays();\n appendImages(result);\n $('#grid2').show();\n $('.grid2').show();\n $('aside').show();\n\n }\n if ($(e.target).text() === 'Three Rows') {\n chosenGrid = 'grid3';\n var result = compareVeggieArrays();\n appendImages(result);\n $('#grid3').show();\n $('.grid3').show();\n $('aside').show();\n}\n});\n$('#plotChoices option').on('click', function(e){\n\nif ($(e.target).text() === 'One Row'){\n $('#plotChoices').on('click', function (){\n\n $('#plotChoices').slideDown(1000, function(){\n $(this).remove();\n $('#plotChoices').remove();\n $('#veggieChoices2').show();\n $('#vegSubmit2').on('click', function(){\n chosenGrid = 'grid';\n var result = compareVeggieArrays();\n appendImages(result);\n $('#grid').show();\n $('.grid').show();\n $('aside').show();\n });\n });\n });\n}\nif ($(e.target).text() === 'Two Rows') {\n $('#plotChoices option').on('click', function (){\n $('#plotChoices').slideDown(1000, function(){\n $(this).remove();\n $('#plotChoices').remove();\n $('#veggieChoices2').show();\n $('#vegSubmit2').on('click', function(){\n chosenGrid = 'grid2';\n var result = compareVeggieArrays();\n appendImages(result);\n $('#grid2').show();\n $('.grid2').show();\n $('aside').show();\n });\n });\n });\n}\nif ($(e.target).text() === 'Three Rows') {\n $('#plotChoices option').on('click', function (){\n $('#plotChoices').slideDown(1000, function(){\n $(this).remove();\n $('#plotChoices').remove();\n $('#veggieChoices2').show();\n $('#vegSubmit2').on('click', function(){\n chosenGrid = 'grid3';\n var result = compareVeggieArrays();\n appendImages(result);\n // console.log(result);\n $('#grid3').show();\n $('.grid3').show();\n $('aside').show();\n });\n });\n});\n}\n\n});\n }", "function generateLayout() {\n $('.layout-display').each(function () {\n for (var i = 0; i < $(this).attr('data-max'); i++) {\n $(this).append('<div class=\"grid item\"></div>');\n }\n\n\n displayLayoutInfo($(this).parents('.layout'));\n resizeItems($(this));\n });\n}", "function GalleryFancyboxActivator () {\n var galleryFcb = $('.fancybox');\n if(galleryFcb.length){\n galleryFcb.fancybox({\n openEffect : 'elastic',\n closeEffect : 'elastic',\n helpers : {\n media : {}\n }\n });\n }\n}", "function gallery_controls() {\r\n\r\n\t\t$(function() {\r\n\t\t$.getJSON( \"assets/db/albums.json\", function( data ) {\r\n\t\t\tvar albums = [];\r\n\r\n\t\t\tvar album_list = [];\r\n\r\n\t\t\t$.each( data, function (key, val) {\r\n\r\n\t\t\t\tif (Number.isInteger(parseInt(key)) && val[\"is_active\"]==1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\talbums.push( \"<div class='col-sm-6 col-md-4 filtr-item' data-category='\" + parseInt(key) + \"'>\" );\r\n\t\t\t\t\talbums.push( \"<div class='mu-item-thumbonail'>\" );\r\n\t\t\t\t\talbums.push( \"<img class='img-responsive' src='assets/\" + val[\"slug\"] + \".jpg' alt='\" + val[\"title\"] + \"'>\" );\r\n\t\t\t\t\talbums.push( \"</div>\" );\r\n\t\t\t\t\talbums.push( \"<div class='mu-filter-item-content'>\" );\r\n\t\t\t\t\talbums.push( \"<h1 class='mu-filter-item-title'>\" + val[\"title\"] + \"</h2>\" );\r\n\t\t\t\t\talbums.push( \"<h4 class='mu-filter-item-title'>\" + val[\"sub_title\"] + \"</h4>\" );\r\n\t\t\t\t\talbums.push( \"<span class='mu-header-dot' style='background-color: white'></span>\" );\r\n\t\t\t\t\talbums.push( \"<h4 class='mu-filter-item-title'>Released: \" + album_date(val[\"release_date\"]) + \"</h5>\" );\r\n\t\t\t\t\talbums.push( \"<h4 class='mu-filter-item-title'>\" + val[\"tracks\"] + \" tracks (\" + format_album_time(val[\"total_length\"]) + \")</h5>\" );\r\n\t\t\t\t\talbums.push( \"<h5 class='mu-filter-item-title'>&copy; \" + val[\"label\"] + \"</h5>\" );\r\n\t\t\t\t\talbums.push( \"<a class='mu-filter-imglink' href='assets/\" + val[\"slug\"] + \".jpg' title='\" + val[\"title\"] + \"'\" + \"id='\" + key + \"'><i class='fa fa-info-circle'></i></a>\" );\r\n\t\t\t\t\talbums.push( \"<span class='list-track' id='\" + key + \"'><i class='fa fa-question-circle'></i></span>\" );\r\n\t\t\t\t\talbums.push( \"</div>\" );\r\n\t\t\t\t\talbums.push( \"</div>\" );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\talbum_list[key] = key;\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t\tdocument.getElementsByClassName(\"filtr-container\")[0].innerHTML = albums.join(\"\");\r\n\t\t\t\r\n\t\t\t$('.mu-filter-imglink').magnificPopup({\r\n\t\t\t\ttype: 'image',\r\n\t\t\t\tmainClass: 'mfp-fade',\r\n\t\t\t\tgallery:{\r\n\t\t\t\t enabled:true\r\n\t\t\t\t}\r\n\t\t\t });\r\n\t\t});\r\n\t});\r\n}", "function populateModal(id) {\n id = id.substring(14);\n var pret = \"\";\n var titlu = \"\";\n var desc = \"\";\n\n\n $(\".col-lg-6\").each(function () {\n var idcurent = $(this).attr(\"infoprod\");\n \n if (idcurent != null && idcurent == id) {\n var current = $(this);\n \n pret = $(this).find(\".infopret\").text();\n titlu = $(this).find(\".titluGeanta\").text();\n desc = $(this).find(\".descGeanta\").text();\n\n $(current).find(\"input[type=hidden]\").each(function () {\n var c = $(this).attr(\"class\").replace(\"image\", \"poza\");\n var t = \"<div class='col-lg-12'>\";\n var id = getId();\n t = t + \"<img src='' class='img-responsive left_popimages \" + c + \" bagImage' id='\" + id + \"'/>\";\n t = t + \"</div>\";\n $(\".3pictures\").append(t);\n $(\"#\" + id).attr(\"src\", $(this).val());\n });\n\n\n $('#product-image-big').attr(\"src\", $(this).find(\"img\").attr('src'));\n }\n })\n $('.pretprod').html(pret);\n $('.titluprod').html(titlu);\n $('.descprod').html(desc);\n}", "function SetItems() {\n //configuracion del tootip de ayuda\n //tooltip de navegacion superior\n $('.navigationTop a').cluetip({ splitTitle: '|', width: 250, delayedClose: 1200, cursor: 'pointer', sticky: false });\n //tooltip para el link del mapa\n $('.SiteMapa span a').cluetip({ splitTitle: '|', width: 250, delayedClose: 1200, cursor: 'pointer', sticky: false });\n \n $('.tooltip').cluetip({ splitTitle: '|',delayedClose: 1200, width: 150, cursor: 'pointer', sticky: false });\n //tooltip de los buttonfields\n $('input[type=image]').cluetip({ splitTitle: '|', attribute: 'alt', titleAttribute: 'alt', delayedClose: 1200, width: 150, cursor: 'pointer', sticky: false });\n \n //menu popup\n $('#toplistmenu01').popupmenu({ target: \"#PanelNew\", time: 300 });\n $('.note').truncate({ max_length: 40, showLinks: false });\n \n }", "function prepairEntries(container, opt) {\n\n container.find('>.mega-entry').each(function () {\n var ent = $(this);\n ent.removeClass('tp-layout-first-item').removeClass('tp-layout-last-item').removeClass('very-last-item');\n ent.addClass(\"tp-notordered\").addClass(\"mega-entry-added\");\n ent.wrapInner('<div class=\"mega-entry-innerwrap\"></div>');\n //ent.find('.mega-socialbar').appendTo(ent)\n var iw = ent.find('.mega-entry-innerwrap')\n /*if (opt.ie) {\n iw.append('<img class=\"ieimg\" src='+ent.data(\"src\")+'>');\n } else {*/\n iw.css({\n 'background': 'url(' + ent.data(\"src\") + ')',\n 'backgroundPosition': '50% 49%',\n 'backgroundSize': 'cover',\n 'background-repeat': 'no-repeat'\n });\n//\t\t\t\t}\n\n // LET ACT ON THE CLICK ON ITEM SOMEWAY\n ent.find('.mega-show-more').each(function () {\n var msm = $(this);\n\n // SAVE THE ID OF THE mega-entry WHICH IS CORRESPONDING ON THE BUTTON\n msm.data('entid', ent.attr('id'));\n\n // HANDLING OF THE CLICK\n msm.click(function () {\n var msm = $(this);\n var ent = container.find('#' + msm.data('entid'));\n ent.addClass(\"mega-in-detailview\");\n opt.detailview = \"on\";\n });\n\n });\n });\n\n\n }", "function addFields(){\n\tconsole.log(\"### addFields entered ###\");\n var number = document.getElementById(\"attributes\").value;\n \n console.log(\"Numer attributes:\"+number);\n var container = document.getElementById(\"containerFieldset\");\n while (container.hasChildNodes()) {\n container.removeChild(container.lastChild);\n }\n for (i=0;i<number;i++){\n \t\n \t\n// \tvar diva = document.createElement(\"div\");\n// \tdiva.className = \"ui-block-a\";\n// \tdiva.id = \"diva\";\n// \tvar divb = document.createElement(\"div\");\n// \tdivb.className = \"ui-block-b\";\n// \tdivb.id = \"divb\"\n \t\n \t\n \t// Header - right block empty\n \tvar diva = document.createElement(\"div\");\n \tdiva.className = \"ui-block-a\";\n \tdiva.id = \"diva\";\n \tvar divb = document.createElement(\"div\");\n \tdivb.className = \"ui-block-b\";\n \tdivb.id = \"divb\"\n \tvar h1 = document.createElement(\"h3\");\n h1.appendChild(document.createTextNode(\"Attribut \" + (i+1)));\n \tdiva.appendChild(h1);\n \tcontainer.appendChild(diva);\n \t//divb.appendChild();\n \tcontainer.appendChild(divb);\n \t\n \t\n \t\n// var h1 = document.createElement(\"h1\");\n// h1.appendChild(document.createTextNode(\"Attribut \" + (i+1)));\n// container.appendChild(h1);\n \n \t\n \t//Typ block\n \tvar diva = document.createElement(\"div\");\n \tdiva.className = \"ui-block-a\";\n \tdiva.id = \"diva\";\n \tvar divb = document.createElement(\"div\");\n \tdivb.className = \"ui-block-b\";\n \tdivb.id = \"divb\"\n \tdiva.appendChild(document.createTextNode(\"Typ \"));\n \tcontainer.appendChild(diva);\n var input = document.createElement(\"input\");\n input.type = \"text\";\n input.id = \"type\"+ (i+1);\n divb.appendChild(input);\n container.appendChild(divb);\n container.appendChild(document.createElement(\"br\"));\n\n \n \t//Einheit block\n \tvar diva = document.createElement(\"div\");\n \tdiva.className = \"ui-block-a\";\n \tdiva.id = \"diva\";\n \tvar divb = document.createElement(\"div\");\n \tdivb.className = \"ui-block-b\";\n \tdivb.id = \"divb\"\n \tdiva.appendChild(document.createTextNode(\"Einheit \"));\n \tcontainer.appendChild(diva);\n var input = document.createElement(\"input\");\n input.type = \"text\";\n input.id = \"scale\"+ (i+1);\n divb.appendChild(input);\n container.appendChild(divb);\n container.appendChild(document.createElement(\"br\"));\n\n \t//Anzahl/Plot block\n \tvar diva = document.createElement(\"div\");\n \tdiva.className = \"ui-block-a\";\n \tdiva.id = \"diva\";\n \tvar divb = document.createElement(\"div\");\n \tdivb.className = \"ui-block-b\";\n \tdivb.id = \"divb\"\n \tdiva.appendChild(document.createTextNode(\"Anzahl/Plot \"));\n \tcontainer.appendChild(diva);\n var input = document.createElement(\"input\");\n input.type = \"number\";\n input.id = \"count\"+ (i+1);\n divb.appendChild(input);\n container.appendChild(divb);\n container.appendChild(document.createElement(\"br\"));\n\n \n// container.appendChild(document.createTextNode(\"Einheit \"));\n// var input = document.createElement(\"input\");\n// input.type = \"text\";\n// input.id = \"scale\"+ (i+1);\n// container.appendChild(input);\n// container.appendChild(document.createElement(\"br\"));\n// \n// container.appendChild(document.createTextNode(\"Anzahl/Plot \"));\n// var input = document.createElement(\"input\");\n// input.type = \"text\";\n// input.id = \"count\"+ (i+1);\n// container.appendChild(input);\n// container.appendChild(document.createElement(\"br\"));\n// container.appendChild(document.createElement(\"br\")); \n }\n}", "function prepareLightbox() {\n\t\t$(\"[data-chyjicebox]\").each(function() {\n\t\t\tconst el = $(this);\n\t\t\tconst href = el.attr(\"href\");\n\t\t\tconst format = href.toLowerCase().split(\".\")[href.toLowerCase().split(\".\").length - 1];\n\t\t\tif ($.inArray(format, formats) !== -1) {\n\t\t\t\tconst group = el.attr(\"data-chyjicebox\");\n\t\t\t\tconst title = el.children().attr(\"alt\");\n\t\t\t\tconst date = el.attr(\"data-date\");\n\t\t\t\tconst lat = el.attr(\"data-lat\");\n\t\t\t\tconst longt = el.attr(\"data-long\");\n\n\t\t\t\t// order of image when lightbox is opened to know it immediately\n\t\t\t\tlet ii = 0;\n\t\t\t\tif (group !== \"\") {\n\t\t\t\t\tii = currentImageOrder++;\n\t\t\t\t}\n\n\t\t\t\tconst type = (format === \"webm\" || format === \"mp4\") ? Types.VIDEO : Types.IMAGE;\n\t\t\t\tconst ab = new MyImage(href, title, type, date, lat, longt);\n\n\t\t\t\tif (group !== \"\" && format !== \"pdf\") images.push(ab);\n\t\t\t\t// when thumb image or link is clicked show the image\n\t\t\t\tel.click(function(e) {\n\t\t\t\t\tif (e.button === 1) {\n\t\t\t\t\t\t// allow clicking with mouse wheel to open in a new panel\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (group === \"\") {\n\t\t\t\t\t\tfitToScreen = el.attr(\"data-fittoscreen\") !== undefined;\n\t\t\t\t\t}\n\t\t\t\t\tisPDF = (format === \"pdf\");\n\t\t\t\t\tif (isPDF) {\n\t\t\t\t\t\tiframe.attr(\"src\", href);\n\t\t\t\t\t\topen();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmulti = (group !== \"\");\n\t\t\t\t\t\tif (multi) imgbox.addClass(\"cursorpointer\");\n\t\t\t\t\t\telse imgbox.removeClass(\"cursorpointer\");\n\t\t\t\t\t\tfirst = true;\n\t\t\t\t\t\tisClosed = false;\n\t\t\t\t\t\tshowedImage = ab;\n\t\t\t\t\t\tcurrentImageOrder = ii;\n\t\t\t\t\t\taddKeyListener();\n\t\t\t\t\t\tloadImg();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "function paintPatternsInModal() {\n // Delete previous printed data\n $(\"#patternsModal > div > div > div.modal-body\").empty();\n\n for (let i = 0; i < NETWORK.trainingPatterns.length; i++) {\n let pattern = NETWORK.trainingPatterns[i];\n\n let columns = (new Array(parseInt($(\"#width\").val()))).fill(\"1fr\").join(\" \");\n let rows = (new Array(parseInt($(\"#height\").val()))).fill(\"1fr\").join(\" \");\n let elements = pattern.data[0].map(function(item, index) {\n return `<div id=\"modal${i}${index}\" style=\"background-color: ${item == 1 ? \"white\" : \"black\"};\"></div>`\n })\n\n\n $(\"#patternsModal > div > div > div.modal-body\").append(`<div class=\"grid\" style=\"grid-template-columns: ${columns}; grid-template-rows: ${rows}\">${elements.join(\"\")}</div>`);\n }\n}", "function modal_tourism(id)\n {\n document.getElementById('mg_title').innerHTML=\"Info\";\n console.log(server+'_data_tourism_1.php?cari='+id);\n $.ajax({url: server+'_data_tourism_1.php?cari='+id, data: \"\", dataType: 'json', success: function(rows){ \n for (var i in rows.data){ \n var row = rows.data[i];\n var id = row.id;\n var name = row.name;\n var address = row.address;\n var open = row.open;\n var close = row.close;\n var ticket = row.ticket;\n var tourism_type = row.tourism_type;\n var lat=row.latitude;\n var lng = row.longitude;\n console.log(name);\n document.getElementById('mg_body').innerHTML=\"<h2>\"+name+\"</h2><h4>\"+tourism_type+\"</h4><br><div style='margin-left:20px'>Address: \"+address+\"<br>Open: \"+open+\"<br>Close: \"+close+\"<br>Ticket: \"+ticket+\"</div>\";\n }//end for\n\n //FASILITAS TOURISM\n var isi=\"<br><b style='margin-left:20px'>Facility</b> <br><ol>\";\n for (var i in rows.fasilitas){ \n var row = rows.fasilitas[i];\n var id = row.id;\n var name = row.name;\n console.log(name);\n isi = isi+\"<li>\"+name+\"</li>\";\n }//end for\n isi = isi + \"</ol>\";\n $('#mg_body').append(isi);\n\n $('#modal_gallery').modal('show');\n\n }});//end ajax \n }", "function fancyBox() {\n $('.fancybox-thumb').fancybox ({\n padding: 0,\n prevEffect: 'none',\n nextEffect: 'none',\n helpers: {\n title: {\n type: 'outside'\n },\n thumbs: {\n width: 50,\n height: 50\n }\n }\n });\n}", "function goToGallery() {\n resetSort();\n renderGrid();\n document.querySelector('.header2').style.display = 'flex';\n document.querySelector('main').style.display = 'block';\n document.querySelector('.my-info').style.display = 'flex';\n document.querySelector('.canvas-btn-container').style.display = 'none';\n document.querySelector('.paging').style.display = 'flex';\n onClear();\n clearMeme();\n}", "function init_fancy() {\n\t$().fancybox({\n\t\tselector: '.fancy',\n\t\tbuttons: ['close'],\n\t\tbackFocus: false,\n\t\tlang : 'ru',\n\t\ti18n : {\n\t\t\t'ru' : {\n\t\t\t\tCLOSE : 'Закрыть',\n\t\t\t\tNEXT : 'Дальше',\n\t\t\t\tPREV : 'Назад',\n\t\t\t\tERROR : 'Не удается загрузить. <br/> Попробуйте позднее.',\n\t\t\t\tPLAY_START : 'Начать слайдшоу',\n\t\t\t\tPLAY_STOP : 'Остановить слайдшоу',\n\t\t\t\tFULL_SCREEN : 'На весь экран',\n\t\t\t\tTHUMBS : 'Превью'\n\t\t\t}\n\t\t}\n\t});\n\t$().fancybox({\n\t\tselector: '.fancy-modal',\n\t\tbackFocus: false,\n\t\ttouch: false,\n\t\tlang : 'ru',\n\t\ti18n : {\n\t\t\t'ru' : {\n\t\t\t\tCLOSE : 'Закрыть',\n\t\t\t\tNEXT : 'Дальше',\n\t\t\t\tPREV : 'Назад',\n\t\t\t\tERROR : 'Не удается загрузить. <br/> Попробуйте позднее.',\n\t\t\t\tPLAY_START : 'Начать слайдшоу',\n\t\t\t\tPLAY_STOP : 'Остановить слайдшоу',\n\t\t\t\tFULL_SCREEN : 'На весь экран',\n\t\t\t\tTHUMBS : 'Превью'\n\t\t\t}\n\t\t},\n\t\tafterShow: function () {\n\t\t\tinitPicker();\n\t\t}\n\t});\n\t$().fancybox({\n\t\tselector: '.fancy-map',\n\t\ttoolbar: false,\n\t\tsmallBtn: true,\n\t\tbackFocus: false,\n\t\tlang : 'ru',\n\t\ti18n : {\n\t\t\t'ru' : {\n\t\t\t\tCLOSE : 'Закрыть',\n\t\t\t\tNEXT : 'Дальше',\n\t\t\t\tPREV : 'Назад',\n\t\t\t\tERROR : 'Не удается загрузить. <br/> Попробуйте позднее.',\n\t\t\t\tPLAY_START : 'Начать слайдшоу',\n\t\t\t\tPLAY_STOP : 'Остановить слайдшоу',\n\t\t\t\tFULL_SCREEN : 'На весь экран',\n\t\t\t\tTHUMBS : 'Превью'\n\t\t\t}\n\t\t}\n\t});\n}", "function GalleryFancyboxActivator() {\n var galleryFcb = $('.fancybox');\n if (galleryFcb.length) {\n galleryFcb.fancybox({\n openEffect: 'elastic',\n closeEffect: 'elastic',\n helpers: {\n media: {}\n }\n });\n }\n}", "populate() {\n this.div.innerHTML = ''\n\n this.createHeader()\n this.createAddButton()\n this.createAddForm()\n this.createExpensesDiv()\n }", "function populateView(gridView) {\n for (let i = 0; json.content.length > i; i++) {\n if (loadedDecks.includes(json.content[i].vaultId)) {\n // load thumbnail or list-item depending on user selection\n const html = gridView ? thumbnailTemplate({ entry: json.content[i] }) : listItemTemplate({ entry: json.content[i] });\n gridView? $('.content').append(html) : $('ul.mdl-list').append(html);\n $('label#category, li#category').each(function () {\n // compare loaded slide against the json data\n const decks = $(this).data('content');\n if (decks.includes(json.content[i].vaultId)) {\n $(this).show();\n if ($(this).prop('tagName') === 'LI') {\n $(this).parents('.category-content').siblings('label').show();\n }\n }\n });\n }\n }\n }", "function populateUI(results,type) {\n var filmWrapper=$(\".film-wrapper\");\n var seriesWrapper=$(\".series-wrapper\");\n var filmInfoTemplate=$(\"#film-info-template\").html();\n var compiled=Handlebars.compile(filmInfoTemplate);\n\n for (var i = 0; i < results.length; i++) {\n var element=results[i];\n var elementPathUrl=\"https://image.tmdb.org/t/p/w342/\" + element.poster_path;\n //Se non risulta nessun indirizzo al poster del film, mostro una locandina con un punto interrogativo.\n if (element.poster_path==null) {\n elementPathUrl=\"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTPP5IbPgoTmUHAxcFAX9s9bBIJJ026gTMh5qXtTK5xeg7-5tnh\"\n }\n\n var stars=getStars(element.vote_average);\n var inData={};\n\n if (type==\"tv\") {\n inData={\n //Una parte importantissima, perché imposto il data-id così da potermi recuperare lo specifico film più tardi.\n itemId:\"tv/\" + element.id,\n itemGenres:element.genre_ids,\n title:element.name,\n originalTitle:element.original_name,\n //Recupero la lingua originale e lo passo alla funzione che si occuperà di assegnarmi una src dell'immagine in base al paese.\n flag:getLanguageFlag(element.original_language),\n //Qui utilizzo Handlebars con il suo foreach. Per ogni elemento dell'array stampa una stella.\n //Gli elementi dell'array sono spazi vuoti perché così non scrive altro oltre la stella.\n stars:getArrStars(stars),\n noStars:getArrStars(5-stars),\n posterPathUrl:elementPathUrl,\n itemOverview:element.overview\n }\n } else {\n inData={\n itemId:\"movie/\" + element.id,\n itemGenres:element.genre_ids,\n title:element.title,\n originalTitle:element.original_title,\n flag:getLanguageFlag(element.original_language),\n stars:getArrStars(stars),\n noStars:getArrStars(5-stars),\n posterPathUrl:elementPathUrl,\n itemOverview:element.overview\n }\n }\n\n var filmInfo= compiled(inData);\n\n if (type==\"movie\") {\n filmWrapper.append(filmInfo);\n } else {\n seriesWrapper.append(filmInfo);\n }\n }\n}", "function addPhotos() {\n var photoContainerTmpl = _.template($('#photoContainerTmpl').html());\n var photoTmpl = _.template($('#photoTmpl').html());\n var photoStr = \"\";\n albums.forEach(function(el) {\n photoStr += photoContainerTmpl(el);\n\n el.photos.forEach(function (item) {\n photoStr += \"<li>\"\n + \"<a href='' >\"\n + \"<div class='photo-wrapper'>\"\n + \"<img src='\" + item.url + \"' + rel='\" + item.rel + \"' />\"\n + \"<h3>\" + item.name + \"</h3>\"\n + \"</div>\"\n + \"</a>\"\n + \"</li>\";\n })\n photoStr += \"</ul>\"\n photoStr += \"</div>\"\n });\n $('.right-col').append(photoStr);\n}", "function load_grid(info) {\n $.get('/page_ajax/grid', function (res) {\n var title = info.param_obs.split('|')[0].split('_')[1];\n var rasgrad = gradient[info.desc.instrument.dec + '|' + info.desc.param_obs_desc];\n var list = '';\n for (var i = 0; i < rasgrad.length; i++) {\n list = list + '<div>' + rasgrad[i] + '</div>';\n }\n var html = res.replace('{title}', title).replace('{list}', list);\n $(\"#list-menu\").append(html);\n $(\"#date-grid\").datepicker({\n dateFormat: 'dd-mm-yy',\n beforeShowDay: enableAllTheseDays,\n defaultDate: grid_date[grid_date.length - 1]\n });\n loadhourgrid();\n $(\"#date-grid\").change(function () {\n loadhourgrid();\n });\n $(\"#hour-grid\").change(function () {\n loadImageObs();\n });\n loadImageObs();\n });\n}", "onAdd() {\n this.createPopupHtml();\n this.getPanes().floatPane.appendChild(this.containerDiv);\n }", "function GatheringList()\r\n{\r\n var loadTotals = function()\r\n {\r\n // Clear out the totals, sum everything and create a new totals element \r\n $('#totals').html('<div style=\"text-align: center; font-weight: bold; padding-bottom: 3px;\">TOTALS</div><div id=\"totalsrow\" style=\"width:600px; margin-left:auto; margin-right:auto; padding-bottom: 5px; border-bottom: 1px dashed #000; text-align:center; position:relative; z-index:1;\"></div>')\r\n \r\n var items = $('a.clue');\r\n var itemCounts = {};\r\n var numItems = 0;\r\n \r\n for (var i = 0; i < items.length; i++)\r\n {\r\n var item = $(items[i]);\r\n var id = parseInt(/id=(\\d+)/.exec(item.attr('rel'))[1]);\r\n var count = parseInt(item.parent().find('div').text());\r\n \r\n if (itemCounts[id])\r\n {\r\n itemCounts[id] += count;\r\n $('#item_' + id + ' div').text(itemCounts[id]);\r\n }\r\n else\r\n {\r\n itemCounts[id] = count;\r\n numItems++;\r\n var totalEntry = item.parent().clone();\r\n totalEntry.attr('id', 'item_' + id);\r\n $('#totalsrow').append(totalEntry);\r\n }\r\n }\r\n \r\n $('#totals').css('height', (Math.floor((numItems - 1) / 7) + 1) * 105);\r\n \r\n // Add tooltips to any newly created elements.\r\n $('a.clue').cluetip({\r\n height:\"auto\",\r\n ajaxCache: true\r\n }); \r\n }\r\n\r\n // Claim the \"Repeat Gathering\" button\r\n var repeatButton = $('.thingbutton[value^=\"Repeat Gathering\"]');\r\n repeatButton.attr('type', 'button');\r\n \r\n var form = repeatButton.parent();\r\n var type = /action=([^&]+)/.exec(form.attr('action'))[1];\r\n \r\n // Make a better html structure so selecting with jQuery isn't a nightmare\r\n $('a.clue').parent().parent().wrap('<div id=\"gatheringList\">');\r\n $('#gatheringList').after('<div id=\"totals\" style=\"height: 105px; padding-bottom: 6px;\"></div>');\r\n var successDiv = $('#super-container div:contains(Success!)');\r\n successDiv.attr('id', 'successdiv');\r\n \r\n // Move things around for better layout\r\n var text = $('#super-container span:contains(Hoard)').parent();\r\n text.css('top', 15);\r\n var tmpHTML1 = text.clone().wrap('<p>').parent().html();\r\n var tmpHTML2 = $('#gatheringList').clone().wrap('<p>').parent().html();\r\n text.remove();\r\n $('#gatheringList').remove();\r\n $('#super-container').append(tmpHTML1);\r\n $('#super-container').append(tmpHTML2);\r\n \r\n $($('#gatheringList div')[0]).prepend('<div>Turn 1</div>');\r\n \r\n loadTotals();\r\n \r\n repeatButton.click(function(e)\r\n {\r\n // Loading spinners yay and submit the gather request\r\n var gatherType = $('input[name=\"gather\"]').val();\r\n $('#successdiv').html('<img src=\"/images/layout/loading.gif\">');\r\n \r\n $.ajax({\r\n type: \"POST\",\r\n data: 'gather=' + gatherType,\r\n url: \"main.php?p=gather&action=\" + type,\r\n processData: false,\r\n cache: false\r\n }).done(function(reply)\r\n {\r\n // Remove the loading spinner\r\n $('#successdiv').html('Success!');\r\n \r\n // Decrement the turns counter (we're not reloading the page so this has to be done manually)\r\n var turnsElement = $('#super-container div:contains(Turns Left) div')\r\n var newTurnsCount = parseInt(turnsElement.text().trim()) - 1;\r\n \r\n // If we're out of turns, disable the repeat button\r\n if (newTurnsCount <= 0)\r\n {\r\n newTurnsCount = 0;\r\n \r\n repeatButton.off('click');\r\n repeatButton.removeClass('beigebutton');\r\n repeatButton.removeClass('thingbutton');\r\n repeatButton.addClass('greybutton');\r\n repeatButton.addClass('stopbutton');\r\n repeatButton.attr('disabled', 'disabled');\r\n }\r\n \r\n turnsElement.text(newTurnsCount);\r\n\r\n // Append the new items to the gathering list\r\n var itemSet = $($.parseHTML(reply)).find('.clue').parent().parent();\r\n $('#gatheringList').append(itemSet.clone());\r\n \r\n var gatheringDivs = $('#gatheringList > div');\r\n var turnCount = gatheringDivs.length;\r\n $(gatheringDivs[turnCount - 1]).prepend('<div>Turn ' + turnCount + '</div>');\r\n \r\n loadTotals();\r\n });\r\n });\r\n}", "function displayData(data) {\n \n container.innerHTML = '';\n\n data.forEach(function (fact) {\n container.innerHTML += `<div class=\"product\"><div class=\"row\"><div class=\"col-sm-8\"><h3>Title: ${fact.title}</h3>\n <img src=\"${fact.image_url}\" ><p>Price: ${fact.price}</p>\n </div></div>\n </div>`;\n });\n}", "function runjsPersoreselGrid(){\n\n if(window.screen.availWidth < 1100){\n $('#optim-big-scr').html('Cet écran a été optimisé pour téléphone mobile.');\n // Mobile\n responsivefields = [\n { name: \"ref_tag\",\n title: \"#\",\n type: \"text\",\n align: \"left\",\n width: 95,\n headercss: \"h-jsG-l\",\n itemTemplate: function(value, item) {\n return '<i class=\"monosp-ft-mob\">' + value + '</i>';\n }\n },\n { name: \"status\",\n title: '<i class=\"far fa-edit\"></i>',\n type: \"text\",\n align: \"center\",\n width: 25,\n headercss: \"h-jsG-c\",\n itemTemplate: function(value, item) {\n\n switch (value.toString()) {\n case '3':\n //return item.type_pack;\n return (item.type_pack == 'P') ? '<i class=\"mgs-red fas fa-pen-square\"></i>' : '<i class=\"fas fa-arrow-circle-right\"></i>';\n break;\n case '10':\n return '<i class=\"fas fa-hand-holding-heart\"></i>';\n break;\n default:\n return '<i class=\"fas fa-arrow-circle-right\"></i>';\n }\n }\n },\n { name: \"part_name\",\n title: 'Part.',\n type: \"text\",\n align: \"center\",\n width: 65,\n headercss: \"h-jsG-c\",\n itemTemplate: function(value, item) {\n return ((value == null) ? '-' : value.substring(0, STR_LENGTH_SM));\n }\n },\n {\n name: \"paid_code\",\n title: '<i class=\"fas fa-receipt\"></i>',\n type: \"number\",\n width: 30,\n headercss: \"h-jsG-c\",\n itemTemplate: function(value, item) {\n return '<p class=\"center\">' + ((item.hdl_price == 'N') ? '<i class=\"fas fa-window-close\"></i>' : value) + '</p>';\n\n }\n },\n //Default width is auto\n { name: \"bcdescription\",\n title: '<i class=\"fas fa-info-circle\"></i>',\n type: \"text\",\n headercss: \"h-jsG-c\",\n itemTemplate: function(value, item) {\n return ((value == null) ? '-' : value.substring(0, STR_LENGTH_SM));\n }\n }\n ];\n }\n else{\n // Big screens\n responsivefields = [\n { name: \"ref_tag\",\n title: \"Référence\",\n type: \"text\",\n align: \"right\",\n width: 43,\n headercss: \"h-jsG-r\",\n itemTemplate: function(value, item) {\n return '<i class=\"monosp-ft\">' + value + '</i>';\n }\n },\n { name: \"step\",\n title: \"Status\",\n type: \"text\",\n width: 55,\n headercss: \"h-jsG-l\",\n itemTemplate: function(value, item) {\n return ((value == null) ? '-' : value.substring(0, STR_LENGTH_XXL));\n }\n },\n { name: \"status\",\n title: '<i class=\"far fa-edit\"></i>',\n type: \"text\",\n align: \"center\",\n width: 10,\n headercss: \"h-jsG-c\",\n itemTemplate: function(value, item) {\n return ((value == '3') && (item.type_pack == 'P')) ? '<i class=\"mgs-red fas fa-pen-square\"></i>' : '<i class=\"fas fa-window-close\"></i>';\n }\n },\n { name: \"type_pack\",\n title: '<i class=\"fas fa-barcode\"></i>',\n type: \"text\",\n align: \"center\",\n width: 10,\n headercss: \"h-jsG-c\",\n itemTemplate: function(value, item) {\n return (value == 'D') ? '<i class=\"c-w fas fa-box\"></i>' : '<i class=\"c-b fas fa-truck\"></i>';\n }\n },\n //Default width is auto\n { name: \"part_name\",\n title: \"Nom partenaire\",\n type: \"text\",\n width: 45,\n headercss: \"h-jsG-l\",\n itemTemplate: function(value, item) {\n return ((value == null) ? '-' : value.substring(0, STR_LENGTH_XL));\n }\n },\n { name: \"bcdescription\",\n title: \"Description\",\n type: \"text\",\n headercss: \"h-jsG-l\",\n itemTemplate: function(value, item) {\n return ((value == null) ? '-' : value.substring(0, STR_LENGTH_XXL));\n }\n },\n { name: \"create_date\", title: \"Créé le\", type: \"text\", width: 30, headercss: \"h-jsG-l\" },\n { name: \"diff_days\",\n title: '<i class=\"fas fa-stopwatch\"></i>',\n type: \"number\",\n width: 3,\n headercss: \"h-jsG-c\",\n itemTemplate: function(value, item) {\n return '<p class=\"center\">' + value + '</p>';\n }\n },\n {\n name: \"paid_code\",\n title: '<i class=\"fas fa-receipt\"></i>',\n type: \"number\",\n width: 3,\n headercss: \"h-jsG-c\",\n itemTemplate: function(value, item) {\n return '<p class=\"center\">' + ((item.hdl_price == 'N') ? '<i class=\"fas fa-window-close\"></i>' : value) + '</p>';\n // return item.hdl_price;\n }\n }\n\n ];\n }\n\n\n $(\"#nb-el-dash\").html(filteredDataTagToJsonArray.length);\n if(dataTagToJsonArray.length > 0){\n $(\"#jsGrid\").jsGrid({\n height: \"auto\",\n width: \"100%\",\n\n sorting: true,\n paging: true,\n // args are item - itemIndex - event\n rowClick: function(args){\n goToBarcode(args.item.id, args.item.secure)\n },\n data: filteredDataTagToJsonArray,\n\n fields: responsivefields\n });\n }\n else{\n $(\"#jsGrid\").hide();\n }\n}", "function generage_grid() {\n\n for (var i = 0; i < rows; i++) {\n $('.grid-container').append('<div class=\"grid-row\"></div>');\n }\n\n\n $('.grid-row').each(function () {\n for (i = 0; i < columns; i++) {\n $(this).append('<div class=\"grid-cell\"></div>')\n }\n });\n\n var game_container_height = (34.5 * rows)\n $('.game-container').height(game_container_height);\n var game_container_width = (34.5 * columns)\n $('.game-container').width(game_container_width);\n }", "onAdd() {\n this.getPanes().floatPane.appendChild(this.containerDiv);\n }", "function createSampleData(data){\n \n // items = [];\n var fgW = $.fg.getItemWidth();\n var fgH = fgW*0.5625;\n for (var x=0;x<data.length;x++){\n \n //CREATES A VIEW WITH OUR CUSTOM LAYOUT\n var view = Alloy.createController('item_gallery',{\n image:data[x].thumb,\n title:data[x].title,\n width:fgW,\n height:fgH,\n }).getView();\n \n //THIS IS THE DATA THAT WE WANT AVAILABLE FOR THIS ITEM WHEN onItemClick OCCURS\n var values = {\n title: data[x].title,\n image: data[x].thumb,\n video: data[x].video\n };\n \n //NOW WE PUSH TO THE ARRAY THE VIEW AND THE DATA\n items.push({\n view: view,\n data: values\n });\n };\n\n\n\n //ADD ALL THE ITEMS TO THE GRID\n Ti.API.info('BEFORE.FG');\n $.fg.addGridItems(items);\n Ti.API.info('AFTER.FG');\n \n}", "function populate(data) {\n var html_append=\"\";\n var count=\"\";\n\t$('.loader-wrapper').hide();\n $('.to-top').css('display','flex');\n $('.to-bottom').css('display','flex');\n $('.project-count-per-page').css('display','flex');\n $('.grid-wrapper').css('display','grid');\n $('.grid-wrapper').css('grid-template-rows','repeat('+data.per_page/4+', 1fr)');\n $('.page-navigation').show();\n if($(window).width() >= 768 && $(window).width() < 1200)\n {\n $('.grid-wrapper').css('grid-template-rows','repeat('+data.per_page/3+', 1fr)');\n }\n if($(window).width() >= 576 && $(window).width() < 768)\n {\n $('.grid-wrapper').css('grid-template-rows','repeat('+data.per_page/2+', 1fr)');\n }\n if($(window).width() < 576)\n {\n $('.grid-wrapper').css('grid-template-rows','repeat('+data.per_page+', 1fr)');\n }\n \n\tfor (var i = 0; i<data.per_page; i++) {\n /* Creating a card for each project */\n html_append += \"<div class='card'>\";\n if(data.projects[i].image_url)\n html_append += \"<img class='card-img-top' src='\"+data.projects[i].image_url+\"' alt='No image'></img>\";\n else\n html_append += \"<img class='card-img-top' src='Default.png' alt='No image'></img>\";\n html_append += \"<div class='card-body'>\";\n\t\thtml_append += \"<h5 class='card-title'>\"+data.projects[i].name+\"</h5>\";\n html_append += \"<p class='card-text data'>\" + data.projects[i].summary + \"</p>\"; \n html_append += \"<div class='card-text owner'>Owner ID : \";\n html_append += \"<div class='project-owner'>\" + data.projects[i].owner_id;\n html_append += \"<div class='tooltip'><div class='owner-data'>\";\n html_append += \"<p class='tooltip-text'>Fetching the owner details ...</p>\";\n html_append += \"<div class='tooltip-loader'></div>\";\n html_append += \"</div></div></div></div>\";\n html_append += \"<div class='grid-stats'>\"\n html_append += \"<i class='fa fa-comment' title='Comments'></i><p class='card-text stats'>\" + data.projects[i].comments + \" </p>\";\n html_append += \"<i class='fa fa-users' title='Followers'></i><p class='card-text stats'>\" + data.projects[i].followers + \" </p>\";\n html_append += \"<img src='https://dev.hackaday.io/img/logo.svg' title='Skulls' class='skulls-logo' width='18px' height='18px'><p class='card-text stats'>\";\n html_append += data.projects[i].skulls + \" </p>\";\n html_append += \"<i class='fa fa-eye' title='Views'></i><p class='card-text stats'>\" + data.projects[i].views + \" </p>\";\n html_append += \"</div></div></div>\";\n }\n /* Appending data from Javascript to respective element in Html */\n count = \"<div class='project-count-data'><p>Showing Projects: \"+((data.page-1)*50+1)+\" to \"+((data.page-1)*50+data.per_page)+\"</p></div>\";\n $('.project-count-per-page').html(count); \n\t$('.grid-wrapper').append(html_append); \n\n /* Handling owner details by jQuery */\n /* Implemented mouseenter and mouseleave jQuery to implement the tooltip */\n $('.project-owner').mouseenter(function() {\n html_append = \"\";\n var owner_id = $(this).clone().children().remove().end().text();\n \n $.ajax({\n url: \"/owner?owner_id=\"+owner_id,\n type: \"GET\",\n\n success: function(data) {\n $('.tooltip-text').hide();\n $('.tooltip-loader').hide();\n /* Creating a modal-type view for owner data on mouse hover */\n html_append += \"<div class='to-empty'>\";\n html_append += \"<div class='owner-text'><b>Username:</b> \" + data.username + \"</div>\";\n html_append += \"<div class='owner-text'><b>Screen Name:</b> \" + data.screen_name + \"</div>\";\n html_append += \"<div class='owner-text'><b>About me:</b> \" + data.about_me + \"</div>\";\n html_append += \"<div class='owner-text'><i class='fa fa-map-marker' title='Location'></i> \" + data.location + \"</div>\";\n html_append += \"<div class='owner-stats'>\"\n html_append += \"<div class='owner-text'><i class='fa fa-code-fork' title='Projects'></i> \" + data.projects + \"</div>\";\n html_append += \"<div class='owner-text'><img src='https://dev.hackaday.io/img/logo.svg' title='Skulls' class='skulls-logo' width='18px' height='18px'> \" + data.skulls + \"</div>\";\n html_append += \"<div class='owner-text'><i class='fa fa-users' title='Followers'></i> \" + data.followers + \"</div>\";\n html_append += \"</div></div>\";\n \n $('.owner-data').append(html_append);\n }\n });\n });\n\n $('.project-owner').mouseleave(function() {\n $('.to-empty').remove();\n $('.tooltip-text').show();\n $('.tooltip-loader').show();\n });\n}", "function populateDivs (human) {\n const grid = document.getElementById('grid')\n animals.forEach(function (animal) {\n const element = document.createElement('div')\n element.className = 'grid-item'\n const nameElement = document.createElement('h3')\n const p = document.createElement('p')\n const img = document.createElement('img')\n if (animal instanceof Human) {\n nameElement.innerHTML = human.name\n img.src = 'images/human.png'\n } else {\n nameElement.innerHTML = animal.species\n img.src = `images/${animal.species}.png`\n if (animal.species === 'Pigeon') {\n p.innerHTML = animal.fact\n } else {\n p.innerHTML = generateFact(animal, human)\n }\n }\n element.appendChild(nameElement)\n element.appendChild(img)\n element.appendChild(p)\n // add tiles to DOM\n grid.append(element)\n })\n\n // Remove form from screen\n formContainer.remove()\n}", "function populate() {\n\t\tvar temp = \"\";\n\t\tvar div = '<div class=\"squares\"></div>';\n\t\tvar input = parseInt(prompt(\"Choose a new grid size!\"), 10);\n\t\t$('.squares').remove();\n\t\tfor (var i = 1; i <= input * input; i++) {\n\t\t\ttemp += div;\n\t\t};\n\t\t$(\".wrapper\").append(temp);\n\t\tvar height = 640 / input;\n\t\t$('.squares').css('height', height);\n\t\t$('.squares').css('width', height);\n\t}", "function collage() {\n $('.gallery').collagePlus(\n {\n 'fadeSpeed' : 2000,\n 'targetHeight' : 400\n }\n );\n }", "function buildThumbGallery() { \n\tdynamicGallery = [];\n\n\t// Variable used to count every 4th .col div\n\tvar fourthDiv = 0;\n\n\t// Create empty variable for DOM HTML\n\tvar HTML = \"\";\n\n\t// target #gallery\n\tvar galleryContainer = document.getElementById(\"gallery\");\n\n\t// Loop through object and build HTML\n\tfor ( var i=0 ; i < gallery.length; i++ ) {\n\t\t// Call buildDynamicGallery\n\t\tbuildDynamicGallery(i);\n\n\t\t// Add one to fourthDiv\n\t\tfourthDiv++;\n\t\t\tif ( fourthDiv === 4 ){\n\t\t\t\tHTML += '<div class=\"col live zero-right\">';\n\t\t\t\t// reset fourthDiv to zero\n\t\t\t\tfourthDiv = 0;\n\t\t\t} else {\n\t\t\t\tHTML += '<div class=\"col live\">';\n\t\t\t}\n\t\t HTML += '<a href=\"images/photos/'+ gallery[i].image +'.jpg\"';\n\t\t HTML += 'data-index=\"'+ i +'\"';\n\t\t HTML += 'class=\"image-link '+ gallery[i].type +'\">';\n\t\t HTML += '<img src=\"images/thumbs/'+ gallery[i].image +'.jpg\"';\n\t\t HTML += 'alt=\"'+ gallery[i].description +'\"';\n\t\t HTML += 'title=\"'+ gallery[i].title +'\" class=\"image\" />';\n\t\t HTML += '<span class=\"caption-info\">';\n\t\t HTML += '<span class=\"caption-style\">'+gallery[i].title+'</span>';\n\t\t HTML += '<br />'+ gallery[i].description +'</span>';\n\t\t HTML += '</a></div>';\n\n\t}\n\n\tgalleryContainer.innerHTML = HTML;\n \n} // ~end buildThumbGallery", "function galleryList(req,res,template,block,next) { \n \n // Render the item via the template provided above\n calipso.theme.renderItem(req,res,template,block,{}); \n next();\n \n}", "function prepareFields(){\r\n var elems = getInputElementsToSumUp();\r\n for(var i=0; i<elems.length; i++){\r\n elems[i].onchange = function(){ return updateSumField(); }\r\n }\r\n updateSumField(); // initialize the text showing the sum\r\n}", "function addCustomImageSlides(rows){\n let pages = \"\";\n for (let row of rows){\n // If location is tumormap or pathway, replace that slide + summary item instead of adding a new one\n if( (row['location'] == 'tumormap') || (row['location'] == 'pathway')){\n let boxname = row['location'];\n let title = document.getElementById(boxname + \"_title\");\n let img = document.getElementById(boxname + \"_img\");\n let caption = document.getElementById(boxname + \"_caption\");\n \n title.innerHTML = row['title'];\n img.src = row['img'];\n caption.innerHTML = row['caption'];\n \n } else {\n pages += '<div class=\"page\">';\n pages += '<h4 class=\"ui top center aligned inverted header\">' + row['title'] + '</h4>';\n pages += '<div><img src=\"' + row[\"img\"] + '\" style=\"width:9.9in;height:5.5in;\">';\n pages += '<div class=\"ui center very basic segment imgcaption\">'\n pages += row[\"caption\"];\n pages += '</div></div></div>';\n }\n }\n return pages;\n }", "function createGallery() {\n log.debug('[Gallery] : createGallery() : number of images = ', todoItem.get('photoCount'));\n galleryExists = true;\n\n var photoCount = todoItem.get('photoCount');\n var columns = 0;\n\n // Bail if no photos, otherwise set the number of columns based on current photo count\n if (photoCount < 1) {\n Alloy.Globals.Menu.showInfoBar({title: \"No Photos To Display\"});\n log.debug(\"[Gallery] : createGallery : photoCount === 0\");\n return false;\n } else if (photoCount == 1) {\n columns = 1;\n } else if (photoCount == 2) {\n columns = 2;\n } else {\n columns = 3;\n }\n\n if (columns == 0) {\n return;\n }\n\n $.tdg.init({\n columns: columns,\n space: 10,\n delayTime: 500,\n //gridBackgroundColor: '#e1e1e1',\n //itemBackgroundColor: '#9fcd4c',\n itemBorderColor: '#eb5d36',\n itemBorderWidth: 3,\n itemBorderRadius: 5,\n onItemClick: openLargeImage\n });\n\n displayAllPhotos(photoCount);\n}", "function fancybox() {\n\t// popup\n\tif ($('.js-popup-link').length) {\n\t\tvar $link = $('.js-popup-link'),\n\t\t\t$close = $('.js-close-popup');\n\n\t\t$link.on('click', function () {\n\t\t\tvar href = $(this).attr('href');\n\t\t\t$.fancybox({\n\t\t\t\thref: href,\n\t\t\t\twrapCSS: 'custom-popup',\n\t\t\t\tfitToView : false,\n\t\t\t\twidth : 'auto',\n\t\t\t\theight : 'auto',\n\t\t\t\tmargin: [0, 0, 0, 0],\n\t\t\t\tautoSize : false,\n\t\t\t\tpadding:[0, 0, 0, 0],\n\t\t\t});\n\t\t});\n\t\t$close.on('click', function (e) {\n\t\t\te.preventDefault();\n\t\t\t$.fancybox.close();\n\t\t});\n\t}\n\n\t// image\n\tif ($('.js-image-link').length) {\n\t\t$('.js-image-link').fancybox({\n\t\t\twrapCSS: 'fancy-image'\n\t\t});\n\t}\n}", "function formatPopupContent(content){\n var htmlContent = '<div class=\"popup\">';\n $.each(content, function( index, value ) {\n if(value != null){\n switch(index){\n case 'libelle':\n htmlContent += '<div class=\"row\">';\n htmlContent += '<div class=\"col-lg-12\">';\n htmlContent += value;\n htmlContent += '</div>';\n htmlContent += '</div>';\n break;\n case 'montant':\n htmlContent += '<div class=\"row\">';\n htmlContent += '<div class=\"col-lg-12 montant\">';\n htmlContent += value;\n htmlContent += '</div>';\n htmlContent += '</div>';\n break;\n case 'photo':\n if(value != \"\") {\n htmlContent += '<div class=\"row\">';\n //htmlContent += '<div class=\"col-lg-12\"><img src=\"https://' + window.location.host + window.location.pathname + 'img/';\n htmlContent += '<div class=\"col-lg-12\"><img src=\"data/'+annee+'/photos/';\n htmlContent += value;\n htmlContent += '\"></div>';\n htmlContent += '</div>';\n }\n break;\n }\n }\n });\n htmlContent += '</div>';\n return htmlContent;\n }", "function add_properties() {\n $(\".draggable\").each(function (index, item) {\n $(item).resizable({\n disabled: false,\n minWidth: 150,\n minHeight: 60,\n containment: \"parent\",\n grid: [10, 10],\n });\n $(item).draggable({\n disabled: false,\n handle: \"div\",\n containment: \"parent\",\n grid: [10, 10],\n opacity: 0.5,\n snap: false,\n snapMode: \"both\",\n snapTolerance: 10,\n stack: \".draggable\"\n });\n });\n }", "function buildContent (data, appendName) {\n $.each(data, (index, item) => {\n var contentdiv = $(\"<div/>\").addClass(\"row align-items-center content\").appendTo(appendName);\n var imgdiv = $(\"<div/>\").addClass(\"col-md-6\").appendTo(contentdiv);\n var datadiv1 = $(\"<div/>\").addClass(\"col-md-6 text-center\").appendTo(contentdiv);\n var datadiv2 = $(\"<div/>\").addClass(\"row justify-content-center\").appendTo(datadiv1);\n var datadiv3 = $(\"<div/>\").addClass(\"col-10 col-lg-8 about my-5 mb-md-0\").appendTo(datadiv2);\n var img = \"<img src='\" + item.thumbnail + \"' class='img-fluid'>\";\n $(img).appendTo(imgdiv);\n var title = \"<h2>\" + item.title + \"</h2>\";\n $(title).appendTo(datadiv3);\n var text = \"<p class='lead'>\" + item.text + \"</p>\";\n $(text).appendTo(datadiv3);\n var link = \"<a href='\" + item.articleURL + \"'>read more</a>\";\n $(link).appendTo(datadiv3);\n });\n}", "function populateMyWorks(myWorks) {\n for(i=0; i <myWorks.length; i++){\n var object = myWorks[i];\n var row = document.createElement('div');\n\t row.className = 'col-md-4 anba329';\n row.innerHTML = '<div class=\"single_image\"><img src=\"'+object['img']+'\" alt=\"\"> <div class=\"image_overlay\"> <a href=\"'+object['link']+'\">View Project</a><h2>'+object['name']+'</h2></div>';\n //document.getElementById('recentWorks').appendChild(row);\n $(row).hide().appendTo('#recentWorks').fadeIn(1000);\n }\n}", "function PMAPE(value){\n $('.modal.a-p').remove()\n $(\"body\").append(`<div class=\"modal e-p\">\n<p class=\"modal-remove e-p cursor\"><i class=\"fa fa-times\"></i></p>\n <div class=\"wrapper\">\n <header>\n <h1>Edit my product</h1>\n </header>\n <div class=\"sections\">\n\n <section class=\"active\">\n\n <input type=\"text\" placeholder=\"Name\" name=\"edit_products_name\">\n <input type=\"text\" placeholder=\"Description\" name=\"edit_products_description\" id=\"title\">\n\n <div class=\"select-container w-1\">\n <div class=\"text-select w-1\">\n <select name=\"edit_print_products_categories\" class=\"w-1\">\n\n </select>\n </div>\n </div>\n <div class=\"m-c-a-sizes\">\n\n </div>\n <div class=\"m-c-a-lengths\">\n\n </div>\n <div class=\"m-c-a-colors\">\n\n </div>\n <div class=\"m-c-a-images\">\n\n </div>\n <div class=\"c-a-sizes\">\n <div class=\"button-box add-product-add-sizes\">Add sizes</div>\n </div>\n <div class=\"c-a-lengths\">\n <div class=\"button-box add-product-add-lengths\">Add lengths</div>\n </div>\n <div class=\"c-a-colors\">\n <div class=\"button-box add-product-add-colors\">Add colors</div>\n </div>\n <div class=\"c-p-v-container\">\n <div>\n <input type=\"text\" placeholder=\"Count\" name=\"edit-product-add-count\">\n </div>\n <div>\n <input type=\"text\" placeholder=\"Price\" name=\"edit-product-add-Price\">\n <div class=\"text-select w-1\">\n <select name=\"edit_print_products_valuable\" class=\"w-2\">\n\n\n </select>\n </div>\n </div>\n </div>\n\n <div class=\"images edit-products-images\">\n <div class=\"pic edit-products-images\">\n add\n </div>\n </div>\n </section>\n <section>\n <input type=\"text\" placeholder=\"Topic\" id=\"topic\">\n <textarea placeholder=\"something...\" id=\"msg\"></textarea>\n </section>\n </div>\n <footer>\n <ul>\n <li><span id=\"edit-products-reset\" value=\"${value}\">reset</span></li>\n <li><span id=\"edit-products-send\" value=\"${value}\">send</span></li>\n </ul>\n </footer>\n </div>\n\n </div>`)\n EditProducts(value)\n}", "function init(e)\n {\n component = $(e);\n component.addClass('mt-container');\n addTextarea();\n addInput();\n addList();\n component.append('<div style=\"clear:both;\"></div>');\n }", "function facyadd_pro(){\n $.fancybox.open({\n 'type' : 'inline'\n ,'src' : \"#modal_conceptos\"\n ,'modal': true\n });\n }", "function grid() {\n\tif ($('.js-grid').length) {\n\t\t$('.js-grid').isotope({\n\t\t\titemSelector: '.js-grid-item',\n\t\t\tpercentPositijs-grid-itemon: true\n\t\t});\n\t}\n}", "function addBoxes(wrapper) {\n let container = document.getElementById(wrapper);\n container.innerHTML = \"\";\n let letter = wrapper.slice(wrapper.length -1);\n for (var box = 0; box < 12; box++) {\n // check for column, set text style \n switch(letter.toLowerCase()) {\n case \"a\":\n container.innerHTML = container.innerHTML + \"<div>\" + letter.toLowerCase() + \"0\" + box + \"</div>\";\n break;\n case \"b\":\n container.innerHTML = container.innerHTML + \"<div><b>\" + letter.toLowerCase() + \"0\" + box + \"</b></div>\";\n break;\n case \"c\":\n container.innerHTML = container.innerHTML + \"<div>\" + letter.toLowerCase() + \"0\" + box + \"</div>\";\n }\n }\n }", "function initdetail(){$(\"#container\").html('');creategrid([iquery.detail]);relist();$('#loading').text('');bdshareshow();}", "function AddData() {\n var i;\n for (i = 0; i < app.entries.length; i++) {\n myEmotionalData.push(app.entries[i].slider);\n myDateData.push(app.entries[i].date);\n }\n}", "function fill_data(ele) {\n var p_tag = ele.children('p.tab_type');\n var meta_title = ele.children('h3').text();\n var meta_desc = ele.children('p.meta_desc').text();\n var meta_date = p_tag.children('span.type_latest').text();\n var meta_download = p_tag.children('span.type_hot').text();\n var meta_likes = p_tag.children('span.type_favorite').text();\n\n $('#theme_detail_panel h3').text(meta_title);\n $('#theme_detail_panel p').text(meta_desc);\n $('#theme_detail_panel ul li.info_date').text(meta_date);\n $('#theme_detail_panel ul li.info_download').text(meta_download);\n $('#theme_detail_panel ul li.info_fb').text(meta_likes);\n\n }", "function fillPropValues(box) {\n if (box != null) {\n fillBoxPropValues(box);\n } else {\n fillBoxPropValues(document.querySelector(`#${document.querySelector('.container').children[0].id}`));\n fillFlexFlow();\n }\n}", "addToContainerPhotos(_photos){\n let photos = _photos\n let amountOfPhotos = Object.keys(photos).length\n\n if(amountOfPhotos >= 1){ \n let containerPhotos = this.mainBox\n containerPhotos.innerHTML = \"\"\n\n for(let photo in photos){\n let photoBox = document.createElement('div')\n let infoPhoto = photos[photo]\n\n this.addPhoto(photoBox, infoPhoto)\n this.addTitle(photoBox, infoPhoto)\n this.addDate(photoBox, infoPhoto)\n \n photoBox.classList.add('photoBox')\n /* photoBox.classList.add(`photoBox${counter}`) */\n containerPhotos.append(photoBox)\n \n }\n this.preparingDragScroll()\n\n //show message\n this.sandbox.publish('showMessage', false)\n }else{\n this.disableGalery(true)\n\n //show message\n this.sandbox.publish('showMessage', 'Las imagenes para este mes aún no han sido cargadas. Puedes ver fotos de otro mes mientras terminanos con la carga.')\n }\n }", "function loadData (data) {\n data.results.forEach((entry) => {\n const card = document.createElement('DIV')\n card.className = 'card'\n const innerHTML = `\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${entry.picture.medium}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${entry.name.first} ${entry.name.last}</h3>\n <p class=\"card-text\">${entry.email}</p>\n <p class=\"card-text cap\">${entry.location.city}, ${entry.location.state}</p>\n </div>`\n\n card.insertAdjacentHTML('beforeend', innerHTML)\n\n card.addEventListener('click', () => {\n showModal(entry)\n })\n document.querySelector('#gallery').insertAdjacentElement('beforeEnd', card)\n })\n}", "display_collection_photoData(results){\n for(var i=0;i<results.length;i++){\n const div = document.createElement(\"div\");\n const img = document.createElement(\"img\");\n const label = document.createElement(\"label\");\n const p = document.createElement(\"p\");\n const h4 = document.createElement(\"h4\");\n\n collection_section.appendChild(div);\n div.appendChild(h4)\n div.appendChild(img);\n div.appendChild(label);\n div.appendChild(p);\n\n h4.textContent = `${results[i].timestamp}`;\n div.classList.add(\"collect-section-2-div\");\n img.classList.add(\"collect-section-2-img\");\n\n if(`${results[i].label}` == \"\" || `${results[i].label}` == undefined){\n label.textContent = \"\";\n }else{\n label.textContent = `${results[i].label}`;\n }\n \n if(results[i].imageurl.split(\".\")[1] == \"cloudfront\"){\n img.setAttribute(\"src\", `${results[i].imageurl}`);\n }\n else{\n img.setAttribute(\"src\", `${results[i].imageurl}` + \"&w=500&h=300&dpr=2\");\n }\n \n if(results[i].description == null) {\n p.textContent = \"\"\n } else {\n p.textContent = `${results[i].description}`;\n }\n \n }\n }", "function attFields() {\n\n\tlet code = '<div id=\"fieldadd\">';\n\tfor (i = 0; i < NAME_LIST.length; i++) {\n\n\t\tif (NAME_LIST[i] === 'color') {\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<a class=\"w3-text-red\">*</a><br>'+\n\t\t\t\t\t\t'<input type=\"color\" id=\"color\" value=#808080 style=\"width:100%\">'+\n\t\t\t\t\t'</div>';\n\n\t\t} else if (NECESSARY_VAL.indexOf(NAME_LIST[i]) !== -1){\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<a class=\"w3-text-red\">*</a><br>'+\n\t\t\t\t\t\t'<input type=\"text\" autocomplete=\"on\" class=\"w3-input w3-border\" id=\"'+ NAME_LIST[i] +'\">'+\n\t\t\t\t\t'</div>';\n\t\t} else if ([\"PDB_file\",\"image\"].indexOf(NAME_LIST[i]) !== -1){\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<br>'+\n\t\t\t\t\t\t'<input type=\"file\" autocomplete=\"on\" id=\"'+ NAME_LIST[i] +'\">'+\n\t\t\t\t\t'</div>';\n\t\t} else {\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<br>'+\n\t\t\t\t\t\t'<input type=\"text\" autocomplete=\"on\" class=\"w3-input w3-border\" id=\"'+ NAME_LIST[i] +'\">'+\n\t\t\t\t\t'</div>';\n\t\t}\n\t};\n\t\n\tcode += '</div>';\n\treturn code;\n}", "function showInfoBox(new_cases, total_cases, new_deaths, total_deaths) {\n /*return '<div class=\"container-fluid flex-wrap\" style=\"width: 25vh; font-size: 15px\">' + '' +\n '<div class=\"row\"> ' +\n '<div class=\"col-6 d-flex justify-content-end\" style=\"color: #000000\">New Cases</div>' +\n '<div class=\"col-6 d-flex justify-content-start\" style=\"font-weight: bold\">' + new_cases + '</div>' +\n '</div>' +\n '<div class=\"row\">' +\n '<div class=\"col-6 d-flex justify-content-end\" style=\"color: #000000\">Total Cases</div>' +\n '<div class=\"col-6 d-flex justify-content-start\" style=\"font-weight: bold\">' + total_cases + '</div>' +\n '</div>' +\n '<div class=\"row\">' +\n '<div class=\"col-6 d-flex justify-content-end \" style=\"color: #000000\">New Deaths</div>' +\n '<div class=\"col-6 d-flex justify-content-start\" style=\"font-weight: bold\">' + new_deaths + '</div>' +\n '</div>' +\n '<div class=\"row\">' +\n '<div class=\"col-6 d-flex justify-content-end\">Total Deaths</div>' +\n '<div class=\"col-6 d-flex justify-content-start\" style=\"font-weight: bold\">' + total_deaths + '</div>' +\n '</div>' +\n '</div>';*/\n return '<div style=\"width: 25vh\">' +\n 'New Cases: <b>' + new_cases + '</b><br>' +\n 'Total Cases: <b>' + total_cases + '</b><br>' +\n 'New Deaths: <b>' + new_deaths + '</b><br>' +\n 'Cumulative Deaths: <b>' + total_deaths + '</b></div>';\n }", "function setExtraInfo(show) {\n var extraContainer =\n document.getElementById(\"extra-container\");\n if (extraContainer) {\n if (show) {\n extraContainer.style.display = \"flex\";\n } else {\n extraContainer.style.display = \"none\";\n }\n } else {\n if (show) {\n document\n .getElementsByTagName(\"form\")[0]\n .childNodes[1].insertAdjacentHTML(\n \"beforebegin\",\n '<div id=\"extra-container\" style=\"display: flex; flex-wrap: wrap; align-content: center; justify-content: center;\"><div style=\"padding-top: 20px; font-size: 18px;\">Plans starting at less than $1/week. Cancel anytime.</div> <div style=\"padding-top: 30px; font-size: 16px;\"> <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"21\" height=\"22\" viewBox=\"0 0 21 22\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4 12.3916L4.72 11.6756L8.3 15.2396L16.879 6.65265L17.581 7.36965L8.3 16.6526L4 12.3916Z\" fill=\"#1A8917\"/> </svg> No ads<br> <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"21\" height=\"22\" viewBox=\"0 0 21 22\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4 12.3916L4.72 11.6756L8.3 15.2396L16.879 6.65265L17.581 7.36965L8.3 16.6526L4 12.3916Z\" fill=\"#1A8917\"/> </svg> Support quality writing<br> <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"21\" height=\"22\" viewBox=\"0 0 21 22\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4 12.3916L4.72 11.6756L8.3 15.2396L16.879 6.65265L17.581 7.36965L8.3 16.6526L4 12.3916Z\" fill=\"#1A8917\"/> </svg> Access on any device</div></div>'\n );\n }\n }\n }", "_createGrids() {\n this.settingsGridOption = this.artifactoryGridFactory.getGridInstance(this.$scope)\n .setColumns(this._getSettingsColumns())\n //.setMultiSelect(this.)\n .setDraggable(this.reorderLdap.bind(this))\n .setButtons(this._getSettingsActions());\n //.setBatchActions(this._getSettingsBatchActions());\n\n this.groupsGridOption = this.artifactoryGridFactory.getGridInstance(this.$scope)\n .setColumns(this._getGroupsColumns())\n //.setMultiSelect()\n .setRowTemplate('default')\n .setButtons(this._getGroupsActions());\n //.setBatchActions(this._getGroupsBatchActions());\n }", "function addContentToLegend() {\n\n // changes height of div from 0 to make it visible\n var element = document.getElementById(\"left-side-panel-legend\");\n element.style.maxHeight = \"639px\";\n for (i=0, n = jpgMaps.length; i < n; i++) {\n var creatDIV = document.createElement(\"DIV\");\n creatDIV.id = 'ImageCont' + i;\n var para = document.createElement(\"p\");\n para.innerHTML = jpgMaps[i].title;\n\n // create image and add to div\n var picture = document.createElement('img');\n picture.classList.add(\"myImg\");\n picture.id = 'Image' + i;\n picture.alt = jpgMaps[i].title;\n picture.src = jpgMaps[i].jpgSmall;\n // adds and images and text to div\n creatDIV.appendChild(picture);\n //para.appendChild(node);\n creatDIV.appendChild(para);\n creatDIV.className = \"Images\";\n // adds div with image and text to side-panel\n \n element.appendChild(creatDIV);\n\n // style elements in divs: images and divs\n document.getElementById('Image' + i).style.width = \"100%\";\n document.getElementById('Image' + i).style.maxWidth = \"30px\";\n \n };\n }", "function add_field(){\n\t\n\t//Parse the reusults from the queries\n\tvar result = JSON.parse(JSON_result);\n\t\n\tvar i;\n\tvar displayed_number_result = 0;\n\t\n\t//Empty the screen\n\tdocument.getElementById(\"more_project_card\").innerHTML = \"\";\n\tdocument.getElementById(\"more_diagram_card\").innerHTML = \"\";\n\tdocument.getElementById(\"more_doc_card\").innerHTML = \"\";\n\tdocument.getElementById(\"more_diagram_list\").innerHTML = \"\";\n\tdocument.getElementById(\"more_project_list\").innerHTML = \"\";\n\t\n\t\n\t//Make the dropdown buttton go back to its default value\n\tvar dropdownMenuButton = document.getElementById(\"dropdownMenuButton\");\n\tdropdownMenuButton.selectedIndex = 0;\n\t\n\t\n\tif(forswitch == true){\n\tif(result.length == 0){\n\t\tvar no_result_template = document.getElementById(\"no_result_template\");\n\t\t\t\n\t\t\tif (\"content\" in document.createElement(\"template\")) {\n\t\t\t\tvar clone = document.importNode(no_result_template.content, true);\n\t\t\t\tdocument.getElementById('more_project_card').appendChild(clone);\n\t\t\t}\n\t}else{\n\tswitch (display_type){\n\t\t//-----------------------------------------------------------------------------------------------------------------------------------------------------------\n\t\t//Display of the diagrams\n\t\t//-----------------------------------------------------------------------------------------------------------------------------------------------------------\n\t\tcase 'uml':\n\t\t\tvar project_template = document.getElementById(\"diagram_card_template\");\n\t\t\t\n\t\t\tfor (i=0; i<result.length;i++){\n\t\t\t\tif (\"content\" in document.createElement(\"template\")) {\n\t\t\n\t\t\t\t\tvar clone = document.importNode(project_template.content, true);\n\n\t\t\t\t\tvar template_number = clone.getElementById('template_number');\t\n\t\t\t\t\t\n\t\t\t\t\tvar dia_name = clone.getElementById('dia_name');\n\t\t\t\t\tvar project_name = clone.getElementById('project_name');\n\t\t\t\t\tvar dia_image = clone.getElementById(\"dia_image\");\n\t\t\t\t\tvar ahref = clone.getElementById(\"ahref\");\n\t\t\t\t\tvar link = clone.getElementById(\"project_link\");\n\t\t\t\t\tvar dia_type = result[i].umlfiles_name.substr(result[i].umlfiles_name.length-3);\n\t\t\t\t\tif(dia_type == \"peg\"){dia_type = \"jpeg\";}\n\t\t\t\t\tvar dia_type_id = clone.getElementById(\"dia_type\");\n\t\t\t\t\tvar xml_display = clone.getElementById(\"xml_display\");\n\t\t\t\t\tvar placeholder = clone.getElementById('placeholder');\n\t\t\t\t\t\n\t\t\t\t\t//if( i == 0 || result[i-1].umlfiles_name != result[i].umlfiles_name){\n\t\t\t\t\t\t\n\t\t\t\t\t\tdisplayed_number_result ++;\n\t\t\t\t\t\t\n\t\t\t\t\t\ttemplate_number.id = template_number.id+' '+i;\n\t\t\t\t\t\tproject_name.innerHTML = result[i].repos_name;\n\t\t\t\t\t\tdia_name.innerHTML = result[i].umlfiles_name;\n\t\t\t\t\t\tdia_image.style = \"object-fit : scale-down; max-width : 100%; max-height : 250px; background_size : cover\";\n\t\t\t\t\t\tdia_type_id.innerHTML = dia_type;\n\t\t\t\t\t\tahref.href = result[i].umlfies_url;\n\t\t\t\t\t\tlink.href = result[i].repos_url;\n\t\t\t\t\t\tif(dia_type == 'uml' || dia_type == \"xml\" || dia_type == \"xmi\" || dia_type == \"svg\"){\n\t\t\t\t\t\n\t\t\t\t\t\t\txml_display.src = result[i].umlfies_url;\n\t\t\t\t\t\t\t//dia_image.style.backgroundColor = \"white\";\n\t\t\t\t\t\t\tdia_image.parentNode.removeChild(dia_image);\n\t\t\t\t\t\t\tplaceholder.src = \"\";\n\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(dia_type == \"png\" || dia_type == \"gif\"){\n\t\t\t\t\t\t\t\tdia_image.style.backgroundColor = \"white\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\txml_display.parentNode.removeChild(xml_display);\n\t\t\t\t\t\t\tdia_image.data = result[i].umlfies_url;\n\t\t\t\t\t\t\t//ahref.style.backgroundImage = \"url('\"+result[i].umlfies_url+\"')\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\tdocument.getElementById('more_diagram_card').appendChild(clone);\n\t\t\t\t\t//}\n\t\t\t\t}\n\t\t\t}\n\t\tvar number_result = document.getElementById('number_result');\n\t\tnumber_result.innerHTML = \"Number of results : \"+displayed_number_result;\n\t\t\t\n\t\t\t\n\t\tbreak;\n\t\t//-----------------------------------------------------------------------------------------------------------------------------------------------------------\n\t\t//Display of the docs\n\t\t//-----------------------------------------------------------------------------------------------------------------------------------------------------------\n\n\t\tcase 'doc':\n\t\t\tvar project_template = document.getElementById(\"doc_card_template\");\n\t\tbreak;\n\t\t\n\t\t\n\t\t//-----------------------------------------------------------------------------------------------------------------------------------------------------------\n\t\t//Display of the projects\n\t\t//-----------------------------------------------------------------------------------------------------------------------------------------------------------\n\t\tdefault:\n\t\t\tvar project_template = document.getElementById(\"project_card_template\");\n\t\t\tvar counter_proj = 1;\n\t\t\t\n\t\t\tfor (i=0; i<result.length;i++){\n\t\t\t\tif (\"content\" in document.createElement(\"template\")) {\n\t\t\n\t\t\t\t\tvar clone = document.importNode(project_template.content, true);\t\n\t\t\t\t\t\n\t\t\t\t\tvar template_number = clone.getElementById('template_number');\t\n\t\t\t\t\t\n\t\t\t\t\tvar project_number = clone.getElementById('project_number');\n\t\t\t\t\tvar project_name = clone.getElementById('project_name');\n\t\t\t\t\tvar number_commits = clone.getElementById('number_commits');\n\t\t\t\t\tvar founder_name = clone.getElementById('founder_name');\n\t\t\t\t\tvar link = clone.getElementById(\"project_link\");\n\t\t\t\t\tvar number_models = clone.getElementById(\"number_models\");\n\t\t\t\t\tvar number_xmi = clone.getElementById(\"number_xmi\");\n\t\t\t\n\t\t\t\t\t//if((i>0 && result[i-1].repos_name != result[i].repos_name || i == 0)){\n\t\t\t\t\t\ttemplate_number.id = template_number.id+' '+i;\n\t\t\t\t\t\tproject_number.innerHTML = \"#\"+counter_proj+\" \";\n\t\t\t\t\t\tproject_name.innerHTML = result[i].repos_name;\n\t\t\t\t\t\tnumber_commits.innerHTML = result[i].number_commits;\n\t\t\t\t\t\tfounder_name.innerHTML = result[i].founder;\n\t\t\t\t\t\tlink.href = result[i].repos_url;\n\t\t\t\t\t\tnumber_models.innerHTML = result[i].count_filenumber;\n\t\t\t\t\t\tnumber_xmi.innerHTML = result[i].count_xmi;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tdocument.getElementById('more_project_card').appendChild(clone);\n\t\t\t\t\t\tcounter_proj ++;\n\t\t\t\t\t//}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\n\n\t\t\n\t\n\t}\t\n\tforswitch = false;\n\t}\n\t}else{\n\t\tswitch_view(display_type);\n\t}\n}", "function addPeople() {\n //hideRow('createdTr');\n // hideRow('editTr');\n // hideRow(\"createdTr\");\n \n showRow('addTr');\n \n document.getElementById(\"headerLabel\").style.color=\"white\";\n document.getElementById(\"headerLabel\").innerHTML=\"Add People\";\n // showRow('addTr');\n \n //------------------- Slider code start ---------------\n \n //getSlider(4,10);\n \n \n \n \n //--------------------Slider Code end -------------------\n var overlay = document.getElementById('overlay');\n var specialBox = document.getElementById('specialBox');\n // hideRow(\"approvedBy\");\n //hideRow(\"tlcommentsTr\");\n // hideRow(\"hrcommentsTr\");\n overlay.style.opacity = .8;\n if(overlay.style.display == \"block\"){\n overlay.style.display = \"none\";\n specialBox.style.display = \"none\";\n }\n else {\n overlay.style.display = \"block\";\n specialBox.style.display = \"block\";\n }\n}", "function initgriditems() {\n \n //remove this eventualy or use it to provide further displaimers re storage facilities\n function isLocalStorageNameSupported() {\n // Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem\n // throw QuotaExceededError. We're going to detect this and just silently drop any calls to setItem\n // to avoid the entire page breaking, without having to do a check at each usage of Storage.\n if (typeof localStorage === 'object') {\n try {\n localStorage.setItem('localStorage', 1);\n localStorage.removeItem('localStorage');\n } catch (e) {\n Storage.prototype._setItem = Storage.prototype.setItem;\n Storage.prototype.setItem = function() {};\n alert('Your web browser does not support storing settings locally. In Safari, the most common cause of this is using \"Private Browsing Mode\". Some settings may not save or some features may not work properly for you.');\n }\n }\n }\n\n isLocalStorageNameSupported(); // try this out and improved messages\n \n\n //localStorageSize(); to check size\n\n\n $('.grid').each(function () {\n\n $thisgrid = $(this);\n\n if ($(\"body\").hasClass(\"logged-in\")){\n //if logged in don't use local storage\n \n verifyItemsRepeater($thisgrid); // initial - move to better place - or inside an init function of sorts\n initiatepackery($thisgrid);\n\n\n } else {\n\n // if not logged in we look if local storage has saved.\n // if not use the what's and save the og content as a variable?\n // there and save it to the local storage\n //\n // console.log(\"localStorage\" +localStorage+\"\");\n\n if (localStorage.getItem(\"gridContent\") === null) {\n \n // console.log(\"if not local storage\");\n\n\n verifyItemsRepeater($thisgrid); // initial - move to better place - or inside an init function of sorts\n initiatepackery($thisgrid);\n // var OgGridContent = document.getElementById(\"tester-grid-id\").innerHTML;\n var gridContent = document.getElementById(\"tester-grid-id\").innerHTML;//\n\n } else {\n\n // console.log(\"if local storage\");\n\n \n var gridContent = LZString.decompress(localStorage.getItem('gridContent'));\n \n $(\"#tester-grid-id\").empty();\n\n $(\"#tester-grid-id\").append(gridContent);\n \n verifyItemsRepeater($thisgrid);\n //init function of sorts\n initiatepackery($thisgrid);\n \n }//if (localStorage.getItem(\"gridContent\") === null) \n\n \n \n\n }// if ($(\"body\").hasClass(\"logged-in\"))\n \n //allow this click options regardless of user logged in or not\n\n $(\"#clear-local-storage\").click(function () {\n\n console.log(\"clearing local storage\");\n localStorage.removeItem('gridContent');\n localStorage.removeItem('coordinates');\n \n location.reload();\n \n }); // $(\".dev-toggle\").click(function ( )\n\n\n //allow clicking on icon + also full area once open\n $(\".helper-icon, .helper-window\").click(function () {\n\n // console.log(\"click helper icon\");\n\n // $this = $(this);\n \n if ($('body').hasClass(\"helper-on\")){\n \n $('body').removeClass(\"helper-on\")\n\n } else {\n \n $('body').addClass(\"helper-on\");\n $(\".helper-icon\").removeClass(\"pulse\");\n\n } //if \n\n }); // $(\".helper-icon\").click(function () \n\n\n });\n\n } //initgriditems()", "function setupGallery() {\n\t\t if($(\".photogallery\").length) {\n\t\t\tvar globaltitle = $(\".photogallery h2\").text();\n\t\t\t$(\".photogallery h2\").css(\"display\", \"none\");\n\t\t\t$('.photogallery ul').wrap(\"<div class=\\\"scroller\\\"/>\");\n\t\t\t$('.photogallery img').attr(\"width\", \"106\");\n\t\t\t$('.photogallery').append(\"<div class='viewer'></div>\");\n\t\t\t$(\".photogallery .scroller p\").css(\"display\", \"none\");\n\t\t\n\t\t\t$(\".photogallery .scroller img\").each(function() {\n\t\t\n\t\t\t $(this).fadeTo('fast', 0.5);\n\t\t\t\n\t\t\t $(this).click(function() {\n\t\t\t\t$(\".viewer\").html(\"<img src=\\\"\" + $(this).attr(\"src\") + \"\\\"/><p/>\");\n\t\t\t\tif($(this).parent().find(\"p\").text() != \"\") {\n\t\t\t\t $(\".viewer p\").html($(this).parent().find(\"p\").text());\n\t\t\t\t} else {\n\t\t\t\t $(\".viewer p\").html(globaltitle);\n\t\t\t\t}\n\t\t\t\t$(\".photogallery .selected\").fadeTo('slow', 0.5).removeClass(\"selected\");\n\t\t\t\t$(this).addClass(\"selected\").fadeTo('slow', 1.0);\n\t\t\t });\n\t\t\n\t\t\t $(this).hover(function() {\n\t\t\t\t$(this).fadeTo('fast', 1.0);\n\t\t\t }, function() {\n\t\t\t\tif(!$(this).hasClass(\"selected\")) {\n\t\t\t\t $(this).fadeTo('fast', 0.5);\n\t\t\t\t}\n\t\t\t });\n\t\t\n\t\t\t});\n\t\t\taddJScrollPane(\".photogallery .scroller\");\n\t\t\n\t\t\t$(\".photogallery ul li:first img\").click();\n\t\t }\n\t\t}", "function updatePaxDisplay() {\n\n var paxDetail = {\n roomQuantity: 0,\n adultQuantity: 0,\n childQuantity: 0\n };\n\n var searchOptions = getSearchOptions();\n\n paxDetail.roomQuantity = searchOptions.hotelSearchBody.length;\n searchOptions.hotelSearchBody.forEach(function name(pax) {\n paxDetail.adultQuantity += +pax.adultQuantity;\n paxDetail.childQuantity += +pax.childQuantity;\n });\n\n return paxDetail;\n\n }", "function fillCardsValuations(rows)\n{\n let content = '';\n //Se recorren las filas para armar el cuerpo de la tabla y se utiliza comilla invertida para escapar los caracteres especiales\n rows.forEach(function(row){ \n content += `\n <div class=\"col s12 m6 l4\">\n <div class=\"card white\"> \n <div class=\"card-content white-text hoverable\">\n <p class=\"black-text\">\n <strong class=\"blue-text\">Producto:</strong> ${row.producto}</p>\n <p class=\"black-text\">\n <strong class=\"blue-text\">Cliente:</strong> ${row.cliente}</p> \n <p class=\"black-text\"> \n <strong class=\"blue-text\">Puntuacion:</strong> ${row.valoracion}</p>\n <p class=\"black-text\"> \n </div>\n </div>\n </div> \n `;\n });\n $('#modal-content').html(content);\n $('select').formSelect();\n $('.tooltipped').tooltip(); \n $('.materialboxed').materialbox();\n}", "function wrapContent() {\n canvas.find('.column').each(function() {\n var col = $(this);\n var contents = $();\n col.children().each(function() {\n var child = $(this);\n if (child.is('.row, .ge-tools-drawer, .ge-content')) {\n doWrap(contents);\n } else {\n contents = contents.add(child);\n }\n });\n doWrap(contents);\n });\n }", "function insertContent(content) {\n $.each(content, function(indexProduct, product) {\n // create new elements\n var liProduct = $('<li>', {class: \"product\"}).data(\"kids\", product.kids).data('kid-adult', product.kid_adult).data('women', product.women); //main product-div\n // console.log(liProduct.data());\n var aWrap = $('<a>', {href: product.url, target: \"_blank\"}) //link to Product\n // aWrap.on('click', function (event) {\n // event.preventDefault();\n // })\n var img = $('<img>', {src: product.image, class: \"small-photo\"}); //product img + data-url for maxi-img\n var bigPhotoIcon = $('<img>', {src:\"D:/WORKSPACE/sample-grid/images/more-zoom.png\", class:'big-photo-icon'}).data(\"big\", product.img_url).addClass('hidden');\n var divNameWrap = $('<div>', {class: \"name-wrap\"}); //div for Name\n var spanName = $('<span>').text(product.name); //span for Name\n\n var divPriceWrap = $('<div>', {class: \"price-wrap\"}); //div for Price\n var spanPrice = $('<span>', {class: \"price\"}); //span for Price\n var supCurrency = $('<sup>', {class: \"currency\"}).text(\" \" + product.currency); //currency for Price\n if (product.price == \"0,00\") { //insert price\n spanPrice.text('N/A')\n } else {\n spanPrice.text(product.price);\n }\n var pOldPrice = $('<p>', {class: \"old-price\"}); //old Price\n if ((product.price_old === \"0,00\")||(product.price_old == product.price)) { //only display when the product indeed had old price\n pOldPrice.text('');\n } else {\n pOldPrice.text(product.price_old + product.currency);\n }\n var divDeliveryWrap = $('<div>', {class: \"delivery-wrap\"}); //div for Delivery\n var spanDelivery = $('<span>').text(\"Delivery: \" + product.delivery); //span for Delivery\n var divSizeWrap = $('<div>', {class: \"size-wrap\"}); //div for size-wrap\n var spanSizeLabel = $('<span>').text(\"Sizes: \"); //span for Size-Label\n var spanSizes = $('<span>', {class: \"sizes\"}).text(product.sizes); //span for Sizes\n //rest of data\n var divOtherWrap = $('<div>', {class: \"other-wrap\"}); //div for other-wrap\n var divOnline = $('<div>', {class: \"online\"}); //Online\n if (product.online === \"1\") { //text for displaying when product is online\n divOnline.text(\"available online\");\n } else {\n divOnline.text(\"unavailable online\");\n }\n var pPackage = $('<p>', {class: \"package\"}); //pPackage\n if (product.package === \"1\") {\n pPackage.text(\"Part of a Set: Yes\")\n } else {\n pPackage.text(\"Part of a Set: No\");\n }\n var divPorto = $('<div>', {class: \"porto\"}); //shipping text\n if (product.free_porto === \"1\") {\n divPorto.text(\"Free Shipping\");\n } else {\n divPorto.text(\"+ shipping\");\n }\n var pIdNumber = $('<p>', {class: \"id-number\"}).text(\"Product No: \"); //ID\n var spanIdNumber = $('<span>').text(product.id);\n\n //create other elements (not json data)\n var divReadMore = $('<div>', {class: \"read-more\"}).text('QUICK LOOK');\n\n\n //append elements to DOM\n liProduct.append(bigPhotoIcon);\n liProduct.append(aWrap);\n aWrap.append(img);\n // aWrap.append(bigPhotoIcon);\n //Name\n aWrap.append(divNameWrap);\n divNameWrap.append(spanName);\n //Price\n aWrap.append(divPriceWrap);\n divPriceWrap.append(spanPrice);\n divPriceWrap.append(supCurrency);\n divPriceWrap.append(pOldPrice);\n //read MORE\n liProduct.append(divReadMore);\n // product to DOM\n productLists.append(liProduct);\n\n //show all details\n function showDetails(){\n divReadMore.each(function(i,v){\n $(this).click(function(){\n\n var detailsDiv = $('<div>');\n var detailsFullScreen = $('<div>');\n\n detailsFullScreen.addClass('full-screen-details').fadeIn('slow').appendTo($('.details-box'));//add fullScreen class and attach to <body>\n detailsDiv.addClass('detailsDiv').appendTo(detailsFullScreen);\n\n //create and add two columns to display info\n var detailsDivImg = $('<div>').addClass('half lefthalf').appendTo(detailsDiv);\n var detailsDivInfo = $('<div>').addClass('half righthalf').appendTo(detailsDiv);\n var destroyButton = $(\"<div>\").addClass('destroy').appendTo(detailsDivInfo); //exit button\n //clone and append elements that will appear in detailsDiv\n var imgCloned = img.clone().appendTo(detailsDivImg);\n var divNameWrapCloned = divNameWrap.clone().appendTo(detailsDivInfo);\n var divPriceWrapCloned = divPriceWrap.clone().appendTo(detailsDivInfo);\n divPriceWrapCloned.append(divPorto);\n\n\n //Delivery & online\n detailsDivInfo.append(divDeliveryWrap);\n divDeliveryWrap.append(spanDelivery);\n detailsDivInfo.append(divOnline);\n\n //Sizes\n detailsDivInfo.append(divSizeWrap);\n divSizeWrap.append(spanSizeLabel);\n divSizeWrap.append(spanSizes);\n //other\n detailsDivInfo.append(divOtherWrap);\n divOtherWrap.append(pPackage);\n divOtherWrap.append(pIdNumber);\n pIdNumber.append(spanIdNumber);\n\n $('body').on('click', '.destroy', function(){ //exits full screen\n detailsFullScreen.fadeOut('slow');\n });\n\n })\n })\n }\n\n //function for showing big photo on a new screen\n function showBigPhoto() {\n //show and hide zoom icon when hovering on photo\n img.each(function(i,v){\n $(this).on(\"mouseover\", function(){\n $(this).closest(\".product\").find(\".big-photo-icon\").removeClass('hidden'); //finds the right icon\n });\n $(this).on(\"mouseleave\", function(){\n $(this).closest(\".product\").find(\".big-photo-icon\").addClass('hidden');\n });\n })\n\n //show big photo\n bigPhotoIcon.each(function(i,v){\n $(this).on(\"mouseover\", function(){\n $(this).removeClass('hidden');\n });\n $(this).click(function(){\n var imageSource = $(this).data('big');\n\n var bigImg = $('<img>'); //create big image\n var divBigImg = $('<div>') //create div that contains img and close button\n var fullScreen = $('<div>'); // create full screen\n var closeButton = $('<div>'); //create button that exits full screen\n\n fullScreen.addClass('full-screen-bigphoto').fadeIn('slow').appendTo($('.photomax-box'));//add fullScreen class and attach to <body>\n divBigImg.addClass('div-big-img').appendTo(fullScreen);\n bigImg.attr('src', imageSource).appendTo(divBigImg);//add img src and attach to <fullScreen>\n closeButton.addClass('destroy').appendTo(divBigImg);//add closeButton and attach to <fullScreen>\n\n $('body').on('click', '.destroy', function(){ //exit full screen\n aWrap.on('click', function (event) { //disables unisport page to open\n return true;\n })\n fullScreen.fadeOut('slow');\n\n });\n })\n //hide zoom icon\n $(this).on(\"mouseleave\", function(){\n $(this).addClass('hidden');\n });\n })\n }\n\n //filter data-kids,women,adolescent\n function filter(){\n var options = $('options');\n var select = $(\"#filter\");\n\n select.change(function(){\n $( \"select option:selected\" ).each(function() {\n liProduct.show();\n if ($(this).hasClass(\"kids\")){\n if (liProduct.data('kida') != '1') {\n liProduct.hide();\n }\n } else if ($(this).hasClass('kid-adult')) {\n if (liProduct.data('kid-adult') != '1') {\n liProduct.hide();\n }\n } else if ($(this).hasClass('women')) {\n if (liProduct.data('women') != '1') {\n liProduct.hide();\n }\n }\n })\n })\n }//end of filter function\n\n filter();\n showDetails();\n showBigPhoto();\n\n\n\n }); // end of Insert content\n }", "function populateModal(property) {\n var html;\n //console.log(property);\n $(\"#modalTitle\").text(property.address + \", \" + property.cityName + \", \" + \"NJ\");\n $(\"#propertyAddress\").text(property.address);\n $(\"#propertyTown\").text(property.cityName + \", \" + \"NJ\" + \" \" + property.zipcode);\n $(\"#propertyInfo\").text(property.bedrooms + \" beds | \" + property.fullBaths + \" baths | \" + property.sqFt + \" sqft\");\n $(\"#propertyComment\").text(property.remarksConcat);\n $(\"#propertyType\").text(property.idxPropType);\n $(\"#propertyPrice\").text(property.listingPrice);\n $(\"#mainImage\").attr(\"style\", \"background-image: url('\" + property.image['0'].url + \"'\");\n $(\"#mainImage\").attr(\"src\", property.image['0'].url);\n $(\"#fullDetails\").attr(\"href\", property.fullDetailsURL);\n $(\".thumbnailContainer\").empty();\n for(var i = 0; i < property.image.totalCount; i++)\n {\n html = '<div>' +\n '<img class=\"propertyImages\" src=\"' + property.image[i].url + '\">' +\n '</div>';\n $(\".thumbnailContainer\").append(html);\n }\n setTimeout(function() {\n $('.thumbnailContainer').slick({\n dots: false,\n arrows: true,\n infinite: false,\n speed: 600,\n slidesToShow: 6,\n slidesToScroll: 3,\n variableWidth: false,\n autoplay: false,\n });\n $(\".thumbnailContainer\").animate({\n opacity: 1,\n marginTop: \"0px\",\n marginBottom: \"20px\"\n }, 250);\n }, 500);\n }", "function dynamicAddBox() {\r\n\t\tif (objchoice.insertCount<6)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"220px\", \"height\": \"220px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, 6);\r\n\t\t\t\t\tobjchoice.resultBox[objchoice.insertCount] = objchoice.backupBox[5];\r\n\t\t\t\t\tobjchoice.backupBox.splice(5, 1);\t\r\n\t\t\t\t\t$(\".functionBox\").show();\r\n\t\t\t\t\tobjchoice.memoryCount = 5;\r\n\t\t\t\t\tobjchoice.insertCount = 1;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse if (objchoice.insertCount<18)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"130px\", \"height\": \"130px\"});\r\n\t\t\t\t\t$(\".firstLayer\").css({\"width\": \"120px\", \"height\": \"120px\"});\r\n\t\t\t\t\t$(\".functionBox\").css({\"width\": \"100px\", \"height\": \"100px\"});\r\n\t\t\t\t\t$(\".functionButton\").css({\"width\": \"100px\", \"height\": \"50px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, 18);\r\n\t\t\t\t\tobjchoice.memoryCount = 11;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (objchoice.insertCount<28)\r\n\t\t{\r\n\t\t\tswitch (objchoice.insertCount)\r\n\t\t\t{\r\n\t\t\t\tcase 18:\r\n\t\t\t\t\t$(\"main, main img\").css({\"width\": \"120px\", \"height\": \"120px\"});\r\n\t\t\t\t\t$(\".firstLayer\").css({\"width\": \"110px\", \"height\": \"110px\"});\r\n\t\t\t\t\t$(\".secondLayer\").css({\"width\": \"100px\", \"height\": \"100px\"});\r\n\t\t\t\t\t$(\".functionBox\").css({\"width\": \"80px\", \"height\": \"80px\"});\r\n\t\t\t\t\t$(\".functionButton\").css({\"width\": \"80px\", \"height\": \"40px\"});\r\n\t\t\t\t\tobjmain = new getAttribute(\"main\");\r\n\t\t\t\t\tobjmain = setmainPosition(objmain, objContainer);\r\n\t\t\t\t\tsetboxPosition(objchoice, objmain, objchoice.initialBox.length);\r\n\t\t\t\t\tobjchoice.memoryCount = 9;\r\n\t\t\t\tdefault: \r\n\t\t\t\t\tshowrandomBox(objchoice);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{ $(\".alertBox\").show(); }\r\n\t} // end function", "function populateMainPanel(content) {\n // clear main panel\n $(\"#main-panel\").empty();\n\n // iterate over search results\n $.each(content[\"results\"], function (key, value) {\n var film = content[\"results\"][key];\n var imagePath = \"http://via.placeholder.com/185x278?text=?\";\n if (film[\"poster_path\"] != null) {\n imagePath = \"https://image.tmdb.org/t/p/w185\" + film[\"poster_path\"];\n }\n var overviewTrimmed = film[\"overview\"];\n var filmID = film[\"id\"];\n\n var thumbRendered = Mustache.render(thumbTemplate, {title: film[\"title\"], overview: overviewTrimmed, film_image: imagePath, film_id: filmID});\n $(\"#main-panel\").append(thumbRendered);\n });\n\n $(\".thumbnail-container .hide-btn\").on(\"click\", function(e) {\n e.preventDefault();\n $(this).closest(\".thumbnail-container\").remove();\n });\n\n $(\".thumbnail-container .watched-btn\").on(\"click\", function(e) {\n e.preventDefault();\n addToWatchedList($(this).attr(\"data-film-id\"));\n });\n}", "function loadGrid( p ){\n\tvar sideid = p.default_surface, //sideID(),\n\t\tboxes = {},\n\t\tphoto_size,\n\t\tgr_css_width_px = convertUnits( p.surfaces[sideid].grid.width, \"to pix print\" ) * (p.scale/100),\n\t\tgr_css_height_px = convertUnits( p.surfaces[sideid].grid.height, \"to pix print\" ) * (p.scale/100);\n\n\t// console.log(p.surfaces[sideid]);\n\tp.canvas_data = {}; // Reset canvas data\n\n\tproduct_size = { w: $(\"#product-wrapper\").data( \"product_css_w_px\" ),\n\t\t\t\t\t h: $(\"#product-wrapper\").data( \"product_css_h_px\" ),\n\t\t\t\t\t w_ratio: $(\"#product-wrapper\").data( \"product_css_w_px\" ) / 100,\n\t\t\t\t\t h_ratio: $(\"#product-wrapper\").data( \"product_css_h_px\" ) / 100 };\n\n\tgrid_css = { width: (gr_css_width_px / product_size.w_ratio)+\"%\",\n\t\t\t\t height: (gr_css_height_px / product_size.h_ratio)+\"%\",\n\t\t\t\t top: (p.surfaces[sideid].grid.y / product_size.h_ratio)+\"%\",\n\t\t\t\t left: (p.surfaces[sideid].grid.x / product_size.w_ratio)+\"%\" };\n\n\t$grid = $(\"#template-grid\").empty().css( grid_css );\n\t$grid_helper = $(\"#grid-helper-frame\").empty().css( grid_css );\n\t$(\"#texts-layer\").css(grid_css);\n\tcell_css = {};\n\n\t// Copy details for canvas\n\tfor(side in p.surfaces){\n\t\tp.layout_data.scale = p.scale/100;\n\t\tif(typeof p.layout_data[side] == \"undefined\"){\n\t\t\tp.layout_data[side] = {};\n\n\t\t};\n\n\t\tif(typeof p.layout_data[side].cells == \"undefined\"){ p.layout_data[side].cells = {}; };\n\t\tp.layout_data[side].canvas = { width: convertUnits( p.surfaces[side].width, \"to pix print\" ),\n\t\t\t\t\t\t\t\t\t\t height: convertUnits( p.surfaces[side].height, \"to pix print\" ),\n\t\t\t\t\t\t\t\t\t\t name: p.surfaces[side].surface_name };\n\t\t// Check if graphic template have been applyed to the surface\n\t\tif(typeof p.surfaces[side].grid.uri !== \"undefined\"){\n\t\t\tif(typeof p.layout_data[side].graphic_template == \"undefined\"){\n\t\t\t\tp.layout_data[side].graphic_template = { url: p.surfaces[side].grid.uri,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t width: p.layout_data[side].canvas.width,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t height: p.layout_data[side].canvas.height };\n\t\t\t}\n\t\t} else {\n\t\t\tif(typeof p.layout_data[side].graphic_template !== \"undefined\"){\n\t\t\t\tdelete p.layout_data[side].graphic_template;\n\t\t\t}\n\t\t}\n\t}\n\t// console.log(convertUnits(p.surfaces[p.default_surface].img_width, \"to pix print\"));\n\tfor(c in p.surfaces[sideid].grid.cells ){\n\n\t\tif(typeof p.surfaces[sideid].grid.cells[c].uploadable != \"undefined\" && p.surfaces[sideid].grid.cells[c].uploadable == true){\n\t\t\tc_w = p.surfaces[sideid].grid.cells[c].w * (p.scale/100);\n\t\t\tc_h = p.surfaces[sideid].grid.cells[c].h * (p.scale/100);\n\t\t\tc_x = p.surfaces[sideid].grid.cells[c].x * (p.scale/100);\n\t\t\tc_y = p.surfaces[sideid].grid.cells[c].y * (p.scale/100);\n\n\t\t\tcell_css = { width: (c_w / (gr_css_width_px / 100)) +\"%\",\n\t\t\t\t\t\t height: (c_h / (gr_css_height_px / 100)) +\"%\",\n\t\t\t\t\t\t top: \t (c_y / (gr_css_height_px / 100)) +\"%\",\n\t\t\t\t\t\t left: \t (c_x / (gr_css_width_px / 100)) +\"%\" };\n\n\t\t\tif(typeof p.surfaces[sideid].grid.cells[c].rotation != \"undefined\"){\n\t\t\t\t\n\t\t\t\t$.extend(cell_css, { \"-ms-transform-origin\": \"50% 50%\",\n\t\t\t\t\t\t\t\t\t \"-webkit-transform-origin\": \"50% 50%\",\n\t\t\t\t\t\t\t\t\t \"transform-origin\": \"50% 50%\",\n\t\t\t\t\t\t\t\t\t \"-ms-transform\": \"rotate(\"+p.surfaces[sideid].grid.cells[c].rotation+\"deg)\",\n\t\t\t\t\t\t\t\t\t \"-webkit-transform\": \"rotate(\"+p.surfaces[sideid].grid.cells[c].rotation+\"deg)\",\n\t\t\t\t\t\t\t\t\t \"transform\": \"rotate(\"+p.surfaces[sideid].grid.cells[c].rotation+\"deg)\"} );\n\t\t\t}\n\n\t\t\tif(c_w < c_h){\n\t\t\t\tphoto_dimensionA = \"width\";\n\t\t\t\tphoto_dimensionB = \"height\";\n\t\t\t} else {\n\t\t\t\tphoto_dimensionA = \"height\";\n\t\t\t\tphoto_dimensionB = \"width\";\n\t\t\t}\n\n\t\t\t$polaroid_img = $(\"<img class='polaroid-icon' src='/assets/layout-img/personalization/polaroid-green-plain.png'>\");\n\t\t\tvar pi_w = $polaroid_img.width(),\n\t\t\t\tpi_h = $polaroid_img.height(),\n\t\t\t\tpi_rat = pi_w / pi_h;\n\n\t\t\t$polaroid_img.css(photo_dimensionA, \"60%\").css({\"max-width\": \"128px\", \"max-height\": \"129px\"});\n\t\t\t\t\t\t\t\n\t\t\t$(\"<div>\").addClass(\"cell\").prop(\"data-id\", c)\n\t\t\t\t\t\t\t\t\t .prop(\"data-c_w\", p.surfaces[sideid].grid.cells[c].w)\n\t\t\t\t\t\t\t\t\t .prop(\"data-c_h\", p.surfaces[sideid].grid.cells[c].h)\n\t\t\t\t\t\t\t\t\t .prop(\"data-c_x\", p.surfaces[sideid].grid.cells[c].x)\n\t\t\t\t\t\t\t\t\t .prop(\"data-c_y\", p.surfaces[sideid].grid.cells[c].y)\n\t\t\t\t\t\t\t\t\t .css( cell_css )\n\t\t\t\t.appendTo( $grid );\n\n\t\t\t$(\"<div>\").addClass(\"cell-helper\")\n\t\t\t\t\t .prop(\"id\", \"cellhelper\"+c)\n\t\t\t\t\t .css( cell_css )\n\t\t\t\t\t .append(\"<div class='cell-upload-hint'>Upload</div>\")\n\t\t\t\t\t .append($polaroid_img)\n\t\t\t\t\t .appendTo( $grid_helper );\n\t\t\t// Save each cell data Printable\n\t\t\tp.layout_data[sideid].cells[c] = {\tw: p.surfaces[sideid].grid.cells[c].w,\n\t\t\t\t\t\t\t\t\t\t\t\th: p.surfaces[sideid].grid.cells[c].h,\n\t\t\t\t\t\t\t\t\t\t\t\tx: p.surfaces[sideid].grid.cells[c].x,\n\t\t\t\t\t\t\t\t\t\t\t\ty: p.surfaces[sideid].grid.cells[c].y, }\n\n\t\t}\n\n\t}\n\n\t$(\".cell\").unbind(\"mouseover\").bind(\"mouseover\", showCellInfo);\n\t$(\".cell\").unbind(\"mouseout\").bind(\"mouseout\", hideCellInfo);\n\tloadGraphic(p.surfaces[sideid].grid, p);\n\n\t// When empty cell clicked, switch to PhotoUpload tab\n\n\tif(isMobile()){\n\t\t$(\".cell\").unbind(\"click\");\n\t\t$(\".cell\").bind(\"click\", selectCell);\n\t}\n}", "function display(data) {\n div = document.createElement(\"div\");\n div.className = \"container-fluid row justify-content-center\";\n div.id = \"row\";\n // using foreach loop to iterate through data----------------------\n data.forEach((element) => {\n const newdiv = document.createElement(\"div\");\n newdiv.className = \"col-10 col-sm-5 col-lg-3\";\n // adding name to the div----------------------------------------\n const name = document.createElement(\"h3\");\n name.innerHTML = `${element.name}`;\n newdiv.appendChild(name);\n // adding type to div--------------------------------------------\n const type = document.createElement(\"p\");\n type.innerHTML = `brewery type : ${element.brewery_type}`;\n type.id = \"type\";\n newdiv.appendChild(type);\n // adding address to div-----------------------------------------\n const address = document.createElement(\"p\");\n // checking for street name if null it will execute if part else it will ecxecute else part.\n if (element.street == null) \n address.innerHTML = `Address: , ${element.city}, ${element.state}, ${element.country}, ${element.postal_code.split('-')[0]}.`;\n else\n address.innerHTML = `Address: ${element.street}, ${element.city}, ${element.state}, ${element.country}, ${element.postal_code.split('-')[0]}.`;\n newdiv.appendChild(address);\n // adding website to div-----------------------------------------\n const web = document.createElement(\"p\");\n // checking for website if null it will display Not Available else it will display website name.\n web.id=\"web\";\n if (element.website_url == null)\n web.innerHTML = `<i class=\"fa fa-globe\" aria-hidden=\"true\"></i> - Not Available`;\n else\n web.innerHTML = `<i class=\"fa fa-globe\" aria-hidden=\"true\"></i> ${element.website_url}`;\n newdiv.appendChild(web);\n // adding number to div------------------------------------------\n const phone = document.createElement(\"p\");\n // checking for number if null it will display Not Available else it will display number.\n if (element.phone == null)\n phone.innerHTML = `<i class=\"fa fa-phone\" aria-hidden=\"true\"></i> - Not Available `;\n else\n phone.innerHTML = `<i class=\"fa fa-phone\" aria-hidden=\"true\"></i>${element.phone}`;\n newdiv.appendChild(phone);\n div.appendChild(newdiv);\n root.appendChild(div);//appending all element to root element\n });\n}", "render() {\n let me = $(this);\n let parentModule = me.closest('flx-module');\n let wcModule = parentModule[0];\n let rendered = '';\n if (this.data.length > 0) {\n if (this.tHeader && this.tHeader !== '') {\n let render = flexygo.utils.parser.recursiveCompile(this.data[0], this.tHeader, this);\n rendered += render;\n }\n let uniqueId = flexygo.utils.uniqueId();\n rendered += `<div class=\"zoomElements\">\n <i class=\"flx-icon icon-zoomout icon-zoom-115 zoom-ic minusZoom\"></i>\n <input class=\"sliderZoom\" min=\"0.1\" max= \"2\" value= \"1\" step= \"0.05\" type= \"range\"></input>\n <i class=\"flx-icon icon-zoom-1 icon-zoom-115 zoom-ic plusZoom\" ></i>\n <i class=\"flx-icon icon-focus icon-zoom-115 zoom-ic fitZoom\"></i>\n </div>\n <div class=\"flx-orgchart margintoporgchart\" id=\"` + uniqueId + `\"></div>`;\n if (this.tFooter && this.tFooter !== '') {\n let render = flexygo.utils.parser.recursiveCompile(this.data[0], this.tFooter, this);\n rendered += render;\n }\n me.html(rendered);\n //zoom\n let slider = me.find(\".sliderZoom\");\n slider.on(\"change\", function () {\n me.find(\".flx-orgchart\").css({ \"zoom\": $(this).val() });\n });\n me.find(\".plusZoom\").on(\"click\", function () {\n slider.val(parseFloat(slider.val()) + parseFloat(slider.attr('step')));\n slider.change();\n });\n me.find(\".minusZoom\").on(\"click\", function () {\n slider.val(parseFloat(slider.val()) - parseFloat(slider.attr('step')));\n slider.change();\n });\n me.find(\".fitZoom\").on(\"click\", function () {\n if (parseFloat(me.find(\"svg\").attr(\"width\")) != 0) {\n slider.val($('.cntBody').width() / parseFloat(me.find(\"svg\").attr(\"width\")));\n slider.change();\n }\n });\n let initialNode = new flexygo.api.orgchart.Node();\n initialNode.children = new Array();\n if (this.tBody && this.tBody !== '') {\n for (let i = 0; i < this.data.length; i++) {\n if (flexygo.utils.isBlank(this.data[i].Parent)) {\n let node = new flexygo.api.orgchart.Node();\n node.id = this.data[i].Id;\n node.innerHTML = flexygo.utils.parser.recursiveCompile(this.data[i], this.tBody, this);\n node.children = this.getChildren(this.data[i].Id);\n node.stackChildren = this.stackChildren;\n initialNode.children.push(node);\n }\n }\n }\n this.options.chart.container = \"#\" + uniqueId;\n this.options.chart.callback = {\n onTreeLoaded: () => { this.stopLoading(); this.setInitialZoom(); this.dragScroll(); }\n };\n this.options.nodeStructure = initialNode;\n this.tree = new Treant(this.options);\n }\n if (parentModule && wcModule) {\n wcModule.moduleLoaded(this);\n }\n }", "function getGallery(obj) {\r\n for (var i = 0; i < obj.length; i++) {\r\n $mainList.append('' +\r\n '<div class=\"gallery\" style=\"background-image: url(http://st.kp.yandex.net/images/film_big/' + obj[i].preview + '.jpg)\">' +\r\n '<a href=\"#\" data-gallery-item=\"http://st.kp.yandex.net/images/' + obj[i].preview + '\">' +\r\n '<img src=\"http://st.kp.yandex.net/images/' + obj[i].preview + '\" alt=\"\">' +\r\n '</a>' +\r\n '</div>' +\r\n '');\r\n }\r\n }", "function get_field_data_value () \n {\n var $idvl = $params('.wp_gcf_inner-top .form-id-value').val();\n var $name = $params('.wp_gcf_inner-top .form-name-value').val();\n var $exct = $params('.wp_gcf_inner-bottom .add-field-item .add-field-excerpt').val();\n var $desc = $params('.wp_gcf_inner-bottom .add-field-item .add-field-desc').val();\n var $brow = $params('.wp_gcf_inner-bottom .add-field-item .field-item-browse .browse-input').val();\n\n return { 'id':$idvl, 'name':$name, 'excerpt':$exct, 'content':$desc, 'browse':$brow };\n }", "function fillNestedFields($multifield, valueArr) {\n _.each(valueArr, function (record, index) {\n $multifield.find(\".js-coral-Multifield-add\").click();\n //a setTimeout may be needed\n _.each(record, function (value, key) {\n setWidgetValue($($multifield.find(\"[name='./\" + key + \"']\")[index]), value);\n });\n });\n }", "function detalle(nombre, descripcion, nombreArea) {\n\n var tabla = \"\";\n var vacio = \"--\";\n\n tabla += \"<table class='tbListado centrar' style='text-align: center;'>\";\n tabla += \"<tr>\";\n tabla += \"<td class='encabezado'>NOMBRE &Aacute;REA</td><td class='encabezado'>NOMBRE DEL CARGO</td></tr>\";\n tabla += '<td class=\"cuerpoListado10\">' + ((nombreArea == \"\") ? vacio : unescape(nombreArea)) + '</td><td class=\"cuerpoListado10\">' + ((nombre == \"\") ? vacio : unescape(nombre)) + '</td>';\n\n\n tabla += \"<table class='tbListado centrar' style='text-align: center;'><tr><td class='encabezado' colspan ='2'><b> </b>DESCRIPCIÓN</td></tr>\";\n tabla += '</tr>';\n tabla += '<td class=\"cuerpoListado10\">' + ((descripcion == \"\") ? vacio : unescape(descripcion)) + '</td>';\n\n tabla += '</tr>';\n tabla += \"</table>\";\n document.getElementById(\"divTablaDetalle\").innerHTML = tabla;\n\n $.fancybox({\n 'showCloseButton': false,\n 'hideOnOverlayClick': false,\n 'enableEscapeButton': false,\n 'transitionIn': 'fade',\n 'transitionOut': 'fade',\n 'transitionOut': 'fade',\n 'href': '#divDetalleCargo'\n });\n\n}", "function populateMyWorks(myWorks) {\n for(i=0; i <myWorks.length; i++){\n var object = myWorks[i];\n var row = document.createElement('div');\n row.className = 'col-md-4 no_padding';\n row.innerHTML = '<div class=\"single_image\"><img src=\"'+object['img']+'\" alt=\"\"> <div class=\"image_overlay\"> <a href=\"'+object['link']+'\">Ver Proyecto</a><h2>'+object['name']+'</h2></div>';\n //document.getElementById('recentWorks').appendChild(row);\n $(row).hide().appendTo('#recentWorks').fadeIn(1000);\n }\n}", "function popupContent (geoID) {\r\n var index = -1;\r\n for (i=0 ; i < dataReg.cumul_par_reg_lasts.length ; i++) {\r\n if (dataReg.cumul_par_reg_lasts[i].reg_id == geoID) {\r\n index = i;\r\n break; \r\n }\r\n }\r\n\r\n if (index != -1) {\r\n var regName = dataReg.cumul_par_reg_lasts[index].reg_nom,\r\n rad = dataReg.cumul_par_reg_lasts[index].rad,\r\n hosp = dataReg.cumul_par_reg_lasts[index].hosp,\r\n rea = dataReg.cumul_par_reg_lasts[index].rea,\r\n dc = dataReg.cumul_par_reg_lasts[index].dc; \r\n var displayText = \"<h2>\" + regName + \"</h2>\" + \r\n \"<div class='num green'> Guéri: \" + rad + \"</div>\" +\r\n \"<div class='num yellow'> Hospitalisés: \" + hosp + \"</div>\" +\r\n \"<div class='num orange'> Réanimations: \" + rea + \"</div>\" +\r\n \"<div class='num red'> Morts: \" + dc + \"</div>\";\r\n \r\n $(popup).html(displayText);\r\n }\r\n}" ]
[ "0.5487896", "0.5434743", "0.5408386", "0.5375987", "0.53671753", "0.53619415", "0.53388476", "0.5338306", "0.5332664", "0.5322752", "0.5320682", "0.53182495", "0.5312672", "0.5250149", "0.52407247", "0.5240117", "0.52380985", "0.52188253", "0.52098686", "0.519757", "0.5186992", "0.5185762", "0.51844", "0.5182526", "0.51818675", "0.5179151", "0.5177008", "0.5174728", "0.5158707", "0.515693", "0.51421213", "0.51407826", "0.51378626", "0.5136968", "0.5135692", "0.5134866", "0.5128287", "0.51240534", "0.51111996", "0.51029336", "0.50915945", "0.50865865", "0.5086196", "0.5082539", "0.50825256", "0.50819206", "0.50738555", "0.5069531", "0.50688034", "0.50676095", "0.50663567", "0.5063361", "0.50625354", "0.5061396", "0.50608677", "0.5056767", "0.5052395", "0.5052108", "0.5049768", "0.504046", "0.50353914", "0.50323474", "0.50315595", "0.50205505", "0.50142574", "0.5012724", "0.5002931", "0.4997015", "0.49956197", "0.49948928", "0.49909633", "0.49894106", "0.4986852", "0.4986318", "0.49861795", "0.49841934", "0.49841923", "0.49829215", "0.4981482", "0.4979236", "0.49776092", "0.49761352", "0.4971829", "0.4968859", "0.49671498", "0.49626032", "0.49619636", "0.49614868", "0.4960139", "0.49594125", "0.49583274", "0.4955504", "0.49534428", "0.4952314", "0.49506795", "0.494805", "0.49462402", "0.49443516", "0.49431878", "0.49429068" ]
0.60808325
0
Filter Notes by Tags
filterNotes(e) { e.preventDefault(); const tagCategory = this.state.search; let promise = axios.get(url); promise .then(result => { const notes = []; for (let id in result.data) { const note = { id, tag: result.data[id].tag, text: result.data[id].text }; notes.push(note); } let newNotes; if (tagCategory === '') { newNotes = notes; } else { var options = { pre: '<' , post: '>' , extract: function(el) { return el.rompalu; } }; newNotes = fuzzy.filter('bcn', notes,options); var matches = newNotes.map(function(el) { return el.string; }); // newNotes = notes.filter(note => { // return note.tag && note.tag.indexOf(tagCategory) > -1; // }); } this.setState({notes: newNotes}); }, err => { console.log(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter_notes(tags)\n {\n var id, note, tr, match;\n for (id in noteslist.rows) {\n tr = noteslist.rows[id].obj;\n note = notesdata[id];\n match = note.tags && note.tags.length;\n for (var i=0; match && note && i < tags.length; i++) {\n if ($.inArray(tags[i], note.tags) < 0)\n match = false;\n }\n\n if (match || !tags.length) {\n $(tr).show();\n }\n else {\n $(tr).hide();\n }\n\n if (me.selected_note && me.selected_note.uid == note.uid && !match) {\n warn_unsaved_changes(function(){\n me.selected_note = null;\n noteslist.clear_selection();\n }, function(){\n filter_notes(tags);\n });\n }\n }\n }", "function tags(tags) { }", "function filtradoTags(tags) {\n return (tags.length==2) && tags[0].includes(\"isCriteriaOf\") && tags[1].includes(\"mark\");\n}", "function filtradoTags2(tags) {\n return (tags.length==2) && tags[0].includes(\"mark\") && tags[1].includes(\"isCriteriaOf\");\n}", "function filterByKeyword (tags) {\n var ref = firebase.database().ref();\n var query = ref.child('tags').child(tags);\n var filterByTag = $firebaseObject(query);\n return filterByTag;\n }", "function tagDescriptionFilter(collection,tag) {\n \n var sendback = new Backbone.Collection();\n \n for (i = 0; i < collection.length; i++) {\n var model = collection.at(i);\n if(model.attributes.descriptiontags == tag) {\n sendback.push(model);\n }\n }\n return sendback;\n}", "function filter_post_by_tag(posts, tag) {\n var results = [];\n $.each(posts, function(index, item){\n if (item['categories'].indexOf(tag) != -1){\n results.push(item);\n }\n });\n return results\n }", "applyTags(tags) {\n return (\n tags &&\n tags\n .filter(t => this.state.selectedTags.indexOf(t.id) > -1)\n .map(t => ({ title: t.title, id: t.id }))\n );\n }", "function tags(text) {\n return $board.$(\".tag\").filter(function () {\n return $(this).text().toLowerCase() == text.toLowerCase();\n });\n}", "function findByTags(tasks, tags) {\n return tasks.filter(p => p.tags.some(function(t){\n return tags.indexOf(t) > -1;\n }));\n}", "function getTags(tags) {\n return tags.filter((x) => !SPECIAL_TAGS.has(x)).sort();\n}", "tagSearch(event) {\n //Search for tags matching\n }", "function tagTitleFilter(collection,tag) {\n \n var sendback = new Backbone.Collection();\n \n for (i = 0; i < collection.length; i++) {\n var model = collection.at(i);\n if(model.attributes.titletags == tag) {\n sendback.push(model);\n }\n }\n return sendback;\n}", "function findByTags(tasks, tags) {\n return tasks.filter(task => task.tags.some(tag => tags.indexOf(tag) !== -1));\n}", "function getTags(text) {\n const regexp = new RegExp(text, \"i\");\n\n return $q((resolve, reject) => {\n const request = Tag.all();\n\n request.promise.then(()=> {\n const result =\n request.data.filter(\n (t) => t.data.attributes.name.match(regexp));\n\n resolve(result);\n });\n });\n }", "function findByTag(tasks, tag) {\n let tareas = tasks.filter(t => t.tags.indexOf(tag) !== -1);\n return tareas;\n}", "async function itemsWithTags(){\n const items = await todoItem.findAll({\n include: [tag]\n });\n return items.map(item => item.get({plain: true}));\n }", "filterDataByInputTextTag() {\n const activeTag = this.scopeObject.objModel.tag;\n const searchTerm = this.scopeObject.objModel.text;\n const endPoint = this.epProvider.getEndPointByName('searchTitle');\n\n if (activeTag === 'filtered') {\n const searchProm = this.httpObj.get(`${endPoint}?search=${searchTerm}`);\n searchProm.then(\n (response) => {\n this.scopeObject.allData = response.data;\n },\n (errorData) => {\n this.scopeObject.allData = []\n }\n );\n }\n }", "function findByTag(tasks, tag) {\n return tasks.filter(task => task.tags.indexOf(tag) !== -1);\n}", "function findTags(data) {\n let tags = [];\n data.forEach(recipe => {\n recipe.tags.forEach(tag => {\n if (!tags.includes(tag)) {\n tags.push(tag);\n }\n });\n });\n tags.sort();\n tags.forEach(tag => domUpdates.listTag(capitalize(tag), tag));\n}", "function unionTags(notebook, tags){\n\tvar list = [];\n\tfor(var i = 0; i < tags.length; i++){\n\t\tvar tag = tags[i];\n\n\t\tvar tagList = notebook.access_database[tag];\n\t\tif(tagList !== undefined){\n\t\t\tlist = list.concat(tagList);\n\t\t}\n\t}\n\tlist = list.filter(function(elem, ind){\n\t\treturn list.indexOf(elem) === ind;\n\t})\n\treturn list;\n}", "async function filterByTags() {\r\n tags = agent.parameters.tag;\r\n\r\n let request = {\r\n method: 'POST',\r\n headers: { 'x-access-token': token },\r\n redirect: 'follow'\r\n }\r\n\r\n if (token === \"\" || typeof token === 'undefined') {\r\n addAgentMessage(\"Sorry I cannot perform that. Please login first!\")\r\n return;\r\n }\r\n // console.log(tags)\r\n\r\n\r\n const serverReturn = await fetch(ENDPOINT_URL + '/application/tags/' + tags, request)\r\n\r\n if (!serverReturn.ok) {\r\n // console.log(serverReturn)\r\n addAgentMessage(\"There was a problem while filtering products. Please try again!\");\r\n return;\r\n }\r\n\r\n message = \"Hera are the items with \" + tags + \" tags in the given category.\"\r\n addAgentMessage(message)\r\n\r\n }", "function tagMarked(tags){ return tagList(MARKED, tags) }", "tags(tags) {\n this.checkSearchType();\n const ts = [];\n for (const tag of tags) {\n const values = typeof tag.values === 'string' ? [tag.values] : tag.values;\n ts.push({\n name: tag.name,\n values,\n });\n }\n this.options.tags = ts;\n return this;\n }", "filterFeaturesByTags (tagsExcluded) {\n var filtered = []\n for (let feature of this.features) {\n if (!feature.tags.some(tag => tagsExcluded.includes(tag))) {\n feature.scenarios = feature.scenarios.filter(scenario => !scenario.tags.some(tag => tagsExcluded.includes(tag)))\n if (feature.scenarios.length) {\n filtered.push(feature)\n }\n }\n }\n return filtered\n }", "function filterForTags(limitToTags) {\n return function (operation) {\n if (!limitToTags) {\n return true;\n }\n if (Array.isArray(limitToTags) && Array.isArray(operation.tags)) {\n for (var i = 0; i < limitToTags.length; i++) {\n for (var j = 0; j < operation.tags.length; j++) {\n if (limitToTags[i] === operation.tags[j]) {\n return true;\n }\n }\n }\n }\n return false;\n };\n }", "function filterRequestsByTags(tags, requests) {\n return requests.filter(r => {\n for (let [index, val] of tags.entries()) {\n if(r.tags[index] != val){\n return\n }\n }\n return r\n })\n}", "filterByTag(...args) {\n const filtered = new PacketList();\n\n const handle = tag => packetType => tag === packetType;\n\n for (let i = 0; i < this.length; i++) {\n if (args.some(handle(this[i].tag))) {\n filtered.push(this[i]);\n }\n }\n\n return filtered;\n }", "searchByTags(tags) {\n const matchEntities = [];\n for (let entity of this.__entities) {\n if (entity.matchTags(tags)) {\n matchEntities.push(entity);\n }\n }\n return matchEntities;\n }", "function tagBookmarked(tags){ return tagList(BOOKMARKS, tags) }", "function filterByTagName(tagValue) {\n\tvar afterRemovedArray = [];\n\tarray.map((f) => {\n\t\tvar count = 0;\n\t\tfor (skill of f.skills) {\n\t\t\tfor (i = 0; i < selectedTagNameList.length; i++) {\n\t\t\t\tif (selectedTagNameList[i] === skill) {\n\t\t\t\t\tcount = count + 1;\n\t\t\t\t\tif (count === selectedTagNameList.length) {\n\t\t\t\t\t\tafterRemovedArray.push(f);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\trenderBoxes(afterRemovedArray);\n\n\t// const tempArray = [];\n\t// if (filteredTags.length > 0) {\n\t// \tfilteredTags.map((a) => {\n\t// \t\tfor (skill of a.skills) {\n\t// \t\t\tif (tagValue.textContent === skill) {\n\t// \t\t\t\ttempArray.push(a);\n\t// \t\t\t}\n\t// \t\t}\n\t// \t});\n\t// } else {\n\t// \tarray.map((a) => {\n\t// \t\tfor (skill of a.skills) {\n\t// \t\t\tif (tagValue.textContent === skill) {\n\t// \t\t\t\ttempArray.push(a);\n\t// \t\t\t}\n\t// \t\t}\n\t// \t});\n\t// }\n\t// filteredTags = tempArray;\n\t// // console.log(filteredTags);\n\t// var filteredDuplicateRemoved = removeusingSet(filteredTags);\n\t// renderBoxes(filteredDuplicateRemoved);\n\t// // console.log('filteredDuplicateRemoved', filteredDuplicateRemoved);\n}", "function tagSelectNOT(tags, from, tagset){\r\n\tvar remove = tagSelectAND(tags, from, false, tagset)\r\n\t// keep the elements that DO NOT exist in remove...\r\n\treturn from.filter(function(e){\r\n\t\treturn remove.indexOf(e) < 0\r\n\t})\r\n}", "function tagSelectOR(tags, from, no_sort, tagset){\r\n\ttags = typeof(tags) == typeof('str') ? [ tags ] : tags\r\n\ttagset = tagset == null ? TAGS : tagset\r\n\tfrom = from == null ? getLoadedGIDs() : from\r\n\r\n\tvar all = []\r\n\r\n\ttags.forEach(function(tag){\r\n\t\ttag = tagset[tag]\r\n\t\ttag = tag == null ? [] : tag\r\n\t\tall = all.concat(tag)\r\n\t})\r\n\r\n\treturn from.filter(function(e){\r\n\t\treturn all.indexOf(e) >= 0\r\n\t})\r\n}", "function filter( a, tag ) {\n var r = [], \n uids = {};\n if( tag ) tag = new RegExp( \"^\" + tag + \"$\", \"i\" );\n for( var i = 0, ae; ae = a[ i++ ]; ) {\n ae.uid = ae.uid || _uid++;\n if( !uids[ae.uid] && (!tag || ae.nodeName.search( tag ) !== -1) ) {\n r[r.length] = uids[ae.uid] = ae;\n }\n }\n return r;\n }", "function process_tags(file_name, text) {\n let split = trim_array(text.split('\\n'));\n\n if (split.length > 1) {\n let line = split[2];\n let index = find_next_index_of(line, 0, '}');\n\n // Making sure the article does actually have a list of tags\n if (line[0] === '{' && index >= 0) {\n // The list of article tags\n let tagsList = line.substring(1, index).split(',');\n\n for (let i = 0; i < tagsList.length; i++) {\n if (tagsList[0] !== '') {\n // Adding the tag to the first index, then adding a new empty list\n // so that future articles that are tagged with it can go there\n if (!tags[0].includes(tagsList[i])) {\n tags[0].push(tagsList[i]);\n tags.push([]);\n }\n\n // Adding the article to the tags' lists of tagged articles\n tags[tags[0].indexOf(tagsList[i]) + 1].push(file_name);\n }\n }\n }\n }\n}", "function update_taglist(tags)\n {\n // compute counts first by iterating over all notes\n var counts = {};\n $.each(notesdata, function(id, rec) {\n for (var t, j=0; rec && rec.tags && j < rec.tags.length; j++) {\n t = rec.tags[j];\n if (typeof counts[t] == 'undefined')\n counts[t] = 0;\n counts[t]++;\n }\n });\n\n rcmail.triggerEvent('kolab-tags-counts', {counter: counts});\n\n if (tags && tags.length) {\n rcmail.triggerEvent('kolab-tags-refresh', {tags: tags});\n }\n }", "function createTag_Filter_List(){\n$.map(appArray, function (e, i){\n \t\tvar appTagArray = e.tags.split(\", \");\n \t\t$.map(appTagArray, function (f, j){\n \t\t\tvar tag = f;\n \t\t\tvar patt1= new RegExp(tag);\n\t\t\t// spit string, set new array = variable array, then loop through it. \n\t\t\tif (patt1.test(allTags) === false){\n \t\t\tallTags.push(f)\n \t\t\t}\n \t\t});\n \t});\nallTags.sort()\n}", "matchTags(tags) {\n let regExpStr = '^';\n for (let tagName in tags) {\n regExpStr += `(?=.*${[tagName]}:${tags[tagName]})`;\n }\n var reg = new RegExp(regExpStr);\n if (reg.test(this.__combinedTagString)) {\n return true;\n }\n else {\n return false;\n }\n }", "function filterRecettesEnClick() {\n\n //emty the array \n filteredRecettesClick = [];\n \n //loop throught each tag and execute this code\n clickedTags.forEach(tag => {\n\n filteredRecettesClick.push(...recettes.filter(recette => {\n\n return recette.ingredients.some(i => i.ingredient.includes(tag)); \n\n }))\n\n })\n \n recetteContainerDOM.innerHTML = \" \";\n allRecepiess(filteredRecettesClick);\n}", "async function articlesTask4 () {\n try{\n const withTags = await articleCollection.find({ tags: { $in: ['tag2', 'tag1-a'] } }).toArray()\n \n } catch(error){\n console.log(error);\n }\n }", "function getTags(){\n let arrayOfTags = [];\n FisheyeDataFR.photographes.forEach(photographer => {\n photographer.tags.forEach(tag => {\n if(arrayOfTags.indexOf(tag) === -1) {\n arrayOfTags.push(tag);\n }\n });\n });\n return arrayOfTags;\n}", "function initTags() {\n \n for (var j = $scope.QUERY.whattodo.length - 1; j >= 0; j--) {\n for (var i = $scope.tripTags.length - 1; i >= 0; i--) {\n if ($scope.QUERY.whattodo[j].slug == $scope.tripTags[i].slug) {\n $scope.local.tags.push($scope.tripTags[i]);\n break;\n }\n }\n }\n }", "function has_interesting_tags(t, ignore_tags) {\n\t if (typeof ignore_tags !== \"object\")\n\t ignore_tags={};\n\t if (typeof options.uninterestingTags === \"function\")\n\t return !options.uninterestingTags(t, ignore_tags);\n\t for (var k in t)\n\t if (!(options.uninterestingTags[k]===true) &&\n\t !(ignore_tags[k]===true || ignore_tags[k]===t[k]))\n\t return true;\n\t return false;\n\t } // helper function to extract meta information", "get textByTag () {\n return this.items.map(i => ({\n tag: i.tag,\n text: i.text\n }));\n }", "function GetArtworksByTagsList(tag){\n var result = [];\n var tagArray = tag.split(':');\n\n /* Loop all the artwork */\n for(var i = 0; i < ArtworkArray.length; i++){\n /* Initialize trigger */\n var CanBeAdd = false;\n\n /* Loop all tag request */\n for(var j = 0; j < tagArray.length; j++){\n\n /* Get current selection artwork tags */\n var selectionTags = ArtworkArray[i].Tags.split(':');\n\n /* Loop the current selection artwork tags*/\n for(var k = 0; k < selectionTags.length; k++){\n\n /* Before the trigger flip, do the check */\n if(!CanBeAdd){\n\n /* Check if the any tag match */\n if(tagArray[j] == selectionTags[k]){\n CanBeAdd = true;\n result.push(ArtworkArray[i]);\n }\n }\n }\n }\n }\n\n /* Return query result */\n return result;\n}", "function removeTagByName(tagName) {\n $(\"#mhTagFilter .filterList .filterEntry\").each((index, elem) => {\n if ($(elem).text().includes(tagName)) {\n $(elem).find(\".filterEntryClose\").click();\n }\n })\n}", "function get_list_from_tags(tag_list) {\n // All the tags that we want to include articles from\n let good = tag_list[0].split(',');\n\n // All the tags that we want to exclude articles from\n let bad = (tag_list.length === 2) ? tag_list[1].split(',') : [];\n\n // The current list of articles that may make the cut\n let valid_articles = [];\n\n // The tag index of the tag that's articles we're currently checking through\n let index = get_tag_index(good[0]);\n\n // Creating the initial valid setup from the first good tag\n for (let i = 0; i < get_tagged_length(good[0]); i++)\n valid_articles.push(tags[index + 1][i]);\n\n for (let j = 0; j < valid_articles.length; j++) {\n let is_tag_private = false;\n\n if (!is_wiki_private)\n for (let prv = 0; prv < private_tags.length; prv++)\n if (tags[get_tag_index(private_tags[prv]) + 1].includes(valid_articles[j]) ||\n private_tags[prv] === valid_articles[j])\n is_tag_private = true;\n\n // Making the element null if it's private\n if (!is_wiki_private && is_tag_private)\n valid_articles[j] = 'null';\n else {\n // Making sure each element is contained within each other 'good' tag\n for (let k = 1; k < good.length; k++) {\n index = get_tag_index(good[k]);\n\n if (index < 0 || !tags[index + 1].includes(valid_articles[j])) {\n valid_articles[j] = 'null';\n break;\n }\n }\n\n // Making sure each element isn't contained within each 'bad' tag\n for (let l = 0; l < bad.length; l++) {\n index = get_tag_index(bad[l]);\n\n if (index >= 0 && tags[index + 1].includes(valid_articles[j])) {\n valid_articles[j] = 'null';\n break;\n }\n }\n }\n }\n\n let lst = '';\n\n // Creating a sequence of buttons in list elements to go inside the list\n for (let m = 0; m < valid_articles.length; m++)\n if (valid_articles[m] !== 'null')\n lst += '<li><button onclick=\"set_current_article(this)\">' + valid_articles[m] + '</button></li>';\n\n return '<ul>' + lst + '</ul>'; // Returning the final list\n}", "function filterByQuery(query, notesArray){\n let queryResults = notesArray;\n if(query.title){\n queryResults = queryResults.filter(note => note.title.toLowerCase() === query.title.toLowerCase())\n }\n if(query.text){\n queryResults = queryResults.filter(note => note.text.toLowerCase() === query.text.toLowerCase())\n }\n return queryResults;\n}", "function tags (elt, tag){\r\n\t\treturn elt.getElementsByTagName(tag);\r\n\t}", "function filterTags(regEx) {\n /**\n * @param repo target repo to look for tags, supplied by callback initiator\n */\n return function (repo) {\n return git.Tag.list(repo)\n .then(tagList => tagList.filter(tag => regEx.exec(tag)));\n };\n}", "function tagOnlyList(list, tags, no_sort){\r\n\tno_sort = no_sort == null ? true : false\r\n\ttagSelectAND(tags, null, no_sort)\r\n\t\t.forEach(function(gid){\r\n\t\t\tif(list.indexOf(gid) < 0){\r\n\t\t\t\tremoveTag(tags, gid)\r\n\t\t\t}\r\n\t\t})\r\n\treturn tagList(list, tags)\r\n}", "_filter(value) {\n const filterValue = value.toLowerCase();\n return this.tags_all.filter(option => option.text.toLowerCase().includes(filterValue));\n }", "removeTag(event) {\n var element = event.currentTarget.parentElement;\n element.remove();\n var text = element.childNodes[1].data.substring(1);\n text = text.slice(0, -1);\n for (var i = 0; i < this.tags.length; i++) {\n if (this.tags[i] === text) {\n var arrayIndex = this.tags.indexOf(text);\n if (arrayIndex > -1)\n this.tags.splice(arrayIndex, 1);\n }\n }\n if (this.tags.length > 0) {\n this.showTags();\n }\n else {\n this.tag_entries = [];\n this.dataSource = new _angular_material_table__WEBPACK_IMPORTED_MODULE_2__[\"MatTableDataSource\"](this.tag_entries);\n }\n }", "getTags(userId) {\n\t\treturn this._getObjects(\n\t\t\t(\n\t\t\t\t'SELECT DISTINCT t.tag_text FROM TAGS t ' + \n\t\t\t\t'JOIN LINKS_TAGS lt ON t.tag_id = lt.tag_id ' +\n\t\t\t\t'JOIN LINKS l ON lt.link_id = l.link_id ' +\n\t\t\t\t'JOIN MESSAGE m ON l.link_id = m.link_id ' + \n\t\t\t\t'WHERE m.sender_id = :id OR m.recipient_id = :id'\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: userId\n\t\t\t}\n\t\t);\n\t}", "function readTagView(tagString) {\n var tags = [];\n tagString = tagString || $('input[name=tags]').val();\n var matches = tagString.match(/([^ \\]\\[]+)|(?:\\[\\[([^\\]]+)\\]\\])/g) || [];\n $.each(matches, function(index, value) {\n tags.push(value.replace(/[\\]\\[]+/g, ''));\n });\n return tags;\n}", "function applyFilter() {\n return { params: { filter: { tags: ['Menu'] } } };\n}", "function setTags(tags, doSort) {\n //writeDebug(\"called setTags(\"+tags+\")\");\n\n clearSelection();\n var values;\n if (typeof(tags) == 'object') {\n values = tags;\n } else {\n values = tags.split(/\\s*,\\s*/);\n }\n if (!values.length) {\n return;\n }\n var tmpValues = new Array()\n for (var i = 0; i < values.length; i++) {\n tmpValues.push(values[i].replace(/([^0-9A-Za-z_])/, '\\\\$1'));\n }\n var filter = \"#\"+tmpValues.join(\",#\");\n //writeDebug(\"filter=\"+filter);\n $tagCloud.find(filter).addClass(\"current\");\n if (doSort) {\n values = values.sort();\n }\n $input.val(values.join(\", \"));\n }", "function getTags() {\r\n var filtered = new Array(), tagList = document.getElementsByTagName('input');\r\n for (var i = 0, l = tagList.length, tag = null; i<l; i++) {\r\n tag = tagList[i];\r\n // we're only interested in these two types\r\n if (tag.type == \"password\" || tag.type == \"text\") {\r\n filtered.push(tag);\r\n }\r\n }\r\n return filtered;\r\n}", "onAddTags() {}", "hasTag(tagList, filter) {\n if (filter === '') return true;\n else if (tagList === undefined) return false;\n else {\n for (let i = 0; i < tagList.length; i++) {\n if (tagList[i].toLowerCase().includes(filter.toLowerCase())) return true;\n }\n return false;\n }\n }", "applyTags(tags) {\n var qp = { tags: tags.toString() };\n return this.refreshModel(qp).then( model =>{\n this.emit(events.TAGS_SELECTED);\n return model;\n });\n }", "showTags() {\n var tag = [...this.tags];\n for (var i = 0; i < tag.length; i++) {\n while (tag[i].indexOf(\" \") > -1) {\n tag[i] = tag[i].replace(\" \", \"%20\");\n }\n }\n var apiUrl = \"search?q=SELECT%20*%20FROM%20messages%20WHERE%20tags.text=\";\n for (var i = 0; i < tag.length; i++) {\n apiUrl += (\"'\" + tag[i] + \"'\");\n if (i !== (tag.length - 1)) {\n apiUrl += (\"%20AND%20tags.text=\");\n }\n }\n this.http.get(base_url + apiUrl).subscribe(res => {\n this.tag_entries = res.data.items;\n this.dataSource = new _angular_material_table__WEBPACK_IMPORTED_MODULE_2__[\"MatTableDataSource\"](this.tag_entries);\n });\n }", "getTags(attrSelector) {\n if (!attrSelector) return [];\n\n const list\n /*NodeList*/\n = this._doc.querySelectorAll(`meta[${attrSelector}]`);\n\n return list ? [].slice.call(list) : [];\n }", "function searchTag(tag) {\n const sql = `SELECT * FROM post WHERE tags LIKE '${tag}' ORDER BY timeposted DESC;`;\n return db.execute(sql);\n}", "function listTags() {\n return db('tags');\n}", "function filterTodos (term) {\n\n\n // Make an Array of tasks\n\n Array.from(list.children)\n // filter tasks list to hide the list item that doesn't include the (Searched Term)\n .filter( item=> !item.textContent.toLowerCase().includes(term))\n // add the filter class that hide this item \n .forEach(item => item.classList.add('filter'));\n \n Array.from(list.children)\n // filter tasks list to show the list item that includes the (Searched Term)\n .filter( item=> item.textContent.toLowerCase().includes(term))\n\n // remove the filter class that hide this item \n .forEach(item => item.classList.remove('filter'));\n}", "function noteFilter(obj) {\n return _.pick(obj, ['notebookId', 'title', 'content']);\n}", "function has_interesting_tags(t, ignore_tags) {\n if (typeof ignore_tags !== \"object\")\n ignore_tags={};\n if (typeof options.uninterestingTags === \"function\")\n return !options.uninterestingTags(t, ignore_tags);\n for (var k in t)\n if (!(options.uninterestingTags[k]===true) &&\n !(ignore_tags[k]===true || ignore_tags[k]===t[k]))\n return true;\n return false;\n }", "function has_interesting_tags(t, ignore_tags) {\n if (typeof ignore_tags !== \"object\")\n ignore_tags={};\n if (typeof options.uninterestingTags === \"function\")\n return !options.uninterestingTags(t, ignore_tags);\n for (var k in t)\n if (!(options.uninterestingTags[k]===true) &&\n !(ignore_tags[k]===true || ignore_tags[k]===t[k]))\n return true;\n return false;\n }", "function getTags() {\n var tags = $('#tags .label').text().match(/[^ ]+/g)\n return tags || [];\n }", "function refreshTags() {\n var existingTagsCount = {};\n self.tags = [];\n _.each(NoteService.notes, function (note) {\n if (note.active === SearchService.searchParams.active.value) {\n _.each(note.tags, function (tag) {\n if (!existingTagsCount[tag]) {\n existingTagsCount[tag] = 0;\n }\n existingTagsCount[tag]++;\n });\n }\n });\n _.each(existingTagsCount, function (value, key) {\n self.tags.push(new Tag(key, value));\n });\n if (self.tags.length > 25) {\n self.tags.push(new Tag(\"Not an Easter Egg\", 0));\n }\n }", "updateTags() {\n let tags = this.get('tags');\n let oldTags = tags.filterBy('id', null);\n\n tags.removeObjects(oldTags);\n oldTags.invoke('deleteRecord');\n }", "filterlist(){\n\n\t\t\t// filterlist object\n\t\t\t// returns a filter funtion over the constructed post\n\t\t\treturn this.postlist.filter((post)=>{\n\n\t\t\t\t// of an inculded array of title-toLowerCase matching any keyword-toLowerCase returned\n\t\t\t\treturn post.title.toLowerCase().includes(this.keyword.toLowerCase());\n\t\t\t});\n\t\t}", "function findTags(text) {\n var i,\n startIndex,\n stopIndex,\n tag,\n tags = [];\n\n startIndex = text.indexOf('<', 0);\n \n while (startIndex > -1) {\n stopIndex = text.indexOf('>', startIndex);\n tag = text.substring(startIndex, stopIndex + 1);\n tags.push(tag);\n startIndex = text.indexOf('<', stopIndex);\n }\n\n return tags;\n}", "function getTags(){\n if (typeof reportTagsPage == \"undefined\") {\n var myCols = [\n\t\t {title: \"Tag Name\",dataField: \"name\",sort: \"r.rtag_name\",filtration: {name: \"r.rtag_name\",alias: \"Tags\"}\n\t\t},{title: \"Color\",dataField: function(o){\n return \"<div style=\\\"width: 50px;height: 20px; background-color:\" + o.color + \" \\\"/>\";\n },sort: \"r.rtag_color\"\n\t\t},{title: \"# of Reports\",dataField: \"ofReports\",sort: \"count(rr.rtag_id)\"\n }];\n if (adminTabInit.report != \"none\") {\n myCols.push({\n title: \"Edit\",\n dataField: function(o){\n return \"<img src=\\\"include/images/Edit-icon-s.png\\\" border=\\\"0\\\" onclick=\\\"upReportTags(\" + o.id + \");\\\"/>\";\n }\n }, {\n title: \"Delete\",\n dataField: function(o){\n if (o.ofReports == 0) \n return \"<img src=\\\"include/images/reject16.png\\\" border=\\\"0\\\" onclick=\\\"invoke('\\delReportTags(\" + o.id + \"\\)','\"+o.id+\"');\\\"/>\";\n else \n return \"\";\n }\n });\n }\n reportTagsPage = new SANINCO.Page('__report_tags', \"reportTagsPage\", {\n sortingField: \"r.created_timestamp\",\n sortingDirection: \"desc\",\n vo: \"viewReportAdminVO\",\n totalPageUri: actionUri.getReportAdminTagsTotalPageNoUri,\n dataUri: actionUri.searchReportAdminTagsUri,\n paginationDiv: \"__report_tags_page\",\n recPerArray: [10, 15, 20, 30, 40, 50, 80, 100],\n scrollTop: true,\n cols: myCols\n });\n\t\t\n\t\treportTagsPage.addCompleteEvent(function(){\n\t\t\tdocument.getElementById('__validation_tag_innetHTML').innerHTML = \"\";\n\t\t});\n\t\t\n }\n \n reportTagsPage.addSuccessEvent(function(data){\n dataString = data.data;\n });\n \n filter = new SANINCO.Filter();\n filter.addEditeEvent(function(){\n reportTagsPage.start();\n });\n filter.add('r.rtag_name', 'String');\n reportTagsPage.setFilter(filter);\n \n reportTagsPage.start();\n}", "getTags(attrSelector) {\n if (!attrSelector)\n return [];\n const list /*NodeList*/ = this._doc.querySelectorAll(`meta[${attrSelector}]`);\n return list ? [].slice.call(list) : [];\n }", "getTags(attrSelector) {\n if (!attrSelector)\n return [];\n const list /*NodeList*/ = this._doc.querySelectorAll(`meta[${attrSelector}]`);\n return list ? [].slice.call(list) : [];\n }", "getTags(attrSelector) {\n if (!attrSelector)\n return [];\n const list /*NodeList*/ = this._doc.querySelectorAll(`meta[${attrSelector}]`);\n return list ? [].slice.call(list) : [];\n }", "getTags(attrSelector) {\n if (!attrSelector)\n return [];\n const list /*NodeList*/ = this._doc.querySelectorAll(`meta[${attrSelector}]`);\n return list ? [].slice.call(list) : [];\n }", "getTags(attrSelector) {\n if (!attrSelector)\n return [];\n const list /*NodeList*/ = this._doc.querySelectorAll(`meta[${attrSelector}]`);\n return list ? [].slice.call(list) : [];\n }", "function readAllTags() {\n\n\tvar objectStore = db.transaction(\"tags\").objectStore(\"tags\");\n\n\tobjectStore.openCursor().onsuccess = function(event) {\n\n\t\tvar cursor = event.target.result;\n\t\tif (cursor) {\n\t\t\tconsole.log(\"Tagtext: \" + cursor.value.tagtext + \", Tagpos: \" + cursor.value.tagpos + \", Color: \" + cursor.value.tagcolor + \", Tagid: \" + cursor.value.tagid + \", Tagform: \" + cursor.value.tagform);\n\t\t\tcursor.continue();\n\t\t}\n\t\telse {\n\t\t\t/* alert(\"No more entries!\"); */\n\t\t}\n\n\t};\n\n}", "function getSentences(tag) {\n for (i = 0; i < tag.length; i++) {\n var text = tag[i].textContent\n if (text.indexOf(\" \") !== 1) {\n if (text !== \"\") {\n allTexts.push(text);\n }\n }\n }\n\n\n\n for (i = 0; i < allTexts.length; i++) {\n article = allTexts.join(\"\\n\");\n allWords = article.split(/\\W+/);\n }\n }", "function getAllTagsFromMeAndOthers() {\n getAllMyTags();\n getAllOthersTags();\n}", "findAllTags() {\n return jsonData;\n }", "function FilterByTag(chosenTag){\n //remove filter \"all\" if another choose\n if(chosenTag !==\"הצג הכל\" && tags_to_show.includes(\"הצג הכל\")){\n removeElement(tags_to_show,\"הצג הכל\");\n document.getElementById(\"btn_\" + \"הצג הכל\").classList.toggle(\"clicked\");\n }\n\n //delete chosenTag from tags_to_show list if the button unchecked\n if(tags_to_show.includes(chosenTag)) {\n removeElement(tags_to_show,chosenTag);\n }\n\n //add chosenTag to tags_to_show list\n else {\n tags_to_show.push(chosenTag);\n console.log(chosenTag);\n }\n\n //styling pushed button and filter updates by tags_to_show\n document.getElementById(\"btn_\" + chosenTag).classList.toggle(\"clicked\");\n Filter();\n}", "function cleanTagArr(arr) {\n let filteredArr = [];\n let cleanedStr = \"\";\n\n arr.forEach(function(item) {\n cleanedStr = item.replace(tagEndFilter, \"\");\n cleanedStr = cleanedStr.replace(tagBeginFilter, \"\");\n cleanedStr = _.trim(cleanedStr);\n filteredArr.push(cleanedStr);\n });\n return filteredArr;\n}", "function intersectTags(notebook, tags){\n\tvar count = {};\n\tvar list =[];\n\tfor(var i = 0; i < tags.length; i++){\n\t\tvar tag = tags[i];\n\n\t\tvar tagList = notebook.access_database[tag];\n\n\t\t// Check whether the tag has anything yet.\n\t\tif(tagList !== undefined){\n\t\t\ttagList.forEach(\n\t\t\tfunction(elem){\n\t\t\t\tvar index = elem + \"\";\n\t\t\t\tvar curr = count[index];\n\t\t\t\tif(curr === undefined){\n\t\t\t\t\tcount[index] = 1;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcount[index] = curr + 1;\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\tfor(prop in count){\n\t\tif(count[prop] === tags.length){\n\t\t\tlist.push(parseInt(prop));\n\t\t}\n\t}\n\treturn list;\n}", "function doneTyping () {\n var description = $('#post_description').val().toLowerCase();\n $.each(TAGS, function(i, value) {\n if (description.includes(value) && value.length > 1 &&\n value != 'other') {\n $('.tags-input').tagsinput('add', value);\n }\n });\n}", "@computed\n get filters() {\n if (this.annotations.length == 0) {\n return [];\n }\n return orderBy(\n map(groupBy(this.annotations, 'tagId'), d => {\n const item = d[0];\n return {\n id: item.tagId,\n tagPath: item.tagPath,\n color: item.color,\n count: d.length,\n };\n }),\n 'count',\n 'desc',\n );\n }", "function getTags() {\n\tvar tagString = \" \";\n\tfor (let tag of safeQueryA('div.boxbody td a[rel=\"tag\"]')) {\n\t\ttagString += tag.innerText.replace(/[#,]/g, '') + \" \";\n\t};\n\treturn tagString.replace(/[,\\\\/:?<>\\t\\n\\v\\f\\r]/g, '_');\n}", "function showSelectedTag()\n {\n var tag = \"\";\n $(\".obj_news\").hide();\n $(\".filtericon\").hide();\n\n for(var i in tagSelected)\n {\n tag += \".\"+tagSelected[i];\n $(\".filtericon\").filter(\".\"+tagSelected[i]).fadeIn(\"slow\");\n }\n\n $(\".obj_news\"+tag).fadeIn(\"slow\");\n }", "function filter(taglist){\n\tif(taglist==\"alle\"){\n\t\t$('#project-tiles').isotope({ filter: '*' });\n\t}else{\n\t\tlist = taglist.split('-');\n\t\tvar filterstr = '';\n\t\tvar c = 0;\n\t\tfor (key in list) {\n\t\t\tif(list[key] && list[key] != undefined) {\n\t\t if (c>0) filterstr += ', ';\n\t\t filterstr += '.'+list[key];\n \t\t}\n\t\t c++;\n\t\t}\n\t\t// console.log(\"filter for:\" + filterstr);\n\t\t$('#project-tiles').isotope({ filter: filterstr});\n\t}\n\t$(\"#filterpanel a.act\").removeClass('act');\n\t$(\"#filterpanel a.\"+taglist).addClass('act');\n}", "function searchForTags() {\n\tvar baseUrl, url, params;\n\n\tbaseUrl = $('#form-edit input[name=base-url]').val();\n\turl = baseUrl + '/tables/empty-tags/table';\n\tparams = $('#search').serialize();\n\n\t$('.progress').show();\n\n\t$.get(\n\t\turl,\n\t\tparams,\n\t\tfunction (data) {\n\t\t\t$('.progress').hide();\n\n\t\t\t$('#content').html(data.message);\n\t\t\t$('#content .icons img').hide();\n\t\t\t$('#content').show();\n\n\t\t\tif (data.totalPages <= 1) {\n\t\t\t\t$('#pager').hide();\n\t\t\t} else {\n\t\t\t\t$('#totalTagsVal').html(data.totalTags);\n\t\t\t\t$(\"#pager\").pager({\n\t\t\t\t\tpagenumber: data.currentPage,\n\t\t\t\t\tpagecount: data.totalPages,\n\t\t\t\t\tbuttonClickCallback: function (pageClickedNumber) {\n\t\t\t\t\t\t$('#search input[name=page]').val(pageClickedNumber);\n\t\t\t\t\t\tsearchForTags();\n\t\t\t\t\t}\n\t\t\t\t}).show();\n\t\t\t}\n\t\t},\n\t\t'json'\n\t);\n}", "function Filter(){\n\n let tags_div_ls = document.querySelectorAll(\"#tags_container\");\n\n // loop for pass each update-container\n for (let i = 0; i < tags_div_ls.length; i++){\n let num_of_tags = tags_div_ls[i].childElementCount;\n let to_hide = true;\n\n // loop for pass each tag of current update\n for (let j = 1; j <= num_of_tags; j++) {\n let tag = tags_div_ls[i].querySelector(\":nth-child(\" + j + \")\").innerHTML;\n if (tags_to_show.includes(tag) || tags_to_show.includes(\"הצג הכל\") || tags_to_show.length === 0) {\n to_hide = false;\n }\n }\n\n let mail_to_hide = $(\"#mail_container_\"+i);\n to_hide? mail_to_hide.slideUp(400) : mail_to_hide.slideDown(400);\n\n // let mail_to_hide = document.getElementById(\"mail_container_\" + i);\n // to_hide ? mail_to_hide.style.display = \"none\" :mail_to_hide.style.display = \"\";\n }\n}", "function tag(){\n // clears the tag and title field\n betterClear('tags', 'titleParagraph');\n\n // The variable paragraph is for all the tags of artist 1; paragraph 2 is for all the tags of artist 2\n var paragraph = document.getElementById('tags');\n var paragraph2 = document.getElementById('tags2');\n var artistName = document.getElementById(\"name\").value.toLowerCase();\n var artistName2 = document.getElementById(\"name2\").value.toLowerCase();\n var album = document.getElementById(\"album\").value.toLowerCase();\n var album2 = document.getElementById(\"album2\").value.toLowerCase();\n var mood = document.getElementById(\"mood\").value.toLowerCase();\n var mood2 = document.getElementById(\"mood2\").value.toLowerCase();\n var genre = document.getElementById(\"genre\").value.toLowerCase();\n var genre2 = document.getElementById(\"genre2\").value.toLowerCase();\n var instrument = document.getElementById(\"instrument\").value.toLowerCase();\n var instrument2 = document.getElementById(\"instrument2\").value.toLowerCase();\n=======\n>>>>>>> b3bc9c5b930f0e8d6d69c0c1c5d90f064f04c002\n\n // initialize tags for artist 1\n var tags = `\n ${artistName} type beat,\n ${artistName} type beat 2021,\n ${artistName} type beat free,\n ${artistName} type beat 2020,\n ${artistName} type beat free for profit,\n ${artistName} type beat with hook,\n free ${artistName} type beat,\n `\n\n // initialize tags for artist 2\n var tags2 = `\n ${artistName2} type beat,\n ${artistName2} type beat 2021,\n ${artistName2} type beat free,\n ${artistName2} type beat 2020,\n ${artistName2} type beat free for profit,\n ${artistName2} type beat with hook,\n free ${artistName2} type beat,\n `\n\n // additional tags for artist 1\n if (mood != ''){ tags += `${artistName} type beat ${mood},`;}\n if (album != ''){ tags += `${artistName} type beat ${album},`;}\n if (instrument != ''){ tags += `${artistName} type beat ${instrument},`;}\n if (genre != ''){ tags += `${artistName} type beat ${genre},`;}\n\n // node the tags to add to the paragraph\n var tagsNode = document.createTextNode(tags);\n paragraph.appendChild(tagsNode);\n\n // additional tags for artist 2\n if (artistName2 != ''){\n if (mood2 != ''){ tags2 += `${artistName2} type beat ${mood2},`;}\n if (album2 != ''){ tags2 += `${artistName2} type beat ${album2},`;}\n if (instrument2 != ''){ tags2 += `${artistName2} type beat ${instrument2},`;}\n if (genre2 != ''){ tags2 += `${artistName2} type beat ${genre2},`;}\n // node the 2nd tags to add to the paragraph 2\n var tags2Node = document.createTextNode(tags2);\n paragraph2.appendChild(tags2Node);\n }\n console.log(tags2);\n // create Instagram caption by calling outside function\n instagramCaption(artistName, artistName2, mood);\n additionalTags(tags, tags2, artistName, artistName2);\n\n \n}", "static async untagAll(tagId) {\n\t\tconst noteTags = await NoteTag.modelSelectAll('SELECT id FROM note_tags WHERE tag_id = ?', [tagId]);\n\t\tfor (let i = 0; i < noteTags.length; i++) {\n\t\t\tawait NoteTag.delete(noteTags[i].id);\n\t\t}\n\n\t\tawait Tag.delete(tagId);\n\t}", "addTag(tag) {\r\n // If tag exsist, do not add it. Else push to note.tags array\r\n if (this.tags.includes(tag)) {\r\n console.error(`Found tag: ${tag} in note taglist. Can't add.`);\r\n } else {\r\n this.tags.push(tag);\r\n console.log(`Added tag: \"${tag}\" to note: (${this.title})`)\r\n }\r\n }", "function fetch_tags(parentobj, tag)\n{\n\tif (parentobj == null)\n\t{\n\t\treturn new Array();\n\t}\n\telse if (typeof parentobj.getElementsByTagName != 'undefined')\n\t{\n\t\treturn parentobj.getElementsByTagName(tag);\n\t}\n\telse if (parentobj.all && parentobj.all.tags)\n\t{\n\t\treturn parentobj.all.tags(tag);\n\t}\n\telse\n\t{\n\t\treturn new Array();\n\t}\n}", "function querySearch(query) {\n var results = query ? vm.tags.filter(createFilterFor(query)) : [];\n return results;\n }", "addTags() {\n const {\n doc,\n margins,\n metadata,\n documentFont,\n documentBoldFont,\n } = this.pdfBuilder;\n const fontSize = 9;\n let lineHeight = this.data.length - 1;\n doc.font(documentFont);\n doc.fontSize(fontSize);\n\n const tags = metadata.tags || [];\n\n for (let i = 0; i < tags.length; i += 1) {\n if (typeof tags[i] === 'string') {\n doc.text(\n tags[i],\n margins.left,\n (this.height + margins.bottom) - (lineHeight * fontSize));\n lineHeight -= 1;\n } else if (typeof tags[i] === 'object' && tags[i].value !== undefined && tags[i].label !== undefined) {\n doc\n .font(documentBoldFont)\n .text(`${tags[i].label}:`,\n margins.left,\n (this.height + margins.bottom) - (lineHeight * fontSize),\n { lineBreak: false })\n .font(documentFont)\n .text(tags[i].value);\n lineHeight -= 1;\n }\n }\n }" ]
[ "0.7423184", "0.6709971", "0.6677388", "0.66748637", "0.662941", "0.63826823", "0.6152156", "0.6137908", "0.6047202", "0.5993102", "0.5958183", "0.59414595", "0.5939921", "0.5936382", "0.5905244", "0.58351755", "0.5780541", "0.57714903", "0.5697105", "0.5693547", "0.5683578", "0.56779164", "0.5677454", "0.5665542", "0.56654114", "0.5649837", "0.5622899", "0.55949146", "0.55541784", "0.5554116", "0.5546062", "0.5498096", "0.54689425", "0.54455537", "0.543835", "0.5427947", "0.5425476", "0.53949356", "0.5391682", "0.53681505", "0.53502715", "0.53473836", "0.5345242", "0.5331616", "0.5325804", "0.5325499", "0.5301375", "0.5289698", "0.528892", "0.52782226", "0.5273734", "0.52662", "0.52580136", "0.5244785", "0.52348435", "0.5223129", "0.5215489", "0.5205331", "0.52002156", "0.51982456", "0.51848006", "0.5167256", "0.5159452", "0.5135027", "0.51212716", "0.51185495", "0.51179624", "0.51058644", "0.51058644", "0.51053584", "0.50900096", "0.508964", "0.5068651", "0.5064176", "0.50539213", "0.50494075", "0.50494075", "0.50494075", "0.50494075", "0.50494075", "0.50450265", "0.5043985", "0.5038231", "0.5023745", "0.5018712", "0.5009989", "0.50055003", "0.5001635", "0.4997722", "0.49925536", "0.49774903", "0.49739912", "0.49725246", "0.49639058", "0.4946971", "0.49455762", "0.4943564", "0.49355698", "0.49335998", "0.49251172" ]
0.62764424
6
Add Tags UPDATE NOTE NEEDS TO BE FIXED
updateNote() { let notes = this.state.notes; let id = this.state.editNoteId; let text= this.state.input; let tag = this.state.tags; let tagList = tag.split(','); axios.put(editUrl + id + '.json', {text, tag: tagList}) .then( result => { let newNotes = notes.map( note => { if(note.id === id){ note.text = text; note.tag = tagList; } return note; }); this.setState({notes: newNotes, input: '', tags: ''}); }, err => { console.log(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tags(tags) { }", "function addTag(tag_index,tag_name,tag_content,tagArray) {\r\n var tag={tag_index,tag_name,tag_content};\r\n tagArray.push(tag);\r\n}", "onAddTags() {}", "addTags(tags) {\n tags = Object.assign({}, tags)\n this.tags = Object.assign(this.tags, tags)\n // calculate graph implications for the new tags\n this.tags = inferTagSet(this.tags)\n return this\n }", "function updateTags(){\n\tWRAP_STATE.describeTags = WRAP_STATE.tagStack.reduce(function(a, b){\n\t\treturn a.concat(b);\n\t}, []);\n\tWRAP_STATE.hasDescribeTags = (WRAP_OPTIONS.tagsAny)? \n\t\thasAnyTags(WRAP_STATE.describeTags): \n\t\thasAllTags(WRAP_STATE.describeTags);\n}", "function refreshTags() {\n var existingTagsCount = {};\n self.tags = [];\n _.each(NoteService.notes, function (note) {\n if (note.active === SearchService.searchParams.active.value) {\n _.each(note.tags, function (tag) {\n if (!existingTagsCount[tag]) {\n existingTagsCount[tag] = 0;\n }\n existingTagsCount[tag]++;\n });\n }\n });\n _.each(existingTagsCount, function (value, key) {\n self.tags.push(new Tag(key, value));\n });\n if (self.tags.length > 25) {\n self.tags.push(new Tag(\"Not an Easter Egg\", 0));\n }\n }", "addTag(tag) {\r\n // If tag exsist, do not add it. Else push to note.tags array\r\n if (this.tags.includes(tag)) {\r\n console.error(`Found tag: ${tag} in note taglist. Can't add.`);\r\n } else {\r\n this.tags.push(tag);\r\n console.log(`Added tag: \"${tag}\" to note: (${this.title})`)\r\n }\r\n }", "function makingTags(tags) {\n var addTags = '';\n if (tags !== null) {\n addTags += '<ul class=\"tags\">';\n for (let i = 0; i < tags.length; i++) {\n addTags += '<li>' + tags[i] + '</li>';\n }\n addTags += '</ul>';\n }\n return addTags;\n}", "function addTag(id, tag){\n\t\n}", "function initTags() {\n \n for (var j = $scope.QUERY.whattodo.length - 1; j >= 0; j--) {\n for (var i = $scope.tripTags.length - 1; i >= 0; i--) {\n if ($scope.QUERY.whattodo[j].slug == $scope.tripTags[i].slug) {\n $scope.local.tags.push($scope.tripTags[i]);\n break;\n }\n }\n }\n }", "function updateGhostTags(gtags,wpcategories) {\n // go through all wpcategories and check if there is a corresponding gtag\n for(var i=0;i<wpcategories.length;i++) {\n var wpcat=wpcategories[i];\n if (wpcat.description && wpcat.description.length>200) {\n wpcat.description=wpcat.description.substring(0,200);\n }\n if (gTagLookup[wpcat.slug]) {\n //console.log('Found gtag '+wpcat.slug+' updating description');\n gTagLookup[wpcat.slug].description=wpcat.description;\n gTagLookup[wpcat.slug].meta_description=wpcat.description;\n } else {\n //console.log('Not found gtag '+wpcat.slug+' adding');\n var tag = { id: gtags.length,\n uuid: uuid.v4(),\n name: null,\n slug: null,\n description: null,\n image: null,\n parent_id: null,\n visibility: 'public',\n meta_title: null,\n meta_description: null,\n created_at: '2016-07-26 13:09:47',\n created_by: 1,\n updated_at: '2016-07-26 13:09:47',\n updated_by: 1\n };\n tag.slug=wpcat.slug;\n tag.name=wpcat.name;\n tag.description=wpcat.description;\n tag.meta_description=wpcat.description;\n // add the new tag\n gtags.push(tag);\n }\n }\n}", "function appendTags() {\n \n $.each(availableTags, function(k, tag) {\n $('#DataTags').append(\n '<a href=\"#\" class=\"label\" onclick=\"Tags.toggleTag(this, \\''+tag+'\\')\">'+tag+'</a> '\n );\n });\n \n }", "addTags(tags, forceCreation = false) {\n if (!tags) return [];\n return tags.reduce((result, tag) => {\n if (tag) {\n result.push(this._getOrCreateElement(tag, forceCreation));\n }\n\n return result;\n }, []);\n }", "addTags() {\n const {\n doc,\n margins,\n metadata,\n documentFont,\n documentBoldFont,\n } = this.pdfBuilder;\n const fontSize = 9;\n let lineHeight = this.data.length - 1;\n doc.font(documentFont);\n doc.fontSize(fontSize);\n\n const tags = metadata.tags || [];\n\n for (let i = 0; i < tags.length; i += 1) {\n if (typeof tags[i] === 'string') {\n doc.text(\n tags[i],\n margins.left,\n (this.height + margins.bottom) - (lineHeight * fontSize));\n lineHeight -= 1;\n } else if (typeof tags[i] === 'object' && tags[i].value !== undefined && tags[i].label !== undefined) {\n doc\n .font(documentBoldFont)\n .text(`${tags[i].label}:`,\n margins.left,\n (this.height + margins.bottom) - (lineHeight * fontSize),\n { lineBreak: false })\n .font(documentFont)\n .text(tags[i].value);\n lineHeight -= 1;\n }\n }\n }", "function addTag (name) {\n $('#post_current_tags').val(function () {\n return $(this).val().concat(name, ',')\n })\n $('.current-tags').append(\"<span class='badge badge-pill badge-primary tag'>\" + name + '</span>')\n }", "addTag() {\n this.tags.push(this.tagControl.value);\n this.tagControl.setValue(\"\");\n this.showTags();\n }", "function populateTagField (tagArray){\n\t\ttagArray.forEach(addTag);\n\t}", "function addTagAddTagListeners() {\n const allowedQuotes = ['\"', '\\'']; // the characters which a multi-word tag can be enclosed in\n\n const addInput = document.getElementById(\"tag-add\");\n const addList = document.getElementById(\"tag-add-results\");\n document.getElementById('tag-list').addEventListener('tagChange', updateExistingTagLabels);\n addInput.addEventListener('input', (e) => {\n\n if (e.constructor.name !== 'InputEvent') {\n // then this is a selection, not user input\n addTag(addInput.value);\n\n } else if (e.data === ' ' || allowedQuotes.includes(e.data)) {\n extractAndAddTag(addInput.value, allowedQuotes)\n }\n while (addList.firstChild) {\n addList.removeChild(addList.firstChild);\n }\n const query = addInput.value;\n if (query) {\n searchAddTags(query);\n }\n });\n addInput.addEventListener('keyup', e => {\n if (e.key === 'Enter') {\n extractAndAddTag(addInput.value, allowedQuotes);\n }\n });\n}", "function updateExistingTagLabels() {\n removeExistingTagLabels();\n if (taggableId !== \"\") {\n sendGetTagsRequest();\n }\n}", "saveTags(tags) {\n let saveError = false;\n const records = this.getTags();\n const newTag = difference(tags, records.map(t => t.label.toLowerCase()));\n\n if (!newTag || !newTag.length) return;\n\n this.props.mutator.tags.POST({\n label: newTag[0],\n description: newTag[0],\n }).catch(\n // eslint-disable-next-line no-unused-vars\n err => { saveError = true; this.showCallout('error', 'stripes-smart-components.cannotSaveNewTag'); }\n ).finally(() => {\n if (!saveError) {\n this.showCallout('success', 'stripes-smart-components.newTagCreated');\n }\n });\n }", "function update_taglist(tags)\n {\n // compute counts first by iterating over all notes\n var counts = {};\n $.each(notesdata, function(id, rec) {\n for (var t, j=0; rec && rec.tags && j < rec.tags.length; j++) {\n t = rec.tags[j];\n if (typeof counts[t] == 'undefined')\n counts[t] = 0;\n counts[t]++;\n }\n });\n\n rcmail.triggerEvent('kolab-tags-counts', {counter: counts});\n\n if (tags && tags.length) {\n rcmail.triggerEvent('kolab-tags-refresh', {tags: tags});\n }\n }", "updateTags() {\n // Clear previous tags\n let parent = document.getElementById('tag-container');\n this.clearChildNodes(parent);\n\n let {area, comparisonAreas} = this.selected;\n\n // Create tag for focused country\n this.createTag(area.country, true);\n\n // Create tag for each comparison area\n for (let i = 0; i < comparisonAreas.length; i++) {\n this.createTag(comparisonAreas[i], false);\n }\n }", "function addTag() {\n idIndex = idUpdate();\n let tagpointId = \"tag\" + idIndex;\n var tagpoint = jQuery(\"<div/>\", {\n id: tagpointId,\n class: \"all tagshared tagcont\",\n });\n\n let inputId = \"i\" + idIndex;\n var inputpoint = jQuery(\"<input/>\", {\n id: inputId,\n class: \"all ibox\",\n value: \"...\",\n });\n\n var buttonpoint = jQuery(\"<span/>\", {\n id: \"b\" + idIndex,\n class: \"all\",\n html: \"&otimes;\",\n });\n\n $(this).parent().prepend(tagpoint);\n\n $(\"#\" + tagpointId).append(inputpoint);\n $(\"#\" + tagpointId).append(buttonpoint);\n $(\"#\" + inputId).on(\"blur\", processTagInput);\n}", "function Tagged() {\r\n}", "function tag(){\n // clears the tag and title field\n betterClear('tags', 'titleParagraph');\n\n // The variable paragraph is for all the tags of artist 1; paragraph 2 is for all the tags of artist 2\n var paragraph = document.getElementById('tags');\n var paragraph2 = document.getElementById('tags2');\n var artistName = document.getElementById(\"name\").value.toLowerCase();\n var artistName2 = document.getElementById(\"name2\").value.toLowerCase();\n var album = document.getElementById(\"album\").value.toLowerCase();\n var album2 = document.getElementById(\"album2\").value.toLowerCase();\n var mood = document.getElementById(\"mood\").value.toLowerCase();\n var mood2 = document.getElementById(\"mood2\").value.toLowerCase();\n var genre = document.getElementById(\"genre\").value.toLowerCase();\n var genre2 = document.getElementById(\"genre2\").value.toLowerCase();\n var instrument = document.getElementById(\"instrument\").value.toLowerCase();\n var instrument2 = document.getElementById(\"instrument2\").value.toLowerCase();\n=======\n>>>>>>> b3bc9c5b930f0e8d6d69c0c1c5d90f064f04c002\n\n // initialize tags for artist 1\n var tags = `\n ${artistName} type beat,\n ${artistName} type beat 2021,\n ${artistName} type beat free,\n ${artistName} type beat 2020,\n ${artistName} type beat free for profit,\n ${artistName} type beat with hook,\n free ${artistName} type beat,\n `\n\n // initialize tags for artist 2\n var tags2 = `\n ${artistName2} type beat,\n ${artistName2} type beat 2021,\n ${artistName2} type beat free,\n ${artistName2} type beat 2020,\n ${artistName2} type beat free for profit,\n ${artistName2} type beat with hook,\n free ${artistName2} type beat,\n `\n\n // additional tags for artist 1\n if (mood != ''){ tags += `${artistName} type beat ${mood},`;}\n if (album != ''){ tags += `${artistName} type beat ${album},`;}\n if (instrument != ''){ tags += `${artistName} type beat ${instrument},`;}\n if (genre != ''){ tags += `${artistName} type beat ${genre},`;}\n\n // node the tags to add to the paragraph\n var tagsNode = document.createTextNode(tags);\n paragraph.appendChild(tagsNode);\n\n // additional tags for artist 2\n if (artistName2 != ''){\n if (mood2 != ''){ tags2 += `${artistName2} type beat ${mood2},`;}\n if (album2 != ''){ tags2 += `${artistName2} type beat ${album2},`;}\n if (instrument2 != ''){ tags2 += `${artistName2} type beat ${instrument2},`;}\n if (genre2 != ''){ tags2 += `${artistName2} type beat ${genre2},`;}\n // node the 2nd tags to add to the paragraph 2\n var tags2Node = document.createTextNode(tags2);\n paragraph2.appendChild(tags2Node);\n }\n console.log(tags2);\n // create Instagram caption by calling outside function\n instagramCaption(artistName, artistName2, mood);\n additionalTags(tags, tags2, artistName, artistName2);\n\n \n}", "function updateTags(tags) {\n $('#tags').empty();\n tags = Object.keys(tags);\n tags = tags.sort();\n $.each(tags, function(index, tag) {\n var taglink = $('<a>')\n .text(tag)\n .addClass('taglink')\n .bind('click', function() {\n updateTagView(readTagView(), tag);\n });\n $('#tags').append(taglink);\n });\n}", "function addTag() { \n let tags = ['h1', 'h2', 'h3', 'h4', 'div', 'p', 'ul', 'ol', 'li'];\n if (activeExists() && !tags.includes(input.value)) { \n alert(`${input.value} value aren't allowed you can use only these tags: h1, h2, h3, h4, div, p, ul, ol, li`); \n return;\n }\n return activeExists().appendChild(createTags.tag(input.value, ''));\n}", "addTag(name) {\n const tag = this.tags.find((tag) => {\n return tag.name === name;\n });\n if (!tag) {\n this.tags = [\n ...this.tags,\n { id: this.getIdTags(), name: name, checked: false },\n ];\n } else {\n }\n }", "addTags(tags, forceCreation = false) {\n if (!tags)\n return [];\n return tags.reduce((result, tag) => {\n if (tag) {\n result.push(this._getOrCreateElement(tag, forceCreation));\n }\n return result;\n }, []);\n }", "addTags(tags, forceCreation = false) {\n if (!tags)\n return [];\n return tags.reduce((result, tag) => {\n if (tag) {\n result.push(this._getOrCreateElement(tag, forceCreation));\n }\n return result;\n }, []);\n }", "addTags(tags, forceCreation = false) {\n if (!tags)\n return [];\n return tags.reduce((result, tag) => {\n if (tag) {\n result.push(this._getOrCreateElement(tag, forceCreation));\n }\n return result;\n }, []);\n }", "addTags(tags, forceCreation = false) {\n if (!tags)\n return [];\n return tags.reduce((result, tag) => {\n if (tag) {\n result.push(this._getOrCreateElement(tag, forceCreation));\n }\n return result;\n }, []);\n }", "addTags(tags, forceCreation = false) {\n if (!tags)\n return [];\n return tags.reduce((result, tag) => {\n if (tag) {\n result.push(this._getOrCreateElement(tag, forceCreation));\n }\n return result;\n }, []);\n }", "initReplacementTags(tags, fitSize) {\n if (tags.length > 0) {\n tags.forEach((item) => {\n this.createReplacementTag(item, fitSize);\n });\n }\n }", "setupTags() {\n let allTags = [];\n this.model.forEach(function(post) {\n post.tags.forEach(function(tag) {\n let eTag = allTags.find(function(e){\n return e.name = tag;\n });\n\n if(eTag === undefined) {\n allTags.push({id: tag, name: tag, count: 1});\n } else {\n eTag.count++;\n }\n });\n });\n this.set('tags', allTags);\n }", "function addTag(tagContent) {\n let tagsArea = document.querySelector(\".tagGenerator__tagsArea\");\n let newTag = document.createElement('p');\n\n newTag.classList.add(\"tagGenerator__tag\");\n newTag.innerHTML = `<span>${tagContent}</span><span>\n <svg class=\"tagGenerator__cross\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289Z\" fill=\"currentColor\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z\" fill=\"currentColor\"/>\n </svg>\n </span>`;\n\n tagsArea.append(newTag);\n state.tagsContainer.push(tagContent);\n toLocalStorage(state.tagsContainer);\n addListenerToCrosses();\n}", "function setupTags(pageId, tags) {\n // Remove old tags stuff if it's there\n $(\"DIV#\" + pageId + \" input#Tags ~ DIV.superblyTagfieldDiv\").remove();\n // Get the populated values\n var data = $(\"DIV#\" + pageId + \" input#Tags\").val();\n if (data != \"\")\n data = data.split(\",\");\n else\n data = [];\n\n var tagArray = convertTagObjectsToStrArray(tags);\n\n // Setup tags field\n $(\"DIV#\" + pageId + \" input#Tags\").superblyTagField({\n allowNewTags: true,\n showTagsNumber: 10,\n preset: data,\n tags: tagArray\n });\n}", "function updateTagView(tags, changedTag) {\n var outputTags = [];\n\n if (changedTag) {\n var tagIndex = tags.indexOf(changedTag);\n if (tagIndex == -1) {\n tags.push(changedTag);\n } else {\n tags.splice(tags.indexOf(changedTag), 1);\n }\n }\n\n $.each(tags, function(index, tag) {\n if (tag.match(/ /)) {\n outputTags.push('[[' + tag + ']]');\n } else {\n outputTags.push(tag);\n }\n });\n \n $('#editor input').val(outputTags.join(' '))\n}", "onAddTag() {}", "function additionalTags(tags = '', tags2 = '', artistName = '', artistName2 = ''){\n // get the youtubeDescription field\n var tagField = document.getElementById(\"tags\");\n var tagField2 = document.getElementById(\"tags2\");\n\n var checkBox = document.getElementById(\"myCheck\");\n if (checkBox.checked == true){\n tags += `\n ${artistName} type beat with hook free,\n ${artistName} type beat 2021 with hook,\n ${artistName} type beat 2021 with hook free,\n ${artistName} type beat 2020 with hook,\n ${artistName} type beat 2020 with hook free,\n ${artistName} type beat 2019 with hook,\n ${artistName} type beat 2019 with hook free,\n ${artistName} type instrumental,\n ${artistName} type instrumental free,\n ${artistName} type instrumental with hook,\n ${artistName} type instrumental with hook free,\n ${artistName} type instrumental free for profit,\n ${artistName} type instrumental 2021,\n ${artistName} type instrumental 2021 with hook,\n ${artistName} type instrumental 2021 with hook free,\n ${artistName} type instrumental 2020,\n ${artistName} type instrumental 2020 with hook,\n ${artistName} type instrumental 2020 with hook free,\n ${artistName} type instrumental 2019,\n ${artistName} type instrumental 2019 with hook,\n ${artistName} type instrumental 2019 with hook free,\n `\n // add EXTRA tags to the existing tags 2\n tags2 += `\n ${artistName2} type beat with hook free,\n ${artistName2} type beat 2021 with hook,\n ${artistName2} type beat 2021 with hook free,\n ${artistName2} type beat 2020 with hook,\n ${artistName2} type beat 2020 with hook free,\n ${artistName2} type beat 2019 with hook,\n ${artistName2} type beat 2019 with hook free,\n ${artistName2} type instrumental,\n ${artistName2} type instrumental free,\n ${artistName2} type instrumental with hook,\n ${artistName2} type instrumental with hook free,\n ${artistName2} type instrumental free for profit,\n ${artistName2} type instrumental 2021,\n ${artistName2} type instrumental 2021 with hook,\n ${artistName2} type instrumental 2021 with hook free,\n ${artistName2} type instrumental 2020,\n ${artistName2} type instrumental 2020 with hook,\n ${artistName2} type instrumental 2020 with hook free,\n ${artistName2} type instrumental 2019,\n ${artistName2} type instrumental 2019 with hook,\n ${artistName2} type instrumental 2019 with hook free,\n free beat, type beat, airavata, airavata type beat, free, airavata music\n `\n var description = `${tags}${tags2}`\n var descriptionNode = document.createTextNode(description);\n tagField2.appendChild(descriptionNode)\n }\n // var additionalTagNode1 = document.createTextNode(tags);\n // var additionalTagNode2 = document.createTextNode(tags2);\n // tagField += additionalTagNode1;\n // tagField2 += additionalTagNode2;\n // var description = \"[Insert Title]\\n 🛒 Purchase Beat (Instant Delivery): [BEATSTARS LINK]\\n🌐 Social Media: @addyhebou, @saintstephmusic\\n📩 Email: hi@saintstephmusic.com\\n\\n[QUIRKY MESSAGE]\\n\\nThank you for listening to my music - let me know what you think below and I'll get back to you! You're the best - subscribe to get more airavata !!\\n\\nUSAGE RIGHTS FOR FREE USE\\n\\n* You can use this beat for non-commercial and/or promotional use if you wish\\n* You must credit the producer as shown in the title of this video\\n* (Prod. by airavata) if you choose to use this beat for non-commercial and/or promotional use\\n\\n____________________________\\n\\nWhat's okay for promotional use? I'm glad you asked, buddy.\\n\\n✅ Soundcloud (no ads enabled)\\n✅ YouTube (no ads enabled)\\n\\nWhat's NOT okay for promotional use? Once again, I'm glad you asked.\\n\\n🚫 Uploading to streaming service (Apple Music, Spotify, DistroKid, etc.) is NOT permitted\\n🚫 No paid performances\\n\\nIf you were to purchase this beat untagged for lease or exclusive license, please HIT ME UP. Contact me at my info listed above.\\n\\n______________\\nOtherwise, let's get this bread\\n\\n\\n\\n\\n=======\\n$\";\n ;\n\n\n}", "function additionalTags(tags = '', tags2 = '', artistName = '', artistName2 = ''){\n // get the youtubeDescription field\n var tagField = document.getElementById(\"tags\");\n var tagField2 = document.getElementById(\"tags2\");\n\n var checkBox = document.getElementById(\"myCheck\");\n if (checkBox.checked == true){\n tags += `\n ${artistName} type beat with hook free,\n ${artistName} type beat 2021 with hook,\n ${artistName} type beat 2021 with hook free,\n ${artistName} type beat 2020 with hook,\n ${artistName} type beat 2020 with hook free,\n ${artistName} type beat 2019 with hook,\n ${artistName} type beat 2019 with hook free,\n ${artistName} type instrumental,\n ${artistName} type instrumental free,\n ${artistName} type instrumental with hook,\n ${artistName} type instrumental with hook free,\n ${artistName} type instrumental free for profit,\n ${artistName} type instrumental 2021,\n ${artistName} type instrumental 2021 with hook,\n ${artistName} type instrumental 2021 with hook free,\n ${artistName} type instrumental 2020,\n ${artistName} type instrumental 2020 with hook,\n ${artistName} type instrumental 2020 with hook free,\n ${artistName} type instrumental 2019,\n ${artistName} type instrumental 2019 with hook,\n ${artistName} type instrumental 2019 with hook free,\n `\n // add EXTRA tags to the existing tags 2\n tags2 += `\n ${artistName2} type beat with hook free,\n ${artistName2} type beat 2021 with hook,\n ${artistName2} type beat 2021 with hook free,\n ${artistName2} type beat 2020 with hook,\n ${artistName2} type beat 2020 with hook free,\n ${artistName2} type beat 2019 with hook,\n ${artistName2} type beat 2019 with hook free,\n ${artistName2} type instrumental,\n ${artistName2} type instrumental free,\n ${artistName2} type instrumental with hook,\n ${artistName2} type instrumental with hook free,\n ${artistName2} type instrumental free for profit,\n ${artistName2} type instrumental 2021,\n ${artistName2} type instrumental 2021 with hook,\n ${artistName2} type instrumental 2021 with hook free,\n ${artistName2} type instrumental 2020,\n ${artistName2} type instrumental 2020 with hook,\n ${artistName2} type instrumental 2020 with hook free,\n ${artistName2} type instrumental 2019,\n ${artistName2} type instrumental 2019 with hook,\n ${artistName2} type instrumental 2019 with hook free,\n free beat, type beat, saint steph, saint steph type beat, free, saint steph music\n `\n var description = `${tags}${tags2}`\n var descriptionNode = document.createTextNode(description);\n tagField2.appendChild(descriptionNode)\n }\n // var additionalTagNode1 = document.createTextNode(tags);\n // var additionalTagNode2 = document.createTextNode(tags2);\n // tagField += additionalTagNode1;\n // tagField2 += additionalTagNode2;\n // var description = \"[Insert Title]\\n 🛒 Purchase Beat (Instant Delivery): [BEATSTARS LINK]\\n🌐 Social Media: @addyhebou, @saintstephmusic\\n📩 Email: hi@saintstephmusic.com\\n\\n[QUIRKY MESSAGE]\\n\\nThank you for listening to my music - let me know what you think below and I'll get back to you! You're the best - subscribe to get more Saint Steph !!\\n\\nUSAGE RIGHTS FOR FREE USE\\n\\n* You can use this beat for non-commercial and/or promotional use if you wish\\n* You must credit the producer as shown in the title of this video\\n* (Prod. by Saint Steph) if you choose to use this beat for non-commercial and/or promotional use\\n\\n____________________________\\n\\nWhat's okay for promotional use? I'm glad you asked, buddy.\\n\\n✅ Soundcloud (no ads enabled)\\n✅ YouTube (no ads enabled)\\n\\nWhat's NOT okay for promotional use? Once again, I'm glad you asked.\\n\\n🚫 Uploading to streaming service (Apple Music, Spotify, DistroKid, etc.) is NOT permitted\\n🚫 No paid performances\\n\\nIf you were to purchase this beat untagged for lease or exclusive license, please HIT ME UP. Contact me at my info listed above.\\n\\n______________\\nOtherwise, let's get this bread\\n\\n\\n\\n\\n=======\\n$\";\n ;\n\n\n}", "function additionalTags(tags = '', tags2 = '', artistName = '', artistName2 = ''){\n // get the youtubeDescription field\n var tagField = document.getElementById(\"tags\");\n var tagField2 = document.getElementById(\"tags2\");\n\n var checkBox = document.getElementById(\"myCheck\");\n if (checkBox.checked == true){\n tags += `\n ${artistName} type beat with hook free,\n ${artistName} type beat 2021 with hook,\n ${artistName} type beat 2021 with hook free,\n ${artistName} type beat 2020 with hook,\n ${artistName} type beat 2020 with hook free,\n ${artistName} type beat 2019 with hook,\n ${artistName} type beat 2019 with hook free,\n ${artistName} type instrumental,\n ${artistName} type instrumental free,\n ${artistName} type instrumental with hook,\n ${artistName} type instrumental with hook free,\n ${artistName} type instrumental free for profit,\n ${artistName} type instrumental 2021,\n ${artistName} type instrumental 2021 with hook,\n ${artistName} type instrumental 2021 with hook free,\n ${artistName} type instrumental 2020,\n ${artistName} type instrumental 2020 with hook,\n ${artistName} type instrumental 2020 with hook free,\n ${artistName} type instrumental 2019,\n ${artistName} type instrumental 2019 with hook,\n ${artistName} type instrumental 2019 with hook free,\n `\n // add EXTRA tags to the existing tags 2\n tags2 += `\n ${artistName2} type beat with hook free,\n ${artistName2} type beat 2021 with hook,\n ${artistName2} type beat 2021 with hook free,\n ${artistName2} type beat 2020 with hook,\n ${artistName2} type beat 2020 with hook free,\n ${artistName2} type beat 2019 with hook,\n ${artistName2} type beat 2019 with hook free,\n ${artistName2} type instrumental,\n ${artistName2} type instrumental free,\n ${artistName2} type instrumental with hook,\n ${artistName2} type instrumental with hook free,\n ${artistName2} type instrumental free for profit,\n ${artistName2} type instrumental 2021,\n ${artistName2} type instrumental 2021 with hook,\n ${artistName2} type instrumental 2021 with hook free,\n ${artistName2} type instrumental 2020,\n ${artistName2} type instrumental 2020 with hook,\n ${artistName2} type instrumental 2020 with hook free,\n ${artistName2} type instrumental 2019,\n ${artistName2} type instrumental 2019 with hook,\n ${artistName2} type instrumental 2019 with hook free,\n free beat, type beat, saint steph, saint steph type beat, free, saint steph music\n `\n var description = `${tags}${tags2}`\n var descriptionNode = document.createTextNode(description);\n tagField2.appendChild(descriptionNode)\n }\n // var additionalTagNode1 = document.createTextNode(tags);\n // var additionalTagNode2 = document.createTextNode(tags2);\n // tagField += additionalTagNode1;\n // tagField2 += additionalTagNode2;\n // var description = \"[Insert Title]\\n 🛒 Purchase Beat (Instant Delivery): [BEATSTARS LINK]\\n🌐 Social Media: @addyhebou, @saintstephmusic\\n📩 Email: hi@saintstephmusic.com\\n\\n[QUIRKY MESSAGE]\\n\\nThank you for listening to my music - let me know what you think below and I'll get back to you! You're the best - subscribe to get more Saint Steph !!\\n\\nUSAGE RIGHTS FOR FREE USE\\n\\n* You can use this beat for non-commercial and/or promotional use if you wish\\n* You must credit the producer as shown in the title of this video\\n* (Prod. by Saint Steph) if you choose to use this beat for non-commercial and/or promotional use\\n\\n____________________________\\n\\nWhat's okay for promotional use? I'm glad you asked, buddy.\\n\\n✅ Soundcloud (no ads enabled)\\n✅ YouTube (no ads enabled)\\n\\nWhat's NOT okay for promotional use? Once again, I'm glad you asked.\\n\\n🚫 Uploading to streaming service (Apple Music, Spotify, DistroKid, etc.) is NOT permitted\\n🚫 No paid performances\\n\\nIf you were to purchase this beat untagged for lease or exclusive license, please HIT ME UP. Contact me at my info listed above.\\n\\n______________\\nOtherwise, let's get this bread\\n\\n\\n\\n\\n=======\\n$\";\n ;\n\n\n}", "function additionalTags(tags = '', tags2 = '', artistName = '', artistName2 = ''){\n // get the youtubeDescription field\n var tagField = document.getElementById(\"tags\");\n var tagField2 = document.getElementById(\"tags2\");\n\n var checkBox = document.getElementById(\"myCheck\");\n if (checkBox.checked == true){\n tags += `\n ${artistName} type beat with hook free,\n ${artistName} type beat 2021 with hook,\n ${artistName} type beat 2021 with hook free,\n ${artistName} type beat 2020 with hook,\n ${artistName} type beat 2020 with hook free,\n ${artistName} type beat 2019 with hook,\n ${artistName} type beat 2019 with hook free,\n ${artistName} type instrumental,\n ${artistName} type instrumental free,\n ${artistName} type instrumental with hook,\n ${artistName} type instrumental with hook free,\n ${artistName} type instrumental free for profit,\n ${artistName} type instrumental 2021,\n ${artistName} type instrumental 2021 with hook,\n ${artistName} type instrumental 2021 with hook free,\n ${artistName} type instrumental 2020,\n ${artistName} type instrumental 2020 with hook,\n ${artistName} type instrumental 2020 with hook free,\n ${artistName} type instrumental 2019,\n ${artistName} type instrumental 2019 with hook,\n ${artistName} type instrumental 2019 with hook free,\n `\n // add EXTRA tags to the existing tags 2\n tags2 += `\n ${artistName2} type beat with hook free,\n ${artistName2} type beat 2021 with hook,\n ${artistName2} type beat 2021 with hook free,\n ${artistName2} type beat 2020 with hook,\n ${artistName2} type beat 2020 with hook free,\n ${artistName2} type beat 2019 with hook,\n ${artistName2} type beat 2019 with hook free,\n ${artistName2} type instrumental,\n ${artistName2} type instrumental free,\n ${artistName2} type instrumental with hook,\n ${artistName2} type instrumental with hook free,\n ${artistName2} type instrumental free for profit,\n ${artistName2} type instrumental 2021,\n ${artistName2} type instrumental 2021 with hook,\n ${artistName2} type instrumental 2021 with hook free,\n ${artistName2} type instrumental 2020,\n ${artistName2} type instrumental 2020 with hook,\n ${artistName2} type instrumental 2020 with hook free,\n ${artistName2} type instrumental 2019,\n ${artistName2} type instrumental 2019 with hook,\n ${artistName2} type instrumental 2019 with hook free,\n free beat, type beat, saint steph, saint steph type beat, free, saint steph music\n `\n var description = `${tags}${tags2}`\n var descriptionNode = document.createTextNode(description);\n tagField2.appendChild(descriptionNode)\n }\n // var additionalTagNode1 = document.createTextNode(tags);\n // var additionalTagNode2 = document.createTextNode(tags2);\n // tagField += additionalTagNode1;\n // tagField2 += additionalTagNode2;\n // var description = \"[Insert Title]\\n 🛒 Purchase Beat (Instant Delivery): [BEATSTARS LINK]\\n🌐 Social Media: @addyhebou, @saintstephmusic\\n📩 Email: hi@saintstephmusic.com\\n\\n[QUIRKY MESSAGE]\\n\\nThank you for listening to my music - let me know what you think below and I'll get back to you! You're the best - subscribe to get more Saint Steph !!\\n\\nUSAGE RIGHTS FOR FREE USE\\n\\n* You can use this beat for non-commercial and/or promotional use if you wish\\n* You must credit the producer as shown in the title of this video\\n* (Prod. by Saint Steph) if you choose to use this beat for non-commercial and/or promotional use\\n\\n____________________________\\n\\nWhat's okay for promotional use? I'm glad you asked, buddy.\\n\\n✅ Soundcloud (no ads enabled)\\n✅ YouTube (no ads enabled)\\n\\nWhat's NOT okay for promotional use? Once again, I'm glad you asked.\\n\\n🚫 Uploading to streaming service (Apple Music, Spotify, DistroKid, etc.) is NOT permitted\\n🚫 No paid performances\\n\\nIf you were to purchase this beat untagged for lease or exclusive license, please HIT ME UP. Contact me at my info listed above.\\n\\n______________\\nOtherwise, let's get this bread\\n\\n\\n\\n\\n=======\\n$\";\n ;\n\n\n}", "__init5() {this.tags = {};}", "__init5() {this.tags = {};}", "__init5() {this.tags = {};}", "set_tags(self) {\n var tags = [];\n for (var i = 0; i < self.items.length; i++) {\n if (self.items[i]['tags']) {\n var these_tags = self.items[i]['tags'];\n var slugs = these_tags.map(self.slugify);\n tags = tags.concat(these_tags);\n if (self.items[i]['className']) {\n self.items[i]['className'] = self.items[i]['className'] + ' ' + slugs.join(' ');\n } else {\n self.items[i]['className'] = slugs.join(' ');\n }\n }\n }\n tags = tags.filter( self.onlyUnique );\n tags.sort();\n self.setup_filters(self,tags,\"Tags\");\n return tags;\n }", "function addTagInternal( tag ) {\n if( typeof tag === 'string' && attrs.tagTitleField ) {\n var tmp = {};\n tmp[attrs.tagTitleField] = tag;\n tag = tmp;\n }\n\n scope.tags.push( tag );\n scope.inputText = '';\n scope.selection = -1;\n }", "function changeTags(value){\n setTags(value)\n console.log(tags)\n }", "function registertags(){\n // reset the tagresult content.\n var tagresult = $('#tagresult');\n tagresult.val('');\n\t\t// for each tag, add it to the value field.\n $(\".listtags a span\").each(function(i){\n \t// if first do not add a comma\n if(i > 0) {\n tagresult.val( tagresult.val() + ', ');\n }\n tagresult.val( tagresult.val() + $(this).html() );\n });\n }", "tagChange(tag) {\n let tagPos = this.tags.indexOf(tag);\n if (tagPos === this.tags.length-1 && (tag.name !== '' || tag.value !== '')) this.addEmptyTag();\n }", "function addUserTag() {\n var userTag = $(\"#addTagInput\").val().trim().toLowerCase();\n\n if (userTag.length > 2 && defaultTags.indexOf(userTag) === -1) {\n defaultTags.push(userTag);\n renderTags(defaultTags);\n fetchGifs(userTag);\n $(\"#addTagInput\").val(\"\");\n }\n}", "function addTag($str){\n\t\t\tconsole.log(\"addTag:\" + $str);\n\t\t\t\n\t\t\tvar arr = $str.split(\" \");\n\t\t\t\n\t\t\tif(arr.length > 1){\n\t\t\t\t$str = \"\\\"\" + $str + \"\\\"\";\n\t\t\t}\n\t\t\t\n\t\t\tvar i,\n\t\t\t\tl=tags.length,\n\t\t\t\tfound = false;\n\t\t\tfor(i = 0;i<l;i++){\n\t\t\t\tvar val = tags[i];\n\t\t\t\tif(val === $str){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(!found){\n\t\t\t\ttags.push($str);\n\t\t\t\taddTagButton($str);\n\t\t\t\t//addTagValue($str);\n\t\t\t\twriteTagsToField();\n\t\t\t}\n\t\t}", "function addTag(item, listTag) {\n let list = listTag.filter(function (item1) {\n return item1.post === item.id;\n })\n item['listTag'] = list;\n return item;\n}", "saveEntityTags(tags) {\n const {\n getEntity,\n getEntityTags,\n entityTagsPath,\n } = this.props;\n const entity = getEntity(this.props);\n const tagList = getEntityTags(this.props);\n const tagsToSave = { tagList: sortBy(uniq([...tags, ...tagList])) };\n set(entity, entityTagsPath, tagsToSave);\n this.props.mutator.entities.PUT(entity)\n .catch(err => {\n const errorId = err.status === OPTIMISTIC_LOCKING_STATUS\n ? 'stripes-components.optimisticLocking.saveError'\n : 'stripes-smart-components.cannotSaveTagToRecord';\n\n this.showCallout('error', errorId);\n });\n }", "function addData(data) {\n console.log(` Adding: Tag (${data.name})`);\n Tags.insert(data);\n}", "tags(tags) {\n this.checkSearchType();\n const ts = [];\n for (const tag of tags) {\n const values = typeof tag.values === 'string' ? [tag.values] : tag.values;\n ts.push({\n name: tag.name,\n values,\n });\n }\n this.options.tags = ts;\n return this;\n }", "update_tags(state) {\n Vue.http.get(Hunt.API_URL + '/tags')\n .then(\n success => {\n state.tags = [];\n success.body.forEach(x=>{\n state.tags.push({\n label: x.name,\n value: x.id\n });\n });\n },\n fail => {\n if(fail.status===403) {\n Bus.$emit(\"goto-login\");\n }\n Hunt.toast(fail.data.message);\n console.log(fail);\n }\n );\n }", "function addTag(tag) {\n var node = document.createElement(\"li\");\n $(node).append('<span>' + tag + '</span><a href=\"#\" title=\"Remove tag\">x</a>');\n\n // When clicked, remove the node and save the tags list.\n $(node).find('a').click(function() {\n $(node).remove();\n saveTags();\n })\n\n // Add to the list.\n $list.append(node);\n }", "function tag(){\n // clears the tag and title field\n betterClear('tags', 'titleParagraph');\n\n // The variable paragraph is for all the tags of artist 1; paragraph 2 is for all the tags of artist 2\n var paragraph = document.getElementById('tags');\n var paragraph2 = document.getElementById('tags2');\n var artistName = document.getElementById(\"name\").value.toLowerCase();\n var artistName2 = document.getElementById(\"name2\").value.toLowerCase();\n var album = document.getElementById(\"album\").value.toLowerCase();\n var album2 = document.getElementById(\"album2\").value.toLowerCase();\n var mood = document.getElementById(\"mood\").value.toLowerCase();\n var mood2 = document.getElementById(\"mood2\").value.toLowerCase();\n var genre = document.getElementById(\"genre\").value.toLowerCase();\n var genre2 = document.getElementById(\"genre2\").value.toLowerCase();\n var instrument = document.getElementById(\"instrument\").value.toLowerCase();\n var instrument2 = document.getElementById(\"instrument2\").value.toLowerCase();\n<<<<<<< HEAD\n\n // initialize tags for artist 1\n var tags = `\n ${artistName} type beat,\n ${artistName} type beat 2021,\n ${artistName} type beat free,\n ${artistName} type beat 2020,\n ${artistName} type beat free for profit,\n ${artistName} type beat with hook,\n free ${artistName} type beat,\n `\n\n // initialize tags for artist 2\n var tags2 = `\n ${artistName2} type beat,\n ${artistName2} type beat 2021,\n ${artistName2} type beat free,\n ${artistName2} type beat 2020,\n ${artistName2} type beat free for profit,\n ${artistName2} type beat with hook,\n free ${artistName2} type beat,\n `\n\n // additional tags for artist 1\n if (mood != ''){ tags += `${artistName} type beat ${mood},`;}\n if (album != ''){ tags += `${artistName} type beat ${album},`;}\n if (instrument != ''){ tags += `${artistName} type beat ${instrument},`;}\n if (genre != ''){ tags += `${artistName} type beat ${genre},`;}\n\n // node the tags to add to the paragraph\n var tagsNode = document.createTextNode(tags);\n paragraph.appendChild(tagsNode);\n\n // additional tags for artist 2\n if (artistName2 != ''){\n if (mood2 != ''){ tags2 += `${artistName2} type beat ${mood2},`;}\n if (album2 != ''){ tags2 += `${artistName2} type beat ${album2},`;}\n if (instrument2 != ''){ tags2 += `${artistName2} type beat ${instrument2},`;}\n if (genre2 != ''){ tags2 += `${artistName2} type beat ${genre2},`;}\n // node the 2nd tags to add to the paragraph 2\n var tags2Node = document.createTextNode(tags2);\n paragraph2.appendChild(tags2Node);\n }\n console.log(tags2);\n // create Instagram caption by calling outside function\n instagramCaption(artistName, artistName2, mood);\n additionalTags(tags, tags2, artistName, artistName2);\n\n \n}", "addTags(group, tags) {\n const operation = {\n \"operationType\": \"add\",\n \"group\": group,\n \"tags\": tags\n };\n this.operations.push(operation);\n return this;\n }", "function addTag(obj,addNewTag){\n\tif(!obj['tag']){\n\t\tobj['tag'] = [];\n\t}\n\n\tif(obj['genre']){\n\t\tdelete obj['genre'];\n\t}\n\n\tfor(var i = 0; i < obj.tag.length; i++){\n\t\tif(obj.tag[i] === addNewTag){\n\t\t\treturn 'Tag already exist!';\n\t\t} \n\t}\n\n\tobj['tag'].push(addNewTag);\n\t\n\treturn 'New Tag Added!';\n}", "function onTagChange($e,$data){\n\t\t\taddTag($data.item.value);\n\t\t}", "function setTags(tags, doSort) {\n //writeDebug(\"called setTags(\"+tags+\")\");\n\n clearSelection();\n var values;\n if (typeof(tags) == 'object') {\n values = tags;\n } else {\n values = tags.split(/\\s*,\\s*/);\n }\n if (!values.length) {\n return;\n }\n var tmpValues = new Array()\n for (var i = 0; i < values.length; i++) {\n tmpValues.push(values[i].replace(/([^0-9A-Za-z_])/, '\\\\$1'));\n }\n var filter = \"#\"+tmpValues.join(\",#\");\n //writeDebug(\"filter=\"+filter);\n $tagCloud.find(filter).addClass(\"current\");\n if (doSort) {\n values = values.sort();\n }\n $input.val(values.join(\", \"));\n }", "function onTagChange() {\n\n\t}", "function findTags(data) {\n let tags = [];\n data.forEach(recipe => {\n recipe.tags.forEach(tag => {\n if (!tags.includes(tag)) {\n tags.push(tag);\n }\n });\n });\n tags.sort();\n tags.forEach(tag => domUpdates.listTag(capitalize(tag), tag));\n}", "onUpdateTagAtIndex() {}", "function tag(){\n // clears the tag and title field\n betterClear('tags', 'titleParagraph');\n\n // The variable paragraph is for all the tags of artist 1; paragraph 2 is for all the tags of artist 2\n var paragraph = document.getElementById('tags');\n var paragraph2 = document.getElementById('tags2');\n var artistName = document.getElementById(\"name\").value.toLowerCase();\n var artistName2 = document.getElementById(\"name2\").value.toLowerCase();\n var album = document.getElementById(\"album\").value.toLowerCase();\n var album2 = document.getElementById(\"album2\").value.toLowerCase();\n var mood = document.getElementById(\"mood\").value.toLowerCase();\n var mood2 = document.getElementById(\"mood2\").value.toLowerCase();\n var genre = document.getElementById(\"genre\").value.toLowerCase();\n var genre2 = document.getElementById(\"genre2\").value.toLowerCase();\n var instrument = document.getElementById(\"instrument\").value.toLowerCase();\n var instrument2 = document.getElementById(\"instrument2\").value.toLowerCase();\n\n // initialize tags for artist 1\n var tags = `\n ${artistName} type beat,\n ${artistName} type beat 2021,\n ${artistName} type beat free,\n ${artistName} type beat 2020,\n ${artistName} type beat free for profit,\n ${artistName} type beat with hook,\n free ${artistName} type beat,\n `\n\n // initialize tags for artist 2\n var tags2 = `\n ${artistName2} type beat,\n ${artistName2} type beat 2021,\n ${artistName2} type beat free,\n ${artistName2} type beat 2020,\n ${artistName2} type beat free for profit,\n ${artistName2} type beat with hook,\n free ${artistName2} type beat,\n `\n\n // additional tags for artist 1\n if (mood != ''){ tags += `${artistName} type beat ${mood},`;}\n if (album != ''){ tags += `${artistName} type beat ${album},`;}\n if (instrument != ''){ tags += `${artistName} type beat ${instrument},`;}\n if (genre != ''){ tags += `${artistName} type beat ${genre},`;}\n\n // node the tags to add to the paragraph\n var tagsNode = document.createTextNode(tags);\n paragraph.appendChild(tagsNode);\n\n // additional tags for artist 2\n if (artistName2 != ''){\n if (mood2 != ''){ tags2 += `${artistName2} type beat ${mood2},`;}\n if (album2 != ''){ tags2 += `${artistName2} type beat ${album2},`;}\n if (instrument2 != ''){ tags2 += `${artistName2} type beat ${instrument2},`;}\n if (genre2 != ''){ tags2 += `${artistName2} type beat ${genre2},`;}\n // node the 2nd tags to add to the paragraph 2\n var tags2Node = document.createTextNode(tags2);\n paragraph2.appendChild(tags2Node);\n }\n console.log(tags2);\n // create Instagram caption by calling outside function\n instagramCaption(artistName, artistName2, mood);\n additionalTags(tags, tags2, artistName, artistName2);\n\n \n}", "function setupTagMenu() {\n\t\tvar tagArray = [];\n\t\tvar tagString = '';\n\n\t\t$('.media_block').each(function() {\n\t\t\tvar tagList = String(unescape($(this).attr('data-tags')));\n\t\t\tif(tagList != 'None' && tagList != 'null') {\n\t\t\t\ttagList.split(', ').join(',');\n\t\t\t\tvar tempTagArray = tagList.split(',');\n\t\t\t\tfor(var i = 0; i < tempTagArray.length; i++) {\n\t\t\t\t\tif(!checkTagsForDuplicates(tagArray, $.trim(tempTagArray[i])) && $.trim(tempTagArray[i]) != 'None' && $.trim(tempTagArray[i]) != '') {\n\t\t\t\t\t\ttagArray.push($.trim(tempTagArray[i]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t$('#media_tag_inner').html('');\n\n\t\ttagArray.sort();\n\n\t\tfor(var i = 0; i < tagArray.length; i++) {\n\t\t\ttagString += '<div class=\"tag_button\" data-tag=\"' + tagArray[i] + '\">' + tagArray[i] + '</div>' + \"\\n\";\n\t\t}\n\n\t\t$('#media_tag_inner').html(tagString);\n\n\t\t$('.tag_button').each(function(i) {\n\t\t\t$(this).bind('mouseenter', tagBtnOver);\n\t\t\t$(this).bind('mouseleave', tagBtnOut);\n\t\t\t$(this).bind('click', tagBtnClick);\n\t\t});\n\n\t}", "function customTaglist(title, newTags)\r\n{\r\n\tvar tagList = !recursion && ( document.getElementById(\"tag-box\") || document.getElementById(\"tag-list\") );\r\n\tif( !tagList )\r\n\t\treturn;\r\n\t\r\n\tvar fragment = createElementX([{ tag:\"h1\", text:title }]);\r\n\tvar newList = fragment.appendChildX( {tag:\"ul\"}) ;\r\n\tvar tagsValue = document.getElementById(\"tags\").value;\r\n\tif( tagsValue.length > 0 )\r\n\t\ttagsValue = '+'+tagsValue;\r\n\t\r\n\tfor( var i = 0; i < newTags.length; i++ )\r\n\t{\r\n\t\tvar newListItem = createElementX({ tag: \"li\", class:\"category-0\"/* general tag by default */ });\r\n\t\tvar thisTag = newTags[i];//Make copy to avoid removing tag type from original settings\r\n\t\t\r\n\t\tif( thisTag.indexOf(\"art:\") == 0 )\r\n\t\t\tnewListItem.className = \"category-1\";\r\n\t\telse if( thisTag.indexOf(\"char:\") == 0 )\r\n\t\t\tnewListItem.className = \"category-4\";\r\n\t\telse if( thisTag.indexOf(\"copy:\") == 0 )\r\n\t\t\tnewListItem.className = \"category-3\";\r\n\t\t\r\n\t\tthisTag = thisTag.replace(/^(art|char|copy|gen):/,'');\r\n\t\t\r\n\t\tif( thisTag.indexOf(\":\") > 0 )\r\n\t\t\tnewListItem.innerHTML = '<a class=\"wiki-link\" href=\"/wiki_pages?title=help:cheatsheet\">?</a>';\r\n\t\telse\r\n\t\t\tnewListItem.innerHTML = '<a class=\"wiki-link\" href=\"/wiki_pages?title='+thisTag.replace(/ /g,'_')+'\">?</a>';\r\n\t\t\r\n\t\tnewListItem.innerHTML += ' <a href=\"/posts?tags='+thisTag.replace(/ /g,'_')+tagsValue+'\" class=\"search-inc-tag\">+</a> <a href=\"/posts?tags=-'+thisTag.replace(/ /g,'_')+tagsValue+'\" class=\"search-exl-tag\">&ndash;</a>'+' <a href=\"/posts?tags='+thisTag.replace(/ /g,'_')+'\" class=\"search-tag\">'+thisTag.replace(/_/g,' ')+'</a>';\r\n\t\tnewList.appendChild(newListItem);\r\n\t}\r\n\t\r\n\ttagList.appendChild(fragment);\r\n}", "async handleTagCreated(tag) {\n this.setState({\n tags: [...this.state.tags, tag],\n draftTags: [...this.state.draftTags, tag]\n });\n }", "function addPreExistingTags() {\r\n if(subjectDatalistInput.getAttribute('data-value') !== ''){\r\n let preExistingSubjectsArray = document.getElementById('subject-input').getAttribute('data-value').split(';');\r\n let preExistingIDsArray = document.getElementById('subject-input').getAttribute('data-id').split(',');\r\n\r\n let preExistingSubjectJSONToPush = [];\r\n\r\n for (var x = 0; x< preExistingSubjectsArray.length; x++){\r\n preExistingSubjectJSONToPush.push({name: preExistingSubjectsArray[x], id: preExistingIDsArray[x]});\r\n }\r\n\r\n // need to add the values in the $book->SubjectName which are semi-colon separated\r\n console.log('line 79: ', preExistingSubjectJSONToPush);\r\n\r\n // loop through the tags object and for each item, create a tag in the container and prepend it \r\n // to the front of the container\r\n preExistingSubjectJSONToPush.slice().reverse().forEach(function(tag) {\r\n const input = createTag(tag);\r\n \r\n // add the pre-existing tags to the tag container for UI purposes\r\n tagContainer.prepend(input);\r\n\r\n // add pre-existing tags to tag object \r\n tags.push(tag);\r\n })\r\n }\r\n updateUI();\r\n}", "function addTag(iconsList, tag) {\n\t let added = false;\n\t iconsList.forEach((name) => {\n\t if (icons[name] !== void 0 &&\n\t icons[name].tags.indexOf(tag) === -1) {\n\t icons[name].tags.push(tag);\n\t added = true;\n\t }\n\t });\n\t return added;\n\t }", "function CustomTags () {\n const [tags, setTags] = useState([])\n\n const reactTags = useRef()\n\n const onDelete = useCallback((tagIndex) => {\n setTags(tags.filter((_, i) => i !== tagIndex))\n }, [tags])\n\n const onAddition = useCallback((newTag) => {\n setTags([...tags, newTag])\n }, [tags])\n\n const onValidate = useCallback((newTag) => {\n return /^[a-z]{3,12}$/i.test(newTag.name)\n })\n\n return (\n <>\n <p>Enter new tags meeting the requirements below:</p>\n <ReactTags\n allowNew\n newTagText='Create new tag:'\n ref={reactTags}\n tags={tags}\n suggestions={[]}\n onDelete={onDelete}\n onAddition={onAddition}\n onValidate={onValidate}\n />\n <p style={{ margin: '0.25rem 0', color: 'gray' }}>\n <small><em>Tags must be 3–12 characters in length and only contain the letters A-Z</em></small>\n </p>\n <p><b>Output:</b></p>\n <pre><code>{JSON.stringify(tags, null, 2)}</code></pre>\n </>\n )\n}", "function addTag(item, tag) {\n\t\tfor (var t in item.tags) {\n\t\t\tif (item.tags[t] == tag) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\titem.tags.push(tag);\n\t}", "function toggleTag(e) {\n var id = $(e).attr(\"data-id\");\n var availableTags = [];\n var availableTagsID = [];\n $('.header_div_2 .keywords div').children('p').each(function () {\n availableTags.push($(this).text());\n availableTagsID.push($(this).parent().children(\"button\").attr(\"data-id\"));\n });\n\n var original_height;\n\n $('.myTags').tagit({\n tagSource: availableTags,\n select: true,\n sortable: true,\n allowNewTags: false,\n triggerKeys: ['enter', 'tab'],\n allowSpaces: true,\n beforeTagAdded: function (event, ui) {\n original_height = $(\".header_div_3\").height();\n if ($.inArray(ui.tagLabel, availableTags) == -1) {\n return false;\n }\n },\n afterTagAdded: function (event, ui) {\n var e = $(\".header_div_2 .keywords div p[value='\" + ui.tagLabel + \"']\").parent();\n $(\".content-wrapper.original .myTags\").tagit(\"createTag\", ui.tagLabel);\n $(\".content-wrapper.duplicate .myTags\").tagit(\"createTag\", ui.tagLabel);\n var button_element = $('button[data-id=' + $(e).children(\"button\").attr(\"data-id\") + ']');\n $(button_element).css(\"background-color\", \"#ab2019\");\n $(button_element).attr(\"data-function\", \"remove\");\n $(button_element).children(\"i\").removeClass(\"fa-plus\");\n $(button_element).children(\"i\").addClass(\"fa-close\");\n },\n beforeTagRemoved: function (event, ui) {\n original_height = $(\".header_div_3\").height();\n var data_id = $(ui.tag).attr(\"data-id\");\n var button_element = $('button[data-id=' + data_id + ']');\n $(button_element).attr(\"data-function\", \"add\").css(\"background-color\", \"#3bc264\");\n $(button_element).children(\"i\").removeClass(\"fa-close\");\n $(button_element).children(\"i\").addClass(\"fa-plus\");\n },\n afterTagRemoved: function (event, ui) {\n var data_id = $(ui.tag).attr(\"data-id\");\n $(\".myTags\").tagit(\"removeTag\", $(\".myTags li[data-id=\" + data_id + \"]\"));\n var button_element = $('button[data-id=' + data_id + ']');\n $(button_element).attr(\"data-function\", \"add\").css(\"background-color\", \"#3bc264\");\n $(button_element).children(\"i\").removeClass(\"fa-close\");\n $(button_element).children(\"i\").addClass(\"fa-plus\");\n }\n });\n\n if ($(e).attr(\"data-function\") == \"add\") {\n $(\".myTags\").tagit(\"createTag\", e.id);\n $(\".content-wrapper.original .myTags li\").eq(-2).attr(\"data-id\", id);\n $(\".content-wrapper.duplicate .myTags li\").eq(-2).attr(\"data-id\", id);\n }\n else if ($(e).attr(\"data-function\") == \"remove\") {\n $(\".myTags\").tagit(\"removeTag\", $(\".myTags li[data-id=\" + $(e).attr(\"data-id\") + \"]\"));\n }\n}", "applyTags(tags) {\n var qp = { tags: tags.toString() };\n return this.refreshModel(qp).then( model =>{\n this.emit(events.TAGS_SELECTED);\n return model;\n });\n }", "function loadTagCloud () {\n $('#tag-cloud-box').children('.cloud-tags').remove()\n if (tasks.tagList.length + gitHub.tagList.length + serviceNow.snTagList.length + rally.rallyTagList.length > 0) {\n const utl = [...new Set(tasks.tagList.concat(gitHub.tagList).concat(serviceNow.snTagList).concat(rally.rallyTagList))]\n utl.sort()\n utl.forEach((tag) => {\n let color = `#${asciiToHex(tag)}`\n color = hexToHSL(color, 60)\n $('#tag-cloud-box').append(`<div class=\"cloud-tags\" style=\"background-color: ${color}\">${tag}</div>`)\n })\n }\n}", "function addTagLabel(name) {\n let tagList = document.getElementById(\"tag-line\");\n let newTag = document.createElement(\"span\");\n let newText = document.createElement(\"span\");\n let newRemove = document.createElement(\"a\");\n let newIcon = document.createElement(\"i\");\n let input = document.getElementById(\"tag-add\");\n\n input.value = \"\";\n\n newTag.className = \"tag-label tag\";\n newTag.id = name;\n\n let aElement = document.createElement('a');\n aElement.innerText = name;\n newText.appendChild(aElement);\n\n newIcon.className = \"remove glyphicon glyphicon-remove-sign glyphicon-white\";\n\n newRemove.onclick = function() {\n tagList.removeChild(newTag);\n toAddTagList.delete(name.toLowerCase());\n removeTagFromItem(name);\n };\n newText.onclick = function() {\n window.location.href = '/tags/display/' + encodeURIComponent(name.toLowerCase());\n };\n newRemove.appendChild(newIcon);\n newTag.appendChild(newText);\n newTag.appendChild(newRemove);\n\n if(!toAddTagList.has(name)) {\n toAddTagList.add(name);\n tagList.appendChild(newTag);\n }\n}", "function tag(){\n // clears the tag and title field\n betterClear('tags', 'titleParagraph');\n\n // The variable paragraph is for all the tags of artist 1; paragraph 2 is for all the tags of artist 2\n var paragraph = document.getElementById('tags');\n var paragraph2 = document.getElementById('tags2');\n var artistName = document.getElementById(\"name\").value.toLowerCase();\n var artistName2 = document.getElementById(\"name2\").value.toLowerCase();\n // var album = document.getElementById(\"album\").value.toLowerCase();\n // var album2 = document.getElementById(\"album2\").value.toLowerCase();\n var mood = document.getElementById(\"mood\").value.toLowerCase();\n var mood2 = document.getElementById(\"mood2\").value.toLowerCase();\n // var genre = document.getElementById(\"genre\").value.toLowerCase();\n // var genre2 = document.getElementById(\"genre2\").value.toLowerCase();\n var instrument = document.getElementById(\"instrument\").value.toLowerCase();\n var instrument2 = document.getElementById(\"instrument2\").value.toLowerCase();\n\n // initialize tags for artist 1\n var tags = `\n ${artistName} type beat,\n ${artistName} type beat 2021,\n ${artistName} type beat free,\n ${artistName} type beat 2020,\n ${artistName} type beat free for profit,\n ${artistName} type beat with hook,\n free ${artistName} type beat,\n `\n\n // initialize tags for artist 2\n var tags2 = `\n ${artistName2} type beat,\n ${artistName2} type beat 2021,\n ${artistName2} type beat free,\n ${artistName2} type beat 2020,\n ${artistName2} type beat free for profit,\n ${artistName2} type beat with hook,\n free ${artistName2} type beat,\n `\n\n // additional tags for artist 1\n if (mood != ''){ tags += `${artistName} type beat ${mood},`;}\n // if (album != ''){ tags += `${artistName} type beat ${album},`;}\n if (instrument != ''){ tags += `${artistName} type beat ${instrument},`;}\n // if (genre != ''){ tags += `${artistName} type beat ${genre},`;}\n\n // node the tags to add to the paragraph\n var tagsNode = document.createTextNode(tags);\n paragraph.appendChild(tagsNode);\n\n // additional tags for artist 2\n if (artistName2 != ''){\n if (mood2 != ''){ tags2 += `${artistName2} type beat ${mood2},`;}\n // if (album2 != ''){ tags2 += `${artistName2} type beat ${album2},`;}\n if (instrument2 != ''){ tags2 += `${artistName2} type beat ${instrument2},`;}\n // if (genre2 != ''){ tags2 += `${artistName2} type beat ${genre2},`;}\n // node the 2nd tags to add to the paragraph 2\n var tags2Node = document.createTextNode(tags2);\n paragraph2.appendChild(tags2Node);\n }\n // create Instagram caption by calling outside function\n additionalTags(tags, tags2, artistName, artistName2);\n\n \n}", "updateTags() {\n let tags = this.get('tags');\n let oldTags = tags.filterBy('id', null);\n\n tags.removeObjects(oldTags);\n oldTags.invoke('deleteRecord');\n }", "function generateTags() {\n let allTags = {};\n const articles = document.querySelectorAll(optArticleSelector);\n\n for (let article of articles) {\n\n const tagList = article.querySelector(optArticleTagsSelector);\n let html = '';\n const articleTags = article.getAttribute('data-tags');\n const articleTagsArray = articleTags.split(' ');\n\n for (let tag of articleTagsArray) {\n const linkHTMLData = { id: tag, title: tag };\n const linkHTML = templates.tagLink(linkHTMLData);\n html = html + linkHTML + ' ';\n\n // eslint-disable-next-line no-prototype-builtins\n if (!allTags.hasOwnProperty(tag)) {\n allTags[tag] = 1;\n } else {\n allTags[tag]++;\n }\n }\n tagList.innerHTML = html;\n }\n\n const tagList = document.querySelector('.tags');\n const tagsParams = calculateTagsParams(allTags);\n const allTagsData = { tags: [] };\n\n for (let tag in allTags) {\n allTagsData.tags.push({\n tag: tag,\n count: allTags[tag],\n className: calculateTagClass(allTags[tag], tagsParams)\n });\n\n }\n tagList.innerHTML = templates.tagCloudLink(allTagsData);\n }", "async function addTag(tag){\n if(!selectedTags.includes(tag)){\n console.log(\"adding \" + tag);\n\n setInput(\"\");\n setSelectedTags([...selectedTags, tag]);\n availableTags.current = availableTags.current.filter((tagx) => tagx !== tag);\n setTagSuggestions([]);\n }\n }", "function saveTags() {\n $field.val(\n $.map($list.find('li > span'), function(obj) {\n return $(obj).text();\n }).join(',')\n );\n }", "function imgAddToTag(e, id){\n let tags = JSON.parse(localStorage.getItem('tags'))\n tags = tags.map(tagObj=> {\n if (tagObj.title === e.target.innerHTML) {\n if (tagObj.images.includes(id)) {\n tagObj.images = tagObj.images.filter(imgId => imgId !== id)\n nodePassive(e.target)\n return {...tagObj}\n } else {\n tagObj.images.push(id)\n nodeActive(e.target)\n return {...tagObj}\n }\n } else {\n return tagObj\n }\n })\n localStorage.setItem('tags', JSON.stringify(tags))\n }", "function addTag(tag) {\n // If we entered from payload we have some additional info\n if ($('#eview_sub2')[0]) { \n var longTag = tag.split(\",\")[0];\n var theClass = tag.split(\",\")[1];\n var t_tag = truncTag(longTag,20);\n } else {\n var t_tag = truncTag(tag,20);\n } \n\n // Hide empty\n $('.tag_empty').hide();\n\n // Check if tag exists\n var tag_exists = 0;\n $('.tag').each(function() {\n if ($(this).text() == t_tag) {\n $(this).addClass('tag_active');\n tag_exists = 1;\n }\n }); \n\n // Add tag to left pane\n if (tag_exists == 0) {\n var newTag = \"<div title=\\\"\" + tag + \"\\\" data-val=\\\"\" + tag + \"\\\" class=tag>\" + t_tag + \"</div>\";\n $('#tg_box').prepend(newTag);\n }\n \n // If we have the payload open, add here as well\n if ($('#eview_sub2')[0]) {\n if($('#pickbox_label').is(\":visible\")) {\n theClass = $('#pickbox_label').data('sord')[0];\n }\n // Remove placeholder\n if ($('#tag_none')[0]) $('#tag_none').remove();\n var newTag = \"<div title=\\\"\" + longTag + \"\\\" data-val=\\\"\" + longTag + \"\\\" class=tag_\" + theClass + \">\" + t_tag + \"</div>\"; \n $('#tag_area').prepend(newTag);\n }\n\n }", "function renderTagList() {\n const tags = getTagsPart();\n\n if (tags && tags.length > 0) {\n const ul = document.querySelector('#tag-list');\n\n if (tags.length > 0) {\n clearElementChildren(ul);\n\n tags.forEach(item => addTag(item, ul, removeTag));\n }\n }\n}", "function addTag(tag)\n{\n if (is_similar() && tag !== '')\n {\n $('.your_tags')\n .append('\\\n <a class=\"dropdown-item cursor\" name=\"tag\">#'\n + tag +\n '</a>'\n );\n }\n\n function is_similar()\n {\n let my_tags = [];\n\n for (let spl of $('a[name=tag]')){\n my_tags.push(spl.innerHTML);\n }\n\n return ((my_tags.indexOf(\"#\" + tag) == -1));\n }\n}", "function updateTags(tags, gid, tagset, images){\r\n\ttags = typeof(tags) == typeof('str') ? [ tags ] : tags\r\n\tgid = gid == null ? getImageGID() : gid\r\n\ttagset = tagset == null ? TAGS : tagset\r\n\timages = images == null ? IMAGES : images\r\n\r\n\tvar img = images[gid]\r\n\r\n\t// remove...\r\n\tif(img.tags != null){\r\n\t\tvar rtags = []\r\n\t\timg.tags.map(function(tag){\r\n\t\t\tif(tags.indexOf(tag) < 0){\r\n\t\t\t\trtags.push(tag)\r\n\t\t\t}\r\n\t\t})\r\n\t\tremoveTag(rtags, gid, tagset, images)\r\n\t}\r\n\r\n\t// add...\r\n\taddTag(tags, gid, tagset, images)\r\n}", "function process_tags(file_name, text) {\n let split = trim_array(text.split('\\n'));\n\n if (split.length > 1) {\n let line = split[2];\n let index = find_next_index_of(line, 0, '}');\n\n // Making sure the article does actually have a list of tags\n if (line[0] === '{' && index >= 0) {\n // The list of article tags\n let tagsList = line.substring(1, index).split(',');\n\n for (let i = 0; i < tagsList.length; i++) {\n if (tagsList[0] !== '') {\n // Adding the tag to the first index, then adding a new empty list\n // so that future articles that are tagged with it can go there\n if (!tags[0].includes(tagsList[i])) {\n tags[0].push(tagsList[i]);\n tags.push([]);\n }\n\n // Adding the article to the tags' lists of tagged articles\n tags[tags[0].indexOf(tagsList[i]) + 1].push(file_name);\n }\n }\n }\n }\n}", "function addTag(tag, index) {\n var input = $('#new-tags');\n input.val(input.val() + ', ' + tag);\n var a = $('#tag-' + index);\n a.attr('onclick', 'return false;');\n a.find('span').removeClass('label-success').text('Birka pievienota pasākumam');\n a.css('cursor', 'default');\n}", "function enableTagging() {\n setStatus('disableTagging', false);\n $(\"body\").find(\"button[name=tag]\").each(function(t) {\n $(this).removeClass('disabled');\n });\n }", "function update_tags(path, data, context){\n var obj = JSON.parse(data); \n // empty the helpful text message element\n $('#tag_content').empty();\n // Populate some of the items\n $('textarea#namespace_description_textarea').val(obj.description);\n $('#namespace_description').html(obj.description);\n $('#path').html(path);\n $('#namespace_path').html(path);\n // cache the two jQuery objects\n $namespace_list = $('#namespace_list');\n $tag_list = $('#tag_list');\n // add namespace\n $.each(obj.namespaceNames, function(n, namespace) {\n var item = { \"name\": namespace, \"path\": path};\n context.partial('templates/namespace.template', { item: item}, function(rendered) { $namespace_list.append(rendered)});\n });\n \n // add tags\n $.each(obj.tagNames, function(t, tag) {\n var item = { \"name\": tag, \"path\": path};\n context.partial('templates/tag.template', { item: item}, function(rendered) { $tag_list.append(rendered)});\n });\n }", "onReplaceTagAtIndex() {}", "additionalNametags(self) { return []; }", "function uploadTags() {\n if (document.getElementById('indexIngredients')) {\n tagList = $('#indexIngredients').val();\n $('#indexCategories').val().forEach(category => {\n db.collection('categories').doc(category).update({\n tags: firebase.firestore.FieldValue.arrayUnion(...tagList)\n })\n })\n }\n if (document.getElementById('groceryIngredients')) {\n tagList = $('#groceryIngredients').val();\n $('#groceryCategories').val().forEach(category => {\n db.collection('grocery_categories').doc(category).update({\n tags: firebase.firestore.FieldValue.arrayUnion(...tagList)\n })\n })\n }\n }", "function loadTags() {\n\t\tlet tags = new wp.api.collections.Tags()\n\n\t\ttags.fetch().done( () => {\n\t\t\tconsole.log(tags);\n\t\t\t\t//clearCategories();\n\t\t\t\ttags.each( tag => loadTag( tag.attributes ) );\n\t\t});\n\t}", "function addTagsToAlgolia(allTags = ['name']) {\n const client = algoliasearch(\n process.env.GATSBY_ALGOLIA_APPLICATION_ID,\n process.env.GATSBY_ALGOLIA_ADMIN_KEY\n )\n\n const index = client.initIndex(process.env.GATSBY_ALGOLIA_INDEX_TAGS)\n\n const tagObjects = allTags.map((tag, index) => ({\n objectID: `tag_${tag.replace(/\\s+/g, '_').toLowerCase()}`,\n tag,\n }))\n\n index.addObjects(tagObjects, (err, content) => {\n if (err) {\n console.error(err)\n }\n })\n\n index.setSettings(\n {\n searchableAttributes: ['tag'],\n attributeForDistinct: 'tag',\n distinct: true,\n hitsPerPage: 5,\n },\n (err, content) => {\n if (err) {\n console.error(err)\n }\n }\n )\n}", "function insertNewTagInput() {\n\t$('#tk_tagAddHolder').append($('<input>', { id: 'tk_tagInput', value: 'Add a new tag!' }));\n\t$('#tk_tagAddHolder').append($('<div>', { id: 'tk_tagSuggestions' }));\n\t$('#tk_tagSuggestions').append($('<div>', { id: 'tk_suggestionTitle', text: 'Add a Popular Tag' }));\n\n\t// filter out searchTags that have already been entered\n\tvar suggestionTags = searchTags.slice(0); // need to preserve searchTags\n\tvar iL=communityTags.length;\n\tfor(var i=0; i<iL; i++) {\n\t\tfor(var j=0; j<suggestionTags.length; j++) {\n\t\t\tif(suggestionTags[j].tagName == communityTags[i].tagName) {\n\t\t\t\tsuggestionTags.splice(j,1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// sort searchTags by ups\n\tsuggestionTags.sort(function(a, b) {\n\t\tvar aSort = a.votes.total;\n\t\tvar bSort = b.votes.total;\n\t\treturn bSort-aSort;\n\t});\t\n\n\t// add them to the list\n\tfor(var i=0; i<suggestionTags.length && i<16; i++) {\n\t\t$('#tk_tagSuggestions').append($('<a>',{ href: '#', class: 'tk_suggestionRow', text: suggestionTags[i].tagName }));\n\t}\n\n\t// keep list from pushing page down\n\tvar x = (suggestionTags.length+1)*tagSuggestionHeight*-1;\n\t$('#tk_tagSuggestions').css('margin-bottom',x + 'px');\n}", "_initTagsAdvanced() {\n if (document.querySelector('#tagsAdvanced')) {\n var whitelist = [\n 'Anpan',\n 'Breadstick',\n 'Biscotti',\n 'Cholermüs',\n 'Dorayaki',\n 'Fougasse',\n 'Kifli',\n 'Lefse',\n 'Melonpan',\n 'Naan',\n 'Qistibi',\n 'Panbrioche',\n 'Rewena',\n 'Shirmal',\n 'Tunnbröd',\n 'Vánočka',\n 'Zopf',\n ];\n var tagifyAdvanced = new Tagify(document.querySelector('#tagsAdvanced'), {\n enforceWhitelist: true,\n dropdown: {\n enabled: 1,\n },\n whitelist: document\n .querySelector('#tagsAdvanced')\n .value.trim()\n .split(/\\s*,\\s*/), // Array of values. stackoverflow.com/a/43375571/104380\n });\n\n // \"remove all tags\" button event listener\n document.querySelector('#removeAllTags').addEventListener('click', tagifyAdvanced.removeAllTags.bind(tagifyAdvanced));\n\n // Chainable event listeners\n tagifyAdvanced\n .on('add', onAddTag)\n .on('remove', onRemoveTag)\n .on('input', onInput)\n .on('edit', onTagEdit)\n .on('invalid', onInvalidTag)\n .on('click', onTagClick)\n .on('focus', onTagifyFocusBlur)\n .on('blur', onTagifyFocusBlur)\n .on('dropdown:hide dropdown:show', (e) => console.log(e.type))\n .on('dropdown:select', onDropdownSelect);\n\n var mockAjax = (function mockAjax() {\n var timeout;\n return function (duration) {\n clearTimeout(timeout); // abort last request\n return new Promise(function (resolve, reject) {\n timeout = setTimeout(resolve, duration || 700, whitelist);\n });\n };\n })();\n\n // tag added callback\n function onAddTag(e) {\n console.log('onAddTag: ', e.detail);\n console.log('original input value: ', document.querySelector('#tagsAdvanced').value);\n tagifyAdvanced.off('add', onAddTag); // exmaple of removing a custom Tagify event\n }\n\n // tag remvoed callback\n function onRemoveTag(e) {\n console.log('onRemoveTag:', e.detail, 'tagify instance value:', tagifyAdvanced.value);\n }\n\n // on character(s) added/removed (user is typing/deleting)\n function onInput(e) {\n console.log('onInput: ', e.detail);\n tagifyAdvanced.settings.whitelist.length = 0; // reset current whitelist\n tagifyAdvanced.loading(true).dropdown.hide.call(tagifyAdvanced); // show the loader animation\n\n // get new whitelist from a delayed mocked request (Promise)\n mockAjax().then(function (result) {\n // replace tagify \"whitelist\" array values with new values\n // and add back the ones already choses as Tags\n tagifyAdvanced.settings.whitelist.push(...result, ...tagifyAdvanced.value);\n\n // render the suggestions dropdown.\n tagifyAdvanced.loading(false).dropdown.show.call(tagifyAdvanced, e.detail.value);\n });\n }\n\n function onTagEdit(e) {}\n\n function onInvalidTag(e) {}\n\n function onTagClick(e) {}\n\n function onTagifyFocusBlur(e) {}\n\n function onDropdownSelect(e) {}\n }\n }", "static uposTags() {\n // return [ \"ADJ\", \"ADP\", \"ADV\", \"AUX\", \"CONJ\", \"DET\", \"INTJ\", \"NOUN\", \"NUM\", \"PART\", \"PRON\", \"PROPN\", \"PUNCT\", \"SCONJ\", \"SYM\", \"VERB\", \"X\" ]\n return [\n {\n \"value\": \"ADJ\",\n \"label\": \"Adjective\"\n },\n {\n \"value\": \"ADP\",\n \"label\": \"Adposition\"\n },\n {\n \"value\": \"ADV\",\n \"label\": \"Adverb\"\n },\n {\n \"value\": \"AUX\",\n \"label\": \"Auxiliary Verb\"\n },\n {\n \"value\": \"CCONJ\",\n \"label\": \"Coordinating Conjunction\"\n },\n {\n \"value\": \"DET\",\n \"label\": \"Determiner\"\n },\n {\n \"value\": \"INTJ\",\n \"label\": \"Interjection\"\n },\n {\n \"value\": \"NOUN\",\n \"label\": \"Noun\"\n },\n {\n \"value\": \"NUM\",\n \"label\": \"Numeral\"\n },\n {\n \"value\": \"PART\",\n \"label\": \"Particle\"\n },\n {\n \"value\": \"PRON\",\n \"label\": \"Pronoun\"\n },\n {\n \"value\": \"PROPN\",\n \"label\": \"Proper Noun\"\n },\n {\n \"value\": \"PUNCT\",\n \"label\": \"Punctuation\"\n },\n {\n \"value\": \"SCONJ\",\n \"label\": \"Subordinating Conjunction\"\n },\n {\n \"value\": \"SYM\",\n \"label\": \"Symbol\"\n },\n {\n \"value\": \"VERB\",\n \"label\": \"Verb\"\n },\n {\n \"value\": \"X\",\n \"label\": \"Other\"\n }\n ]\n }" ]
[ "0.7387906", "0.7251404", "0.7153994", "0.7099827", "0.70873046", "0.70794547", "0.7054802", "0.70471495", "0.69335383", "0.6803474", "0.67968065", "0.67637855", "0.6748811", "0.6738825", "0.66982925", "0.66908187", "0.6687641", "0.66764146", "0.66650647", "0.66456705", "0.66225743", "0.66104853", "0.6569716", "0.6564542", "0.656203", "0.65459144", "0.65375847", "0.6535888", "0.65312177", "0.65312177", "0.65312177", "0.65312177", "0.65312177", "0.6524236", "0.65188843", "0.651632", "0.65110755", "0.6509546", "0.6501176", "0.64804846", "0.64804846", "0.64804846", "0.64804846", "0.6474239", "0.6474239", "0.6474239", "0.64725673", "0.6472419", "0.64686507", "0.646701", "0.64645517", "0.6417628", "0.64152884", "0.63976264", "0.6390741", "0.6382974", "0.63704056", "0.63321835", "0.6332087", "0.6328416", "0.63272595", "0.63124865", "0.6301601", "0.62943435", "0.6292878", "0.6280598", "0.6277439", "0.6274224", "0.6267075", "0.6261293", "0.6260873", "0.6259294", "0.6247404", "0.6239013", "0.623405", "0.6232702", "0.62314963", "0.6229217", "0.6226176", "0.62236387", "0.6222326", "0.62155396", "0.6211677", "0.6205951", "0.6205065", "0.61939937", "0.6182204", "0.6173755", "0.6161201", "0.6154965", "0.6151417", "0.6145424", "0.61426044", "0.6140905", "0.61400056", "0.6136832", "0.61349434", "0.6134542", "0.6126714", "0.61247534", "0.61109334" ]
0.0
-1
inner working of this function
function gameFunction() { if (document.querySelector('input:checked') === null) { alert('Please select one of the three options.'); return; } const userChoice = document.querySelector('input:checked').value; const computerChoice = getComputerThrow(); const userWon = rockPaperScissors(userChoice, computerChoice); if (userWon === 'user') { wins++; liveResults.textContent = 'You won!'; totalWins.textContent = `Your total wins are ${wins}`; } else if (userWon === 'computer') { losses++; liveResults.textContent = 'You lost!'; totalLosses.textContent = `Your total losses are ${losses}`; } else if (userWon === 'draw') { draws++; liveResults.textContent = 'A draw!'; totalDraws.textContent = `Your total draws are ${draws}`; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "static private internal function m121() {}", "function _____SHARED_functions_____(){}", "static private protected internal function m118() {}", "transient final protected internal function m174() {}", "transient final private protected internal function m167() {}", "transient final private internal function m170() {}", "function fn() {\n\t\t }", "transient private protected public internal function m181() {}", "function wa(){}", "__previnit(){}", "function comportement (){\n\t }", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "static private protected public internal function m117() {}", "function fm(){}", "obtain(){}", "apply () {}", "static transient private protected internal function m55() {}", "function Scdr() {\r\n}", "function miFuncion (){}", "transient final private protected public internal function m166() {}", "static protected internal function m125() {}", "static transient final private internal function m43() {}", "function sb(){this.pf=[]}", "static final private internal function m106() {}", "function ea(){}", "transient private public function m183() {}", "function redactInfo (obj) {\n \n}// CODE HERE", "static transient final protected internal function m47() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function updateroster() {\n\n}", "function oi(){}", "function __func(){}", "function TMP(){return;}", "function TMP(){return;}", "_firstRendered() { }", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "function TMP() {\n return;\n }", "static transient private internal function m58() {}", "function priv () {\n\t\t\t\n\t\t}", "static final private protected internal function m103() {}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function w(){this.a={}}", "function accessesingData1() {\n\n}", "function accessesingData1() {\n\n}", "work() {}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function z(){r.call(this)}", "rolledBack() {}", "static transient private protected public internal function m54() {}", "function reflowContent() {\n\t\t\t}", "function walker() {\n\n}", "_reflow() {\n this._init();\n }", "static transient final private protected internal function m40() {}", "function kp() {\n $log.debug(\"TODO\");\n }", "calcExtraParams () {}", "static final private protected public internal function m102() {}", "process(){\n return null;\n }", "function iehack() {\r\n\trecalc();\r\n}", "__init3() {this._numProcessing = 0;}", "__init3() {this._numProcessing = 0;}", "__init3() {this._numProcessing = 0;}", "_calculateBounds() {\n // FILL IN//\n }", "function Ha(){}", "function getAndProcessData() { \n\t\tchooseFileSource();\n\t}", "function da(){}", "function da(){}", "function da(){}", "static private public function m119() {}", "updateSelfData(ro) {}", "static transient final protected public internal function m46() {}", "function run() {}", "_update() {\n }", "function tempConvert(){\n \n}", "transient final private public function m168() {}", "function _construct()\n\t\t{;\n\t\t}" ]
[ "0.6540367", "0.62368804", "0.6236711", "0.62117434", "0.616918", "0.59639865", "0.59015316", "0.5873283", "0.58373016", "0.58023936", "0.56132144", "0.5558817", "0.55560195", "0.5533693", "0.5489347", "0.5478784", "0.5451235", "0.5449582", "0.5449582", "0.5433544", "0.5412535", "0.53880405", "0.53060013", "0.5304768", "0.5295457", "0.52489674", "0.52260065", "0.5224448", "0.5222419", "0.5216017", "0.52127355", "0.52007186", "0.51866853", "0.5178015", "0.5176451", "0.51655954", "0.51655954", "0.51655954", "0.5141975", "0.51223004", "0.5104213", "0.5102851", "0.5102851", "0.5092249", "0.5086475", "0.5086475", "0.5086475", "0.50862616", "0.50615185", "0.505897", "0.50530714", "0.5042927", "0.5042927", "0.5042927", "0.5042927", "0.5042927", "0.5042927", "0.5042927", "0.5042927", "0.5042927", "0.5042927", "0.5042927", "0.5042927", "0.5042927", "0.5040092", "0.5018057", "0.5018057", "0.50148535", "0.5013769", "0.5013769", "0.5013769", "0.5013769", "0.501284", "0.500637", "0.5005195", "0.50040966", "0.4986086", "0.49707428", "0.49660188", "0.4965326", "0.49614257", "0.49456495", "0.49359477", "0.4929525", "0.49285796", "0.49285796", "0.49285796", "0.49234262", "0.49230912", "0.4922385", "0.49190918", "0.49190918", "0.49190918", "0.49065", "0.4887694", "0.4884501", "0.48791072", "0.48727113", "0.4871846", "0.4865411", "0.48623958" ]
0.0
-1
Battleship Characteristics & Details // (You Could Say This Section Is Full Of Ship) // / Fleet Creation & Ship Properties
function Fleet(name) { this.name = name; // Define Ships In Fleet // this.shipDetails = [{ "name": "carrier", "length": 5 }, { "name": "battleship", "length": 4 }, { "name": "cruiser", "length": 3 }, { "name": "destroyer", "length": 3 }, { "name": "frigate", "length": 2 }]; this.numOfShips = this.shipDetails.length; this.ships = []; this.currentShipSize = 0; this.currentShip = 0; this.initShips = function() { for(var i = 0; i < this.numOfShips; i++) { this.ships[i] = new Ship(this.shipDetails[i].name); this.ships[i].length = this.shipDetails[i].length; } }; // Remove Ship From Gameplay When Sunk // this.removeShip = function(pos) { this.numOfShips--; $(".text").text(coms.sunk(this.name, this.ships[pos].name)); if (this == playerFleet) npc.sizeOfShipSunk = this.ships[pos].length; this.ships.splice(pos, 1); // No More Ships To Hit - Game Over :( // if (this.ships.length == 0) { $(".text").text(coms.lost(this.name)); } return true; }; // Communication Of Result // this.shipHit = function(ship_name) { $(".text").text(coms.hit(this.name)); return true; } // Has A Ship Been Hit? // this.checkIfHit = function(point) { for(var i = 0; i < this.numOfShips; i++) { if (this.ships[i].locationCheck(point)) { this.ships[i].getRidOf(this.ships[i].hitPoints.indexOf(point)); if (this.ships[i].hitPoints == 0)return this.removeShip(i); else return this.shipHit(this.ships[i].name); } } return false; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createShip(index) {\n\n // if the cannoneer isn't in the game, set it to a fixed (near maximum) level\n let cannons = [2, -1, -1, -1], cannoneerLvl = 0, cannoneerInGame = false;\n if(!cannoneerInGame) {\n cannons = [2, 2, 2, 2]\n cannoneerLvl = 3;\n }\n\n let randOrientation = Math.floor(Math.random() * 8);\n\n return {\n num: index,\n myUnitType: 0, \n players: [], \n shipTitle: 'Unnamed Ship',\n resources: [10, 0, 5, 0], // [5,1,1,0], \n workingCrew: 2,\n x: 0, \n y: 0, \n orientation: randOrientation, \n speed: 0,\n health: 100, \n roleStats: [\n { lvl: 0, lvlUp: false }, \n { lvl: 0, lvlUp: false }, \n { lvl: 0, lvlUp: false }, \n { lvl: 0, lvlUp: false, sailLvl: 0, peddleLvl: 0 }, \n { lvl: cannoneerLvl, lvlUp: false } ], \n cannons: cannons,\n errorMessages: [],\n delayedClues: [],\n }\n\n}", "function Battleship(ships) {\n this.openSquares;\n this.shipSquares = [];\n this.hits = [];\n this.misses = [];\n this.horizontalShips = [];\n this.verticalShips = [];\n\n this.shipSquaresKey = []; // will contain the order of how ships are arranged in shipSquares\n\n this.groupedShipSquares = []; // will contain an array of arrays, each representing a ship\n\n // the order will be determined by shipSquaresKey and goes horizontal -> vertical\n this.ships = ships;\n}", "function Fleet(name) {\n\tthis.name = name;\n\t// Define Ships In Fleet //\n\tthis.shipDetails = [{ \"name\": \"carrier\", \"length\": 5 },\n\t\t\t\t\t\t{ \"name\": \"battleship\", \"length\": 4 },\n\t\t\t\t\t\t{ \"name\": \"cruiser\", \"length\": 3 },\n\t\t\t\t\t\t{ \"name\": \"destroyer\", \"length\": 3 },\n\t\t\t\t\t\t{ \"name\": \"frigate\", \"length\": 2 }];\n\tthis.numOfShips = this.shipDetails.length;\n\tthis.ships = [];\n\tthis.currentShipSize = 0;\n\tthis.currentShip = 0;\n\tthis.initShips = function() {\n\t\tfor(var i = 0; i < this.numOfShips; i++) {\n\t\t\tthis.ships[i] = new Ship(this.shipDetails[i].name);\n\t\t\tthis.ships[i].length = this.shipDetails[i].length;\n\t\t}\n\t};\n\t// Remove Ship From Gameplay When Sunk //\n\tthis.removeShip = function(pos) {\n\t\tthis.numOfShips--;\n\t\t$(\".text\").text(coms.sunk(this.name, this.ships[pos].name));\n\t\tif (this == player1Fleet) player2Fleet.sizeOfShipSunk = this.ships[pos].length;\n\t\tthis.ships.splice(pos, 1);\n\t\t// No More Ships To Hit - Game Over :( //\n\t\tif (this.ships.length == 0) {\n\t\t\t$(\".text\").text(coms.lost(this.name));\n\t\t\tsetTimeout(reload, 1500);\n\t\t}\n\t\treturn true;\n\t};\n\t// Communication Of Result //\n\tthis.shipHit = function(ship_name) {\n\t\t$(\".text\").text(coms.hit(this.name));\n\t\treturn true;\n\t}\n\t// Has A Ship Been Hit? //\n\tthis.checkIfHit = function(point) {\n\t\tfor(var i = 0; i < this.numOfShips; i++) {\n\t\t\tif (this.ships[i].locationCheck(point)) {\n\t\t\t\tthis.ships[i].getRidOf(this.ships[i].hitPoints.indexOf(point));\n\t\t\t\tif (this.ships[i].hitPoints == 0)return this.removeShip(i);\n\t\t\t\telse return this.shipHit(this.ships[i].name);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n}", "constructor(name, health){\n this.ship_case = {};\n this.health_point = health;\n this.name = name;\n }", "function setShip(location, ship, orientation, genericFleet, type) {\n\t// Checking Ship For Overlap Player 2 //\n\tif (!(checkOverlap(location, ship.length, orientation, genericFleet))) {\n\t\t// Player 2 Horizontal Ship Placement Details//\n\t\tif (orientation == \"horz\") {\n\t\t\t// Player 2 Horizontal Ship Hit Locations //\n\t\t\tgenericFleet.ships[genericFleet.currentShip].populateHorzHits(location);\n\t\t\t$(\".text\").text(coms.placed(genericFleet.ships[genericFleet.currentShip].name + \" has\"));\n\t\t\t// Adding Player 2 Horizontal Ship To Board //\n\t\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t\t$(\".bottom3 .\" + i).addClass(genericFleet.ships[genericFleet.currentShip].name);\n\t\t\t\t$(\".bottom3 .\" + i).children().removeClass(\"hole\");\n\t\t\t}\n\t\t\t// When Player 2 Horizontal Ship Placed... //\n\t\t\tif (++genericFleet.currentShip == genericFleet.numOfShips) {\n\t\t\t\t// Naval Command Communicates... //\n\t\t\t\t$(\".text\").text(coms.placed(\"ships have\"));\n\t\t\t\t// & Mouse Tracking Turns Off //\n\t\t\t\t$(\".bottom3\").find(\".points\").off(\"mouseenter\");\n\t\t\t\t// Delay For Smoother User Experience //\n\t\t\t\tsetTimeout(hideBoard3, 500);\t\t\t\t\n\t\t\t\tsetTimeout(startGame, 500);\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Player 2 Random Ship Placement //\n\t\t\t\tif (type == \"random\") randomSetupMultiP2(genericFleet);\n\t\t\t\t// Player 2 Self Ship Placement //\n\t\t\t\telse placeShipP2(genericFleet.ships[genericFleet.currentShip], genericFleet);\n\t\t\t}\n\t\t} else {\n\t\t\tvar inc = 0;\n\t\t\t// Player 2 Vertical Ship Hit Locations //\n\t\t\tgenericFleet.ships[genericFleet.currentShip].populateVertHits(location);\n\t\t\t$(\".text\").text(coms.placed(genericFleet.ships[genericFleet.currentShip].name + \" has\"));\n\t\t\t// Adding Player 2 Vertical Ship To Board //\n\t\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t\t$(\".bottom3 .\" + (location + inc)).addClass(genericFleet.ships[genericFleet.currentShip].name);\n\t\t\t\t$(\".bottom3 .\" + (location + inc)).children().removeClass(\"hole\");\n\t\t\t\tinc = inc + 10;\n\t\t\t}\n\t\t\t// When Player 2 Vertical Ship Placed... //\n\t\t\tif (++genericFleet.currentShip == genericFleet.numOfShips) {\n\t\t\t\t// Naval Command Communicates... //\n\t\t\t\t$(\".text\").text(coms.placed(\"ships have\"));\n\t\t\t\t// & Mouse Tracking Turns Off //\n\t\t\t\t$(\".bottom3\").find(\".points\").off(\"mouseenter\");\n\t\t\t\t// Delay For Smoother User Experience //\n\t\t\t\tsetTimeout(hideBoard3, 500);\t\t\t\t\n\t\t\t\tsetTimeout(startGame, 500);\t\t\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Player 2 Random Ship Placement //\n\t\t\t\tif (type == \"random\") randomSetupMultiP2(genericFleet);\n\t\t\t\t// Player 2 Self Ship Placement //\n\t\t\t\telse placeShipP2(genericFleet.ships[genericFleet.currentShip], genericFleet);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Player 2 Random Ship Placement //\n\t\tif (type == \"random\") randomSetupMultiP2(genericFleet);\n\t\t// Player 2 Self Ship Placement //\n\t\telse $(\".text\").text(coms.error);\n\t}\n }", "function buildShips()\n{\n var shipNames =[\n \"Lucitania\", \n \"Queen Anne\", \n \"Black Pearl\",\n \"Magdellena\",\n \"Mary Celeste\",\n \"Edmond Fitzgerald\",\n \"The Consitution\"];\n var flags = [\n \"French\", \n \"British\",\n \"Jolly Rodger\",\n \"US\"];\n var cannons = [1, 5, 10, 20, 30, 50]; \n\n cannons = randomGenerator(cannons);\n\n crewNum = randomGenerator(cannons);\n\n return {\n Name: randomGenerator(shipNames),\n Flag: randomGenerator(flags),\n Size:{\n Cannons: cannons,\n crew: crewNum\n },\n Strength: cannons + crewNum\n } \n}", "constructor() {\n\n // Ship position\n this.position = new Position();\n\n // Ship properties\n this.size = DEFAULT_SHIP_SIZE_FACTOR; // Size constant which is multiplied by the default ship size.\n this.speed = DEFAULT_SHIP_SPEED; // Ship movement constant, which is multiplied by the default ship speed.\n\n // There is a text and answer associated with each ship\n this.data = null; // Contains object with question and answer\n this.textColor = DEFAULT_SHIP_TEXT_COLOR // Question color\n\n // Dead ship is not updated or rendered\n this.dead = true;\n }", "function newShip () {\n\treturn {\n\t\tx: canvas.width / 2,\n\t\ty: canvas.height / 2,\n\t\tr: shipSize / 2,\n\t\ta: 90 / 180 * Math.PI, // radiant\n\t\tblinkNumber: Math.ceil(shipInvisibilityDuration / shipBlinkDuration),\n\t\tblinkTime: Math.ceil(shipBlinkDuration * FPS),\n\t\tcanShoot: true,\n\t\tdead: false,\n\t\texplodeTime: 0,\n\t\tlasers:[],\n\t\trotation: 0,\n\t\tthrusting: false,\n\t\tthrust : {\n\t\t\tx: 0,\n\t\t\ty: 0\n\t\t}\n\t}\n}", "function Ship(draft,crew) {\n this.draft = draft;\n this.crew = crew;\n this.isWorthIt = function() {\n return this.draft - this.crew*1.5 >= 20;\n }\n}", "function canHasAircraft(ship) {\n return ($.inArray(ship.ShipType, [\"CV\", \"CVL\", \"BAS\"]) > -1 && $.inArray(ship.Location, [\"DUE\", \"OFF\", \"SNK\"]) == -1);\n}", "function updateShip(ship){\n let shipHTML = document.getElementById(ship.getID());\n let shipHull = shipHTML.querySelector('#hull');\n shipHull.innerHTML = ship.getHull();\n shipHull.style.background = `linear-gradient(to right, green ${Math.floor((ship.getHull()/ship.getBaseHull())*100)}%, brown 0%)`;\n if(ship.getID() === \"enemy_boss\"){\n let shipFP = document.querySelectorAll(\"#enemy_boss #aux .fire\");\n let f = shipFP.length;\n for (let i = 0; i < f; i++){\n shipFP[i].style.background = `linear-gradient(to right, yellow ${Math.floor((ship.getFirePodHealth()[i]/(ship.getBaseHull() / (ship.getFirePodHealth().length + 1)))*100)}%, brown 0%)`;\n }\n }\n let shipShield = shipHTML.querySelector('#shield');\n shipShield.innerHTML = ship.getShield();\n if (ship.getFaction() === \"player\")\n shipShield.style.background = `linear-gradient(to right, aqua ${isNaN(Math.floor((ship.getShield()/ship.getBaseShield())*100))?0:Math.floor((ship.getShield()/ship.getBaseShield())*100)}%, blue 0%)`;\n else if (ship.getFaction() === \"enemy\")\n shipShield.style.background = `linear-gradient(to right, aqua ${isNaN(Math.floor((ship.getShield()/ship.getBaseShield())*100))?0:Math.floor((ship.getShield()/ship.getBaseShield())*100)}%, red 0%)`;\n}", "function generate_decision_variables(obj, numFleet) {\n // Here we store the contribution to constraints\n // We have one entry for each ship + fleet combination\n var decisionShips = {};\n for (var ship in profileShips) {\n for (var l = 0; l < numFleet; l++) {\n decisionShips[l + \"+\" + profileShips[ship].rosterID] = {};\n }\n }\n\n for (var ship in profileShips) {\n for (var i = 0; i < numFleet; i++) {\n // Ship count for fleet\n decisionShips[i + \"+\" + profileShips[ship].rosterID][i + \"maxShips\"] = 1;\n // Minimum fighter power\n decisionShips[i + \"+\" + profileShips[ship].rosterID][i + \"AP\"] = profileShips[ship].fighter();\n // OASW count\n // TODO: user input for minimum asw\n decisionShips[i + \"+\" + profileShips[ship].rosterID][i + \"OASW\"] = (profileShips[ship].AS >= 70) ? 1 : 0;\n // AACI count\n // TODO: smarter way to ignore BB\n decisionShips[i + \"+\" + profileShips[ship].rosterID][i + \"AACI\"] = (profileShips[ship].AA >= 100 && profileShips[ship].class !== 8) ? 1 : 0;\n // Contribution to objective function\n decisionShips[i + \"+\" + profileShips[ship].rosterID][\"obj\"] = profileShips[ship][obj[i]];\n // Class restrictions\n decisionShips[i + \"+\" + profileShips[ship].rosterID][i + \"Class #\" + profileShips[ship].class] = 1;\n // Non-duplicate ship\n decisionShips[i + \"+\" + profileShips[ship].rosterID][profileShips[ship].yomi] = 1;\n }\n }\n\n return decisionShips;\n\n}", "function Fleet(playerGrid, player) {\n\t\tthis.numShips = CONST.AVAILABLE_SHIPS.length;\n\t\tthis.playerGrid = playerGrid;\n\t\tthis.player = player;\n\t\tthis.fleetRoster = [];\n\t\tthis.populate();\n\t}", "function Ship (battleid, playerid, xpos, ypos, stype, orientation, afloat) {\n\tthis.battleid = battleid;\n\tthis.playerid = playerid;\n\tthis.xpos = xpos;\n\tthis.ypos = ypos;\n\tthis.stype = stype;\n\tthis.orientation = orientation;\n\tthis.afloat = afloat;\n}", "function getFootballerFields() {\n return {\n name: 'f.Name',\n nationality: 'f.Nationality',\n national_position: 'f.National_Position',\n national_kit: 'f.National_Kit',\n club: 'f.Club',\n club_position: 'f.Club_Position',\n club_kit: 'f.Club_Kit',\n Club_joining: 'f.Club_Joining',\n contract_expiry: 'f.Contract_Expiry',\n rating: 'f.Rating',\n height: 'f.Height',\n weight: 'f.Weight',\n preffered_foot: 'f.Preffered_Foot',\n birth_date: 'f.Birth_Date',\n age: 'f.Age',\n preffered_position: 'f.Preffered_Position',\n work_rate: 'f.Work_Rate',\n weak_foot: 'f.Weak_foot',\n skill_moves: 'f.Skill_Moves',\n ball_control: 'f.Ball_Control',\n dribbling: 'f.Dribbling',\n marking: 'f.Marking',\n sliding_Tackle: 'f.Sliding_Tackle',\n standing_Tackle: 'f.Standing_Tackle',\n aggression: 'f.Aggression',\n reactions: 'f.Reactions',\n attacking_position: 'f.Attacking_Position',\n interceptions: 'f.Interceptions',\n vision: 'f.Vision',\n composure: 'f.Composure',\n crossing: 'f.Crossing',\n short_pass: 'f.Short_Pass',\n long_pass: 'f.Long_Pass',\n acceleration: 'f.Acceleration',\n speed: 'f.Speed',\n stamina: 'f.Stamina',\n strength: 'f.Strength',\n balance: 'f.Balance',\n agility: 'f.Agility',\n jumping: 'f.Jumping',\n heading: 'f.Heading',\n shot_power: 'f.Shot_Power',\n finishing: 'f.Finishing',\n long_shots: 'f.Long_Shots',\n curve: 'f.Curve',\n freekick_accuracy: 'f.Freekick_Accuracy',\n penalties: 'f.Penalties',\n volleys: 'f.Volleys',\n gk_positioning: 'f.GK_Positioning',\n gk_diving: 'f.GK_Diving',\n gk_kicking: 'f.GK_Kicking',\n gk_handling: 'f.GK_Handling',\n gk_reflexes: 'f.GK_Reflexes',\n };\n}", "function EnergySystem(ship){\n console.log();\n this.ship = ship||null;\n this.energy = 100;\n this.gain = 2;\n}", "function shippingDetails() {\n let currentCustomer = vm.customers[vm.currentIndices.customer];\n let currentOrder = currentCustomer.orders[vm.currentIndices.order];\n let currentShipment = currentOrder.shipments[vm.currentIndices.shipment];\n if (currentShipment !== undefined) {\n let shipmentInfoElement = document.getElementById(\"SHIPPING_DETAILS\").children;\n shipmentInfoElement[1].innerText = currentShipment.tracking_number;\n shipmentInfoElement[4].innerText = currentShipment.carrier;\n shipmentInfoElement[7].innerText = currentShipment.delivery_state;\n shipmentInfoElement[10].innerText = currentShipment.late_penalties;\n shipmentInfoElement[15].innerText = currentShipment.current_location.latitude;\n shipmentInfoElement[18].innerText = currentShipment.current_location.longitude;\n shipmentInfoElement[23].innerText = currentShipment.destination.latitude;\n shipmentInfoElement[26].innerText = currentShipment.destination.longitude;\n shipmentInfoElement[29].innerText = currentShipment.ship_date;\n shipmentInfoElement[32].innerText = currentShipment.expected_date;\n shipmentInfoElement[35].innerText = currentShipment.delivery_state;\n }\n }", "function battleShips(){\n var ship1 = buildShips();\n var ship2 = buildShips();\n ship1.flags = \"Jolly Rodger\";\n \n \n\n if (ship1.Strength < ship2.Strength){\n console.log(ship1.Flag + \"won\");\n }\n else if(ship2.Strength < ship1.Strength){\n console.log(ship1.Flag + \"won\");\n }\n else if (ship1.Strength === ship2.Strength){\n console.log(\"Draw Matey\");\n }\n \n}", "function shipBoom(data){\n var out = {};\n out[data.id] = {\n status: 'boom',\n stage: data.stage\n };\n io.sockets.emit('shipstat', out);\n }", "function addShip(shipState, shipType, row, col) {\r\n //Update the ship's state when it is added to a board.\r\n shipState[shipType].counter = 0;\r\n shipState[shipType].coordinate = [row, col];\r\n\r\n //These changes in stylings and state only apply during the setup phase.\r\n if (state.phase === 'setup') {\r\n //Based on the other code, the playerShipState.type.orientation should already be the same as state.orientation, but this is just a safety check.\r\n shipState[shipType].orientation = state.orientation;\r\n state.shipPrimed = null;\r\n state.orientation = null;\r\n //\r\n portEl.querySelector(`.${shipType}`).classList.add('unavailable');\r\n\r\n //\r\n //During the set up stage, we want the image of the ship to show up when we place it on the square.\r\n //This will, based on the coordinate of the ship's coordinate, place an image of the ship spanning the length in the grid that the ship would take up.\r\n addShipImage(shipState, shipType);\r\n\r\n }\r\n loopEachShipSquare(shipState, shipType, function(element) {\r\n element.classList.add(shipType, 'active');\r\n })\r\n}", "function Ship(name){\n\tthis.name = name;\n\tthis.length = 0;\n\tthis.hitPoints = [];\n\t// Hits for Horizontal Ships //\n\tthis.populateHorzHits = function(start) {\n\t\tfor (var i = 0; i < this.length; i++, start++) {\n\t\t\tthis.hitPoints[i] = start;\n\t\t}\n\t};\n\t// Hits for Vertical Ships //\n\tthis.populateVertHits = function(start) {\n\t\tfor (var i = 0; i < this.length; i++, start += 10) {\n\t\t\tthis.hitPoints[i] = start;\n\t\t}\n\t};\n\t// Is There A Ship In that Location? //\n\tthis.locationCheck = function(loc) {\n\t\tfor (var i = 0; i < this.length; i++) {\n\t\t\tif (this.hitPoints[i] == loc) return true;\t\t\n\t\t}\n\t\treturn false;\n\t};\n\t// Remove Those Hits From Total Count //\n\tthis.getRidOf = function(pos) {\n\t\tthis.hitPoints.splice(pos, 1);\n\t}\n}", "function Ship(name){\n\tthis.name = name;\n\tthis.length = 0;\n\tthis.hitPoints = [];\n\t// Hits for Horizontal Ships //\n\tthis.populateHorzHits = function(start) {\n\t\tfor (var i = 0; i < this.length; i++, start++) {\n\t\t\tthis.hitPoints[i] = start;\n\t\t}\n\t};\n\t// Hits for Vertical Ships //\n\tthis.populateVertHits = function(start) {\n\t\tfor (var i = 0; i < this.length; i++, start += 10) {\n\t\t\tthis.hitPoints[i] = start;\n\t\t}\n\t};\n\t// Is There A Ship In that Location? //\n\tthis.locationCheck = function(loc) {\n\t\tfor (var i = 0; i < this.length; i++) {\n\t\t\tif (this.hitPoints[i] == loc) return true;\t\t\n\t\t}\n\t\treturn false;\n\t};\n\t// Remove Those Hits From Total Count //\n\tthis.getRidOf = function(pos) {\n\t\tthis.hitPoints.splice(pos, 1);\n\t}\n}", "function setShipMulti(location, ship, orientation, genericFleet, type) {\n\t// Checking Ship For Overlap Player 1 //\n\tif (!(checkOverlapMulti(location, ship.length, orientation, genericFleet))) {\n\t\t// Player 1 Horizontal Ship Placement Details//\n\t\tif (orientation == \"horz\") {\n\t\t\t// Player 1 Horizontal Ship Hit Locations //\n\t\t\tgenericFleet.ships[genericFleet.currentShip].populateHorzHits(location);\n\t\t\t$(\".text\").text(coms.placed1(genericFleet.ships[genericFleet.currentShip].name + \" has\"));\n\t\t\t// Adding Player 1 Horizontal Ship To Board //\n\t\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t\t$(\".bottom2 .\" + i).addClass(genericFleet.ships[genericFleet.currentShip].name);\n\t\t\t\t$(\".bottom2 .\" + i).children().removeClass(\"hole\");\n\t\t\t}\n\t\t\t// When Player 1 Horizontal Ship Placed... //\n\t\t\tif (++genericFleet.currentShip == genericFleet.numOfShips) {\n\t\t\t\t// Naval Command Communicates... //\n\t\t\t\t$(\".text\").text(coms.placed1(\"ships have\"));\n\t\t\t\t// & Mouse Tracking Turns Off //\n\t\t\t\t$(\".bottom2\").find(\".points\").off(\"mouseenter\");\n\t\t\t\t// Player 2 Option Buttons Generated //\n\t\t\t\t$(\".horz\").addClass(\"player\").addClass(\"hide\").removeClass(\"horz\").text(\"Place My Own\");\t\n\t\t\t\t$(\".vert\").addClass(\"five\").removeClass(\"vert\").text(\"Player 2 Place Ships\");\n\t\t\t\t// Delay For Smoother User Experience //\t\t\t\t\t\t\t\t\n\t\t\t\tsetTimeout(gameSetupMultiP2, 500);\n\t\t\t} else {\n\t\t\t\t// Player 1 Random Ship Placement //\n\t\t\t\tif (type == \"random\") randomSetupMulti(genericFleet);\n\t\t\t\t// Player 1 Self Ship Placement //\n\t\t\t\telse placeShipP1(genericFleet.ships[genericFleet.currentShip], genericFleet);\n\t\t\t}\n\t\t} else {\n\t\t\tvar inc = 0;\n\t\t\t// Player 1 Vertical Ship Hit Locations //\n\t\t\tgenericFleet.ships[genericFleet.currentShip].populateVertHits(location);\n\t\t\t$(\".text\").text(coms.placed1(genericFleet.ships[genericFleet.currentShip].name + \" has\"));\n\t\t\t// Adding Player 1 Vertical Ship To Board //\n\t\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t\t$(\".bottom2 .\" + (location + inc)).addClass(genericFleet.ships[genericFleet.currentShip].name);\n\t\t\t\t$(\".bottom2 .\" + (location + inc)).children().removeClass(\"hole\");\n\t\t\t\tinc = inc + 10;\n\t\t\t}\n\t\t\t// When Player 1 Vertical Ship Placed... //\n\t\t\tif (++genericFleet.currentShip == genericFleet.numOfShips) {\n\t\t\t\t// Naval Command Communicates... //\n\t\t\t\t$(\".text\").text(coms.placed1(\"ships have\"));\n\t\t\t\t// & Mouse Tracking Turns Off //\n\t\t\t\t$(\".bottom2\").find(\".points\").off(\"mouseenter\");\n\t\t\t\t$(\".horz\").addClass(\"player\").addClass(\"hide\").removeClass(\"horz\").text(\"Place My Own\");\t\n\t\t\t\t$(\".vert\").addClass(\"five\").removeClass(\"vert\").text(\"Player 2 Place Ships\");\n\t\t\t\t// Delay For Smoother User Experience //\n\t\t\t\tsetTimeout(gameSetupMultiP2, 500);\n\t\t\t} else {\n\t\t\t\t// Player 1 Random Ship Placement //\n\t\t\t\tif (type == \"random\") randomSetupMulti(genericFleet);\n\t\t\t\t// Player 1 Self Ship Placement //\n\t\t\t\telse placeShipP1(genericFleet.ships[genericFleet.currentShip], genericFleet);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Player 1 Random Ship Placement //\n\t\tif (type == \"random\") randomSetupMulti(genericFleet);\n\t\t// Naval Command Communicates Error //\n\t\telse $(\".text\").text(coms.error);\n\t}\n }", "function boardShip (shipX, shipY, shipLength, shipDirection) {\n\n\tif (shipDirection == 'h') {\n\n\t\tfor (var y = shipY; y < shipY + shipLength; y++) {\n\n\t\t\tboard.tiles[shipX][y] = 1;\n\n\t\t}\n\n\n\t} else {\n\n\t\tfor (var y = shipY; y < shipY + shipLength; y++) {\n\n\t\t\tboard.tiles[y][shipX] = 1;\n\n\t\t}\n\n\t}\n\n\tboard.shipCount++\n\n}", "function fillTable(s) {\n $(`#ship${s}Name`).html($(`#ship${s}`).children(':selected').text());\n // Convert string values to numbers\n shipNums[s] = [\n +shipData[s].cost_in_credits,\n +shipData[s].max_atmosphering_speed,\n +shipData[s].cargo_capacity,\n +shipData[s].passengers\n ];\n // Save raw numbers for comparison\n shipData[s] = shipNums[s];\n // Convert raw numbers to comma-separated values\n shipNums[s] = shipNums[s].map(e => e.toLocaleString());\n // Display formatted values in table\n $(`#ship${s}Cost`).html(shipNums[s][0]);\n $(`#ship${s}Speed`).html(shipNums[s][1]);\n $(`#ship${s}Cargo`).html(shipNums[s][2]);\n $(`#ship${s}Passengers`).html(shipNums[s][3]);\n }", "function Ship() {\n this.shipHeight = 9;\n this.shipWidth = 75;\n this.shipX = (canvas.width - this.shipWidth) / 2;\n this.shipY = canvas.height - this.shipHeight;\n}", "function Ship (id, grid, rooms, crew, doors) {\n\tthis.id = id;\n\t\n\tthis.hull = 40;\t\n\tthis.hullMax = 40;\n\t\n\tthis.grid = grid;\n\tthis.rooms = rooms;\n\t\n\tthis.crew = crew;\n\t\n\tthis.doors = doors;\n\t\n\tthis.evasion = 0;\n\tthis.pilot = 0;\n\tthis.engine = 0;\n}", "function Shipping(){\n this.request = function(zipStart, zipEnd, weight){\n return \"Rs.750\";\n }\n}", "function createSinglePlayerFleet() {\n\t// Player 1 Random Ship Placement //\n\tplayer1Fleet = new Fleet(\"Player 1\");\n\tplayer1Fleet.initShips();\n\trandomSetupMulti(player1Fleet);\n}", "function twcheese_BattleReport()\n\t{\n\t\tthis.attacker;\n\t\tthis.attackerLosses;\n\t\tthis.attackerQuantity;\n\t\tthis.attackerVillage;\n\t\tthis.buildingLevels;\n\t\tthis.defender;\n\t\tthis.defenderLosses;\n\t\tthis.defenderQuantity;\n\t\tthis.defenderVillage;\n\t\tthis.dot;\n\t\tthis.espionageLevel;\n\t\tthis.haul;\n\t\tthis.loyalty;\n\t\tthis.luck;\n\t\tthis.morale;\n\t\tthis.reportID;\n\t\tthis.resources;\n\t\tthis.sent;\n\t\tthis.unitsInTransit;\n\t\tthis.unitsOutside;\n\t}", "function shipmentCreateString(data) {\n var sendingData =\n {\n \"ShipFromAddress\": {\n \"CompanyName\": \"FEEP\",\n \"FirstName\": null,\n \"LastName\": null,\n \"Title\": null,\n \"Address1\": \"10 UIT Way\",\n \"Address2\": null,\n \"City\": \"Beacon Falls\",\n \"State\": \"CT\",\n \"Country\": \"US\",\n \"Zip\": \"06403\",\n \"Province\": null,\n \"AddressCode\": null,\n \"StateCode\": null,\n \"CountryCode\": null,\n \"Phone\": \"203-463-3300\",\n \"ContactID\": null,\n \"ContactType\": 0,\n \"Email\": null,\n \"TaxNumber\": null,\n \"FaxNumber\": null,\n \"Note\": null,\n \"ExtendedAttributes\": null\n },\n \"ShipmentDate\": null,\n \"ExpectedDeliveryDate\": \"2014-03-10T00:00:00\",\n \"InvoiceNumber\": \"\",\n \"ShipmentNumber\": \"232591006\",\n \"ShipmentLines\": [\n {\n \"ItemIdentifier\": {\n \"SupplierSKU\": \"LB-000110\",\n \"PartnerSKU\": null,\n \"ParentSKU\": \"\",\n \"ManufacturerSKU\": null,\n \"ExternalSKU\": null,\n \"ASIN\": null,\n \"UPC\": \"\",\n \"ISBN\": null,\n \"SerialNumber\": null\n },\n \"Price\": 0,\n \"Cost\": 0,\n \"MSRP\": 0,\n \"Description\": \"apparently\",\n \"Discounts\": null,\n \"ShipmentInfos\": [\n {\n \"DateShipped\": null,\n \"CarrierCode\": \"UNSP\",\n \"ClassCode\": null,\n \"TrackingNumber\": null,\n \"ShippingDiscounts\": null,\n \"SellerFullfillmentId\": null,\n \"ShipmentCost\": 156,\n \"ShipmentTaxes\": null,\n \"InsuranceCost\": 0\n }\n ],\n \"Taxes\": null,\n \"WarehouseCode\": null,\n \"ShippingAddress\": null,\n \"IsDropShip\": false,\n \"Quantity\": 24,\n \"LineNumber\": 1,\n \"Weight\": 0,\n \"WeightUOM\": null,\n \"ExtendedAttributes\": []\n },\n {\n \"ItemIdentifier\": {\n \"SupplierSKU\": \"LB-000078\",\n \"PartnerSKU\": null,\n \"ParentSKU\": \"\",\n \"ManufacturerSKU\": null,\n \"ExternalSKU\": null,\n \"ASIN\": null,\n \"UPC\": \"\",\n \"ISBN\": null,\n \"SerialNumber\": null\n },\n \"Price\": 6.5,\n \"Cost\": 0,\n \"MSRP\": 0,\n \"Description\": \"this is required\",\n \"Discounts\": null,\n \"ShipmentInfos\": [\n {\n \"DateShipped\": \"2014-09-30T16:00:00\",\n \"CarrierCode\": \"UNSP\",\n \"ClassCode\": null,\n \"TrackingNumber\": null,\n \"ShippingDiscounts\": null,\n \"SellerFullfillmentId\": null,\n \"ShipmentCost\": 156,\n \"ShipmentTaxes\": null,\n \"InsuranceCost\": 0\n }\n ],\n \"Taxes\": null,\n \"WarehouseCode\": null,\n \"ShippingAddress\": null,\n \"IsDropShip\": null,\n \"Quantity\": 24,\n \"LineNumber\": 1,\n \"Weight\": 0,\n \"WeightUOM\": null,\n \"ExtendedAttributes\": []\n }\n ],\n \"Identifier\": {\n \"SourceKey\": \"OR1410013665-001\",\n \"LogicbrokerKey\": 25,\n \"DestinationKey\": null,\n \"LinkKey\": \"1410013665\"\n },\n \"OrderNumber\": \"OR1410013665-001\",\n \"PartnerPO\": \"OR1410013665-001\",\n \"SupplierPO\": null,\n \"OrderDate\": \"2014-02-12T00:00:00\",\n \"Discounts\": null,\n \"Taxes\": null,\n \"Payments\": null,\n \"PaymentTerm\": null,\n \"ShipmentInfos\": null,\n \"ShipToAddress\": {\n \"CompanyName\": \"Burlington Coat Factory\",\n \"FirstName\": null,\n \"LastName\": null,\n \"Title\": null,\n \"Address1\": \"4287 Route 130 South\",\n \"Address2\": null,\n \"City\": \"Edgewater Park\",\n \"State\": \"NJ\",\n \"Country\": null,\n \"Zip\": \"08010\",\n \"Province\": null,\n \"AddressCode\": null,\n \"StateCode\": null,\n \"CountryCode\": null,\n \"Phone\": null,\n \"ContactID\": null,\n \"ContactType\": 0,\n \"Email\": null,\n \"TaxNumber\": null,\n \"FaxNumber\": null,\n \"Note\": null,\n \"ExtendedAttributes\": null\n },\n \"BillToAddress\": {\n \"CompanyName\": \"Burlington Coat Factory\",\n \"FirstName\": null,\n \"LastName\": null,\n \"Title\": null,\n \"Address1\": \"ATTN: ACCOUNTS PAYABLE\",\n \"Address2\": \"1830 ROUTE 130 N\",\n \"City\": \"BURLINGTON\",\n \"State\": \"NJ\",\n \"Country\": null,\n \"Zip\": \"08016\",\n \"Province\": null,\n \"AddressCode\": \"02\",\n \"StateCode\": null,\n \"CountryCode\": null,\n \"Phone\": null,\n \"ContactID\": null,\n \"ContactType\": 0,\n \"Email\": \"\",\n \"TaxNumber\": null,\n \"FaxNumber\": null,\n \"Note\": null,\n \"ExtendedAttributes\": null\n },\n \"ExtendedAttributes\": null,\n \"TotalAmount\": 624,\n \"Currency\": null,\n \"Status\": null,\n \"HandlingAmount\": 0,\n \"HandlingTaxes\": null,\n \"Note\": null,\n \"WarehouseCode\": null\n }\n return JSON.stringify(sendingData);\n}", "function placeShipP1(ship, fleet) {\n\tvar orientation = \"horz\";\n\t// Player 1 Vertical Ship Button //\n\t$(\".vert\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"vert\";\n\t});\n\t// Player 1 Horizontal Ship Button //\n\t$(\".horz\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"horz\";\n\t});\n\t// Player 1 Ship Tracks Cursor //\n\t$(\".bottom2\").find(\".points\").off(\"mouseenter\").on(\"mouseenter\", function() {\n\t\tvar num = $(this).attr('class').slice(15);\n\t\t// Player 1 Display Ship Orientation //\n\t\tif (orientation == \"horz\") displayShipHorz1(parseInt(num), ship, this, fleet);\n\t\telse displayShipVert1(parseInt(num), ship, this, fleet);\n\t});\n}", "function placeShip() {\r\n for(index of finalShipArray) {\r\n boardObj.message[index].ship = shipType;\r\n }\r\n}", "function extractShippingData(obj) {\n obj = _.isDefined(obj) ? obj : $cart || {};\n\n return {\n fullName : (obj['shipping_firstname'] + ' ' + obj['shipping_lastname']).trim(),\n firstName : obj['shipping_firstname'],\n lastName : obj['shipping_lastname'],\n address : obj['shipping_address'],\n address2 : obj['shipping_address2'],\n city : obj['shipping_city'],\n state : obj['shipping_state'],\n zip : obj['shipping_zip'],\n country : obj['shipping_country'],\n phone : obj['shipping_phone']\n };\n }", "function AdvancedShipping() {\n\tthis.login = function(credentials) { /*..*/ };\n\tthis.setStart = function(start) { /*..*/ };\n\tthis.setDestination = function(destination) { /*..*/ };\n\tthis.calculate = function(weight) { return '$39.50' };\n}", "autoPopulateDealerShip() {\n if (this.dealerOutletOptions && this.serviceHistory.dealerSfId && this.sourceCmp === 'Service History') {\n this.dealerReadonly = true;\n this.valuesObj.dealerOutletName = this.serviceHistory.dealerSfId;\n this.dealerCityId = (this.dealerData.find(item => item.Id === this.serviceHistory.dealerSfId).For_Code__c);\n this.dealerCityData = (this.dealerData.find(item => item.Id === this.serviceHistory.dealerSfId).For_Code__r.Name);\n } else if (this.enquiryData && this.sourceCmp === 'Opportunity' && this.enquiryData.Dealership__c) {\n this.dealerReadonly = true;\n this.valuesObj.dealerOutletName = this.enquiryData.Dealership__c;\n this.dealerCityData = this.enquiryData.Dealership__r.For_Code__r.Name;\n this.dealerCityId = this.enquiryData.Dealership__r.For_Code__c;\n } else if (this.dealerOutletOptions && this.sourceCmp === 'MCP Calculator' && this.mcpdealerid) {\n this.valuesObj.dealerOutletName = this.mcpdealerid;\n this.dealerReadonly = true;\n } else {\n this.valuesObj.dealerOutletName = this.loggedInUserDealerId;\n this.dealerCityId = (this.dealerData.find(item => item.Id === this.loggedInUserDealerId).For_Code__c);\n this.dealerCityData = (this.dealerData.find(item => item.Id === this.loggedInUserDealerId).For_Code__r.Name);\n }\n return true;\n }", "function createAndPlaceShip() {\n\t// only run this function if game object already exists\n\tif (typeof game != 'undefined') {\n\t\t// ships have no size yet, they're all just 1 square! but I left this here for later\n\t\tvar size = parseInt(document.getElementById('shipsize').value);\n\n\t\tif (size < game.rows) {\n\t\t\t// create a new ship, add it to game.ships array\n\t\t\tvar ship = new Ship(size);\n\t\t\tgame.ships.push(ship);\n\t\t\t// run function that generates ship's coordinates and displays it on the game board\n\t\t\tgame.placeRandomShip(ship, 10);\n\t\t\tconsole.log('Number of ships on the board: ' + game.ships.length)\n\t\t\tconsole.log(game.ships);\n\t\t} else {\n\t\t\talert('Invalid ship size. Enter a number from 1 to ' + game.rows);\t\t\n\t\t}\n\t} else {\n\t\talert('Create a grid first!');\n\t}\n}", "function calcShipping()\n{\n\ttry\n\t{\n\t\tif (nlapiGetFieldValue('custbody_mrf_brandcustomer'))\n\t\t{\n\t\t\tvar shipMethodSet = false;\n\t\t\tvar shippingMethod = null;\n\t\t\tvar shippingItemLine = 0;\n\t\t\tvar shippingOfferApplied = false;\n\t\t\tvar uk = false;\n\t\t\tvar euCountry = false;\n\t\t\tvar hardware = false;\n\t\t\tvar livePlants = false;\n\t\t\tvar seed = false;\n\t\t\t\n\t\t\t// Shipping Country\n\t\t\tvar eu = new Array('AT','BE','BG','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','NL','PL','PT','RO','SK','SI','ES','SE');\n\t\t\tvar shipCountry = nlapiGetFieldValue('shipcountry');\n\t\t\t\n\t\t\t// Brand segregation\n\t\t\tswitch(parseInt(nlapiGetFieldValue('department')))\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t\tbrandPrefix = 'MRF';\n\t\t\t\tbreak;\n\t\t\tcase 2: \n\t\t\t\tbrandPrefix = 'DTB';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tbrandPrefix = 'WLM';\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tbrandPrefix = 'JNS';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif (eu.indexOf(shipCountry) >= 0)\n\t\t\t{\n\t\t\t\teuCountry = true;\n\t\t\t}\n\t\t\telse if(shipCountry == 'GB')\n\t\t\t{\n\t\t\t\tuk = true;\n\t\t\t}\n\t\t\t\n\t\t\t// Loop through item list and see what type of items we have\n\t\t\tfor (var i = 1; i <= nlapiGetLineItemCount('item'); i++)\n\t\t\t{\n\t\t\t\tvar categoryType = getCategoryTypeByReportingCategoryInternalId(nlapiGetLineItemValue('item', 'custcol_reportingcategory', i));\n\t\t\t\t\n\t\t\t\tswitch(categoryType)\n\t\t\t\t{\n\t\t\t\tcase 'PLANTS':\n\t\t\t\tcase 'FLOWER BULBS':\n\t\t\t\tcase 'FRUIT':\n\t\t\t\tcase 'ONIONS/GARLIC/SHALLOTS':\n\t\t\t\tcase 'SEED POTATOES':\n\t\t\t\t\tlivePlants = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'SEEDS':\n\t\t\t\t\tseed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'HARDWARE':\n\t\t\t\t\thardware = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Set the most appropriate Shipping Item\n\t\t\tif (uk)\n\t\t\t{\n\t\t\t\tif (seed && !hardware)\n\t\t\t\t{\n\t\t\t\t\tshippingMethod = getShipMethodByItemId(brandPrefix + ' SEED EXPRESS');\n\t\t\t\t\tshipMethodSet = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (livePlants)\n\t\t\t\t{\n\t\t\t\t\tshippingMethod = getShipMethodByItemId(brandPrefix + ' LIVE PLANTS STANDARD');\n\t\t\t\t\tshipMethodSet = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (hardware)\n\t\t\t\t{\n\t\t\t\t\tshippingMethod = getShipMethodByItemId(brandPrefix + ' HEAVY BULKY');\n\t\t\t\t\tshipMethodSet = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (seed && hardware)\n\t\t\t\t{\n\t\t\t\t\tshippingMethod = getShipMethodByItemId(brandPrefix + ' SEED HEAVY BULKY');\n\t\t\t\t\tshipMethodSet = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (livePlants && hardware)\n\t\t\t\t{\n\t\t\t\t\tshippingMethod = getShipMethodByItemId(brandPrefix + ' LIVE PLANTS HEAVY BULKY');\n\t\t\t\t\tshipMethodSet = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (euCountry && seed && !livePlants && !hardware)\n\t\t\t{\n\t\t\t\tshippingMethod = getShipMethodByItemId(brandPrefix + ' EU SEED');\n\t\t\t\tshipMethodSet = true;\n\t\t\t}\n\t\t\t\n\t\t\tif (euCountry && (livePlants || hardware))\n\t\t\t{\n\t\t\t\talert('We regret that we cannot supply non-seed items outside the UK.');\n\t\t\t\t\n\t\t\t\t// 2.0.2 Add alert to Review & Submit page\n\t\t\t\tvar js = \"$(document).ready(function(){alert('We regret that we cannot supply non-seed items outside the UK.');$('#submitter').hide();});\";\n\t\t\t\tnlapiSetFieldValue('custbody_js', nlapiGetFieldValue('custbody_js') + js, false, true);\n\t\t\t}\n\t\t\t\n\t\t\t// Failsafe if countries catered for are not specified in Set Up Web Store\n\t\t\tif (!uk && !euCountry && shipCountry) // 1.0.1\n\t\t\t{\n\t\t\t\talert('We regret that we cannot supply non-EU customers.');\n\t\t\t\t\n\t\t\t\t// 2.0.2 Add alert to Review & Submit page\n\t\t\t\tvar js = \"$(document).ready(function(){alert('We regret that we cannot supply non-EU customers.');$('#submitter').hide();});\";\n\t\t\t\tnlapiSetFieldValue('custbody_js', nlapiGetFieldValue('custbody_js') + js, false, true);\n\t\t\t}\n\n\t\t\t// Check for shipping items in item list\n\t\t\tfor (var line = 1; line <= nlapiGetLineItemCount('item'); line++)\n\t\t\t{\n\t\t\t\tif (nlapiGetLineItemValue('item', 'custcol_isshipping', line) == 'T')\n\t\t\t\t{\n\t\t\t\t\t// 2.0.1 Is this a shipping offer?\n\t\t\t\t\tif (nlapiGetLineItemValue('item', 'custcol_promotionlineadded', line) == 'T')\n\t\t\t\t\t{\n\t\t\t\t\t\tshippingOfferApplied = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (shippingItemLine == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tshippingItemLine = line;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Set calculated shipping method if no shipping offer applied\n\t\t\tif (shipMethodSet && !shippingOfferApplied)\n\t\t\t{\n\t\t\t\tif (shippingMethod.itemType == 'SERVICE')\n\t\t\t\t{\n\t\t\t\t\t// Unset Shipping Item\n\t\t\t\t\tnlapiSetFieldValue('shipmethod', '', true, true);\n\t\t\t\t\t\n\t\t\t\t\t// If no shipping item line, create one\n\t\t\t\t\tif (shippingItemLine == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tnlapiSelectNewLineItem('item');\n\t\t\t\t\t\tnlapiSetCurrentLineItemValue('item', 'item', shippingMethod.id, false, true);\n\t\t\t\t\t\tnlapiCommitLineItem('item');\n\t\t\t\t\t}\n\t\t\t\t\t// If there already is a shipping item line, and it has a different item, change it\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (nlapiGetLineItemValue('item', 'item', shippingItemLine) != shippingMethod.id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnlapiSelectLineItem('item', shippingItemLine);\n\t\t\t\t\t\t\tnlapiSetCurrentLineItemValue('item', 'item', shippingMethod.id, false, true);\n\t\t\t\t\t\t\tnlapiCommitLineItem('item');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (shippingMethod.itemType == 'SHIPPING') // 2.1.0\n\t\t\t\t{\n\t\t\t\t\t// Remove shipping Service Item line\n\t\t\t\t\tif (shippingItemLine > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tnlapiRemoveLineItem('item', shippingItemLine);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Set Shipping Item\n\t\t\t\t\tnlapiSetFieldValue('shipmethod', shippingMethod.id, true, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Remove previously calculated shipping item line if a \n\t\t\t// shipping offer has been applied, or no shipping method set\n\t\t\tif (shippingItemLine > 0 \n\t\t\t\t&& (!shipMethodSet || shippingOfferApplied)) \n\t\t\t{\n\t\t\t\tnlapiRemoveLineItem('item', shippingItemLine);\n\t\t\t}\n\t\t\t\n\t\t\t// 1.2.0 If there is a shipping offer applied, unset Shipping Item\n\t\t\tif (shipMethodSet && \n\t\t\t\t\tshippingOfferApplied && \n\t\t\t\t\tshippingMethod.itemType == 'SHIPPING')\n\t\t\t{\n\t\t\t\tnlapiSetFieldValue('shipmethod', '', true, true);\n\t\t\t}\n\t\t}\n\t}\n\tcatch(e)\n\t{\n\t\terrorHandler('calcShipping', e);\n\t}\n}", "function spaceship(xShip, yShip, dirShip, velShip, healthShip, fuelShip)\n{\n this.xSpaceship = xShip;\n this.ySpaceship = yShip;\n this.dirSpaceship = dirShip;\n this.velSpaceship = velShip;\n this.health = healthShip;\n this.fuel = fuelShip;\n}", "function ShippingHandling(){\n if (OverSize==true) {\n \t if(UPS==true){\n \tvar ship_Cost=Quantity*7.00;\n \t\n }\n else if(UsPostalAir==true){\n \tvar ship_Cost=Quantity*8.50;\n \t\n }\n else if(FedExGround==true){\n\t\t\t\tvar ship_Cost=Quantity*9.25\n\t\t \n\t\t\t\t\n }\n else if(FedExAir==true){\n \t var ship_Cost=Quantity*12.00;\n \t \n }\n\n var a=ship_Cost+5.00;\n }\n else{\n \t if(UPS==true){\n \tvar ship_Cost=Quantity*7.00;\n \t\n }\n else if(UsPostalAir==true){\n \tvar ship_Cost=Quantity*8.50;\n \t\n }\n else if(FedExGround==true){\n\t\t\t\tvar ship_Cost=Quantity*9.25\n\t\t \n\t\t\t\t\n }\n else if(FedExAir==true){\n \t var ship_Cost=Quantity*12.00;\n \t \n }\n var a=ship_Cost;\n }\n \n \n this.ShippingCost=a;\n document.formToyota.shipper.value=ShippingCost;\n \n }", "function checkShipPlacement() {\n if (!displayGrid.querySelector('.ship')) allShipsPlaced = true;\n }", "function Ship() {\r\n this.floats = true;\r\n this.material = \"steel\";\r\n this.whatAmI = function () {\r\n console.log(`I am made of ${this.material}`);\r\n }\r\n}", "function randomSetup(fleet) {\n\tif (fleet.currentShip >= fleet.numOfShips) return;\n\t\n\tvar orien = Math.floor((Math.random() * 10) + 1);\n\tvar length = fleet.ships[fleet.currentShip].length;\n\t\n\tif (orien < 6) {\n\t\tvar shipOffset = 11 - fleet.ships[fleet.currentShip].length; \n\t\tvar horiz = Math.floor((Math.random() * shipOffset) + 1);\n\t\tvar vert = Math.floor(Math.random() * 9);\n\t\tvar randNum = parseInt(String(vert) + String(horiz));\n\t\tif (fleet == npcFleet) checkOverlap(randNum, length, \"horz\", fleet);\n\t\telse setShip(randNum, fleet.ships[fleet.currentShip], \"horz\", fleet, \"random\");\n\t} else {\n\t\tvar shipOffset = 110 - (fleet.ships[fleet.currentShip].length * 10);\n\t\tvar randNum = Math.floor((Math.random() * shipOffset) + 1);\n\t\n\t\tif (fleet == npcFleet) checkOverlap(randNum, length, \"vert\", fleet); \n\t\telse setShip(randNum, fleet.ships[fleet.currentShip], \"vert\", fleet, \"random\");\n\t}\n}", "constructor(ship, name, shotRate, missilesPerShot, missileDamage, missileLife, missileSpeed, accuracy, lateral, \n scale = 1.0, color = 0xffff44, spread = 90.0){\n this.ship = ship;\n this.name = name;\n this.shotRate = shotRate;\n this.missilesPerShot = missilesPerShot;\n this.missileDamage = missileDamage;\n this.missileLife = missileLife;\n this.missileSpeed = missileSpeed;\n this.accuracy = accuracy;\n this.lateral = lateral;\n this.scale = scale;\n this.color = color;\n this.spread = spread;\n\n this.lastFired = new Date();\n }", "function displayShipHorz1(location, ship, point, fleet) {\n\tvar endPoint = location + ship.length - 2;\n\t// Ship Turned Horizontal Player 1 //\n\tif (!(endPoint % 10 >= 0 && endPoint % 10 < ship.length - 1)) {\n\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t$(\".bottom2 .\" + i).addClass(\"highlight\");\n\t\t}\n\t\t// Place Horizontal Ship On Board Player 1 //\n\t\t$(point).off(\"click\").on(\"click\", function() {\n\t\t\tsetShipMulti(location, ship, \"horz\", fleet, \"player\");\n\t\t});\n\t}\n\t// Placed Horizontal Ship No Longer Tracks Cursor Player 1 //\n\t$(point).off(\"mouseleave\").on(\"mouseleave\", function() {\n\t\tremoveShipHorz1(location, ship.length);\n\t});\n}", "function Fleet(){\n\t\n\t// Top stress vehicle locations, contains\n\t// {Google Maps LatLng object}\n\tvar locations = [];\n\t\n\t// Most stressful streets, contains:\n\t// {\"streetName\", \"camPic\", \"heartDelta\"}\n\tvar mostStressful = [];\n\n\t// Array of fleet g-forces, 50 points of {gLat, gLng}\n\tvar gforce = [];\n\n\t// Stores the vehicle object where the event took place\n\tvar eventVehicle = null;\n\n\t// Array of all 10 vehicles in the fleet\n\tthis.vehicles = [];\n}", "function setupStatusBoard() {\n // Array of all possible ships and associated length\n let ships = [\n ['Carrier', 5],\n ['Battleship', 4],\n ['Destroyer', 3],\n ['Submarine', 3],\n ['Patrol', 2]\n ];\n // Container for holding ships fleet, start game, enemy ships sunk, and refresh/restart\n const ship_div = document.createElement('div');\n ship_div.className = 'ship-div';\n let ship_div_title = document.createElement('h2');\n ship_div_title.innerHTML = 'Place your ships:';\n ship_div.appendChild(ship_div_title);\n // \"Printing\" out the fleet of available ships\n for (let i = 0; i < ships.length; i++) {\n let ship_names = document.createElement('p');\n ship_names.className = ships[i][0];\n ship_names.innerHTML = ships[i][0];\n\n // Change the currently selected ship to the one the player clicked on\n ship_names.addEventListener(\n 'click',\n handler.selectShip(ships[i][0], ships[i][1])\n );\n // Outline the currently selected ship\n ship_names.addEventListener('click', handler.changeSelectShip(), false);\n ship_div.appendChild(ship_names);\n }\n // Add rotate button\n const ship_rotate_button = document.createElement('button');\n ship_rotate_button.className = 'ship-rotate';\n ship_rotate_button.innerHTML = 'Rotate';\n ship_rotate_button.addEventListener('click', handler.changeDirection());\n ship_div.appendChild(ship_rotate_button);\n\n return ship_div;\n}", "function updateShipping(shipping, free) {\n \n // retrieve the subtotal text and strip the $ sign from it. \n let subTotal = $('#subtotal').text().split('$')[1];\n let shippingCost = 0;\n \n // call the getFrames function to retrieve the frames value. \n let frames = getFrames();\n \n // if the free amount specified is less than the subtotal, set the shipping cost to 0. \n if(Number(free.amount) <= Number(subTotal)) {\n shippingCost = 0;\n \n // if the frames value returned is 0, get shipping rules for 'none'.\n } else if(frames == 0){\n shippingCost = shipping.rules.none;\n \n // if the frames value is over 10, get shipping rule for 'over10'.\n } else if(frames >= 10){\n shippingCost = shipping.rules.over10;\n \n // the frames rule will be under 10. \n } else {\n shippingCost = shipping.rules.under10;\n }\n \n //update the shipping cost on the form and update the grand total. \n $('#shipcost').text('$'+shippingCost);\n setGrandTotal(subTotal);\n }", "function displayShipVert1(location, ship, point, fleet) {\n\tvar endPoint = (ship.length * 10) - 10;\n\tvar inc = 0; \n\t// Ship Turned Vertical Player 1 //\n\tif (location + endPoint <= 100) {\n\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t$(\".bottom2 .\" + (location + inc)).addClass(\"highlight\");\n\t\t\tinc = inc + 10;\n\t\t}\n\t\t// Place Vertical Ship On Board Player 1 //\n\t\t$(point).off(\"click\").on(\"click\", function() {\n\t\t\tsetShipMulti(location, ship, \"vert\", fleet, \"player\");\n\t\t});\n\t}\n\t// Placed Vertical Ship No Longer Tracks Cursor Player 1 //\n\t$(point).off(\"mouseleave\").on(\"mouseleave\", function() {\n\t\tremoveShipVert1(location, ship.length);\n\t});\n}", "function getShippingLabel () {\n\n\t}", "placeShip(ship,position){\n\n // if the ship is horizontal\n if (ship.vertical == false){\n for( let i = 0; i < ship.length; i++){\n this.grid[parseInt(position.charAt(0))][parseInt(position.charAt(1))+i] = ship.name+(i+1)\n } \n }\n else{\n // if ship is vertical\n for( let i = 0; i < ship.length; i++){\n this.grid[parseInt(position.charAt(0))+i][parseInt(position.charAt(1))] = ship.name+(i+1)\n }\n \n }\n // adds ship to the shipsPlaced array\n this.shipsPlaced.push(ship) \n this.message = 'Place all your ships and then press ready'\n }", "function drawTableStarships(starship){\n\t\tinfoStarships = $('#tableContent').html();\n\t\tinfoStarships += \"<tr>\"+\n\t\t\t\"<td><img src='/img/starships/\"+ IgnoreSpecialCharactersFromString(starship.name)+ \".png' class='charactersIMG center-block'</td>\"+\n\t\t\t\"<td><b>Name: </b>\"+ starship.name+\"</td>\"+\n\t\t\t\"<td><b>Model: </b>\"+ starship.model+\"</td>\"+\n\t\t\t\"<td><b>Manufacturer: </b>\"+ starship.manufacturer+\" Years</td>\"+\n\t\t\t\"<td><b>Passengers: </b>\"+ starship.passengers+\"</td>\"+\n\t\t\t\"<td><b>Crew: </b>\"+ starship.crew+\"</td>\"+\n\t\t\t\"<td><b>Speed: </b>\"+ starship.max_atmosphering_speed+\" Atm.</td>\"+\n\t\t\t\"<td><b>Cost: </b>\"+ starship.cost_in_credits+\" Galactic credits</td>\"+\n\t\t\t\"<td><b>Length: </b>\"+ starship.length+\" Meters</td>\"+\n\t\t\t\"<td><b>Pilots: </b>\"+drawModal(starship.pilots, starship.name+\"PilotsStarships\", 'people')+\"</td>\"+\n\t\t\t\"<td><b>Films: </b>\"+drawModal(starship.films, starship.name+\"FilmsStarships\", 'films')+\"</td>\"+\n\t\t\t\"</tr>\";\n\n\t\t$table.html(infoStarships);\n\t}", "function Ship_nav(){\n\n var Ship_Traits = document.querySelector(\"#ship_traits\");\n var Ship_Description = document.querySelector(\"#ship_description\");\n var Ship_Attributes = document.querySelector(\"#ship_attributes\");\n var Ship_Fitting = document.querySelector(\"#ship_fitting\");\n var Ship_Requirements = document.querySelector(\"#ship_requirements\");\n var Ship_Mastery = document.querySelector(\"#ship_mastery\");\n var Ship_Variations = document.querySelector(\"#ship_variations\");\n var Ship_Industry = document.querySelector(\"#ship_industry\");\n var Ship_Skins = document.querySelector(\"#ship_skins\");\n var Traits = document.querySelector(\"#traits\");\n var Description = document.querySelector(\"#description\");\n var Attributes = document.querySelector(\"#attributes\");\n var Fitting = document.querySelector(\"#fitting\");\n var Requirements = document.querySelector(\"#requirements\");\n var Mastery = document.querySelector(\"#mastery\");\n var Variations = document.querySelector(\"#variations\");\n var Industry = document.querySelector(\"#industry\");\n var Skins = document.querySelector(\"#skins\");\n\n Traits.style.display = \"block\";\n Description.style.display = \"none\";\n Attributes.style.display = \"none\";\n Fitting.style.display = \"none\";\n Requirements.style.display = \"none\";\n Mastery.style.display = \"none\";\n Variations.style.display = \"none\";\n Industry.style.display = \"none\";\n Skins.style.display = \"none\";\n\n Ship_Traits.addEventListener(\"click\", function(){\n Traits.style.display = \"block\";\n Description.style.display = \"none\";\n Attributes.style.display = \"none\";\n Fitting.style.display = \"none\";\n Requirements.style.display = \"none\";\n Mastery.style.display = \"none\";\n Variations.style.display = \"none\";\n Industry.style.display = \"none\";\n Skins.style.display = \"none\";\n });\n Ship_Description.addEventListener(\"click\", function(){\n Traits.style.display = \"none\";\n Description.style.display = \"block\";\n Attributes.style.display = \"none\";\n Fitting.style.display = \"none\";\n Requirements.style.display = \"none\";\n Mastery.style.display = \"none\";\n Variations.style.display = \"none\";\n Industry.style.display = \"none\";\n Skins.style.display = \"none\";\n });\n Ship_Attributes.addEventListener(\"click\", function(){\n Traits.style.display = \"none\";\n Description.style.display = \"none\";\n Attributes.style.display = \"grid\";\n Fitting.style.display = \"none\";\n Requirements.style.display = \"none\";\n Mastery.style.display = \"none\";\n Variations.style.display = \"none\";\n Industry.style.display = \"none\";\n Skins.style.display = \"none\";\n });\n Ship_Fitting.addEventListener(\"click\", function(){\n Traits.style.display = \"none\";\n Description.style.display = \"none\";\n Attributes.style.display = \"none\";\n Fitting.style.display = \"block\";\n Requirements.style.display = \"none\";\n Mastery.style.display = \"none\";\n Variations.style.display = \"none\";\n Industry.style.display = \"none\";\n Skins.style.display = \"none\";\n });\n Ship_Requirements.addEventListener(\"click\", function(){\n Traits.style.display = \"none\";\n Description.style.display = \"none\";\n Attributes.style.display = \"none\";\n Fitting.style.display = \"none\";\n Requirements.style.display = \"block\";\n Mastery.style.display = \"none\";\n Variations.style.display = \"none\";\n Industry.style.display = \"none\";\n Skins.style.display = \"none\";\n });\n Ship_Mastery.addEventListener(\"click\", function(){\n Traits.style.display = \"none\";\n Description.style.display = \"none\";\n Attributes.style.display = \"none\";\n Fitting.style.display = \"none\";\n Requirements.style.display = \"none\";\n Mastery.style.display = \"block\";\n Variations.style.display = \"none\";\n Industry.style.display = \"none\";\n Skins.style.display = \"none\";\n });\n Ship_Variations.addEventListener(\"click\", function(){\n Traits.style.display = \"none\";\n Description.style.display = \"none\";\n Attributes.style.display = \"none\";\n Fitting.style.display = \"none\";\n Requirements.style.display = \"none\";\n Mastery.style.display = \"none\";\n Variations.style.display = \"block\";\n Industry.style.display = \"none\";\n Skins.style.display = \"none\";\n });\n Ship_Industry.addEventListener(\"click\", function(){\n Traits.style.display = \"none\";\n Description.style.display = \"none\";\n Attributes.style.display = \"none\";\n Fitting.style.display = \"none\";\n Requirements.style.display = \"none\";\n Mastery.style.display = \"none\";\n Variations.style.display = \"none\";\n Industry.style.display = \"block\";\n Skins.style.display = \"none\";\n });\n Ship_Skins.addEventListener(\"click\", function(){\n Traits.style.display = \"none\";\n Description.style.display = \"none\";\n Attributes.style.display = \"none\";\n Fitting.style.display = \"none\";\n Requirements.style.display = \"none\";\n Mastery.style.display = \"none\";\n Variations.style.display = \"none\";\n Industry.style.display = \"none\";\n Skins.style.display = \"block\";\n });\n // Add active class to the current button (highlight it)\n var header = document.querySelector(\".ship_navbar\");\n var btns = header.getElementsByClassName(\"ship_tab\");\n for (var i = 0; i < btns.length; i++) \n {\n btns[i].addEventListener(\"click\", function() {\n var current = document.getElementsByClassName(\"active\");\n current[0].className = current[0].className.replace(\" active\", \"\");\n this.className += \" active\";\n });\n }\n }", "function Ship(parent, type, shipPieces, isPlaced, isSunk) {\n // Create basic variables\n this.parent = parent; \t\t\n this.type = type;\t\t\t\n this.isPlaced = isPlaced;\t\n this.isSunk = isSunk; \n this.id = \"g_\" + this.type;\t\n\n // Create the variables that will determine the location\n this.shipPieces = shipPieces;\n\n // Create the object\n this.object = new window[type](this);\t// Carrier, Cruiser, Battleship, Destroyer, Submarine\n this.g = this.object.g;\t\t\t // a shortcut to the actual svg g object\n this.setAtt(\"id\", this.id);\t\t\t\t\n\n document.getElementsByTagName('svg')[0].appendChild(this.g);\n\n // return this piece object\n return this;\n}", "function placeShipP2(ship, fleet) {\n\tvar orientation = \"horz\";\n\t// Player 2 Vertical Ship Button //\n\t$(\".vert\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"vert\";\n\t});\n\t// Player 2 Horizontal Ship Button //\n\t$(\".horz\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"horz\";\n\t});\n\t// Player 2 Ship Tracks Cursor //\n\t$(\".bottom3\").find(\".points\").off(\"mouseenter\").on(\"mouseenter\", function() {\n\t\tvar num = $(this).attr('class').slice(15);\n\t\t// Player 2 Display Ship Orientation //\n\t\tif (orientation == \"horz\") displayShipHorz2(parseInt(num), ship, this, fleet);\n\t\telse displayShipVert2(parseInt(num), ship, this, fleet);\n\t});\n}", "function shipReport(){\n let ships = allShips();\n let firstLastShips = [ships[0], ships[ships.length-1]];\n return firstLastShips;\n}", "function displayShipHorz2(location, ship, point, fleet) {\n\tvar endPoint = location + ship.length - 2;\n\t// Ship Turned Horizontal Player 2 //\n\tif (!(endPoint % 10 >= 0 && endPoint % 10 < ship.length - 1)) {\n\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t$(\".bottom3 .\" + i).addClass(\"highlight\");\n\t\t}\n\t\t// Place Horizontal Ship On Board Player 2 //\n\t\t$(point).off(\"click\").on(\"click\", function() {\n\t\t\tsetShip(location, ship, \"horz\", fleet, \"player\");\n\t\t});\n\t}\n\t// Placed Horizontal Ship No Longer Tracks Cursor Player 2 //\n\t$(point).off(\"mouseleave\").on(\"mouseleave\", function() {\n\t\tremoveShipHorz2(location, ship.length);\n\t});\n}", "function add_ship(radio_button, ships_global, game_cell, game_board) {\n\n var ships_obj = ships_global[radio_button.dataset.size];\n var ships_arr = ships_obj.ships;\n var last_ship = ships_arr[ships_obj.ships_quantity - 1];\n\n if (last_ship == null || last_ship.is_created() == true) {\n\n if (ships_obj.ships_quantity >= ships_obj.ships_amount) {\n document.querySelector(\".info_span\").innerHTML = \"You have enough ships of this type!\";\n } else {\n\n var ship_id = ships_obj.ships_quantity + 1;\n var new_ship = new Ship(radio_button.dataset.size, ship_id);\n\n new_ship.save_coords(game_cell.dataset.x, game_cell.dataset.y);\n ships_arr.push(new_ship);\n ships_obj.ships_quantity += 1;\n\n game_board[game_cell.dataset.x][game_cell.dataset.y] = false;\n\n game_cell.classList.add(\"ship\");\n game_cell.innerHTML = radio_button.dataset.size;\n\n document.querySelector('.inner_span' + radio_button.dataset.size).innerHTML = ship_id;\n document.querySelector(\".info_span\").innerHTML = 'Added new ship of size ' + radio_button.dataset.size + '!';\n cell_counter += 1;\n }\n } else {\n if (last_ship.check_coords(game_cell.dataset.x, game_cell.dataset.y) == true) {\n\n last_ship.save_coords(game_cell.dataset.x, game_cell.dataset.y);\n last_ship.last_coord_index++;\n game_board[game_cell.dataset.x][game_cell.dataset.y] = false;\n\n game_cell.classList.add(\"ship\");\n game_cell.innerHTML = radio_button.dataset.size;\n cell_counter += 1;\n\n if (cell_counter == 20) {\n document.querySelector('.start_button').removeAttribute('hidden');\n }\n };\n };\n}", "function Ship(x, y) {\n this.x = x;\n this.y = y;\n this.width = 30;\n this.height = 23;\n}", "setClass(shipClass){\n switch(shipClass){\n case \"gunship\": this.setStats(50,30,60,0,30,1); break;\n case \"dreadnaught\": this.setStats(300,60,60,15,5,5); break;\n case \"destroyer\": this.setStats(100,60,60,10,10,3); break;\n case \"railgun\": this.setStats(20,100,80,0,30,8); break;\n case \"fighter\": this.setStats(30,20,50,3,20,2); break;\n }\n this.class=shipClass;\n console.log(`${this.name} converted to ${shipClass}`);\n this.autoname();\n }", "function Ship(length, coordinates, direction) {\r\n this.length = length;\r\n this.coordinates = coordinates;\r\n this.direction = direction;\r\n}", "findShip(row, col) {\n const neighborCell = getNeighbourCells(row, col).find(([row, col]) =>\n this.opponentBoard.cells[row]?.[col]?.classList.contains('ship')\n );\n\n const isHorizontal = neighborCell?.[0] === row;\n const shipStart = Array.from({ length: Math.max(rows, cols) }, (_, index) =>\n isHorizontal ? [row, col - index] : [row - index, col]\n ).find(\n ([row, col]) =>\n this.opponentBoard.cells[row]?.[col]?.classList.contains('ship') !==\n true\n );\n const shipEnd = Array.from({ length: Math.max(rows, cols) }, (_, index) =>\n isHorizontal ? [row, col + index] : [row + index, col]\n ).find(\n ([row, col]) =>\n this.opponentBoard.cells[row]?.[col]?.classList.contains('ship') !==\n true\n );\n\n const horizontalIndex = isHorizontal ? 1 : 0;\n const ship = Array.from(\n { length: shipEnd[horizontalIndex] - shipStart[horizontalIndex] + 1 },\n (_, index) =>\n isHorizontal ? [row, shipStart[1] + index] : [shipStart[0] + index, col]\n );\n const trimmedShip = ship.slice(1, -1);\n\n const largestShip =\n this.fleet.ships.length -\n Array.from(this.fleet.ships)\n .reverse()\n .findIndex((ship) => !ship.disabled);\n\n let canAddBorder = trimmedShip.length === largestShip;\n if (typeof neighborCell === 'undefined')\n canAddBorder ||= getNeighbourCells(row, col).every(\n ([row, col]) =>\n this.opponentBoard.cells[row]?.[col]?.children[0].disabled !== false\n );\n else\n canAddBorder ||=\n this.opponentBoard.cells[shipStart[0]]?.[shipStart[1]]?.children[0]\n .disabled !== false &&\n this.opponentBoard.cells[shipEnd[0]]?.[shipEnd[1]]?.children[0]\n .disabled !== false;\n return ship;\n }", "function generate(ship){\n\n let randomDirection = Math.floor(Math.random() * ship.directions.length); //we generate a number between each ship length\n let current = ship.directions[randomDirection] ; // we grab the ship direction , vertical or horizontal \n \n if (randomDirection === 0){\n directions = 1; // we will render our ship horizontally\n } \n if (randomDirection === 1) {\n directions = 10; // we will render our ship downwards \n } \n \n let randomStart = Math.abs(Math.floor(Math.random() * computerSquares.length - (ship.directions[0].length) * directions)); // we want a point to start, we know that length is 100 and we need to sub the length of 1 grid ( if we get 100 the ship will start offscreen)\n \n\n //make sure that we dont get a taken square\n const isTaken = current.some(index => computerSquares [randomStart + index].classList.contains('taken')); //if true we already have some other ship , or div in there\n const isAtRightEdge = current.some(index => (randomStart + index) % width === width - 1); // if true, we are at the right edge of the board\n const isAtLeftEdge = current.some(index => (randomStart + index) % width === 0);// if true, we are at the left edge of the board\n\n\n if (!isTaken && !isAtRightEdge && !isAtLeftEdge) {\n\n current.forEach(index => computerSquares[randomStart + index].classList.add('taken', ship.name));\n\n }else{\n generate(ship);\n } \n }", "createShips(battleShipSize, destroyerSize) {\r\n for (let i = 0; i < this.battleShips; i++) {\r\n const BattleShip = new shipClass.Ship(battleShipSize);\r\n this.ships.push(BattleShip);\r\n }\r\n for (let i = 0; i < this.destroyers; i++) {\r\n const Destroyer = new shipClass.Ship(destroyerSize);\r\n this.ships.push(Destroyer);\r\n }\r\n }", "function renderShipDetails(shipData) {\n // console.log(shipData);\n let html = '';\n html = `\n <thead>\n <tr>\n <th>Ship Name</th>\n <th>Ship Model</th>\n <th>Class</th>\n <th>Capacity</th>\n <th>Cost in Credits</th>\n </tr>\n <tr>\n <td>${shipData.name}</td>\n <td>${shipData.model}</td>\n <td>${shipData.starship_class}</td>\n <td>${shipData.cargo_capacity}</td>\n <td>${shipData.cost_in_credits}</td>\n </tr>\n </thead>\n `;\n let container = document.getElementById(\"shipList\");\n container.innerHTML = html;\n container.appendChild(buildBackButton(shipData));\n}", "function shipReport() {\n let result = [];\n let ships = allShips();\n \n if (ships.length > 0) {\n let topWestShip = ships[0];\n let topEastShip = topWestShip;\n for (i = 0; i < ships.length; i++) {\n let col = convertColumn(ships[i]);\n let westCol = convertColumn(topWestShip);\n let eastCol = convertColumn(topEastShip);\n if (col < westCol) {\n topWestShip = ships[i];\n }\n if (col > eastCol) {\n topEastShip = ships[i];\n }\n }\n result.push(topWestShip);\n result.push(topEastShip);\n }\n \n return result;\n}", "renderUserShips(shipList) {\n const grid = $(UISelectors.userGrid);\n shipList.forEach((ship) => {\n ship.props.location.forEach((cell) => {\n grid.children[cell - 1].classList.add('ship');\n });\n });\n }", "function cardToAltTextURL(card, ship, fleet) {\t\n\t\t\t\t\n\t\t\t\tvar text = \"\";\n\t\t\t\t\n\t\t\t\tif( card.type == \"ship\" && !card.unique) {\n\t\t\t\t\t// Show class ID for generic ships\n\t\t\t\t\ttext = card.id;\n\t\t\t\t} else text = card.id;\n\t\t\t\t\n\t\t\t\ttext += \",\";\n\t\t\t\tif( card.resource ) {\n\t\t\t\t\tvar resB = cardToAltTextURL(card.resource, ship, fleet);\n\t\t\t\t\ttext += resB.text;\n\t\t\t\t}\n\n\t\t\t\tif( card.captain ) {\n\t\t\t\t\tvar resB = cardToAltTextURL(card.captain, ship, fleet);\n\t\t\t\t\ttext += resB.text;\n\t\t\t\t}\n\n\t\t\t\tif( card.admiral ) {\n\t\t\t\t\tvar resB = cardToAltTextURL(card.admiral, ship, fleet);\n\t\t\t\t\ttext += resB.text;\n\t\t\t\t}\n\n\t\t\t\t$.each( card.upgrades || [], function(i,slot) {\n\t\t\t\t\tif( slot.occupant ) {\n\t\t\t\t\t\tvar resB = cardToAltTextURL(slot.occupant, ship, fleet);\n\t\t\t\t\t\ttext += resB.text;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t$.each( card.upgradeSlots || [], function(i,slot) {\n\t\t\t\t\tif( slot.occupant ) {\n\t\t\t\t\t\tvar resB = cardToAltTextURL(slot.occupant, ship, fleet);\n\t\t\t\t\t\ttext += resB.text;\n\t\t\t\t\t\t// if( countSlotCost )\n\t\t\t\t\t\t// \tcost += resB.cost;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn { cost: 0, text: text };\n\t\t\t}", "function GameBoard(){\n \n this.shipLength= [2,3,3,4],\n this.numships= 4;\n this.shipsSunk= 0;\n this.boardSize= 8;\n this.fire= function(guess) {\n\t\tfor (var i = 0; i < this.numShips; i++) {\n\t\t\tvar ship = this.ships[i];\n\t\t\tvar index = ship.locations.indexOf(guess);\n\n\t\t\tif (index >= 0) {\n\t\t\t\tship.hits[index] = \"hit\";\n\t\t\t\tGame.displayHit(guess);\n\t\t\t\tGame.displayMessage(\"HIT!\");\n\n\t\t\t\tif (this.isSunk(ship)) {\n\t\t\t\t\tGame.displayMessage(\"You sank my battleship!\");\n\t\t\t\t\tthis.shipsSunk++;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tGame.displayMiss(guess);\n\t\tGame.displayMessage(\"You missed.\");\n\t\treturn false;\n\t},\n \n this.isSunk= function(ship) {\n\t\tfor (var i = 0; i < this.shipLength; i++) {\n\t\t\tif (ship.hits[i] !== \"hit\") {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t return true;\n\t},\n \n this.generateShipLocations= function() {\n\t\tvar locations;\n\t\tfor (var i = 0; i < this.numShips; i++) {\n\t\t\tdo {\n\t\t\t\tlocations = this.generateShip();\n\t\t\t} while (this.collision(locations));\n\t\t\tthis.ships[i].locations = locations;\n\t\t}\n\t\tconsole.log(\"Ships array: \");\n\t\tconsole.log(this.ships);\n\t},\n this.generateShip= function() {\n\t\tvar direction = Math.floor(Math.random() * 2);\n\t\tvar row, col;\n\n\t\tif (direction === 1) { // horizontal\n\t\t\trow = Math.floor(Math.random() * this.boardSize);\n\t\t\tcol = Math.floor(Math.random() * (this.boardSize - this.shipLength + 1));\n\t\t} else { // vertical\n\t\t\trow = Math.floor(Math.random() * (this.boardSize - this.shipLength + 1));\n\t\t\tcol = Math.floor(Math.random() * this.boardSize);\n\t\t} \n var newShipLocations= [];\n\t\tfor (var i = 0; i < this.shipLength; i++) {\n\t\t\tif (direction === 1) {\n\t\t\t\tnewShipLocations.push(row + \"\" + (col + i));\n\t\t\t} else {\n\t\t\t\tnewShipLocations.push((row + i) + \"\" + col);\n\t\t\t}\n\t\t}\n\t\treturn newShipLocations;\n\t},\n this.collision= function(locations) {\n\t\tfor (var i = 0; i < this.numShips; i++) {\n\t\t\tvar ship = this.ships[i];\n\t\t\tfor (var j = 0; j < locations.length; j++) {\n\t\t\t\tif (ship.locations.indexOf(locations[j]) >= 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}; \n \n}", "function detail_ship(id){\n id = encodeURIComponent(id);\n var new_div = document.getElementById(\"detail_div\"),\n temp_table,\n new_table,\n new_row,\n new_cell,\n text,\n url,\n response = [];\n\n //Makes request to PHP for Ship Details.\n request = new XMLHttpRequest();\n if (!request) {\n throw 'HttpRequest object not created.';\n }\n url = 'http://web.engr.oregonstate.edu/~olsoeric/CS340/data.php?req=detail_ship&ship=' + id;\n request.open('GET', url, true);\n request.send();\n request.onreadystatechange = function () {\n if (this.readyState === 4) {\n response = JSON.parse(this.responseText); //Parses all requested data.\n\n //Deletes any current data in detail section.\n while(new_div.childNodes.length > 0){\n temp_table = new_div.children[0];\n temp_table.parentNode.removeChild(temp_table);\n }\n\n //Provides Ship Data\n new_table = document.createElement(\"table\");\n new_table.setAttribute(\"class\", \"detail_list\");\n //Headers\n new_row = document.createElement(\"thead\");\n new_cell = document.createElement(\"th\");\n text = document.createTextNode(\"Attribute:\");\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_cell = document.createElement(\"th\");\n text = document.createTextNode(\"Value:\");\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_table.appendChild(new_row);\n //Name\n new_row = document.createElement(\"tr\");\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(\"Name\");\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(response[0][0].name);\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_table.appendChild(new_row);\n //Seats\n new_row = document.createElement(\"tr\");\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(\"Seats\");\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(response[0][0].seats);\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_table.appendChild(new_row);\n //Stages\n new_row = document.createElement(\"tr\");\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(\"Stages\");\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(response[0][0].stages);\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_table.appendChild(new_row);\n //Lander\n new_row = document.createElement(\"tr\");\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(\"Lander\");\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(response[0][0].lander);\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_table.appendChild(new_row);\n //Delete Button\n new_row = document.createElement(\"tr\");\n new_cell = document.createElement(\"td\");\n new_cell.setAttribute(\"align\", \"center\");\n new_cell.setAttribute(\"colspan\", \"2\");\n button = document.createElement(\"Button\");\n button.setAttribute(\"onclick\", \"delete_element('ship', \" + id + \");\");\n text = document.createTextNode(\"Delete\");\n button.appendChild(text);\n new_cell.appendChild(button);\n new_row.appendChild(new_cell);\n new_table.appendChild(new_row);\n new_div.appendChild(new_table);\n\n //List Kerbals Piloted\n new_table = document.createElement(\"table\");\n new_table.setAttribute(\"class\", \"detail_list\");\n //Headers\n new_row = document.createElement(\"thead\");\n new_cell = document.createElement(\"th\");\n text = document.createTextNode(\"Piloted By:\");\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_cell = document.createElement(\"td\");\n new_table.appendChild(new_row);\n //Kerbals\n for (x = 0; x < response[1].length; x++){\n new_row = document.createElement(\"tr\");\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(response[1][x].name);\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_table.appendChild(new_row);\n }\n new_div.appendChild(new_table);\n\n //List Missions Assigned\n new_table = document.createElement(\"table\");\n new_table.setAttribute(\"class\", \"detail_list\");\n //Headers\n new_row = document.createElement(\"thead\");\n new_cell = document.createElement(\"th\");\n text = document.createTextNode(\"Missions Assigned:\");\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_cell = document.createElement(\"td\");\n new_table.appendChild(new_row);\n //Missions\n for (x = 0; x < response[2].length; x++){\n new_row = document.createElement(\"tr\");\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(response[2][x].name);\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_table.appendChild(new_row);\n }\n new_div.appendChild(new_table);\n\n //List Planets Visited\n new_table = document.createElement(\"table\");\n new_table.setAttribute(\"class\", \"detail_list\");\n //Headers\n new_row = document.createElement(\"thead\");\n new_cell = document.createElement(\"th\");\n text = document.createTextNode(\"Planets Visited:\");\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_cell = document.createElement(\"td\");\n new_table.appendChild(new_row);\n //Planets\n for (x = 0; x < response[3].length; x++){\n new_row = document.createElement(\"tr\");\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(response[3][x].name);\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_table.appendChild(new_row);\n }\n new_div.appendChild(new_table);\n\n //List Moons Vistied\n new_table = document.createElement(\"table\");\n new_table.setAttribute(\"class\", \"detail_list\");\n //Headers\n new_row = document.createElement(\"thead\");\n new_cell = document.createElement(\"th\");\n text = document.createTextNode(\"Moons Visited:\");\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_cell = document.createElement(\"td\");\n new_table.appendChild(new_row);\n //Moons\n for (x = 0; x < response[4].length; x++){\n new_row = document.createElement(\"tr\");\n new_cell = document.createElement(\"td\");\n text = document.createTextNode(response[4][x].name);\n new_cell.appendChild(text);\n new_row.appendChild(new_cell);\n new_table.appendChild(new_row);\n }\n new_div.appendChild(new_table);\n }\n }\n}", "positionsShip(ship) {\n const positions = [];\n\n if (ship.orientation === SHIP_ORIENTATION.PORTRAIT) {\n let currentIndex = ship.y;\n\n for (let i = 1; i <= ship.size; i++) {\n positions.push({\n x: ship.x,\n y: currentIndex++,\n shipType: ship.type\n });\n }\n } else {\n let currentIndex = ship.x;\n\n for (let i = 1; i <= ship.size; i++) {\n positions.push({\n x: currentIndex++,\n y: ship.y,\n shipType: ship.type\n });\n }\n }\n\n return positions;\n }", "function ShipsLocal() {\n\n this.go=function(command,data) {\n var c,sy,ps,h,hs,cm,pHistogram,warrantHistogram,mes=\"\";\n var parsed={};\n //alert(command+\"+\"+data);\n \n if ( command==\"cs\" || command==\"as\" ) view2.pMessage.put(\"\");\n \n if ( command==\"cell\" && data ) { // set a square to ship or empty\n parsed = view2.parseGridId(data);\n //alert ( \"cell :\"+parsed.row+\"_\"+parsed.col );\n if (parsed.prefix==\"p\") {\n if ( model.playerBasin.get(parsed.row,parsed.col) != \"s\" ) c=\"s\";\n else c=\"e\";\n model.playerBasin.put(c,parsed.row,parsed.col);\n view2.pBoard.put(c,parsed.row,parsed.col);\n }\n }\n\n if (command==\"rs\") { // remove all ships\n model.playerBasin.clear();\n view2.pBoard.fromBasin(model.playerBasin);\n }\n\n if (command==\"as\") { // automatically draw ships\n sy=new ShipYard(global.getForces());\n ps=sy.buildAll();\n model.playerBasin.clear();\n model.playerBasin.takeShips(ps);\n view2.pBoard.fromBasin(model.playerBasin);\n }\n\n if (command==\"cs\") { // check up and go playing\n h=new Harvester(model.playerBasin);\n h.search();\n model.playerBasin.cleanUp();\n view2.pBoard.fromBasin(model.playerBasin);\n hs=h.yield();\n model.playerShips = new Fleet();\n model.playerShips.take(hs);\n if ( ! model.playerShips.checkMargins() ) {\n view2.pMessage.put(\"Ships must be straight<br /> and not to touch each other. <br />Try new ones\");\n model.playerShips.clear();\n return;\n }\n pHistogram=model.playerShips.makeHistogram();\n warrantHistogram=global.getForces();\n if ( pHistogram.join() != warrantHistogram.join() ) {\n mes=\"The rules require <br />(squares:ships): \";\n mes+=view2.pStat.showClearHistogram(warrantHistogram,\"return\");\n mes+='<br />Your ships do not comply';\n if ( global._demandEqualForces ) mes+=\"<br />Try new ones\";\n view2.pMessage.put( mes );\n if ( global._demandEqualForces ) {\n model.playerShips.clear();\n return;\n }\n }\n\n model.playerStat.setShips(pHistogram);\n view2.pStat.showStat(model.playerStat.shipsAlive,model.playerStat.biggestShip,model.playerStat.shipsSunk);\n view2.pStat.showClearHistogram(pHistogram);\n if (global.hideInactivePanels) { view2.drawButtons.hide(); }\n initFight();\n }\n return;\n };\n \n function initFight() {\n if( typeof enemy != \"object\" ) throw new Error(\"ShipsLocal::go: enemy is not the global object!\");\n if( typeof player != \"object\" ) throw new Error(\"ShipsLocal::go: player is not the global object!\");\n if( typeof arbiter != \"object\" ) throw new Error(\"ShipsLocal::go: arbiter is not the global object!\");\n \n global.setStage(\"fight\");\n global.setState(\"fight\");\n \n enemy=new Enemy( model.enemyShips, model.enemyBasin, model.enemyStat, model.enemyClip, model.playerBasin, view2.eMessage, global._enemyStriker );\n //alert(\"E_hi=\"+enemy.hi());\n player=new PlayerAssistant( model.playerShips, model.playerBasin, model.playerStat, model.playerClip, view2.pMessage );\n arbiter=new Arbiter(player,enemy,global);\n if (global._strikeRule==\"bs\") {\n player._clip.load();\n enemy._clip.load();\n }\n \n if ( global.isActive(\"A\") ) {\n view2.pMessage.add(\"<br />Make your move!\"); \n arbiter.setPlayer();\n }\n else {\n view2.eMessage.add(\"Enemy has first move\");\n arbiter.setEnemy();\n enemy.strike();\n } \n }\n}", "function Ship(size, sign) {\n this.size = size;\n this.sign = sign;\n}", "function calculateTTI(ship) {\n var d = new Date();\n var mySpeed = myShip.speedOverGround; // km/h\n var current = ship;\n var currentSpeed = current.speedOverGround * 1.852; // knots -> km/h\n var distance = Ships.distanceToMe(current.location, myShip.location); // meter\n\n if (ship.relativePosition == \"front\") {\n var speed = ((currentSpeed + mySpeed) * 1000) / 60; // meter per minute\n }\n else if (ship.relativePosition == \"behind\") {\n var speed = ((currentSpeed - mySpeed) * 1000) / 60; // meter per minute\n }\n\n var tti = Math.round(distance / speed); // amount of minutes\n current.distance = Math.round(distance);\n current.tti = tti;\n current.expectedImpact = d.getTime() + (tti * 60 * 1000);\n current.speedDiff = (currentSpeed - mySpeed);\n current.relativeSpeed = Math.round(speed);\n current.speedOverGround = Math.round(current.speedOverGround * 1.852);\n\n if (ship.relativePosition == \"behind\" && $scope.shipsFromBehind.length <= 4 && ship.tti < 20) {\n $scope.shipsFromBehind.push(current);\n Ships.setShipsFromBehind($scope.shipsFromBehind);\n }\n if (ship.relativePosition == \"front\" && $scope.shipsFromFront.length <= 4 && ship.tti < 20) {\n $scope.shipsFromFront.push(current);\n Ships.setShipsFromFront($scope.shipsFromFront);\n }\n\n }", "function RandomGameboard() {\n var occupied = []\n this.destroyer = new RandomShip(2, occupied);\n occupied = occupied.concat(get_ship_positions(this.destroyer.position, this.destroyer.length, this.destroyer.direction));\n this.submarine = new RandomShip(3, occupied);\n occupied = occupied.concat(get_ship_positions(this.submarine.position, this.submarine.length, this.submarine.direction));\n this.cruiser = new RandomShip(3, occupied);\n occupied = occupied.concat(get_ship_positions(this.cruiser.position, this.cruiser.length, this.cruiser.direction));\n this.battleship = new RandomShip(4, occupied);\n occupied = occupied.concat(get_ship_positions(this.battleship.position, this.battleship.length, this.battleship.direction));\n this.carrier = new RandomShip(5, occupied);\n occupied = occupied.concat(get_ship_positions(this.carrier.position, this.carrier.length, this.carrier.direction));\n this.missPts = [];\n this.hitPts = [];\n this.sunkPts = [];\n this.aliveShipNum = 5;\n this.count = 0;\n this.hits = 0;\n}", "function setShipAddressFields(record, shipAddress){\r\n\r\n if(!!shipAddress) {\r\n\r\n nlapiLogExecution('DEBUG', 'f3_setShipAddressFields', JSON.stringify(shipAddress));\r\n\r\n record.setFieldValue('shipcountry', shipAddress.shipcountry);\r\n record.setFieldValue('shipattention', shipAddress.shipattention);\r\n record.setFieldValue('shipaddressee', shipAddress.shipaddressee);\r\n record.setFieldValue('shipphone', shipAddress.shipphone);\r\n record.setFieldValue('shipaddr1', shipAddress.shipaddr1);\r\n record.setFieldValue('shipaddr2', shipAddress.shipaddr2);\r\n record.setFieldValue('shipcity', shipAddress.shipcity);\r\n record.setFieldValue('shipstate', shipAddress.shipstate);\r\n record.setFieldValue('shipzip', shipAddress.shipzip);\r\n }\r\n}", "function displayAllShips(shipArray) {\n\n for (var i=0; i<shipArray.length; i++) {\n var shipType = shipArray[i].type;\n // Getting the array of locations\n var shipLoc = shipArray[i].location;\n var shipPosition = getShipPosition(shipLoc);\n\n // Case horizontal ship\n if (shipPosition === \"horizontal\") {\n // displaying every image\n displayHorizontalShip(shipLoc);\n }\n // Case vertical ship\n if (shipPosition === \"vertical\") {\n // displaying every image\n displayVerticalShip(shipLoc);\n }\n\n }\n\n}", "function shipCost(large, medium, small){ //this is the \"normal\" function to find out the total cost of shipping based on the number of each sized packages being shipped multiplied by the individual cost to ship that particular size. \n\tvar largeRate = 9.95; //this variable represents the cost for one large package.\n\tvar medRate = 7.95; //this variable represents the cost for one medium package.\n\tvar smRate = 5.95; //this variable represents the cost for one small package.\n\tvar cost = (large * largeRate) + (medium * medRate) + (small * smRate); //this variable represents the total shipping cost based on the number of each sized packages multiplied by their individual costs to ship then added together.\n\treturn cost; //this represents the \"finished product\" or \"total\" of the function\n}", "isFullFillment(){\n let hasCity = this.state.schoolCity;\n let hasName = this.state.schoolName;\n let hasType = this.state.schoolType;\n let hasLevel = this.state.schoolLevel;\n console.log(hasCity, hasType, hasName, hasLevel, 'wwwwwww@@');\n }", "function generate(ship) {\n // get a random direction, either vertical or horizontal\n let randomDirection = Math.floor(Math.random() * ship.directions.length); // the 'Math.random() * 2' is either going to be 0 or 1\n let directionArray = ship.directions[randomDirection]; // we grab the ship's direction array\n //if (randomDirection === 0) countBy = 1; // count by 1 if direction is horizontal\n //if (randomDirection === 1) countBy = 10; // count by 10n if direction is vertical\n\n // get a random start to paint our ship\n let randomStart = Math.floor(Math.random() * enemySquares.length); // gives us a random number from 0 to 99\n\n // determine ids of the divs where the ship would be painted\n let shipDivsIdArray = [];\n for (let i = 0; i < directionArray.length; i++) {\n shipDivsIdArray.push(randomStart + directionArray[i]);\n }\n\n // check if ship can fit entirely in grid from randomStart position\n let tooCloseToEdge = false;\n // if direction is horizontal, check if the random start is too close to right edge given the length of the ship to be painted\n if (randomDirection === 0) {\n tooCloseToEdge = shipDivsIdArray\n .slice(1)\n .some((id) => id % nbSquares === 0);\n }\n // if direction is vertical, check if the random start is too close to the bottom edge given the length of the ship to be painted\n if (randomDirection === 1) {\n tooCloseToEdge = shipDivsIdArray.some((id) => {\n return id > 99;\n });\n }\n\n let isTaken = true;\n if (!tooCloseToEdge) {\n // check if any of the squares the ship will be painted on is already taken\n isTaken = shipDivsIdArray.some((id) =>\n enemySquares[id].classList.contains('taken')\n );\n }\n\n // place ship\n if (!tooCloseToEdge && !isTaken) {\n console.log('Ship placed on square numbers: ', shipDivsIdArray);\n shipDivsIdArray.forEach((id) =>\n enemySquares[id].classList.add('taken', ship.name)\n );\n } else {\n console.log('TRY AGAIN!');\n generate(ship);\n }\n }", "function get_ship(req){\n const key = datastore.key([SHIP, parseInt(req.params.id,10)]);\n return datastore.get(key).then( result => {\n var ship = result[0];\n addIDandSelfLink(req, ship);\n\n if(req.get('accept') == 'text/html'){ //Convert object to html\n console.log(\"HTML VERSION\");\n var htmlVersion = \"<ul>\";\n for(var prop in ship){\n htmlVersion += \"<li>\" + prop + \": \" + ship[prop] + \"</li>\";\n }\n htmlVersion += \"</ul>\";\n return htmlVersion; //Returns html/text version\n\n } else {\n\n return ship; //Returns json version\n }\n }).catch( err => {\n return false;\n });\n}", "function _get_shipments(fn) {\n $.ajax({\n url: '/samples/ajax/ship/visit/'+visit+'/pp/5'+(ship ? ('/p/'+ship) : ''),\n type: 'GET',\n dataType: 'json',\n timeout: 5000,\n success: function(json){\n var pgs = []\n var pc = json[0] == 0 ? 1 : json[0]\n for (var i = 0; i < pc; i++) pgs.push('<li><a href=\"#'+(i+1)+'\">'+(i+1)+'</a></li>')\n $('.pages').html('<ul>'+pgs.join('')+'</ul>')\n $('.pages li').removeClass('selected').unbind('click').click(function() {\n ship = parseInt($(this).children('a').attr('href').replace('#', ''))\n \n $('#unassigned').empty()\n shipments = []\n dewars = []\n containers = {}\n $('#assigned .container').each(function(i,e) { containers[$(this).attr('cid')] = 0 })\n \n _get_shipments()\n }).eq(ship-1).addClass('selected')\n \n var ship_opts = ''\n $.each(json[1], function(i,s) {\n ship_opts += '<option value=\"'+s['SHIPPINGID']+'\">'+s['SHIPPINGNAME']+'</option>';\n if ($.inArray(s['SHIPPINGID'], shipments) == -1) {\n $('<div sid=\"'+s['SHIPPINGID']+'\" class=\"shipment\"><h1>'+s['SHIPPINGNAME']+(s['CREATED'] ? (' [Created: '+s['CREATED']+']') : '')+'</h1></div>').hide().appendTo('#unassigned').slideDown()\n \n shipments.push(s['SHIPPINGID'])\n }\n })\n\n $('select[name=shipment]').html(ship_opts).combobox('value', null)\n if (fn) fn()\n _get_dewars()\n }\n })\n }", "function selfSetupP1() {\n\t// Ship Orientation Player 1 //\n\t$(\".player\").addClass(\"horz\").removeClass(\"player\").text(\"Horizontal\");\n\t$(\".random\").addClass(\"vert\").removeClass(\"random\").text(\"Vertical\");\n\t// Create Player 1 Fleet //\n\tplayer1Fleet = new Fleet(\"Player 1\");\n\tplayer1Fleet.initShips();\n\tplaceShipP1(player1Fleet.ships[player1Fleet.currentShip], player1Fleet);\n}", "function checkShipPlacement( placedShipObj ){\n placedShip = placedShipObj.name;\n placedLocation = placedShipObj.cell;\n placedOrientation = placedShipObj.rotation;\n\n var placedHGrid = placedLocation.substr(1, 2).toString(); //check the 2nd (and maybe the 3rd) char of the grid location\n var placedVGrid = placedLocation.substr(0, 1).toString(); //check the 1st char of the grid location\n\n var validHGrid = { // use with rotation === 0\n \"AircraftCarrier\": [1,2,3,4,5,6],\n \"Battleship\": [1,2,3,4,5,6,7],\n \"Destroyer\": [1,2,3,4,5,6,7,8],\n \"Submarine\": [1,2,3,4,5,6,7,8],\n \"PtBoat\": [1,2,3,4,5,6,7,8,9],\n };\n\n var validVGrid = { // use with rotation === 90\n \"AircraftCarrier\": [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"],\n \"Battleship\": [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\"],\n \"Destroyer\": [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\"],\n \"Submarine\": [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\"],\n \"PtBoat\": [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\"],\n };\n\n if( placedOrientation === 0 ){ // HORIZONTAL\n var validH = validHGrid[ placedShip ].indexOf( parseInt(placedHGrid, 10) ); // .toString()\n if ( validH === -1 ) {\n var lastValidElement = validHGrid[ placedShip ][ validHGrid[ placedShip ].length-1 ];\n var fixedCell = placedVGrid + lastValidElement.toString(); // add that after the current placedVGrid\n console.log( \"fixedCell\", fixedCell );\n placedLocation = fixedCell;\n var fixedDistance = validHGrid[ placedShip ].indexOf( parseInt(placedHGrid, 10) ) - validHGrid[ placedShip ].indexOf( parseInt(lastValidElement, 10) );// index of place cell minus the index of the fixed cell\n fixedDistance = fixedDistance * 25;\n var getTheShip = \"#draggable\"+ placedShip.name;\n var theShipStyle = $(getTheShip).attr('style');\n console.log(\"theShipStyle\", theShipStyle);\n }\n } else { // VERTICAL\n var validV = validVGrid[ placedShip ].indexOf( placedVGrid );\n console.log(placedShip, \"is at\", placedVGrid, \"and can be in\",validVGrid[ placedShip ]);\n if ( validV === -1 ) {\n var lastValidElement = validVGrid[ placedShip ][ validVGrid[ placedShip ].length-1 ]; // the linter incorrectly thinks this var has already been defined. There is another assignment but inside the conditional. The logic will only use one or the other.\n var fixedCell = lastValidElement + placedHGrid; // add that after the current placedVGrid\n console.log( \"fixedCell\", fixedCell );\n placedLocation = fixedCell;\n var fixedDistance = validVGrid[ placedShip ].indexOf( parseInt(placedVGrid, 10) ) - validVGrid[ placedShip ].indexOf( parseInt(lastValidElement, 10) );// index of place cell minus the index of the fixed cell\n fixedDistance = fixedDistance * 25;\n var getTheShip = \"#draggable\"+ placedShip.name;\n var theShipStyle = $(getTheShip).attr('style');\n console.log(\"theShipStyle\", theShipStyle);\n }\n }\n\n }", "shipBuilder(shipTypeStringInput) {\n // ensures that a string was inputted\n if (typeof shipTypeStringInput !== \"string\") {\n throw new Error(\"You haven't inputted a string name for the ship\");\n }\n // // status\n this.setState({ shipType: this.props.shipType });\n this.setState({ length: this.determineLength(this.props.shipType) });\n }", "function fnMarkClickedCellAsShip() {\n switch (gameState) {\n case SHIP_DEF_PHASE:\n fnDefineOwnShips();\n break;\n case CONFIG_PHASE:\n fnDefineCompsShips();\n break;\n default:\n alert(\"You can't change the position of your ships during the game.\");\n return;\n }\n}", "function composeShippingData(data) {\n return _.isObject(data) && {\n shipping_firstname : data['firstName'] || '',\n shipping_lastname : data['lastName'] || '',\n shipping_address : data['address'] || '',\n shipping_address2 : data['address2'] || '',\n shipping_city : data['city'] || '',\n shipping_state : data['state'] || '',\n shipping_zip : data['zip'] || '',\n shipping_country : data['country'] || '',\n shipping_phone : data['phone'] || ''\n };\n }", "function ship_placement_interface(n,shipplaced)\n{\n alert(\"Place your length \" + n + \" ship on the left green grid by clicking the starting and ending cells\");\n shiplength=n; \n \n \n}", "constructor(fname , lname, phone, memberShip) {\n super(fname, lname);\n this.phone = phone;\n this.memberShip = memberShip;\n }", "function Verfication_companyName_Shipping_address (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E27_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function fnConfiguration() {\n updateGameState(CONFIG_PHASE);\n fnInitializeShipsAndWater();\n alert(\"Define the computer player's ships, then choose 'Save Ship Config'.\")\n}", "function Ship(size) {\n\tthis.damage = 0;\n\tthis.coords = [];\n\t// pick a random color for each ship. code via http://stackoverflow.com/a/5092872\n\tthis.color = \"#000000\".replace(/0/g,function(){return (~~(Math.random()*16)).toString(16);});\n\t\n\t// 2d coords array will contain [x,y] coordinate pairs for each square occupied (# of squares determined by size)\n\tfor (i = 0; i < size; i++) {\n\t\tthis.coords.push([]);\n\t}\t\t\n}", "function renderShipList(ships, shipListElement) {\n if (shipListElement == null) return;\n let tablerow = document.createElement(\"tr\");\n let thead = document.getElementById(\"shipList\");\n var headerString = `\n <thead>\n <tr><th>Name</th>\n <th>Length</th>\n <th>Crew</th>\n </tr> \n </thead>`;\n tablerow.innerHTML = headerString;\n thead.appendChild(tablerow);\n ships.forEach(ship => {\n let listItem = document.createElement(\"tr\");\n let listItemString = `\n <tr>\n <td>${ship.name}</td>\n <td>${ship.length}</td>\n <td>${ship.crew}</td>\n </tr>\n `;\n listItem.innerHTML = listItemString;\n listItem.theShip = ship;\n thead.appendChild(listItem);\n });\n addShipListener();\n\n}", "function formatShipment(response) {\n return {\n trackingNumber: response.tracking_number,\n deliveryDateTime: response.delivery_date,\n charges: [\n {\n type: \"shipping\",\n amount: {\n value: response.shipment_cost,\n currency: \"USD\"\n }\n },\n {\n type: \"delivery_confirmation\",\n amount: {\n value: response.confirmation_cost,\n currency: \"USD\"\n }\n },\n {\n type: \"location_fee\",\n amount: {\n value: response.location_cost,\n currency: \"USD\"\n }\n },\n ],\n label: {\n name: \"Label\",\n type: \"label\",\n size: \"4x8\",\n format: \"pdf\",\n data: Buffer.from(response.image, \"base64\"),\n },\n packages: response.package_tracking_numbers.map((trackingNumber) => { return { trackingNumber } })\n };\n}", "updateShip(iteration){\n //----[ adds normal wear and tear ]----//\n if (this.inFlight && (this.tick % this.integrity) == 0){\n this.parts[\"engine\"] -= 1;\n this.parts[\"shields\"] -= 1;\n if (this.parts[\"shields\"] <= 0){\n this.parts[\"hull\"] -= 1;\n }\n this.parts[\"thrusters\"] -= 1;\n this.parts[\"life-support systems\"] -= 1;\n }\n\n //------[ update the Things ]------//\n //-> age; remove thing from this.things if necessary\n for (var i = 0; i < this.things.length; i++){\n this.things[i].lastsFor -= 1;\n if (this.things[i].lastsFor <= 0 || this.things[i].markedForRemoval){\n //time's up: remove the item\n console.log(\"Removing \" + this.things[i].what + \" from the ship.\");\n this.things.splice(i, 1);\n }\n }\n\n //----------------------//\n //--[ activate and deactivate any neccessary warnings ]--//\n var warningsToActivate = [];\n var warningsToDeactivate = [];\n var LOW_SHIELD_PERCENTAGE = 15;\n var CRITICAL_HULL_PERCENTAGE = 15;\n //-----//\n if (this.parts[\"shields\"] < LOW_SHIELD_PERCENTAGE){\n warningsToActivate.push(\"SHIELDS LOW\");\n }\n if (this.parts[\"shields\"] >= LOW_SHIELD_PERCENTAGE){\n warningsToDeactivate.push(\"SHIELDS LOW\")\n }\n //-----//\n if (this.parts[\"shields\"] <= 0){\n warningsToActivate.push(\"SHIELDS DOWN\");\n }\n if (this.parts[\"shields\"] > 0){\n warningsToDeactivate.push(\"SHIELDS DOWN\")\n }\n //-----//\n if (this.parts[\"hull\"] < CRITICAL_HULL_PERCENTAGE){\n warningsToActivate.push(\"CRITICAL DAMAGE TO HULL\");\n }\n if (this.parts[\"hull\"] >= CRITICAL_HULL_PERCENTAGE){\n warningsToDeactivate.push(\"CRITICAL DAMAGE TO HULL\");\n }\n //-------------//\n this._activateWarnings(warningsToActivate);\n this._deactivateWarnings(warningsToDeactivate);\n //----------------------------------------//\n\n //--------//\n //--add some debris... I guess\n if (random(2) == 0){\n this.addAThing(\"garbage\",\"a bit of debris\");\n }\n //-----------//\n\n //--[make sure all the parts are above 0]--//\n this._ensurePartsAboveZero();\n //----------------------------------------//\n\n //---------//\n //pay wages. Each person is paid [x] units per day.\n this.funds -= WAGES_PPPD; //TODO: add ability to turn this off temporarily (when low on funds)\n //reduce provisions. Each person consume [x] provision per day.\n this.provisions -= (this.people.length * PROVISIONS_PPPD);\n if (this.provisions < 0){\n this.provisions = 0;\n }\n //use up fuel IF TRAVELLING. Ship consume [x]% of fuel per day.\n if (this.currentJourney !== null){\n this.fuel -= this.fuelRate;\n }\n //---------//\n\n }", "function create_constraints_multiple(maxShips, minFighter, minOASW, minAACI, minClass, maxClass, numFleet) {\n var constraints = {};\n for (var i = 0; i < numFleet; i++) {\n constraints[i + \"maxShips\"] = {\n \"max\": maxShips[i]\n };\n constraints[i + \"OASW\"] = {\n \"min\": minOASW[i]\n };\n constraints[i + \"AP\"] = {\n \"min\": minFighter[i]\n };\n constraints[i + \"AACI\"] = {\n \"min\": minAACI[i]\n };\n\n for (var j = 1; j <= 22; j++) {\n constraints[i + \"Class #\" + j] = {\n \"min\": minClass[i][j-1],\n \"max\": maxClass[i][j-1]\n };\n }\n }\n\n // Non-duplicate ship constraints\n // One for each ship name\n for (var ship in profileShips) {\n constraints[profileShips[ship].yomi] = {\n \"max\": 1\n };\n }\n\n return constraints;\n}", "function shipTableBuilder(){\r\n let shipTableBuilderHelper = \"<table> <tr> <th>Name</th> <th>Model</th> <th>Cost</th> <th>Length</th> <th>ShipCLass</th> <th>Crew</th> </tr>\";\r\n\r\n for(let ship of shipInTable){\r\n shipTableBuilderHelper += \"<tr> <th>\"+ship.name.toLowerCase()+\"</th> <th>\"+ship.model.toLowerCase()+\"</th> <th>\"+((ship.cost_in_credits)/1000)+\" k credits</th> <th>\"+ship.length+\"m</th> <th>\"+ship.starship_class.toLowerCase()+\"</th> <th>\"+ship.crew+\"</th> </tr>\";\r\n }\r\n\r\n shipTableBuilderHelper += \"</table>\"\r\n getId('tableShip').innerHTML = shipTableBuilderHelper;\r\n}", "function dosc(shipp){\n if(gameMap.get(shipp.position).hasStructure ||\n gameMap.get(shipp.position.directionalOffset(Direction.getAllCardinals()[0])).hasStructure ||\n gameMap.get(shipp.position.directionalOffset(Direction.getAllCardinals()[1])).hasStructure ||\n gameMap.get(shipp.position.directionalOffset(Direction.getAllCardinals()[2])).hasStructure ||\n gameMap.get(shipp.position.directionalOffset(Direction.getAllCardinals()[3])).hasStructure){\n return false;\n }\n return true;\n }", "setFreeShipping() {\r\n if (this.props.data.sum > 200) {\r\n for (var i = 0; i < this.state.shipping.length; i++) {\r\n this.state.shipping[i][1] = 'FREE SHIPPING';\r\n }\r\n }\r\n }", "function Verfication_companyName_Shipping_address (input){\r\n\t\tvar result = new Object();\r\n\t\tvar error;\r\n\t\tresult.flgname = [];\r\n\t\tresult.flgflag = [];\r\n\t\tresult.flgvalue = [];\r\n\t\tresult.flgmsg = [];\r\n\t\tresult.pass = true;\r\n\t\tif (!presence_check(input)){\r\n\t\t\terror = \"E20_2\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t\t}\r\n\t\tconsole.log(result.flgname.length);\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n}" ]
[ "0.6219669", "0.6122258", "0.6106414", "0.6004893", "0.5940519", "0.58919734", "0.58860546", "0.5835676", "0.58263576", "0.5788037", "0.57335156", "0.5667143", "0.5633085", "0.5626628", "0.56000525", "0.5578178", "0.55688787", "0.5561249", "0.5557492", "0.554208", "0.55408484", "0.55408484", "0.5488042", "0.5487634", "0.5474535", "0.54003423", "0.53919166", "0.5389612", "0.53752613", "0.5363099", "0.5361715", "0.5358525", "0.53256756", "0.53233457", "0.531883", "0.531452", "0.5291574", "0.52876914", "0.5285203", "0.52817184", "0.5279488", "0.52759206", "0.52705055", "0.5263303", "0.52604604", "0.5257579", "0.52280724", "0.5224594", "0.51986665", "0.51927507", "0.51822543", "0.5173553", "0.5170616", "0.5169837", "0.5169412", "0.51587415", "0.5155465", "0.5154802", "0.51498646", "0.5144576", "0.514309", "0.51393193", "0.5130623", "0.51260805", "0.51244676", "0.5119859", "0.51125", "0.5093523", "0.50890017", "0.5088606", "0.50882804", "0.50844115", "0.50805116", "0.50789547", "0.5074652", "0.5072578", "0.5070977", "0.506783", "0.50544333", "0.5052124", "0.5050709", "0.5048821", "0.50443596", "0.5038613", "0.5037185", "0.5030891", "0.50280917", "0.50238913", "0.5022956", "0.5022938", "0.5021419", "0.5014912", "0.5014906", "0.50111634", "0.50082", "0.5006974", "0.50023896", "0.50014764", "0.49963892", "0.4990808" ]
0.6277782
0
Keeping Track Of Ships In Fleet
function Ship(name){ this.name = name; this.length = 0; this.hitPoints = []; // Hits for Horizontal Ships // this.populateHorzHits = function(start) { for (var i = 0; i < this.length; i++, start++) { this.hitPoints[i] = start; } }; // Hits for Vertical Ships // this.populateVertHits = function(start) { for (var i = 0; i < this.length; i++, start += 10) { this.hitPoints[i] = start; } }; // Is There A Ship In that Location? // this.locationCheck = function(loc) { for (var i = 0; i < this.length; i++) { if (this.hitPoints[i] == loc) return true; } return false; }; // Remove Those Hits From Total Count // this.getRidOf = function(pos) { this.hitPoints.splice(pos, 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShipsLocal() {\n\n this.go=function(command,data) {\n var c,sy,ps,h,hs,cm,pHistogram,warrantHistogram,mes=\"\";\n var parsed={};\n //alert(command+\"+\"+data);\n \n if ( command==\"cs\" || command==\"as\" ) view2.pMessage.put(\"\");\n \n if ( command==\"cell\" && data ) { // set a square to ship or empty\n parsed = view2.parseGridId(data);\n //alert ( \"cell :\"+parsed.row+\"_\"+parsed.col );\n if (parsed.prefix==\"p\") {\n if ( model.playerBasin.get(parsed.row,parsed.col) != \"s\" ) c=\"s\";\n else c=\"e\";\n model.playerBasin.put(c,parsed.row,parsed.col);\n view2.pBoard.put(c,parsed.row,parsed.col);\n }\n }\n\n if (command==\"rs\") { // remove all ships\n model.playerBasin.clear();\n view2.pBoard.fromBasin(model.playerBasin);\n }\n\n if (command==\"as\") { // automatically draw ships\n sy=new ShipYard(global.getForces());\n ps=sy.buildAll();\n model.playerBasin.clear();\n model.playerBasin.takeShips(ps);\n view2.pBoard.fromBasin(model.playerBasin);\n }\n\n if (command==\"cs\") { // check up and go playing\n h=new Harvester(model.playerBasin);\n h.search();\n model.playerBasin.cleanUp();\n view2.pBoard.fromBasin(model.playerBasin);\n hs=h.yield();\n model.playerShips = new Fleet();\n model.playerShips.take(hs);\n if ( ! model.playerShips.checkMargins() ) {\n view2.pMessage.put(\"Ships must be straight<br /> and not to touch each other. <br />Try new ones\");\n model.playerShips.clear();\n return;\n }\n pHistogram=model.playerShips.makeHistogram();\n warrantHistogram=global.getForces();\n if ( pHistogram.join() != warrantHistogram.join() ) {\n mes=\"The rules require <br />(squares:ships): \";\n mes+=view2.pStat.showClearHistogram(warrantHistogram,\"return\");\n mes+='<br />Your ships do not comply';\n if ( global._demandEqualForces ) mes+=\"<br />Try new ones\";\n view2.pMessage.put( mes );\n if ( global._demandEqualForces ) {\n model.playerShips.clear();\n return;\n }\n }\n\n model.playerStat.setShips(pHistogram);\n view2.pStat.showStat(model.playerStat.shipsAlive,model.playerStat.biggestShip,model.playerStat.shipsSunk);\n view2.pStat.showClearHistogram(pHistogram);\n if (global.hideInactivePanels) { view2.drawButtons.hide(); }\n initFight();\n }\n return;\n };\n \n function initFight() {\n if( typeof enemy != \"object\" ) throw new Error(\"ShipsLocal::go: enemy is not the global object!\");\n if( typeof player != \"object\" ) throw new Error(\"ShipsLocal::go: player is not the global object!\");\n if( typeof arbiter != \"object\" ) throw new Error(\"ShipsLocal::go: arbiter is not the global object!\");\n \n global.setStage(\"fight\");\n global.setState(\"fight\");\n \n enemy=new Enemy( model.enemyShips, model.enemyBasin, model.enemyStat, model.enemyClip, model.playerBasin, view2.eMessage, global._enemyStriker );\n //alert(\"E_hi=\"+enemy.hi());\n player=new PlayerAssistant( model.playerShips, model.playerBasin, model.playerStat, model.playerClip, view2.pMessage );\n arbiter=new Arbiter(player,enemy,global);\n if (global._strikeRule==\"bs\") {\n player._clip.load();\n enemy._clip.load();\n }\n \n if ( global.isActive(\"A\") ) {\n view2.pMessage.add(\"<br />Make your move!\"); \n arbiter.setPlayer();\n }\n else {\n view2.eMessage.add(\"Enemy has first move\");\n arbiter.setEnemy();\n enemy.strike();\n } \n }\n}", "checkSink(ship){\n if(ship.isSunk() == true){\n // adds ships to shipsSunk array\n this.shipsSunk.push(ship)\n }\n }", "updateTripList(state, trips) {\r\n state.tripsList = trips;\r\n }", "function Fleet(name) {\n\tthis.name = name;\n\t// Define Ships In Fleet //\n\tthis.shipDetails = [{ \"name\": \"carrier\", \"length\": 5 },\n\t\t\t\t\t\t{ \"name\": \"battleship\", \"length\": 4 },\n\t\t\t\t\t\t{ \"name\": \"cruiser\", \"length\": 3 },\n\t\t\t\t\t\t{ \"name\": \"destroyer\", \"length\": 3 },\n\t\t\t\t\t\t{ \"name\": \"frigate\", \"length\": 2 }];\n\tthis.numOfShips = this.shipDetails.length;\n\tthis.ships = [];\n\tthis.currentShipSize = 0;\n\tthis.currentShip = 0;\n\tthis.initShips = function() {\n\t\tfor(var i = 0; i < this.numOfShips; i++) {\n\t\t\tthis.ships[i] = new Ship(this.shipDetails[i].name);\n\t\t\tthis.ships[i].length = this.shipDetails[i].length;\n\t\t}\n\t};\n\t// Remove Ship From Gameplay When Sunk //\n\tthis.removeShip = function(pos) {\n\t\tthis.numOfShips--;\n\t\t$(\".text\").text(coms.sunk(this.name, this.ships[pos].name));\n\t\tif (this == playerFleet) npc.sizeOfShipSunk = this.ships[pos].length;\n\t\tthis.ships.splice(pos, 1);\n\t\t// No More Ships To Hit - Game Over :( //\n\t\tif (this.ships.length == 0) {\n\t\t\t$(\".text\").text(coms.lost(this.name));\n\t\t}\n\t\treturn true;\n\t};\n\t// Communication Of Result //\n\tthis.shipHit = function(ship_name) {\n\t\t$(\".text\").text(coms.hit(this.name));\n\t\treturn true;\n\t}\n\t// Has A Ship Been Hit? //\n\tthis.checkIfHit = function(point) {\n\t\tfor(var i = 0; i < this.numOfShips; i++) {\n\t\t\tif (this.ships[i].locationCheck(point)) {\n\t\t\t\tthis.ships[i].getRidOf(this.ships[i].hitPoints.indexOf(point));\n\t\t\t\tif (this.ships[i].hitPoints == 0)return this.removeShip(i);\n\t\t\t\telse return this.shipHit(this.ships[i].name);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n}", "function Fleet(name) {\n\tthis.name = name;\n\t// Define Ships In Fleet //\n\tthis.shipDetails = [{ \"name\": \"carrier\", \"length\": 5 },\n\t\t\t\t\t\t{ \"name\": \"battleship\", \"length\": 4 },\n\t\t\t\t\t\t{ \"name\": \"cruiser\", \"length\": 3 },\n\t\t\t\t\t\t{ \"name\": \"destroyer\", \"length\": 3 },\n\t\t\t\t\t\t{ \"name\": \"frigate\", \"length\": 2 }];\n\tthis.numOfShips = this.shipDetails.length;\n\tthis.ships = [];\n\tthis.currentShipSize = 0;\n\tthis.currentShip = 0;\n\tthis.initShips = function() {\n\t\tfor(var i = 0; i < this.numOfShips; i++) {\n\t\t\tthis.ships[i] = new Ship(this.shipDetails[i].name);\n\t\t\tthis.ships[i].length = this.shipDetails[i].length;\n\t\t}\n\t};\n\t// Remove Ship From Gameplay When Sunk //\n\tthis.removeShip = function(pos) {\n\t\tthis.numOfShips--;\n\t\t$(\".text\").text(coms.sunk(this.name, this.ships[pos].name));\n\t\tif (this == player1Fleet) player2Fleet.sizeOfShipSunk = this.ships[pos].length;\n\t\tthis.ships.splice(pos, 1);\n\t\t// No More Ships To Hit - Game Over :( //\n\t\tif (this.ships.length == 0) {\n\t\t\t$(\".text\").text(coms.lost(this.name));\n\t\t\tsetTimeout(reload, 1500);\n\t\t}\n\t\treturn true;\n\t};\n\t// Communication Of Result //\n\tthis.shipHit = function(ship_name) {\n\t\t$(\".text\").text(coms.hit(this.name));\n\t\treturn true;\n\t}\n\t// Has A Ship Been Hit? //\n\tthis.checkIfHit = function(point) {\n\t\tfor(var i = 0; i < this.numOfShips; i++) {\n\t\t\tif (this.ships[i].locationCheck(point)) {\n\t\t\t\tthis.ships[i].getRidOf(this.ships[i].hitPoints.indexOf(point));\n\t\t\t\tif (this.ships[i].hitPoints == 0)return this.removeShip(i);\n\t\t\t\telse return this.shipHit(this.ships[i].name);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n}", "function updateFoodAcquiredState(){\n if(snake.history[0].x === food.x && snake.history[0].y === food.y){\n $(\"#success\").get(0).play();\n points = points + 10;\n $(\"#points\").html(points);\n snake.history.unshift({x:snake.history[0].x,y:snake.history[0].y});\n toBeClearedFields.push(food);\n food.x = Math.floor(Math.random() * size);\n food.y = Math.floor(Math.random() * size);\n }\n }", "PushToLocationList(Spot) {\n }", "function fleetBooked(fleetRegistration){\r\n let planes_1 = planesDummy();\r\n for (let i = 0; i < planes_1.planes.length; i++){\r\n if (planes_1.planes[i].registration == fleetRegistration){\r\n planes_1.planes[i].status = \"unavailable\"; //status update\r\n planes_1.planes[i].tempLoc = planes_1.planes[i].location; //store origin location\r\n break;\r\n }\r\n }\r\n updateLocalStorage(LOCAL_PLANE_DATA_KEY,planes_1);\r\n}", "function TakeItem() {\n if (currentLoc == 1) {\n if (key.check == 0) {\n inventory.push(key.name);\n console.log(inventory);\n UpdateInventory(key.description)\n key.check = 1;\n }\n }\n if (currentLoc == 8) {\n if (hoagie.check == 0) {\n inventory.push(hoagie.name);\n console.log(inventory);\n UpdateInventory(hoagie.description)\n hoagie.check = 1;\n }\n }\n if (currentLoc == 0) {\n if (map.check == 0) {\n inventory.push(map.name);\n console.log(inventory);\n UpdateInventory(map.description)\n map.check = 1;\n }\n }\n if (currentLoc == 3) {\n if (coat.check == 0) {\n inventory.push(coat.name);\n console.log(inventory);\n UpdateInventory(coat.description)\n coat.check = 1;\n }\n }\n }", "updateSunk(player, shipList) {\n switch (player) {\n case 'user':\n shipList.forEach((ship) => {\n if (ship.props.sunk) {\n ship.props.location.forEach((location) => {\n $(UISelectors.userGrid).children[location - 1].classList.remove(\n 'hit'\n );\n $(UISelectors.userGrid).children[location - 1].classList.add(\n 'sunk'\n );\n });\n }\n });\n break;\n case 'computer':\n shipList.forEach((ship) => {\n if (ship.props.sunk) {\n ship.props.location.forEach((location) => {\n $(UISelectors.computerGrid).children[\n location - 1\n ].classList.remove('hit');\n $(UISelectors.computerGrid).children[\n location - 1\n ].classList.add('sunk');\n });\n }\n });\n break;\n }\n }", "pickUpFood() {\n var surTile = this.Survivor.getCurrentTile();\n for (const f of this.foodStock) {\n if (surTile === f.getTile() && f.getActive()) {\n f.setActive(false);\n this.playerFood += this.foodValue;\n this.playerScore += 10;\n }\n }\n }", "function checkLoc(){\n for(var i = 0; i < food.length; i++){\n var distX = food[i].loc.x - snake.loc.x;\n var distY = food[i].loc.y - snake.loc.y;\n if(distX == (0) && distY == (0)){\n food.splice(i, 1);\n //removes the food\n //would add in a new food if that was the way I wanted it to be\n loadFood(0);\n snake.segments.push(createVector(0, 0));\n console.log(snake.segments.length)\n score++;\n }\n }\n}", "async store() {\n const tasks = JSON.stringify(this.tasks);\n await game.user.setFlag(\"fvtt-keikaku\", \"tasks\", tasks);\n }", "deployFleetsRandomly(gameWidth, playableFleets){\n\n // using arrow syntax to access 'this.allFleetsCoordinates' variable\n playableFleets.forEach(function(fleetName) {\n\n //let deployCoordinates = []\n AXIS = ['H', 'V'][Math.floor(Math.random() * 2 )] // randomly pick a axis\n let randomIndex = Math.floor(Math.random() * gameWidth ** 2 )\n\n // keep calculating until we get a spot that was not previously used\n let randomIndexCoordinates = calcRelativeCoordinates(randomIndex, gameWidth, FLEET_SIZE_INFO[fleetName])\n while (randomIndexCoordinates.some(function(index){\n return this.allFleetsCoordinates.includes(index)\n }.bind(this))){\n\n AXIS = ['H', 'V'][Math.floor(Math.random() * 2 )] // randomly pick a axis\n randomIndex = Math.floor(Math.random() * gameWidth ** 2 )\n randomIndexCoordinates = calcRelativeCoordinates(randomIndex, gameWidth, FLEET_SIZE_INFO[fleetName])\n }\n\n // save the coordinates\n this.deployedFleets[fleetName] = new DeployedFleet(fleetName, FLEET_SIZE_INFO[fleetName], randomIndexCoordinates)\n this.allFleetsCoordinates = this.allFleetsCoordinates.concat(randomIndexCoordinates)\n }.bind(this))\n \n }", "function storeStooges() {\n self.log(self.oldStoogesFound);\n self.log(self.oldStoogesKilled);\n spec.integrationStore.putModel(self.moe, stoogeStored);\n spec.integrationStore.putModel(self.larry, stoogeStored);\n spec.integrationStore.putModel(self.shemp, stoogeStored);\n }", "function moveTracker() {\n moveTrack.push({\n \"x\" : x , \n \"y\" : y , \n \"loc\": player.loc\n })\n }", "function Fleet(playerGrid, player) {\n\t\tthis.numShips = CONST.AVAILABLE_SHIPS.length;\n\t\tthis.playerGrid = playerGrid;\n\t\tthis.player = player;\n\t\tthis.fleetRoster = [];\n\t\tthis.populate();\n\t}", "function updateVegetablesCollection (veggies, veggie) {\n if (veggies.indexOf(veggie) === -1) {\n veggies.push(veggie);\n console.log('New veggies collection is : ' + veggies);\n } else if (veggies.indexOf(veggie) > -1) {\n console.log(veggie + ' already exists in the veggies collection.');\n }\n}", "function handleTrack() {\n var shipIcon = document.getElementById(\"shipIcon\");\n shipIcon.style.top = zPosition - 10;\n shipIcon.style.left = xPosition - 5;\n\n if (xPosition < 1 || xPosition > 254 || zPosition < 12 || zPosition > 254) {\n if (nextCheckpoint == 0) {\n xPosition = 150;\n zPosition = 185;\n } else {\n var checkp;\n if (nextCheckpoint == -1) {\n var checkp = checkPointsCoordiantes[checkPointsCoordiantes.length - 1];\n } else {\n var checkp = checkPointsCoordiantes[nextCheckpoint - 1];\n }\n xPosition = checkp[0] / 4;\n zPosition = checkp[1] / 4 + 10;\n }\n }\n}", "function post_ship(name, type, length){\n console.log(\"INSIDE POST_SHIP\");\n var key = datastore.key(SHIP);\n const new_ship = { \"name\": name, \"type\": type, \"length\": length, \"cargo\":[]};\n console.log(\"EXITING POST_SHIP\");\n return datastore.save({\"key\":key, \"data\":new_ship}).then(() =>\n {return key}).catch( err => {\n return false;\n });\n}", "function updateSpots(state) {\n //Find wanted day and index\n const currentDay = state.day;\n const currentDayObj = state.days.find(day => day.name === currentDay);\n const currentDayObjIndex = state.days.findIndex(day => day.name === currentDay);\n //get appt ids and find null appts\n const appointmentIds = currentDayObj.appointments;\n const freeAppointments = appointmentIds.filter(id => !state.appointments[id].interview);\n //null appts array length \n const updatedSpots = freeAppointments.length;\n\n const updatedState = {...state};\n updatedState.days = [...state.days];\n const updatedDay = {...currentDayObj};\n updatedDay.spots = updatedSpots;\n updatedState.days[currentDayObjIndex] = updatedDay;\n\n return updatedState;\n }", "checkShip() {\n console.log(\"checking ship\");\n // setting correct ships to logged in player\n for (var i = 0; i < this.game.gamePlayers.length; i++) {\n if (this.player.Username != this.game.gamePlayers[i].Player.Username) {\n this.salvoes = this.game.gamePlayers[i].salvos;\n }\n if (this.player.Username == this.game.gamePlayers[i].Player.Username) {\n this.playerSalvoes = this.game.gamePlayers[i].salvos;\n }\n }\n\n //TABLE 1 player grid----------------------------------------------------------------------------------------------------\n\n // adding player ships\n this.ships = this.game.ships;\n for (var d = 0; d < this.ships.length; d++) {\n for (var g = 0; g < this.ships[d].Locations.length; g++) {\n console.log(\"adding drop CHECK SHIP\");\n document\n .getElementById(this.ships[d].Locations[g])\n .classList.add(\"drop\");\n }\n }\n // adding hits and salvoes\n for (var x = 0; x < this.salvoes.length; x++) {\n console.log(\"salvoes length ->\" + this.salvoes.length);\n for (var e = 0; e < this.salvoes[x].shots.length; e++) {\n console.log(\"shots length ->\" + this.salvoes[x].shots.length);\n for (var y = 0; y < this.ships.length; y++) {\n for (var i = 0; i < this.ships[y].Locations.length; i++) {\n if (this.ships[y].Locations[i] == this.salvoes[x].shots[e]) {\n document\n .getElementById(this.ships[y].Locations[i])\n .classList.remove(\"drop\");\n\n document\n .getElementById(this.ships[y].Locations[i])\n .classList.add(\"hit\");\n\n this.hits.push(this.ships[y].Locations[i]);\n } else {\n document\n .getElementById(this.salvoes[x].shots[e])\n .classList.add(\"salvo\");\n }\n }\n }\n }\n }\n this.checkHits();\n }", "function updateTowerStore() {\r\n\r\n towerStore.forEach(towerItem => {\r\n\r\n // if player doesn't have enough money then remove event listener\r\n if(TOWER_STATS[towerItem.id.toString()][game.getDifficulty()].purchaseCost <= game.stats.money) {\r\n towerItem.addEventListener('click', onStoreMouseClick);\r\n towerItem.style.opacity = 1;\r\n } else {\r\n towerItem.removeEventListener('click', onStoreMouseClick);\r\n towerItem.style.opacity = .5;\r\n }\r\n });\r\n}", "placeShips(){\n for (var i = 0; i < 1; i++) {\n this.placeBattleShip()\n }\n for (i = 0; i < 2; i++) {\n this.placeSubmarine();\n }\n for (i = 0; i < 2; i++) {\n this.placeDestroyer();\n }\n for (i = 0; i < 1; i++) {\n this.placePaddleboat();\n }\n }", "function updateShops() {\n // update the request:\n url = \"https://api.foursquare.com/v2/venues/search\\?\" +\n \"client_id=\" + client_id +\n \"&client_secret=\" + client_secret +\n \"&v=20170406\" +\n \"&ll=\" + map.getCenter().lat().toString() + \",\" + map.getCenter().lng().toString() +\n \"&query=coffee\" +\n \"&limit=25\" + \"&radius=8000\";\n createFSQMarkerList(url);\n}", "function shivering() {\n\tfindHaunty().setAttribute('id', 'spooked');\n}", "crossingShips(arr, ship) {\r\n arr.map(e => {\r\n if (this.shipsCoordinates.indexOf(e) != -1) {\r\n this.crosses = true;\r\n }\r\n })\r\n if (!this.crosses) {\r\n ship.location = ship.location.concat(arr);\r\n this.shipsCoordinates = this.shipsCoordinates.concat(arr);\r\n arr.length = 0;\r\n } else {\r\n arr.length = 0;\r\n }\r\n }", "function addAllMarkers(drops) {\r\n for (var i = 0; i < drops.length; i++) {\r\n var drop = drops[i];\r\n\r\n if (findIfIvSeenDrop(drop._id) == true) {\r\n var icon_size = new google.maps.Size(40, 40)\r\n } else {\r\n var icon_size = new google.maps.Size(50, 50)\r\n }\r\n\r\n all_markers[i] = new google.maps.Marker({\r\n position: { lat: drop.location.lat, lng: drop.location.lon },\r\n map: map,\r\n icon: { url: drop.icon, scaledSize: icon_size },\r\n optimized: false,\r\n title: drop.title,\r\n })\r\n all_markers[i].addListener('click', function () {\r\n makeIW(this.drop_id)\r\n\r\n // Add drop to user's drops_seen list\r\n if (findIfIvSeenDrop(this.drop_id) == true) {\r\n } else {\r\n console.log(\"Never seen that drop\")\r\n addToDropsSeen(this.drop_id)\r\n }\r\n\r\n var icon = this.getIcon()\r\n icon.size.height = 30;\r\n icon.size.width = 30;\r\n this.setIcon(icon)\r\n\r\n infowindow.open(map, this);\r\n $(\".map-iw-img\").click(function () {\r\n var drop = $(this).data(\"drop\")\r\n var post = $(this).data(\"post\")\r\n var img = $(this).data(\"img\")\r\n var link = \"/drop/\" + drop + \"?post=\" + post + \"&img_num=\" + img\r\n window.location.href = link;\r\n })\r\n $(\".btn-star\").click(function (e) {\r\n if (USER) {\r\n var btn = $(this);\r\n var post_id = btn.data(\"postid\")\r\n var star = btn.find(\"img\");\r\n var likes = btn.next();\r\n if (btn.data(\"like\") == 0) {\r\n star.attr(\"src\", \"/icons/star-full-yellow.svg\")\r\n likes.text(parseInt(likes.text()) + 1)\r\n btn.data(\"like\", \"1\")\r\n postLike(post_id)\r\n } else {\r\n star.attr(\"src\", \"/icons/star-outline.svg\")\r\n likes.text(parseInt(likes.text()) - 1)\r\n btn.data(\"like\", \"0\")\r\n postUnlike(post_id)\r\n }\r\n } else {\r\n flash(\"failure\", \"You need to be logged in to like\")\r\n }\r\n })\r\n add_drop_marker.setMap(null)\r\n var iwOuter = $('.gm-style-iw');\r\n var iwBackground = iwOuter.prev();\r\n iwBackground.children(':nth-child(4)').css({ \"background-color\": \"rgb(26, 123, 165, 0.7)\" })\r\n iwBackground.children(':nth-child(3)').children().children().css({ \"background-color\": \"rgb(16, 82, 110, 0.7)\" });\r\n hideAddDropIW();\r\n setSBar('none')\r\n });\r\n\r\n all_markers[i].addListener('position_changed', function () {\r\n })\r\n\r\n all_markers[i].drop_id = drop._id;\r\n }\r\n // Add color to drop thumbnails\r\n setTimeout(colorMarkers, 2000)\r\n}", "function post_ship(name, type, length){\n console.log(\"INSIDE POST_SHIP\");\n var key = datastore.key(SHIP);\n const new_ship = { \"name\": name, \"type\": type, \"length\": length};\n console.log(\"EXITING POST_SHIP\");\n return datastore.save({\"key\":key, \"data\":new_ship}).then(() =>\n {return key}).catch( err => {\n return false;\n });\n}", "_spawnShip() {\n\n // Find first dead ship and prepare it for respawn\n for (let ship of this.ships) {\n if (ship.dead) {\n // Generate new question and answer\n ship.setData(this.generator.generate());\n // Move ship to the top\n ship.setPosition(new Position(50 + Math.round(Math.random() * (this.canvas.width - 100)), -30));\n ship.setSpeed(Math.round(this.score.score / DEFAULT_SPEEDUP_SCORE) * DEFAULT_SPEEDUP_FACTOR);\n // Respawn the ship\n ship.revive();\n\n // Exit the loop, one ship is enough for now\n return;\n }\n }\n\n console.log(\"Too many ships in game. Could not spawn another one :/\");\n }", "function storePositionforDrinkups() {\n var place = autocomplete.getPlace();\n var position= {\n coords: {latitude:place.geometry.location.lat(),longitude:place.geometry.location.lng()}\n };\n changeMapLocationforDrinkups(position.coords.latitude,position.coords.longitude,15);\n\n initializeMarkers(position);\n}", "stepComplete( playerShips = null ){\n const currentPlayer = this.state.activePlayer;\n const nextPlayer = this.state.activePlayer === 1 ? 2 : 1;\n let step = this.state.step;\n\n //if player is placing ships then store them\n let ships = this.state.ships;\n if( currentPlayer === 1 ){\n ships.player1 = playerShips;\n }else{\n ships.player2 = playerShips;\n }\n\n //if both players are done with placing ships, go into fire mode\n if( this.state.step === data.steps[0] && this.state.activePlayer === 2 ){\n step = data.steps[ 1 ];\n }\n\n this.setState( {\n activePlayer: nextPlayer,\n step: step,\n ships: ships\n } );\n }", "function shipHit(ship, meteor){\r\n\tlives = lives - 1;\r\n\tship.position.x = width/2;\r\n\tship.position.y = height/2;\r\n}", "function medkitHit(ship, medkit){\r\n\tlives = lives + 1;\r\n\tmedkit.remove();\r\n}", "isFresh(tileId) {\n return this.props.dbCurrentPlayer !== null && this.props.dbCurrentPlayer >= 0 \n && this.props.dbPrevRacks[this.props.dbCurrentPlayer].indexOf(tileId) >= 0;\n }", "function checkAllShipsPlaced() {\n for (var p = 0; p < this.game.PLAYERS; p++) {\n for (var s = 0; s < fleet[p].length; s++) {\n\n if (fleet[p][s].length != fleet[p][s].coords.length) return false;\n\n for (var c = 0; c < fleet[p][s].coords.length; c++) {\n coords = fleet[p][s].coords[c];\n \n if (typeof layout[p][coords] == 'undefined') {\n return false;\n };\n }\n\n }\n }\n return true;\n }", "function add_empty_trips_v3(trips, threshold){\n\tconsole.log(\"making combined trips...\");\n\ttrips.forEach(function(trip,i) {\n\t\ttrip.start_date = new Date((+trip.start_date+ +trip.end_date-trip.duration*1000)/2);\n\t\ttrip.end_date = new Date(+trip.start_date+trip.duration*1000);\n\t\tif (i>1){\n\t\t\tfor (var j=i-1; j>=0; j--){\n\t\t\t\tvar ptrip = trips[j];\n\t\t\t\tif(ptrip.bikeid==trip.bikeid){\n\t\t\t\t\tif(ptrip.end_station!=trip.start_station){ // Only consider as empty, trips that connect different locations. Otherwise the vehicle remains idle in the same location\n\t\t\t\t\t\tif(ptrip.end_date>trip.start_date){\n\t\t\t\t\t\t\ttrip.start_date=ptrip.end_date;\n\t\t\t\t\t\t\ttrip.end_date= new Date(+trip.start_date+trip.duration * 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar etrip={};\n\t\t\t\t\t\tetrip.id = tripsCounter++;\n\t\t\t\t\t\tetrip.duration = (+trip.start_date - ptrip.end_date)/1000 <= threshold? (+trip.start_date - ptrip.end_date)/1000 : threshold;\n\t\t\t\t\t\tetrip.start_date = ptrip.end_date;\n\t\t\t\t\t\tetrip.end_date = new Date(+ptrip.end_date+etrip.duration * 1000);\n\t\t\t\t\t\tetrip.start_station = ptrip.end_station;\n\t\t\t\t\t\tetrip.start_station_name = ptrip.end_station_name;\n\t\t\t\t\t\tetrip.start_station_lat = ptrip.end_station_lat;\n\t\t\t\t\t\tetrip.start_station_lng = ptrip.end_station_lng;\n\t\t\t\t\t\tetrip.end_station = trip.start_station;\n\t\t\t\t\t\tetrip.end_station_name = trip.start_station_name;\n\t\t\t\t\t\tetrip.end_station_lat = trip.start_station_lat;\n\t\t\t\t\t\tetrip.end_station_lng = trip.start_station_lng;\n\t\t\t\t\t\tetrip.bikeid = trip.bikeid;\n\t\t\t\t\t\tetrip.trip_id = ptrip.trip_id + \"_\" + trip.trip_id;\n\t\t\t\t\t\tetrip.type = \"empty\";\n\t\t\t\t\t\ttrips.push(etrip);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak; // if the next trip of the same taxi has origin same as current trip's destination, do not consider any other trips from the same taxi\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\ttrips.sort(function(a,b){return a.start_date-b.start_date});\n\treturn trips;\n}", "updateShip(iteration){\n //----[ adds normal wear and tear ]----//\n if (this.inFlight && (this.tick % this.integrity) == 0){\n this.parts[\"engine\"] -= 1;\n this.parts[\"shields\"] -= 1;\n if (this.parts[\"shields\"] <= 0){\n this.parts[\"hull\"] -= 1;\n }\n this.parts[\"thrusters\"] -= 1;\n this.parts[\"life-support systems\"] -= 1;\n }\n\n //------[ update the Things ]------//\n //-> age; remove thing from this.things if necessary\n for (var i = 0; i < this.things.length; i++){\n this.things[i].lastsFor -= 1;\n if (this.things[i].lastsFor <= 0 || this.things[i].markedForRemoval){\n //time's up: remove the item\n console.log(\"Removing \" + this.things[i].what + \" from the ship.\");\n this.things.splice(i, 1);\n }\n }\n\n //----------------------//\n //--[ activate and deactivate any neccessary warnings ]--//\n var warningsToActivate = [];\n var warningsToDeactivate = [];\n var LOW_SHIELD_PERCENTAGE = 15;\n var CRITICAL_HULL_PERCENTAGE = 15;\n //-----//\n if (this.parts[\"shields\"] < LOW_SHIELD_PERCENTAGE){\n warningsToActivate.push(\"SHIELDS LOW\");\n }\n if (this.parts[\"shields\"] >= LOW_SHIELD_PERCENTAGE){\n warningsToDeactivate.push(\"SHIELDS LOW\")\n }\n //-----//\n if (this.parts[\"shields\"] <= 0){\n warningsToActivate.push(\"SHIELDS DOWN\");\n }\n if (this.parts[\"shields\"] > 0){\n warningsToDeactivate.push(\"SHIELDS DOWN\")\n }\n //-----//\n if (this.parts[\"hull\"] < CRITICAL_HULL_PERCENTAGE){\n warningsToActivate.push(\"CRITICAL DAMAGE TO HULL\");\n }\n if (this.parts[\"hull\"] >= CRITICAL_HULL_PERCENTAGE){\n warningsToDeactivate.push(\"CRITICAL DAMAGE TO HULL\");\n }\n //-------------//\n this._activateWarnings(warningsToActivate);\n this._deactivateWarnings(warningsToDeactivate);\n //----------------------------------------//\n\n //--------//\n //--add some debris... I guess\n if (random(2) == 0){\n this.addAThing(\"garbage\",\"a bit of debris\");\n }\n //-----------//\n\n //--[make sure all the parts are above 0]--//\n this._ensurePartsAboveZero();\n //----------------------------------------//\n\n //---------//\n //pay wages. Each person is paid [x] units per day.\n this.funds -= WAGES_PPPD; //TODO: add ability to turn this off temporarily (when low on funds)\n //reduce provisions. Each person consume [x] provision per day.\n this.provisions -= (this.people.length * PROVISIONS_PPPD);\n if (this.provisions < 0){\n this.provisions = 0;\n }\n //use up fuel IF TRAVELLING. Ship consume [x]% of fuel per day.\n if (this.currentJourney !== null){\n this.fuel -= this.fuelRate;\n }\n //---------//\n\n }", "function filterMovingShip(ship) {\n ship = ship.data;\n\n shipsToLoad--; // Decrement the countdown so we end up with 0 after the last ship.\n if(shipsToLoad == 0){\n ProgressIndicator.hide();\n var d = new Date();\n var front = {\n me: myShip,\n timeStamp: d.getTime(),\n others: []\n };\n\n var behind = {\n me: myShip,\n timeStamp: d.getTime(),\n others: []\n };\n\n for(var i=0; i<$scope.shipsFromFront.length; i++){\n front.others.push(JSON.stringify($scope.shipsFromFront[i]));\n }\n\n for(var i=0; i<$scope.shipsFromBehind.length; i++){\n behind.others.push(JSON.stringify($scope.shipsFromBehind[i]));\n }\n\n $http({\n url: 'https://api.mongolab.com/api/1/databases/boatway/collections/fromfront?apiKey=f8fSLZc7mmyHJgmk4WzBuDb2AtVlZoL0',\n method: 'POST',\n data: JSON.stringify(front)\n })\n .success(function (data, status, headers, config) {\n //\n })\n .error(function (data, status, headers, config) {\n console.log(status);\n });\n $http({\n url: 'https://api.mongolab.com/api/1/databases/boatway/collections/frombehind?apiKey=f8fSLZc7mmyHJgmk4WzBuDb2AtVlZoL0',\n method: 'POST',\n data: JSON.stringify(behind)\n })\n .success(function (data, status, headers, config) {\n //\n })\n .error(function (data, status, headers, config) {\n console.log(status);\n });\n }\n\n if (ship.status != 'MOORED' && ship.speedOverGround != 0) {\n filterShipFromBehind(ship);\n }\n }", "addGood(state,id){\r\n\t\t\tstate.basket.unshift({id:id,count:1})\r\n var flag = false;\r\n for (var i = 1; i < state.basket.length; i++){\r\n if (state.basket[i].id == state.basket[0].id){\r\n flag=true \r\n break \r\n }\r\n }\r\n if (flag == true){\r\n state.basket[0].count = state.basket[0].count + state.basket[i].count\r\n state.basket.splice(i,1)\r\n }\r\n\t\t\tthis.dispatch(\"basket/saveBasket\")\r\n\t\t}", "function consumeApple() {\n $(\".mapTile\").removeClass(\"appleTile\");\n generateApple();\n countPoints();\n}", "getsPicked(){\n this.picked = true;\n let fruitIndex = allFruit.indexOf(this);\n console.log('picked ' + fruitIndex);\n if (fruitIndex > -1) {\n allFruit.splice(fruitIndex, 1);\n }\n }", "initiate() {\n //TODO: add db support when a new player joins \n SHIP_LIST[this.id] = this;\n initPack.ship.push(this.getInitPack());\n\n }", "function updateSetExistingSpot() {\n setIsExistingSpot(true);\n setIsNewSpot(false);\n }", "updateToSanta() {}", "function updateShopList(){\r\n container.innerHTML = '';\r\n shopStorage.forEach(function(shop) {\r\n container.append(shopElement(shop));\r\n });\r\n addBtnListener(productsBtnclassName, function(index){\r\n productsList(shopStorage[index], map);\r\n });\r\n addBtnListener(editBtnclassName, function(index){\r\n editShop(index);\r\n });\r\n map.geoObjects.removeAll();\r\n for(var i = 0; i < shopStorage.length; i++){\r\n var cor = shopStorage[i].coords;\r\n var cont = '<b>' + shopStorage[i].name + '</b>' + '<br>' + shopStorage[i].wHours;\r\n map.geoObjects.add(new ymaps.Placemark(cor, {\r\n balloonContent: cont\r\n }, {\r\n preset: 'twirl#violetIcon'\r\n }));\r\n }\r\n addBtnListener(showOnMapBtnClass, function(index){\r\n map.balloon.open(shopStorage[index].coords, {\r\n contentHeader: shopStorage[index].name,\r\n contentBody: shopStorage[index].address,\r\n contentFooter: '<sup>' + shopStorage[index].wHours + '</sup>'\r\n });\r\n });\r\n addBtnListener(removeBtnclassName, function(index, id){\r\n for(var i = 0; i < shopStorage.length; i++){\r\n if(shopStorage[i].id == id){\r\n shopStorage.splice(i, 1);\r\n }\r\n }\r\n updateShopList();\r\n });\r\n }", "shotStatus( cellNum ){\n const currentPlayer = this.state.activePlayer;\n\n //opponents ships\n const ships = currentPlayer === 1 ? this.state.ships.player2 : this.state.ships.player1;\n\n //current players shots\n let shots = this.state.shots;\n\n //returnable data\n let result = {\n status: \"miss\",\n ship: null\n };\n\n //check if the shot hits a ship\n const hitShip = ships.filter( ( s ) => {\n return s.cells.indexOf( cellNum ) > -1;\n } );\n if( hitShip.length > 0 ){\n let ship = hitShip[0];\n\n //push the into the hitCells array\n ship.hitCells.push( cellNum );\n\n //if all cells are hit - ship is sunk\n if( ship.cells.length === ship.hitCells.length ){\n ship.status = \"sunk\";\n console.log( \"ship is sunk\" );\n }\n\n //result of shot\n result.status = \"hit\";\n result.ship = ship;\n }\n\n //log the shot to current player so opponent has access to shots against their ships\n const shotData = {\n cell: cellNum,\n status: result.status\n };\n if( currentPlayer === 1 ){\n shots.player1.push( shotData );\n }else{\n shots.player2.push( shotData );\n }\n\n\n //if all ships are sunk\n let sunkShips = ships.filter( ( s ) => {\n return s.status === \"sunk\";\n } );\n if( sunkShips.length === ships.length ){\n this.setState( {\n step: data.steps[ 2 ]\n } );\n return false;\n }\n\n //if not all ships are sunk, continue with the game\n //set delay so that players can switch\n else{\n this.switchPlayer( 750, true, shots );\n return result;\n }\n }", "placeAShip(letters, numbers) {\n if (myApp.shipPlacing == true) {\n //position vertical ships (shipAlign = 0)\n if (myApp.shipAlign == 0) {\n //console.log(myApp.numbers[numbers + 1 + myApp.shipToPlace])\n if (!myApp.shipCollision.includes(1)) {\n var spv = []; //creates an array that will be pushed with ship info for ajax call\n\n for (var x = 0; x < myApp.shipToPlace; x++) {\n document.getElementById(letters + (numbers + x)).classList.add(myApp.shipName, \"occupied\");\n document.getElementById(myApp.shipName).classList.remove(\"btn-warning\");\n //sets another class to the button\n document.getElementById(myApp.shipName).classList.add(\"btn-secondary\");\n myApp.shipPlacing = false; //and return to the false statmenet to start again\n spv.push(letters + (numbers + x))\n }\n myApp.shipButtons[myApp.shipName] = 1;\n myApp.shipPosition.push({\n shipType: myApp.shipName,\n shipPosition: spv\n }) //push ship info \n\n } else {\n\n }\n } else {\n //position horizontal ships (shipAlign = 1)\n for (var y = 0; y < myApp.letters.length; y++) {\n if (myApp.letters[y] == letters) {\n myApp.starting = y;\n\n\n }\n }\n if (!myApp.shipCollision.includes(1)) {\n var sph = [];\n for (var z = 0; z < myApp.shipToPlace; z++) {\n document.getElementById((myApp.letters[myApp.starting + z]) + numbers).classList.add(myApp.shipName, \"occupied\");\n document.getElementById(myApp.shipName).classList.add(\"btn-secondary\");\n document.getElementById(myApp.shipName).classList.remove(\"btn-warning\");\n myApp.shipPlacing = false;\n sph.push((myApp.letters[myApp.starting + z]) + numbers);\n }\n myApp.shipButtons[myApp.shipName] = 1;\n myApp.shipPosition.push({\n shipType: myApp.shipName,\n shipPosition: sph\n })\n }\n }\n }\n }", "function takeItem() {\n\n if (items[currLoc].isTaken === false) {\n\n inventory.push(items[currLoc].name);\n\n updateDisplay(\"You took the \" + items[currLoc].name) + \".\";\n\n items[currLoc].isTaken = true;\n\n }\n\n else {\n\n updateDisplay(\"This location has no items to pick up\");\n\n }\n\n mapVisibility();\n\n }", "function showShips(){\n for (var i=0; i<(boardSquareDimension*boardSquareDimension); i++) {\n if(board[i]===SHIP) {\n checkLocation = i;\n $(\"#\" + checkLocation).addClass(\"showShip\");\n }\n }\n}", "function serve(service, truck, airport) {\n truck.setProp(\"status\", \"busy\")\n truck.setProp(\"current-service\", service)\n // get from truck position to service road, move there slowly\n let p = geojson.findClosest(truck.getProp(\"position\"), airport.serviceroads)\n //debug.print(\"closest to truck\", truck.position, p)\n truck.addPointToTrack(p, truck.getProp(\"slow\"), 30) // truck moves to serviceroad\n\n // get to parking on service road at full speed\n let parking = geojson.findFeature(service.parking, airport.parkings, \"name\")\n debug.print(parking)\n if (!parking) {\n debug.print(\"not found\", \"name\", service.parking)\n return\n }\n let p1 = geojson.findClosest(parking, airport.serviceroads)\n //debug.print(\"closest to parking\", parking, p1)\n\n // move truck from where it was to close to parking on serviceroads\n let r = geojson.route(p, p1, airport.serviceroads)\n truck.addPathToTrack(r.coordinates, truck.getProp(\"speed\"), null)\n\n // we do not stop \"exactly\" at the parking's center but nearby\n let aroundParkingCoordinates = jitter(parking.geometry.coordinates, 30) // 30 meters\n\n // get from service road to parking slowly and service plane\n // service\n truck.addPointToTrack(aroundParkingCoordinates, truck.getProp(\"slow\"), truck.serviceTime(service.qty))\n\n truck.setProp(\"load\", truck.getProp(\"load\") - service.qty)\n truck.setProp(\"position\", aroundParkingCoordinates)\n\n // ADD STOP TO EXPLAIN SERVICE OPERATION\n truck.addMarker(\n \"serve\",\n aroundParkingCoordinates,\n 0,\n truck.serviceTime(service.qty),\n truck.getProp(\"syncCount\"),\n truck.getProp(\"color\"),\n {\n \"device\": truck.getName(),\n \"service\": truck.getProp(\"service\"),\n \"capacity\": truck.getProp(\"capacity\"),\n \"load\": truck.getProp(\"load\"),\n \"status\": truck.getProp(\"status\"),\n \"action\": \"serve\",\n \"quantity\": service.qty,\n \"posname\": service.parking,\n \"scheduled\": service.datetime\n })\n truck.setProp(\"syncCount\", truck.getProp(\"syncCount\") + 1)\n\n truck.setProp(\"last-service\", service)\n truck.setProp(\"last-parking\", service.parking)\n truck.setProp(\"status\", \"available\")\n\n // We add an extra point at the end to move the truck away from parking back to service road\n // so that it 'leaves' the parking position after it services.\n truck.addPointToTrack(p1, truck.getProp(\"slow\"), 0)\n truck.setProp(\"position\", p1.geometry.coordinates)\n truck.addPointToTrack(p1, 0, 120) // make sure it emits out of parking space.\n}", "function add_ship(radio_button, ships_global, game_cell, game_board) {\n\n var ships_obj = ships_global[radio_button.dataset.size];\n var ships_arr = ships_obj.ships;\n var last_ship = ships_arr[ships_obj.ships_quantity - 1];\n\n if (last_ship == null || last_ship.is_created() == true) {\n\n if (ships_obj.ships_quantity >= ships_obj.ships_amount) {\n document.querySelector(\".info_span\").innerHTML = \"You have enough ships of this type!\";\n } else {\n\n var ship_id = ships_obj.ships_quantity + 1;\n var new_ship = new Ship(radio_button.dataset.size, ship_id);\n\n new_ship.save_coords(game_cell.dataset.x, game_cell.dataset.y);\n ships_arr.push(new_ship);\n ships_obj.ships_quantity += 1;\n\n game_board[game_cell.dataset.x][game_cell.dataset.y] = false;\n\n game_cell.classList.add(\"ship\");\n game_cell.innerHTML = radio_button.dataset.size;\n\n document.querySelector('.inner_span' + radio_button.dataset.size).innerHTML = ship_id;\n document.querySelector(\".info_span\").innerHTML = 'Added new ship of size ' + radio_button.dataset.size + '!';\n cell_counter += 1;\n }\n } else {\n if (last_ship.check_coords(game_cell.dataset.x, game_cell.dataset.y) == true) {\n\n last_ship.save_coords(game_cell.dataset.x, game_cell.dataset.y);\n last_ship.last_coord_index++;\n game_board[game_cell.dataset.x][game_cell.dataset.y] = false;\n\n game_cell.classList.add(\"ship\");\n game_cell.innerHTML = radio_button.dataset.size;\n cell_counter += 1;\n\n if (cell_counter == 20) {\n document.querySelector('.start_button').removeAttribute('hidden');\n }\n };\n };\n}", "function moveFleetUp(){\n moveFleetRequest('u');\n}", "AI_PeelShipsForDefense( star, fleet, milval_needed ) { \n\t\t// already there?\n\t\tif ( fleet.star == star || fleet.dest == star ) { return; }\n\t\t// if they need everything we've got, just reroute the entire fleet.\n\t\tif ( milval_needed >= fleet.milval && !fleet.reserved_milval ) {\n\t\t\tfleet.SetDest( star );\n\t\t\treturn fleet.milval;\n\t\t\t}\n\t\t// otherwise, get some random ships\n\t\telse {\n\t\t\tlet ships_to_send = [];\n\t\t\tlet max_milval_to_strip = fleet.milval - fleet.reserved_milval;\n\t\t\tlet milval_stripped = 0;\n\t\t\tfor ( let i=fleet.ships.length-1; i >= 0 && milval_needed > 0 && milval_stripped < max_milval_to_strip; i-- ) { \n\t\t\t\tlet ship = fleet.ships[i];\n\t\t\t\tif ( ship.bp.milval && ship.bp.milval < milval_needed*2 ) { \n\t\t\t\t\tmilval_needed -= ship.bp.milval;\n\t\t\t\t\tmilval_stripped += ship.bp.milval;\n\t\t\t\t\tships_to_send.push(ship); // add \n\t\t\t\t\tfleet.ships.splice( i, 1 ); // remove\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif ( ships_to_send.length ) { \n\t\t\t\tlet newfleet = new Fleet( fleet.owner, fleet.star );\n\t\t\t\tnewfleet.ships = ships_to_send;\n\t\t\t\tnewfleet.ReevaluateStats();\n\t\t\t\tnewfleet.SetDest( star );\n\t\t\t\t}\n\t\t\tif ( !fleet.ships.length ) {\n\t\t\t\tfleet.Kill();\n\t\t\t\t}\n\t\t\telse {\n\t\t\t\tfleet.ReevaluateStats();\n\t\t\t\t}\n\t\t\treturn milval_stripped;\n\t\t\t}\n\t\t}", "function checkFruitTaken(){\n allFruit.forEach(function (fruit, index) {\n\n // check if player is on fruit tile\n if (player.row === fruit.row && player.col === fruit.col){\n // fruit gets picked\n fruit.getsPicked();\n pickedFruit.push(fruit);\n updateInfo(); \n };\n\n // check if enemy is on fruit tile\n let enemyOnTile = allEnemies.filter(enemy => enemy.row === fruit.row && enemy.col === fruit.col);\n if (enemyOnTile.length > 0){\n if (fruit.eaten === true){\n return; // since we have a time out function we need to check if fruit has already been eaten\n } else {\n fruit.getsEeaten();\n eatenFruit.push(fruit);\n updateInfo();\n }\n }\n });\n\n // if player's basket is empty and all fruit are gone from field, create some new ones\n if (allFruit.length === 0 && pickedFruit.length === 0 && gameStarted === true) {\n createFruit();\n } \n}", "#playerRegisterShips() {\n let self = this;\n let gameboard = document.querySelector(\".p1.gameboard\");\n\n for (let i = 0; i < self.shipLengths.length; i++) {\n let ship = gameboard.querySelector(`#player-ship${i}`);\n let originCell = ship.parentNode;\n let row = parseInt(originCell.dataset.row);\n let col = parseInt(originCell.dataset.col);\n let length = ship.childElementCount;\n let vertical = ship.classList.contains(\"vertical\");\n\n self.players[0].gameboard.placeShip(length, row, col, vertical);\n }\n\n self.#page.enumeratePlayerShipRoster();\n }", "function createSinglePlayerFleet() {\n\t// Player 1 Random Ship Placement //\n\tplayer1Fleet = new Fleet(\"Player 1\");\n\tplayer1Fleet.initShips();\n\trandomSetupMulti(player1Fleet);\n}", "handleClick() {\n this.setState({ viewShips: !this.state.viewShips })\n }", "function dropSlime(){//this function is called every x seconds\n Object.keys(players).forEach( (key) => {\n let p = players[key];\n slime[ [p.x,p.y, p.id] ] = slimeLength;\n });\n Object.keys(slime).forEach((key)=>{\n s = slime[key];\n s -= 1;\n if(s == 0){\n delete slime[key];\n }\n else{\n slime[key] = s;\n }\n });\n}", "function markOccupiedSpots() {\n \n\t\tif(!spotsInitialized || playersInitialized < 2) {\n \n\t\t\treturn null;\n \n } // end if statement\n\t\n\t\tfor(var i = 0; i<10; i++) {\n \n\t\t\tfindClosestSpot(myMarbles[i].x, myMarbles[i].y).isEmpty = false;\n\t\t\tfindClosestSpot(othersMarbles[i].x, othersMarbles[i].y).isEmpty = false;\n \n\t\t} // end for loop\n \n\t} // end markOccupiedSpots()", "_deleteWorkoutMarker() {\n const markerLatLng = this.#markers.find(\n marker =>\n marker._latlng.lat === currentWorkout.coords[0] &&\n marker._latlng.lng === currentWorkout.coords[1]\n );\n const indexmarker = this.#markers.indexOf(markerLatLng);\n this.#map.removeLayer(this.#markers[indexmarker]);\n this.#markers.splice(indexmarker, 1);\n localStorage.setItem('workouts', JSON.stringify(this.#workouts));\n }", "isSunk() {\n if(this.hits === this.length) {\n this.sunk = true\n }\n \n }", "function updateParkingMap() {\n for (let j = 1; j <= PARKING_SPOTS; j++) {\n fillById(\"_\" + j);\n }\n}", "function Fleet(){\n\t\n\t// Top stress vehicle locations, contains\n\t// {Google Maps LatLng object}\n\tvar locations = [];\n\t\n\t// Most stressful streets, contains:\n\t// {\"streetName\", \"camPic\", \"heartDelta\"}\n\tvar mostStressful = [];\n\n\t// Array of fleet g-forces, 50 points of {gLat, gLng}\n\tvar gforce = [];\n\n\t// Stores the vehicle object where the event took place\n\tvar eventVehicle = null;\n\n\t// Array of all 10 vehicles in the fleet\n\tthis.vehicles = [];\n}", "_checkCollision() {\n\n for (let ship of this.ships) {\n let pos = ship.getPosition();\n if (pos.y >= this.canvas.height) {\n // Killed ships are not moved, they stay at their location, but are invisible.\n // I don't want to kill the player with one invisible ship :)\n if (!ship.dead) {\n ship.kill();\n this.score.damage();\n this.base.removeShield();\n }\n }\n }\n }", "function add_empty_trips_v2(trips, threshold){\n\tconsole.log(\"making combined trips...\");\n\ttrips.forEach(function(trip,i) {\n\t\ttrip.end_date=new Date(+trip.start_date+trip.duration * 1000);\n\t\tresult.push(trip);\n\t\tfor (var j=i+1; j<trips.length-1; j++){\n\t\t\tvar ntrip = trips[j];\n\t\t\tif(ntrip.bikeid==trip.bikeid){ //find the next trip of the same taxi\n\t\t\t\tif(ntrip.start_station!=trip.end_station){ // Only consider as empty, trips that connect different locations. Otherwise the vehicle remains idle in the same location\n\t\t\t\t\tif(ntrip.start_date<trip.end_date){\n\t\t\t\t\t\tntrip.start_date=trip.end_date;\n\t\t\t\t\t}\n\t\t\t\t\tvar etrip={};\n\t\t\t\t\tetrip.id = tripsCounter++;\n\t\t\t\t\tetrip.duration = (+ntrip.start_date - trip.end_date)/1000 <= threshold? (+ntrip.start_date - trip.end_date)/1000 : threshold\n\t\t\t\t\tetrip.start_date = trip.end_date;\n\t\t\t\t\tetrip.end_date = new Date(+trip.end_date+etrip.duration * 1000);\n\t\t\t\t\tetrip.start_station = trip.end_station;\n\t\t\t\t\tetrip.start_station_name = trip.end_station_name;\n\t\t\t\t\tetrip.start_station_lat = trip.end_station_lat;\n\t\t\t\t\tetrip.start_station_lng = trip.end_station_lng;\n\t\t\t\t\tetrip.end_station = ntrip.start_station;\n\t\t\t\t\tetrip.end_station_name = ntrip.start_station_name;\n\t\t\t\t\tetrip.end_station_lat = ntrip.start_station_lat;\n\t\t\t\t\tetrip.end_station_lng = ntrip.start_station_lng;\n\t\t\t\t\tetrip.bikeid = trip.bikeid;\n\t\t\t\t\tetrip.trip_id = trip.trip_id + \"_\" + ntrip.trip_id;\n\t\t\t\t\tetrip.type = \"empty\";\n\t\t\t\t\ttrips.push(etrip);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tbreak; // if the next trip of the same taxi has origin same as current trip's destination, do not consider any other trips from the same taxi\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\ttrips.sort(function(a,b){return a.start_date-b.start_date});\n\treturn trips;\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}", "createShips(battleShipSize, destroyerSize) {\r\n for (let i = 0; i < this.battleShips; i++) {\r\n const BattleShip = new shipClass.Ship(battleShipSize);\r\n this.ships.push(BattleShip);\r\n }\r\n for (let i = 0; i < this.destroyers; i++) {\r\n const Destroyer = new shipClass.Ship(destroyerSize);\r\n this.ships.push(Destroyer);\r\n }\r\n }", "function addItem(player, item){\n //Add to inventory\n player.inventory.items.push(item)\n //Add passes to player\n getPasses(item).forEach(pass =>{\n if(!player.passes.includes(pass)){\n player.passes.push(pass)\n }\n })\n }", "function spikeCreator(amount, room) {\n for(var idx = 0; idx < amount; idx++) {\n var spike = new Location(-1, -1);\n spike.canMove = true;\n spike.description = \"Several sharp points stick up from the ground\";\n spike.terrainType = \"spike\";\n spike.symbol = \"#\";\n spike.color = \"spikes\";\n spike.searchable = false;\n spike.drops = [];\n\n room.spikes.push(spike);\n }\n}", "function storeState(){\n\tvar tile_1 = CLICKED_TILE_1;\n\tvar tile_2 = CLICKED_TILE_2;\n\tvar pair_tile = new pairTiles(tile_1,tile_2);\n\tstack.push(pair_tile);\n\t//window.alert(\"STORE_STATE Tile1 == \"+pair_tile.tile_1.value.toString()+\" Tile2 == \"+pair_tile.tile_2.value.toString());\n\t//window.alert(\"Coord = \"+pair_tile.tile_1.coord.x+\" , \"+pair_tile.tile_1.coord.y);\n}", "function passToMap() {\n let startBar = [STORE.brewList[0].longitude, STORE.brewList[0].latitude];\n let otherBars = [];\n STORE.brewList.forEach(bar => {\n otherBars.push([bar.longitude, bar.latitude, bar.name]);\n });\n STORE.recenter(startBar);\n STORE.addMarker(otherBars);\n}", "function pickup()\n{\n // Check if timer has run out\n if (counter > 0 && points < 10)\n {\n // initialize found seat to false\n var found_seat = false;\n \n // initialize shuttle full to false\n var full = false;\n \n // initialize found house to false\n var foundHouse = false;\n \n // intialize freshman to false\n var freshman = false;\n \n // Check distance of all students to shuttle\n for (var i in NewPassengers)\n { \n // Figure distance of student to shuttle\n var d = shuttle.distance(NewPassengers[i].lat,NewPassengers[i].lng);\n \n // Check if student is in range for pickup\n if (d <= 15)\n {\n // check if student is a Freshman\n var exist = HOUSES[NewPassengers[i].house];\n \n // If house exists user is not a freshman\n if (exist != null)\n {\n foundHouse = true;\n var features = earth.getFeatures();\n this.seats = [];\n \n // Pick up student if any empty seats on shuttle\n for (var j in shuttle.seats)\n { \n if (shuttle.seats[j] == null)\n {\n shuttle.seats[j] = NewPassengers[i].name + \" to \" + NewPassengers[i].house;\n $(\"#announcements\").html(NewPassengers[i].name + \" picked up\");\n setTimeout(resetMessage,4000);\n features.removeChild(NewPassengers[i].placemark);\n NewPassengers[i].marker.setMap(null);\n found_seat = true;\n pickedup[j] = {name: NewPassengers[i].name, house: NewPassengers[i].house};\n chart();\n break;\n }\n \n }\n \n // Announce if shuttle is full\n if(found_seat == false)\n {\n $(\"#announcements\").html(\"Sorry, shuttle is full\");\n setTimeout(resetMessage,4000);\n full = true;\n }\n }\n \n // Display message if person to be picked up is Freshman\n else\n {\n $(\"#announcements\").html(\"Sorry! No Freshman Allowed!\");\n setTimeout(resetMessage,4000);\n freshman = true;\n }\n }\n }\n \n // Announce if no student is in range for pickup\n if (found_seat == false && full == false && freshman == false)\n {\n $(\"#announcements\").html(\"No student is in range for pickup\");\n setTimeout(resetMessage,4000);\n }\n }\n \n // If time has run out alert or game has been won display alert\n else\n {\n alert(\"Game Over! Refresh page to play again.\");\n }\n}", "function post_ship(req) {\n var key = datastore.key(SHIP);\n\tconst new_ship = {\"name\": req.body.name, \"type\": req.body.type, \"length\": req.body.length, \"owner\": req.user.name};\n\treturn datastore.save({\"key\": key, \"data\": new_ship}).then(() => {return key});\n}", "function refresh_pokemon_layer() {\n // 1、Prepare new layer\n var layer = new Microsoft.Maps.Layer();\n var pushpins = [];\n for (var i in map_manager.map_items) {\n var map_item = map_manager.map_items[i];\n var icon_url = 'https://raw.githubusercontent.com/longshootzb/firstproject/master/pokemon/' + map_item[\"pokemon_id\"] + '.png';\n var count_down = get_counter_down_time_from_expire_epoch(map_item[\"expire\"]);\n var pushpin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(map_item[\"latitude\"], map_item[\"longitude\"]), \n {title: count_down,\n icon: icon_url});\n pushpins.push(pushpin);\n }\n layer.add(pushpins);\n // 2、Remove old layer\n map_manager.map.layers.clear();\n // 3、Add new layer\n map_manager.map.layers.insert(layer);\n}", "function updateItemTank() {\n const crashedItemLife = myitemTank.some(function (obstacle) {\n return player.crashWith(obstacle);\n });\n if (crashedItemLife) {\n player.increaseLive();\n let filter = myitemTank.filter(function (obstacle) {\n return player.crashWith(obstacle);\n });\n let index = myitemTank.indexOf(filter[0]);\n myitemTank.splice(index, 1);\n } else {\n for (i = 0; i < myitemTank.length; i++) {\n myitemTank[i].y += -1;\n myitemTank[i].update();\n }\n if (myGameArea.frames % 200 === 0) {\n let x = myGameArea.canvas.width;\n let y = myGameArea.canvas.height;\n let randomHeight = Math.floor(Math.random() * (x - 110)) + 50;\n myitemTank.push(new Component(60, 70, \"./imagenes/tanque.png\", randomHeight, y));\n }\n }\n}", "function fnMarkClickedCellAsShip() {\n switch (gameState) {\n case SHIP_DEF_PHASE:\n fnDefineOwnShips();\n break;\n case CONFIG_PHASE:\n fnDefineCompsShips();\n break;\n default:\n alert(\"You can't change the position of your ships during the game.\");\n return;\n }\n}", "spawnCreep(base, lane){\n let creep = null;\n for(let i = 0; i < this.creeps.length; i++){\n if(this.creeps[i].dead){\n creep = this.creeps[i];\n break;\n }\n }\n if(!creep){\n creep = new Creep({id: this.creeps.length});\n this.creeps.push(creep);\n }\n creep.base = base.id;\n creep.lane = lane.id;\n creep.direction = base.id === lane.from? 1 : -1;\n creep.lane_index = base.id === lane.from? 0 : lane.tiles.length - 1;\n creep.health = config.tiers.creep.health[base.creep_health_tier];\n creep.dead = false;\n }", "addToMoveListAndBroadcast(move, gameID) {\n let moves = Connection.games.get(gameID)\n move.id = moves.length + 1\n this.broadcast(move, gameID)\n moves.push(move) \n }", "function setShip(location, ship, orientation, genericFleet, type) {\n\t// Checking Ship For Overlap Player 2 //\n\tif (!(checkOverlap(location, ship.length, orientation, genericFleet))) {\n\t\t// Player 2 Horizontal Ship Placement Details//\n\t\tif (orientation == \"horz\") {\n\t\t\t// Player 2 Horizontal Ship Hit Locations //\n\t\t\tgenericFleet.ships[genericFleet.currentShip].populateHorzHits(location);\n\t\t\t$(\".text\").text(coms.placed(genericFleet.ships[genericFleet.currentShip].name + \" has\"));\n\t\t\t// Adding Player 2 Horizontal Ship To Board //\n\t\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t\t$(\".bottom3 .\" + i).addClass(genericFleet.ships[genericFleet.currentShip].name);\n\t\t\t\t$(\".bottom3 .\" + i).children().removeClass(\"hole\");\n\t\t\t}\n\t\t\t// When Player 2 Horizontal Ship Placed... //\n\t\t\tif (++genericFleet.currentShip == genericFleet.numOfShips) {\n\t\t\t\t// Naval Command Communicates... //\n\t\t\t\t$(\".text\").text(coms.placed(\"ships have\"));\n\t\t\t\t// & Mouse Tracking Turns Off //\n\t\t\t\t$(\".bottom3\").find(\".points\").off(\"mouseenter\");\n\t\t\t\t// Delay For Smoother User Experience //\n\t\t\t\tsetTimeout(hideBoard3, 500);\t\t\t\t\n\t\t\t\tsetTimeout(startGame, 500);\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Player 2 Random Ship Placement //\n\t\t\t\tif (type == \"random\") randomSetupMultiP2(genericFleet);\n\t\t\t\t// Player 2 Self Ship Placement //\n\t\t\t\telse placeShipP2(genericFleet.ships[genericFleet.currentShip], genericFleet);\n\t\t\t}\n\t\t} else {\n\t\t\tvar inc = 0;\n\t\t\t// Player 2 Vertical Ship Hit Locations //\n\t\t\tgenericFleet.ships[genericFleet.currentShip].populateVertHits(location);\n\t\t\t$(\".text\").text(coms.placed(genericFleet.ships[genericFleet.currentShip].name + \" has\"));\n\t\t\t// Adding Player 2 Vertical Ship To Board //\n\t\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t\t$(\".bottom3 .\" + (location + inc)).addClass(genericFleet.ships[genericFleet.currentShip].name);\n\t\t\t\t$(\".bottom3 .\" + (location + inc)).children().removeClass(\"hole\");\n\t\t\t\tinc = inc + 10;\n\t\t\t}\n\t\t\t// When Player 2 Vertical Ship Placed... //\n\t\t\tif (++genericFleet.currentShip == genericFleet.numOfShips) {\n\t\t\t\t// Naval Command Communicates... //\n\t\t\t\t$(\".text\").text(coms.placed(\"ships have\"));\n\t\t\t\t// & Mouse Tracking Turns Off //\n\t\t\t\t$(\".bottom3\").find(\".points\").off(\"mouseenter\");\n\t\t\t\t// Delay For Smoother User Experience //\n\t\t\t\tsetTimeout(hideBoard3, 500);\t\t\t\t\n\t\t\t\tsetTimeout(startGame, 500);\t\t\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Player 2 Random Ship Placement //\n\t\t\t\tif (type == \"random\") randomSetupMultiP2(genericFleet);\n\t\t\t\t// Player 2 Self Ship Placement //\n\t\t\t\telse placeShipP2(genericFleet.ships[genericFleet.currentShip], genericFleet);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Player 2 Random Ship Placement //\n\t\tif (type == \"random\") randomSetupMultiP2(genericFleet);\n\t\t// Player 2 Self Ship Placement //\n\t\telse $(\".text\").text(coms.error);\n\t}\n }", "async function main() {\n let ships = {}\n\n let ref = admin.firestore().collection(\"nmsce/Euclid/Ship\")\n // ref = ref.limit(100)\n\n let snapshot = await ref.get()\n\n for (let doc of snapshot.docs) {\n let name = doc.data().Name\n\n if (typeof name === \"string\" && name !== \"\") {\n name = name.replace(/(?:[A-Z]{2}\\d\\s)?(\\D*)$|(\\D*?)(?:\\s[A-Z]{2}\\d\\s?)?$/, \"$1$2\")\n name = name.replace(/(.*?)[XIV]+$/, \"$1\")\n\n if (typeof ships[name] === \"undefined\") {\n ships[name] = {}\n ships[name].count = 0\n ships[name].list = []\n ships[name].seed = []\n }\n\n ships[name].count++\n ships[name].list.push(doc.data().Name)\n ships[name].list.push(doc.data().Seed)\n }\n }\n\n for (let key of Object.keys(ships))\n if (ships[key].count >= 5)\n console.log(ships[key].count, ships[key].list, ships[key].seed)\n}", "function checkShipPlacement() {\n if (!displayGrid.querySelector('.ship')) allShipsPlaced = true;\n }", "function delete_ship(id){\n console.log(\"INSIDE DELETE_SHIP\");\n const key = datastore.key([SHIP, parseInt(id,10)]);\n return datastore.get(key).then( result => {\n\n //Delete the ship\n return datastore.delete(key).then(()=>{\n console.log(\"EXITING DELETE SHIP\");\n return true;\n });\n }).catch( err => {\n return false;\n });\n}", "function delete_ship(id){\n console.log(\"INSIDE DELETE_SHIP\");\n const key = datastore.key([SHIP, parseInt(id,10)]);\n return datastore.get(key).then( result => {\n\n //Delete the ship\n return datastore.delete(key).then(()=>{\n console.log(\"EXITING DELETE SHIP\");\n return true;\n });\n }).catch( err => {\n return false;\n });\n}", "function createInitialShips() {\n\tentityManager.generateShip();\n}", "function gameTick(){\n for(var i in players) {\n // console.log(\"is it colliding?\");\n // console.log(\"this is colliding: \" + map.colliding(players[i]));\n \n p = players[i];\n p.x = p.x + p.vX;\n p.y = p.y + p.vY;\n var collision = map.colliding(players[i]);\n \n\n if(collision){\n // if there's an item collision \n \n \n if(typeof collision.itemid !== 'undefined') {\n // collected an item!\n map.remove(collision);\n delete items[collision.itemid];\n sio.sockets.emit('item pickup', {\n itemid: collision.itemid, \n userid: p.userid\n });\n p.score++;\n // generate a new one\n createServerItem(Math.random()*CANVAS_WIDTH,Math.random()*CANVAS_HEIGHT,0,16,16,\"power\");\n }\n // if there are collisions, don't move this guy, but move him backwards to get out of the collision\n else {\n p.x = p.x - p.vX;\n p.y = p.y - p.vY;\n\n\n }\n \n }\n // redo x and y so it isn't beyond boundaries\n }\n for(var j in items) {\n item = items[j];\n item.x = item.x;\n item.y = item.y;\n // redo x and y so it isn't beyond boundaries\n }\n // check for collision: Quadtree implementation\n \n // if(map.root.players.length > 0){\n // console.log('yes!');\n // console.log(map.root.players[0]);\n // console.log(map.root.players[1]);\n // }\n //console.log(map)\n map.clear();\n //console.log(map)\n _.each(players, function(item){ map.insert(item); });\n _.each(items, function(item){ map.insert(item); });\n \n }", "function updateAll()\n{\n // move the snake\n var sl = snake.length - 1; \n snake.push({x: snake[sl].x + dx, y: snake[sl].y + dy});\n snake.shift(); \n}", "function currently_in_use_getStocksAndVehicles(trips, timeRange){\n\t// Returns vehicles as objects\n\t// Best one\n\tvar stocks = [];\n\tvar vehicles = [];\n\n stocks.push({\n type : 'inTransit',\n name : 'inTransit',\n id : 'inTransit',\n initial: 0,\n stackOrder: 0,\n values : []\n });\n stocks.push({\n type : 'dispatched',\n name : 'dispatched',\n id : 'dispatched',\n initial: 0,\n stackOrder: 1,\n values : []\n });\n\ttrips.forEach(function(trip) {\n if (stocks.find(d => d.name==trip.start_station)==null) {\n stocks.push({\n type : 'station',\n name : trip.start_station_name,\n id : trip.start_station,\n lat : trip.start_station_lat,\n lng : trip.start_station_lng,\n initial: 0,\n stackOrder: 10,\n values : []\n });\n }\n if (stocks.find(d => d.name==trip.end_station)==null){\n stocks.push({\n type : 'station',\n name : trip.end_station_name,\n id : trip.end_station,\n lat : trip.end_station_lat,\n lng : trip.end_station_lng,\n initial: 0,\n stackOrder: 10,\n values : []\n });\n }\n\t\tif (vehicles.find(d => d.vehicle_id == trip.bikeid)==null) {\n\t\t\tvehicles.push({vehicle_id : trip.bikeid});\n\t\t\tstocks.find(d => d.name==trip.start_station).initial++;\n\t\t}\n\t\tif(trip.start_date<=timeRange[0]){\n\t\t\tif(trip.type==\"full\") stocks.find(function(d){return d.name=='inTransit'}).initial++;\n\t\t\tif(trip.type==\"empty\") stocks.find(function(d){return d.name=='dispatched'}).initial++;\n\t\t}\n\t});\n\treturn {\n\t\tstocks: stocks,\n\t\tvehicles: vehicles\n\t}\n}", "function movedFromRacktoTile(index, newlyDropped)\n {\n\t\tswitch(newlyDropped)\n\t\t\t{\n\t\t\t\t// moved to the double word score\n\t\t\t\tcase \"droppable\": \n\t\t\t\t{\n\t\t\t\t\tscore = score + tile[index].value;\n\t\t\t\t\tscore = score + score;\n\t\t\t\t\twordFlag = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"droppable5\":\n\t\t\t\t{\n\t\t\t\t\twordFlagCheckBegin();\n\t\t\t\t\tscore = score + 2 * tile[index].value;\n\t\t\t\t\twordFlagCheckEnd();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"droppable7\":\n\t\t\t\t{\n\t\t\t\t\twordFlagCheckBegin();\n\t\t\t\t\tscore = score + 2 * tile[index].value;\n\t\t\t\t\twordFlagCheckEnd();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t{\n\t\t\t\t\twordFlagCheckBegin();\n\t\t\t\t\tscore = score + tile[index].value;\n\t\t\t\t\twordFlagCheckEnd();\n\t\t\t\t}\n\t\t\t}\t\n}", "function deleteMarkers() {\n clearMarkers();\n vm.coffeeShops.removeAll();\n vm.hipsterShops.removeAll();\n}", "function Fleet(id) {\n\tthis.id = id;\n\tvar fleetArray = [];\n\tthis.fleetArray = fleetArray;\n\n}", "function dropPins(map, items) {\n var length;\n // var map = new google.maps.Map(document.getElementById('map'), { center: loc, zoom: 12 });\n if( items.length === undefined ) {\n length = 1;\n } else {\n length = items.length;\n }\n\n for (var i = 0; i < length; i++) {\n marker = new google.maps.Marker({\n map: map,\n draggable: true,\n animation: google.maps.Animation.DROP,\n position: {\n lat: restaurants[i].coordinates.latitude,\n lng: restaurants[i].coordinates.longitude\n }\n });\n\n clearMarkers();\n }\n\n function clearMarkers() {\n markers = [];\n\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n }\n\n marker.addListener('click', toggleBounce);\n\n function toggleBounce() {\n if (marker.getAnimation() !== null) {\n marker.setAnimation(null);\n } else {\n marker.setAnimation(google.maps.Animation.BOUNCE);\n }\n }\n }", "function updateSpotsIfChanged() {\n console.log('updating spots if changed');\n var prev = JSON.stringify(spots);\n getSpots(function () {\n if (!_.isEqual(JSON.stringify(spots), prev)) {\n console.log(spots);\n $('#parking .spot').each(function (i, e) {\n console.log($(this).attr('id'));\n if (spots[$(this).attr('id')] > 0) {\n $('#' + $(this).attr('id')).addClass('green');\n $('#' + $(this).attr('id')).append('<img src=\"images/car.png\" class = \"car\"/>');\n }\n else {\n $('#' + $(this).attr('id')).removeClass('green');\n $('#' + $(this).attr('id') + ' .car').remove();\n }\n });\n }\n });\n\n setTimeout(function () {\n if (!stop) updateSpotsIfChanged();\n }, 30000);\n }", "function querySavedTrips() {\n firebase.database().ref('users/'+ firebase.auth().currentUser.uid + '/trips/').once('value', function(tripsSnapshot){\n tripsSnapshot.forEach((tripsSnapshot) => {\n let tripInfo = tripsSnapshot.val();\n const tripName = tripsSnapshot.key;\n let placeIds = [];\n if (typeof(tripInfo) === 'object') {\n placeIds = Object.keys(tripInfo.placeIds);\n } \n addTripToDash(tripName, placeIds);\n });\n });\n}", "#push() {\n const { x, y } = this.#snake[this.#snake.length - 1];\n this.#snake.push({ x, y });\n }", "function flipAlive() {\n\t\t$(this).toggleClass(\"alive\");\n\t\t$(this).toggleClass(\"dead\");\n\t\tgridArray[parseInt($(this).parent().attr('id'), 10)][parseInt($(this).attr('id'), 10)] = 0;\n\t\tif (liveCells.myIndexOf([parseInt($(this).parent().attr(\"id\"), 10), parseInt($(this).attr('id'), 10)]) !== -1) {\n\t\t\tliveCells.splice(liveCells.myIndexOf([parseInt($(this).parent().attr(\"id\"), 10), parseInt($(this).attr('id'), 10)]), 1);\n\t\t}\n\t\t// console.log(liveCells);\n\t}", "function houseKeepIssues () {\n if (store.issuesBySprintNumber.length > config.velocityHistoryLength + 1) {\n let iterator = store.issuesBySprintNumber.keys()\n let entry\n while ((entry = iterator.next()) && !entry.done) {\n if (Math.abs(store.sprintNumber - entry.value) > 10 || store.sprintNumber < entry.value) {\n store.issuesBySprintNumber.delete(entry.value)\n }\n }\n }\n}", "function removeSavedTrip(id) {\n const trips = getSavedTrips();\n const tripIndex = trips.findIndex((trip) => {\n return trip.id === id;\n });\n\n if (tripIndex > -1) {\n trips.splice(tripIndex, 1);\n }\n console.log(trips);\n localStorage.setItem(\"trips\", JSON.stringify(trips));\n reload();\n}", "if(snakes[1].loc.dist(food.loc) === 0){\n food.pickLoc();\n snakes[1].addSegment();\n\n}", "function storeInOverpassData(town, date, elements){\n \n var overpassRoutes = localStorage.getItem(\"overpass_routes\");\n \n var storeRoutes = false;\n var storeStops = false;\n\n if (overpassRoutes === null){\n overpassRoutes=[];\n storeRoutes=true;\n //console.log(\"AllOWED TO STORE ROUTE (Initial): \"+town); \n } else {\n overpassRoutes=JSON.parse(overpassRoutes);\n for (var i=0; i<overpassRoutes.length;i++){\n if (overpassRoutes[i].town != null){ // Bricht sonst ohne Fehlermeldung ab\n if(overpassRoutes[i].town.indexOf(town) != 0){ // Test ob Routen der Stadt schon gespeichert\n storeRoutes=true;\n //console.log(\"AllOWED TO STORE ROUTE: \"+town);\n }\n }\n }\n }\n if (overpassStops.length === 0){\n storeStops=true;\n //console.log(\"AllOWED TO STORE STOPS (Initial): \"+town);\n } else{\n for (var n=0; n<overpassStops.length;n++){\n if (overpassStops[n].town != null){ // Bricht sonst ohne Fehlermeldung ab\n if(overpassStops[n].town.indexOf(town) != 0){ // Test ob Stops der Stadt schon gespeichert\n storeStops=true;\n //console.log(\"AllOWED TO STORE STOPS: \"+town);\n }\n }\n }\n\n }\n \n //Filtere Stops und Routen\n var routes = [];\n var stops = [];\n\n // Switch Case für alles was gespeichert werden muss (viel Code aber eigentlich wenige Unterschiede, minimiert aber Aufwand)\n if (storeStops && storeRoutes){ //Beide\n //console.log(\"Trying to store stops and routes\");\n for (var k=0; k<elements.length; k++){\n if (elements[k].type === \"relation\"){ //Relation -> Route\n //console.log(\"PUSHED ROUTE: \" + elements[k].tags.name);\n routes.push(elements[k]);\n }else if (elements[k].tags != null){\n if((elements[k].tags.highway === \"bus_stop\")||(elements[k].tags.amenity === \"bus_station\")||(elements[k].tags.public_transport === \"platform\")){\n //console.log(\"PUSHED STOP: \" + elements[k].tags.name);\n stops.push(elements[k]);\n }\n }\n }\n var obj1 = new Object();\n obj1.town=town;\n obj1.date=date;\n obj1.elements=stops;\n\n overpassStops.push(obj1);\n localStorage.setItem(\"overpass_stops\",JSON.stringify(overpassStops));\n\n var obj2 = new Object();\n obj2.town=town;\n obj2.date=date;\n\n obj2.elements=routes;\n overpassRoutes.push(obj2);\n localStorage.setItem(\"overpass_routes\",JSON.stringify(overpassRoutes));\n } \n else if (!storeStops && storeRoutes){ //Nur Routes\n //console.log(\"Trying to store routes\");\n for (var k=0; k<elements.length; k++){\n if (elements[k].type === \"relation\"){ //Relation -> Route\n routes.push(elements[k]);\n }\n }\n var obj = new Object();\n obj.town=town;\n obj.date=date;\n obj.elements=routes;\n overpassRoutes.push(obj);\n localStorage.setItem(\"overpass_routes\",JSON.stringify(overpassRoutes));\n }\n else if (storeStops && !storeRoutes){// Nur Stops\n //console.log(\"Trying to store stops\");\n for (var k=0; k<elements.length; k++){\n if (elements[k].tags != null){\n if((elements[k].tags.highway === \"bus_stop\")||(elements[k].tags.amenity === \"bus_station\")||(elements[k].tags.public_transport === \"platform\")){\n stops.push(elements[k]);\n }\n }\n }\n var obj = new Object();\n obj.town=town;\n obj.date=date;\n obj.elements=stops;\n overpassStops.push(obj);\n localStorage.setItem(\"overpass_stops\",JSON.stringify(overpassStops));\n } \n \n }", "AddPosition(RawSpotList) {\n for (let i = 0; i < RawSpotList.length; i++) {\n // calculate relevant location first// only cache the location list\n this.PushToLocationList(RawSpotList[i]);\n // how to determine a RouteID by GPSid\n let currentRouteID = this.GetRouteIDFromSpot(RawSpotList[i].GPSid); // Get Route from coming GPSid\n //\n let currentLeg = this.GetCurrentLegByRouteID(currentRouteID); // current leg object get from DB\n let position = new Position(RawSpotList[i], currentRouteID, currentLeg); // position will write to currentRoute\n //====For debug=========\n console.log(position.CurrentRouteID); //for debug\n console.log(position.CurrentLeg); //for debug\n console.log(position.Spot); //for debug\n //====For debug=========\n position.UpdateLegStatus(); // update status\n }\n }" ]
[ "0.6251798", "0.588347", "0.57260734", "0.5708157", "0.5685251", "0.5593833", "0.5570978", "0.55329376", "0.54191667", "0.5413811", "0.5404049", "0.53766936", "0.53735465", "0.5368961", "0.53679925", "0.5320632", "0.5312145", "0.5298861", "0.5289078", "0.5282714", "0.5277696", "0.52638495", "0.5257229", "0.52499753", "0.5245179", "0.52319306", "0.5226721", "0.52177656", "0.5198036", "0.5196556", "0.5191396", "0.5178811", "0.51665944", "0.51593024", "0.5157261", "0.5144191", "0.5140517", "0.51356786", "0.5131264", "0.5130458", "0.5129296", "0.5127843", "0.51098686", "0.51039743", "0.50951636", "0.50752664", "0.5074501", "0.5073544", "0.5037704", "0.5031651", "0.502868", "0.5027869", "0.5019694", "0.5018157", "0.5017287", "0.50156766", "0.50099504", "0.5008053", "0.500071", "0.49988556", "0.49892026", "0.4988609", "0.49786696", "0.49781275", "0.49675584", "0.49652082", "0.49651858", "0.49593994", "0.49531627", "0.49530178", "0.49512336", "0.49500626", "0.4949623", "0.4948484", "0.4946838", "0.49451035", "0.49439523", "0.494383", "0.49428296", "0.4933699", "0.49286273", "0.49280104", "0.49201468", "0.49201468", "0.4914721", "0.48951986", "0.48950824", "0.48924923", "0.48849452", "0.48840955", "0.48831102", "0.48808664", "0.48780307", "0.48773777", "0.4874293", "0.4873923", "0.48731473", "0.4872864", "0.4872731", "0.48643655", "0.4857362" ]
0.0
-1
Naval Command Ship Placement
function randomSetup(fleet) { if (fleet.currentShip >= fleet.numOfShips) return; var orien = Math.floor((Math.random() * 10) + 1); var length = fleet.ships[fleet.currentShip].length; if (orien < 6) { var shipOffset = 11 - fleet.ships[fleet.currentShip].length; var horiz = Math.floor((Math.random() * shipOffset) + 1); var vert = Math.floor(Math.random() * 9); var randNum = parseInt(String(vert) + String(horiz)); if (fleet == npcFleet) checkOverlap(randNum, length, "horz", fleet); else setShip(randNum, fleet.ships[fleet.currentShip], "horz", fleet, "random"); } else { var shipOffset = 110 - (fleet.ships[fleet.currentShip].length * 10); var randNum = Math.floor((Math.random() * shipOffset) + 1); if (fleet == npcFleet) checkOverlap(randNum, length, "vert", fleet); else setShip(randNum, fleet.ships[fleet.currentShip], "vert", fleet, "random"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "placeShip(ship,position){\n\n // if the ship is horizontal\n if (ship.vertical == false){\n for( let i = 0; i < ship.length; i++){\n this.grid[parseInt(position.charAt(0))][parseInt(position.charAt(1))+i] = ship.name+(i+1)\n } \n }\n else{\n // if ship is vertical\n for( let i = 0; i < ship.length; i++){\n this.grid[parseInt(position.charAt(0))+i][parseInt(position.charAt(1))] = ship.name+(i+1)\n }\n \n }\n // adds ship to the shipsPlaced array\n this.shipsPlaced.push(ship) \n this.message = 'Place all your ships and then press ready'\n }", "function place(player, ship, x, y, d) {\n if (this.game.state != this.state.SETUP) return this.response.code.GAME_COMMENCED;\n if (!checkValidPlayer(player)) return this.response.code.INVALID_PLAYER;\n if (ship > fleet[player].length) return this.response.code.SHIP_INVALID; \n \n // Calculate bounds of the ship starting from the most North / East co-ordinate - transforming ship direction to South or East \n\n var start = {\n \"x\": parseInt(x)\n , \"y\": parseInt(y)\n };\n var current = {\n \"x\": parseInt(x)\n , \"y\": parseInt(y)\n };\n var end = {\n \"x\": parseInt(x)\n , \"y\": parseInt(y)\n };\n \n var coords = [];\n\n switch (d) {\n case this.direction.SOUTH :\n end.x = x + fleet[player][ship].length - 1;\n break;\n case this.direction.NORTH :\n // transform North to South\n start.x = x - fleet[player][ship].length + 1;\n current.x = x - fleet[player][ship].length + 1;\n d = this.direction.SOUTH;\n break;\n case this.direction.WEST :\n // transform West to East\n start.y = y - fleet[player][ship].length + 1;\n current.y = y - fleet[player][ship].length + 1;\n d = this.direction.EAST;\n break;\n case this.direction.EAST :\n end.y = y + fleet[player][ship].length - 1;\n break;\n default :\n return this.response.code.DIRECTION_INVALID;\n }\n \n // out of bounds\n if ( start.x < 0 \n || start.y < 0 \n || end.x >= game.WIDTH\n || end.y >= game.HEIGHT) { return this.response.code.POSITION_OUT_OF_BOUNDS; }\n\n var coord;\n\n switch (d) {\n case this.direction.NORTH :\n case this.direction.SOUTH :\n\n while (current.x <= end.x) {\n coord = current.x.toString() + \",\" + current.y.toString();\n\n if (typeof layout[player][coord] == 'undefined'\n || layout[player][coord] == ship) {\n coords.push(coord);\n } else {\n return this.response.code.SHIP_POSITION_INVALID;\n }\n current.x++;\n }\n break;\n case this.direction.EAST :\n case this.direction.WEST :\n while (current.y <= end.y) {\n coord = current.x.toString() + \",\" + current.y.toString();\n\n if (typeof layout[player][coord] == 'undefined'\n || layout[player][coord] == ship) {\n coords.push(coord);\n } else {\n return this.response.code.SHIP_POSITION_INVALID;\n }\n current.y++;\n }\n break;\n }\n\n // This isn't a great way to fail, but will do\n if (coords.length == fleet[player][ship].length) {\n\n // remove the old ships coordinates\n while (fleet[player][ship].coords.length > 0) {\n delete layout[player][ fleet[player][ship].coords.shift() ];\n }\n\n for (var c = 0; c < coords.length; c++) {\n layout[player][coords[c]] = ship;\n }\n\n fleet[player][ship].coords = coords;\n\n return this.response.code.SUCCESS;\n } else {\n return this.response.code.SHIP_POSITION_INVALID;\n };\n }", "function displayRelativeShipmentLocation(infoNeeded) {\n //Set variables for the current customer and order selected\n let currentCustomer = vm.customers[vm.currentIndices.customer];\n let currentOrder = currentCustomer.orders[vm.currentIndices.order];\n let currentShipment;\n\n //InfoNeeded indicates that a shipment has been selected and info needs to be displayed\n //Therefore the currentShipment is defined\n if(infoNeeded == true)\n currentShipment = currentOrder.shipments[vm.currentIndices.shipment];\n\n var string = \"<px-steps \";\n string += \"items=\\'[\";\n string += \"{\\\"id\\\":\\\"1\\\", \\\"label\\\":\\\"(ORIGIN) \";\n\n //If a shipment is selected display needed information in the component\n if(infoNeeded == true){\n //If location is undefined display the longitude and latitude\n if(generalLocationOrigin[vm.currentIndices.shipment] == \"\")\n string += currentShipment.origin.latitude + \", \" + currentShipment.origin.longitude;\n //Display location\n else\n string += generalLocationOrigin[vm.currentIndices.shipment];\n }\n\n string += \"\\\"},\";\n string += \"{\\\"id\\\":\\\"2\\\", \\\"label\\\":\\\"(CURRENT) \";\n\n //If a shipment is selected display needed information in the component\n if(infoNeeded == true){\n //If location is undefined display the longitude and latitude\n if(generalLocationCurrent[vm.currentIndices.shipment] == \"\")\n string += currentShipment.current_location.latitude + \", \" + currentShipment.current_location.longitude;\n //Display location\n else\n string += generalLocationCurrent[vm.currentIndices.shipment];\n } \n\n string += \"\\\"},\";\n string += \"{\\\"id\\\":\\\"3\\\", \\\"label\\\":\\\"(TO) \";\n\n //If a shipment is selected display needed information in the component\n if(infoNeeded == true){\n //If location is undefined display the longitude and latitude\n if(generalLocationDestination[vm.currentIndices.shipment] == \"\")\n string += currentShipment.destination.latitude + \", \" + currentShipment.destination.longitude;\n //Display location\n else\n string += generalLocationDestination[vm.currentIndices.shipment];\n }\n\n string += \"\\\"}]\\' completed=\\'[\\\"1\\\",\\\"2\\\"\";\n\n //If the current location is at the destination then mark the desination location\n if(infoNeeded){\n if(currentShipment.current_location.latitude == currentShipment.destination.latitude){\n if(currentShipment.current_location.longitude == currentShipment.destination.longitude){\n string += \",\\\"3\\\"\";\n }\n }\n }\n\n string += \"]\\'+</px-steps>\";\n\n\n document.getElementById(\"STEPS\").innerHTML = string;\n }", "function moveWaypoint(commands) {\n //ship and waypoint starting position\n const ship = { x: 0, y: 0 };\n let waypoint = { x: 10, y: -1 };\n\n commands.forEach((command) => {\n switch (command.action) {\n //move the ship to the waypoint\n case 'F':\n ship.x += waypoint.x * command.value;\n ship.y += waypoint.y * command.value;\n break;\n //rotate the waypoint around the ship\n case 'L':\n case 'R':\n waypoint = rotateWaypoint(waypoint, command);\n break;\n //move the waypoint\n default:\n waypoint.x += command.value * directions[command.action].x;\n waypoint.y += command.value * directions[command.action].y;\n }\n });\n //return Manhattan distance of the ship from the start\n return Math.abs(ship.x) + Math.abs(ship.y);\n}", "function checkShipPlacement() {\n if (!displayGrid.querySelector('.ship')) allShipsPlaced = true;\n }", "function checkShipPlacement( placedShipObj ){\n placedShip = placedShipObj.name;\n placedLocation = placedShipObj.cell;\n placedOrientation = placedShipObj.rotation;\n\n var placedHGrid = placedLocation.substr(1, 2).toString(); //check the 2nd (and maybe the 3rd) char of the grid location\n var placedVGrid = placedLocation.substr(0, 1).toString(); //check the 1st char of the grid location\n\n var validHGrid = { // use with rotation === 0\n \"AircraftCarrier\": [1,2,3,4,5,6],\n \"Battleship\": [1,2,3,4,5,6,7],\n \"Destroyer\": [1,2,3,4,5,6,7,8],\n \"Submarine\": [1,2,3,4,5,6,7,8],\n \"PtBoat\": [1,2,3,4,5,6,7,8,9],\n };\n\n var validVGrid = { // use with rotation === 90\n \"AircraftCarrier\": [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"],\n \"Battleship\": [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\"],\n \"Destroyer\": [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\"],\n \"Submarine\": [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\"],\n \"PtBoat\": [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\"],\n };\n\n if( placedOrientation === 0 ){ // HORIZONTAL\n var validH = validHGrid[ placedShip ].indexOf( parseInt(placedHGrid, 10) ); // .toString()\n if ( validH === -1 ) {\n var lastValidElement = validHGrid[ placedShip ][ validHGrid[ placedShip ].length-1 ];\n var fixedCell = placedVGrid + lastValidElement.toString(); // add that after the current placedVGrid\n console.log( \"fixedCell\", fixedCell );\n placedLocation = fixedCell;\n var fixedDistance = validHGrid[ placedShip ].indexOf( parseInt(placedHGrid, 10) ) - validHGrid[ placedShip ].indexOf( parseInt(lastValidElement, 10) );// index of place cell minus the index of the fixed cell\n fixedDistance = fixedDistance * 25;\n var getTheShip = \"#draggable\"+ placedShip.name;\n var theShipStyle = $(getTheShip).attr('style');\n console.log(\"theShipStyle\", theShipStyle);\n }\n } else { // VERTICAL\n var validV = validVGrid[ placedShip ].indexOf( placedVGrid );\n console.log(placedShip, \"is at\", placedVGrid, \"and can be in\",validVGrid[ placedShip ]);\n if ( validV === -1 ) {\n var lastValidElement = validVGrid[ placedShip ][ validVGrid[ placedShip ].length-1 ]; // the linter incorrectly thinks this var has already been defined. There is another assignment but inside the conditional. The logic will only use one or the other.\n var fixedCell = lastValidElement + placedHGrid; // add that after the current placedVGrid\n console.log( \"fixedCell\", fixedCell );\n placedLocation = fixedCell;\n var fixedDistance = validVGrid[ placedShip ].indexOf( parseInt(placedVGrid, 10) ) - validVGrid[ placedShip ].indexOf( parseInt(lastValidElement, 10) );// index of place cell minus the index of the fixed cell\n fixedDistance = fixedDistance * 25;\n var getTheShip = \"#draggable\"+ placedShip.name;\n var theShipStyle = $(getTheShip).attr('style');\n console.log(\"theShipStyle\", theShipStyle);\n }\n }\n\n }", "function placeShipP1(ship, fleet) {\n\tvar orientation = \"horz\";\n\t// Player 1 Vertical Ship Button //\n\t$(\".vert\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"vert\";\n\t});\n\t// Player 1 Horizontal Ship Button //\n\t$(\".horz\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"horz\";\n\t});\n\t// Player 1 Ship Tracks Cursor //\n\t$(\".bottom2\").find(\".points\").off(\"mouseenter\").on(\"mouseenter\", function() {\n\t\tvar num = $(this).attr('class').slice(15);\n\t\t// Player 1 Display Ship Orientation //\n\t\tif (orientation == \"horz\") displayShipHorz1(parseInt(num), ship, this, fleet);\n\t\telse displayShipVert1(parseInt(num), ship, this, fleet);\n\t});\n}", "function moveShip(commands) {\n //ship starting position and direction\n let x = 0;\n let y = 0;\n let currentDirection = 90;\n\n commands.forEach(({ action, value }) => {\n switch (action) {\n case 'F':\n //move the ship in the direction it's heading\n x += value * headings[currentDirection].x;\n y += value * headings[currentDirection].y;\n break;\n case 'L':\n //rotate the ship to the left\n currentDirection -= value;\n if (currentDirection < 0) {\n currentDirection += 360;\n }\n break;\n case 'R':\n //rotate the ship to the right\n currentDirection += value;\n if (currentDirection >= 360) {\n currentDirection -= 360;\n }\n break;\n default:\n //move the ship\n x += value * directions[action].x;\n y += value * directions[action].y;\n }\n });\n //return Manhattan distance of the ship from the start\n return Math.abs(x) + Math.abs(y);\n}", "function followNavigationInstructionsViaWaypoint(actions) {\n const ship = new Ship(0, 0, 0, 0, 0, 1, 10, directions.NORTH, directions.EAST);\n actions.forEach((instruction) => {\n ship.MoveShipViaWaypoint(instruction);\n });\n return calcManhattanDistance(\n ship.coordinates[directions.NORTH],\n ship.coordinates[directions.SOUTH],\n ship.coordinates[directions.EAST],\n ship.coordinates[directions.WEST],\n );\n}", "function placeShipP2(ship, fleet) {\n\tvar orientation = \"horz\";\n\t// Player 2 Vertical Ship Button //\n\t$(\".vert\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"vert\";\n\t});\n\t// Player 2 Horizontal Ship Button //\n\t$(\".horz\").off(\"click\").on(\"click\", function() {\n\t\torientation = \"horz\";\n\t});\n\t// Player 2 Ship Tracks Cursor //\n\t$(\".bottom3\").find(\".points\").off(\"mouseenter\").on(\"mouseenter\", function() {\n\t\tvar num = $(this).attr('class').slice(15);\n\t\t// Player 2 Display Ship Orientation //\n\t\tif (orientation == \"horz\") displayShipHorz2(parseInt(num), ship, this, fleet);\n\t\telse displayShipVert2(parseInt(num), ship, this, fleet);\n\t});\n}", "makeShip(){\n // Rotate\n push();\n translate(this.x1, this.y1);\n angleMode(DEGREES);\n rotate(this.heading);\n noFill();\n stroke(255);\n imageMode(CENTER);\n image(pie, 0, 0, width/55, width/35);\n pop();\n // Move forward\n angleMode(DEGREES);\n this.yacceleration = width/10000*cos(this.heading);\n this.xacceleration = width/10000*sin(this.heading);\n this.y1 -= this.yVelocity;\n this.x1 += this.xVelocity;\n // If one mobile game displays control panel\n controlPanel();\n // Display bullet bullet\n bulletCount();\n }", "function Ship(length, coordinates, direction) {\r\n this.length = length;\r\n this.coordinates = coordinates;\r\n this.direction = direction;\r\n}", "rotateShip() {\n if (myApp.shipAlign == 0) {\n myApp.shipAlign = 1;\n } else {\n myApp.shipAlign = 0;\n }\n }", "placeShips(){\n for (var i = 0; i < 1; i++) {\n this.placeBattleShip()\n }\n for (i = 0; i < 2; i++) {\n this.placeSubmarine();\n }\n for (i = 0; i < 2; i++) {\n this.placeDestroyer();\n }\n for (i = 0; i < 1; i++) {\n this.placePaddleboat();\n }\n }", "function shipCost(weight, distance, isOversized){\n var cost = 0;\n if(isOversized === true){\n cost = weight * distance / 100 + 10\n }else{\n cost = weight * distance / 100\n }\n return cost\n}", "function Ship(size, sign) {\n this.size = size;\n this.sign = sign;\n}", "function setShip(location, ship, orientation, genericFleet, type) {\n\t// Checking Ship For Overlap Player 2 //\n\tif (!(checkOverlap(location, ship.length, orientation, genericFleet))) {\n\t\t// Player 2 Horizontal Ship Placement Details//\n\t\tif (orientation == \"horz\") {\n\t\t\t// Player 2 Horizontal Ship Hit Locations //\n\t\t\tgenericFleet.ships[genericFleet.currentShip].populateHorzHits(location);\n\t\t\t$(\".text\").text(coms.placed(genericFleet.ships[genericFleet.currentShip].name + \" has\"));\n\t\t\t// Adding Player 2 Horizontal Ship To Board //\n\t\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t\t$(\".bottom3 .\" + i).addClass(genericFleet.ships[genericFleet.currentShip].name);\n\t\t\t\t$(\".bottom3 .\" + i).children().removeClass(\"hole\");\n\t\t\t}\n\t\t\t// When Player 2 Horizontal Ship Placed... //\n\t\t\tif (++genericFleet.currentShip == genericFleet.numOfShips) {\n\t\t\t\t// Naval Command Communicates... //\n\t\t\t\t$(\".text\").text(coms.placed(\"ships have\"));\n\t\t\t\t// & Mouse Tracking Turns Off //\n\t\t\t\t$(\".bottom3\").find(\".points\").off(\"mouseenter\");\n\t\t\t\t// Delay For Smoother User Experience //\n\t\t\t\tsetTimeout(hideBoard3, 500);\t\t\t\t\n\t\t\t\tsetTimeout(startGame, 500);\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Player 2 Random Ship Placement //\n\t\t\t\tif (type == \"random\") randomSetupMultiP2(genericFleet);\n\t\t\t\t// Player 2 Self Ship Placement //\n\t\t\t\telse placeShipP2(genericFleet.ships[genericFleet.currentShip], genericFleet);\n\t\t\t}\n\t\t} else {\n\t\t\tvar inc = 0;\n\t\t\t// Player 2 Vertical Ship Hit Locations //\n\t\t\tgenericFleet.ships[genericFleet.currentShip].populateVertHits(location);\n\t\t\t$(\".text\").text(coms.placed(genericFleet.ships[genericFleet.currentShip].name + \" has\"));\n\t\t\t// Adding Player 2 Vertical Ship To Board //\n\t\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t\t$(\".bottom3 .\" + (location + inc)).addClass(genericFleet.ships[genericFleet.currentShip].name);\n\t\t\t\t$(\".bottom3 .\" + (location + inc)).children().removeClass(\"hole\");\n\t\t\t\tinc = inc + 10;\n\t\t\t}\n\t\t\t// When Player 2 Vertical Ship Placed... //\n\t\t\tif (++genericFleet.currentShip == genericFleet.numOfShips) {\n\t\t\t\t// Naval Command Communicates... //\n\t\t\t\t$(\".text\").text(coms.placed(\"ships have\"));\n\t\t\t\t// & Mouse Tracking Turns Off //\n\t\t\t\t$(\".bottom3\").find(\".points\").off(\"mouseenter\");\n\t\t\t\t// Delay For Smoother User Experience //\n\t\t\t\tsetTimeout(hideBoard3, 500);\t\t\t\t\n\t\t\t\tsetTimeout(startGame, 500);\t\t\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Player 2 Random Ship Placement //\n\t\t\t\tif (type == \"random\") randomSetupMultiP2(genericFleet);\n\t\t\t\t// Player 2 Self Ship Placement //\n\t\t\t\telse placeShipP2(genericFleet.ships[genericFleet.currentShip], genericFleet);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Player 2 Random Ship Placement //\n\t\tif (type == \"random\") randomSetupMultiP2(genericFleet);\n\t\t// Player 2 Self Ship Placement //\n\t\telse $(\".text\").text(coms.error);\n\t}\n }", "function posShip() {\r\n this.style.display = \"none\";\r\n menu.style.display = \"none\";\r\n shipType = menu.value;\r\n shipLength = shipKey[shipType];\r\n instructions.innerHTML = \"Use the buttons below to position your \" + shipType + \":\";\r\n divPosBtns.style.display = \"inline\";\r\n\r\n for(i=0; i<shipLength; i++) { \r\n shipArray.push(i); //Keep track of cells the ship is positioned in\r\n }\r\n finalShipArray = shipArray.slice(); //Copy shipArray to finalShipArray\r\n while(checkPlacement() == false) { //If you can't place the ship there...\r\n for(i in shipArray) {\r\n shipArray[i] = shipArray[i] + 10; //...shift the ship down one row\r\n }\r\n if(shipArray[0] > 99) { //If this causes it to go off the end of the board...\r\n for(i in shipArray) {\r\n shipArray[i] = (shipArray[i] + 1) % 10; //...move it to the top of the next column\r\n }\r\n }\r\n finalShipArray = shipArray.slice(); //Copy shipArray to finalShipArray\r\n }\r\n for(index of shipArray) {\r\n board[index].style.backgroundColor = \"gray\"; //Color the cells gray where the ship is placed\r\n }\r\n}", "function ShipsLocal() {\n\n this.go=function(command,data) {\n var c,sy,ps,h,hs,cm,pHistogram,warrantHistogram,mes=\"\";\n var parsed={};\n //alert(command+\"+\"+data);\n \n if ( command==\"cs\" || command==\"as\" ) view2.pMessage.put(\"\");\n \n if ( command==\"cell\" && data ) { // set a square to ship or empty\n parsed = view2.parseGridId(data);\n //alert ( \"cell :\"+parsed.row+\"_\"+parsed.col );\n if (parsed.prefix==\"p\") {\n if ( model.playerBasin.get(parsed.row,parsed.col) != \"s\" ) c=\"s\";\n else c=\"e\";\n model.playerBasin.put(c,parsed.row,parsed.col);\n view2.pBoard.put(c,parsed.row,parsed.col);\n }\n }\n\n if (command==\"rs\") { // remove all ships\n model.playerBasin.clear();\n view2.pBoard.fromBasin(model.playerBasin);\n }\n\n if (command==\"as\") { // automatically draw ships\n sy=new ShipYard(global.getForces());\n ps=sy.buildAll();\n model.playerBasin.clear();\n model.playerBasin.takeShips(ps);\n view2.pBoard.fromBasin(model.playerBasin);\n }\n\n if (command==\"cs\") { // check up and go playing\n h=new Harvester(model.playerBasin);\n h.search();\n model.playerBasin.cleanUp();\n view2.pBoard.fromBasin(model.playerBasin);\n hs=h.yield();\n model.playerShips = new Fleet();\n model.playerShips.take(hs);\n if ( ! model.playerShips.checkMargins() ) {\n view2.pMessage.put(\"Ships must be straight<br /> and not to touch each other. <br />Try new ones\");\n model.playerShips.clear();\n return;\n }\n pHistogram=model.playerShips.makeHistogram();\n warrantHistogram=global.getForces();\n if ( pHistogram.join() != warrantHistogram.join() ) {\n mes=\"The rules require <br />(squares:ships): \";\n mes+=view2.pStat.showClearHistogram(warrantHistogram,\"return\");\n mes+='<br />Your ships do not comply';\n if ( global._demandEqualForces ) mes+=\"<br />Try new ones\";\n view2.pMessage.put( mes );\n if ( global._demandEqualForces ) {\n model.playerShips.clear();\n return;\n }\n }\n\n model.playerStat.setShips(pHistogram);\n view2.pStat.showStat(model.playerStat.shipsAlive,model.playerStat.biggestShip,model.playerStat.shipsSunk);\n view2.pStat.showClearHistogram(pHistogram);\n if (global.hideInactivePanels) { view2.drawButtons.hide(); }\n initFight();\n }\n return;\n };\n \n function initFight() {\n if( typeof enemy != \"object\" ) throw new Error(\"ShipsLocal::go: enemy is not the global object!\");\n if( typeof player != \"object\" ) throw new Error(\"ShipsLocal::go: player is not the global object!\");\n if( typeof arbiter != \"object\" ) throw new Error(\"ShipsLocal::go: arbiter is not the global object!\");\n \n global.setStage(\"fight\");\n global.setState(\"fight\");\n \n enemy=new Enemy( model.enemyShips, model.enemyBasin, model.enemyStat, model.enemyClip, model.playerBasin, view2.eMessage, global._enemyStriker );\n //alert(\"E_hi=\"+enemy.hi());\n player=new PlayerAssistant( model.playerShips, model.playerBasin, model.playerStat, model.playerClip, view2.pMessage );\n arbiter=new Arbiter(player,enemy,global);\n if (global._strikeRule==\"bs\") {\n player._clip.load();\n enemy._clip.load();\n }\n \n if ( global.isActive(\"A\") ) {\n view2.pMessage.add(\"<br />Make your move!\"); \n arbiter.setPlayer();\n }\n else {\n view2.eMessage.add(\"Enemy has first move\");\n arbiter.setEnemy();\n enemy.strike();\n } \n }\n}", "function displayShipmentMapElementsOrder() {\n //Variables for the currently selected customer, order\n let currentCustomer = vm.customers[vm.currentIndices.customer];\n let currentOrder = currentCustomer.orders[vm.currentIndices.order];\n if (flightPathList != null)\n removeLine();\n \n clearMarkers(); //Clears markers already on the map\n\n //Clears arrays for origin, current and destination markers\n originMarkersArray = [];\n currentMarkersArray = [];\n destinationMarkersArray = [];\n\n //Clears arrays for origin, current and destination info window lists\n originInfoWindowList = [];\n currentInfoWindowList = [];\n destinationInfoWindowList = [];\n\n //Clears arrays for origin, current and destination general locations\n generalLocationOrigin = []; \n generalLocationCurrent = []; \n generalLocationDestination = [];\n\n //Finds average point of location to zoom on the map\n let latSum = 0;\n let longSum = 0;\n for (let i = 0; i < currentOrder.shipments.length; i++) {\n addShipmentMarkers(currentOrder.shipments[i], i, currentOrder.shipments.length);\n drawLine(currentOrder.shipments[i].origin, currentOrder.shipments[i].current_location, currentOrder.shipments[i].destination, currentOrder.shipments[i].delivery_state);\n latSum += currentOrder.shipments[i].origin.latitude;\n latSum += currentOrder.shipments[i].current_location.latitude;\n latSum += currentOrder.shipments[i].destination.latitude;\n longSum += currentOrder.shipments[i].origin.longitude;\n longSum += currentOrder.shipments[i].current_location.longitude;\n longSum += currentOrder.shipments[i].destination.longitude;\n }\n let latAvg = latSum / (currentOrder.shipments.length * 3);\n let longAvg = longSum / (currentOrder.shipments.length * 3);\n let avgPos = { lat: latAvg, lng: longAvg };\n \n //Zooms to average location on the map\n map.panTo(avgPos);\n }", "function readableMoveFunction(shipArray){ // not used but \"readable\" verion of the preset Code\n \n var shipArrayIn = shipArray; /* for convertion */\n \n for (var i =0;i<=11;++i) {\n \n var shipSquadronQuantity = parseInt(squadronTransfer.obj.squadron.find('a:nth-child(' + (i + 1) + ') .quantity').text());\n var quantityOfShipToPlace = 0; /* if not found in shipArrayIn then equal to 0 */\n for(var j in shipArrayIn){\n \n if (shipArrayIn[j][0] == i) {\n quantityOfShipToPlace = shipArrayIn[j][1];\n }\n }\n \n var shipDock = parseInt(squadronTransfer.obj.dock.find('a:nth-child(' + (i + 1) + ') .quantity').text());\n var shipQuantityToMove = Math.max(Math.min(quantityOfShipToPlace - shipSquadronQuantity,shipDock),-shipSquadronQuantity); /* btc */\n \n \n if (shipQuantityToMove > 0 ) {\n \n squadronTransfer.move('btc',i,shipQuantityToMove);\n }\n else if(shipQuantityToMove < 0){\n squadronTransfer.move('ctb',i,-shipQuantityToMove);\n }\n \n //if 0 do nothing\n \n }\n squadronTransfer.sendRequest()\n \n}", "function displayShipVert1(location, ship, point, fleet) {\n\tvar endPoint = (ship.length * 10) - 10;\n\tvar inc = 0; \n\t// Ship Turned Vertical Player 1 //\n\tif (location + endPoint <= 100) {\n\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t$(\".bottom2 .\" + (location + inc)).addClass(\"highlight\");\n\t\t\tinc = inc + 10;\n\t\t}\n\t\t// Place Vertical Ship On Board Player 1 //\n\t\t$(point).off(\"click\").on(\"click\", function() {\n\t\t\tsetShipMulti(location, ship, \"vert\", fleet, \"player\");\n\t\t});\n\t}\n\t// Placed Vertical Ship No Longer Tracks Cursor Player 1 //\n\t$(point).off(\"mouseleave\").on(\"mouseleave\", function() {\n\t\tremoveShipVert1(location, ship.length);\n\t});\n}", "orderDelivery({ time, address, starterIndex, mainIndex }) {\n console.log(`Order placed! ${this.starterMenu[starterIndex]} and ${this.mainMenu[mainIndex]} will be delivered to \n ${address} at ${time}`);\n }", "constructor() {\n\n // Ship position\n this.position = new Position();\n\n // Ship properties\n this.size = DEFAULT_SHIP_SIZE_FACTOR; // Size constant which is multiplied by the default ship size.\n this.speed = DEFAULT_SHIP_SPEED; // Ship movement constant, which is multiplied by the default ship speed.\n\n // There is a text and answer associated with each ship\n this.data = null; // Contains object with question and answer\n this.textColor = DEFAULT_SHIP_TEXT_COLOR // Question color\n\n // Dead ship is not updated or rendered\n this.dead = true;\n }", "function addShiploadToOp(event) {\n if (event.target.id == \"\") return;\n \n var shipIdParts = event.target.id.split(\"-\"),\n source = getAircraftSourceById(shipIdParts[1], shipIdParts[0] == \"BAS\"),\n opSource = getAirOpSourceById(shipIdParts[1], shipIdParts[0] == \"BAS\"),\n offset = $(event.target).offset(),\n adding = ((event.clientY - offset.top) < (event.target.offsetHeight / 2)),\n availSquads,\n squadsToAdd;\n\n //Add/remove all ship's aircraft\n for (var i = 0; i < 3; i++) {\n if ($(\"#airopmission\").val() == \"CAP\" && planeTypes[i] != \"F\") continue;\n\n var numDivSelector = \"#\" + source.ElementId + \"-\" + planeTypes[i] + \"-num\",\n numTdSelector = \"#mission\" + planeTypes[i];\n\n if (adding) {\n if (planeTypes[i] == \"T\") {\n squadsToAdd = source.TSquadrons;\n opSource.TSquadrons += source.TSquadrons;\n availSquads = source.TSquadrons = 0;\n } else if (planeTypes[i] == \"F\") {\n squadsToAdd = source.FSquadrons;\n opSource.FSquadrons += source.FSquadrons;\n availSquads = source.FSquadrons = 0;\n } else {\n squadsToAdd = source.DSquadrons;\n opSource.DSquadrons += source.DSquadrons;\n availSquads = source.DSquadrons = 0;\n }\n } else {\n if (planeTypes[i] == \"T\") {\n squadsToAdd = -opSource.TSquadrons;\n source.TSquadrons += opSource.TSquadrons;\n availSquads = source.TSquadrons;\n opSource.TSquadrons = 0;\n } else if (planeTypes[i] == \"F\") {\n squadsToAdd = -opSource.FSquadrons;\n source.FSquadrons += opSource.FSquadrons;\n availSquads = source.FSquadrons;\n opSource.FSquadrons = 0;\n } else {\n squadsToAdd = -opSource.DSquadrons;\n source.DSquadrons += opSource.DSquadrons;\n availSquads = source.DSquadrons;\n opSource.DSquadrons = 0;\n }\n }\n $(numDivSelector).text(availSquads.toString());\n $(numTdSelector).text(textAdd($(numTdSelector).text(), squadsToAdd));\n }\n}", "function readableMoveFunction(shipArray){ // not used but \"readable\" verion of the preset Code\n \n var shipArrayIn = shipArray; /* for convertion */\n \n for (var i =0;i<=11;++i) {\n \n var shipSquadronQuantity = parseInt(squadronTransfer.obj.squadron.find('a:nth-child(' + (i + 1) + ') .quantity').text());\n var quantityOfShipToPlace = 0; /* if not found in shipArrayIn then equal to 0 */\n for(var j in shipArrayIn){\n \n if (shipArrayIn[j][0] == i) {\n quantityOfShipToPlace = shipArrayIn[j][1];\n }\n }\n \n var shipDock = parseInt(squadronTransfer.obj.dock.find('a:nth-child(' + (i + 1) + ') .quantity').text());\n var shipQuantityToMove = Math.max(Math.min(quantityOfShipToPlace - shipSquadronQuantity,shipDock),-shipSquadronQuantity); /* btc */\n \n \n if (shipQuantityToMove > 0 ) {\n \n squadronTransfer.move('btc',i,shipQuantityToMove);\n }\n else if(shipQuantityToMove < 0){\n squadronTransfer.move('ctb',i,-shipQuantityToMove);\n }\n //if 0 do nothing\n \n }\n \n}", "function parse_shipment_instructions(char) {\n\tswitch(char) {\n\t\tcase 'A': return 'Signature required';\n\t\tcase 'B': return 'Signature and proof of identify required';\n\t\tcase 'C': return 'Lift-gate needed for pickup and delivery';\n\t\tcase 'D': return 'Fork lift needed for pickup and delivery';\n\t\tcase 'E': return 'Two people required to handle shipment';\n\t\tcase 'F': return 'Three people required to handle shipment';\n\t\tcase 'G': return 'Call to confirm before pickup';\n\t\tcase 'H': return 'Call to confirm before delivery';\n\t\tcase 'I': return 'Morning pickup before noon';\n\t\tcase 'J': return 'Afternoon pickup before 5 PM';\n\t\tdefault: return false;\n\t}\n}", "showDirection() {\n if (!this.canShowDirection()) return;\n this.removeRouteLine();\n mainNav.showDirectionBox();\n let start_pos = this.start_point.getPos();\n let params = {\n transportMode: this.transport_mode,\n routingMode: \"fast\",\n origin: start_pos.lat + ',' + start_pos.lng\n };\n if (this.via_point) {\n let via_pos = this.via_point.getPos();\n params.via = via_pos.lat + ',' + via_pos.lng;\n }\n let dest_pos = this.dest_point.getPos();\n params.destination = dest_pos.lat + ',' + dest_pos.lng;\n params.return = \"polyline,summary,actions,instructions,passthrough\";\n params.spans = \"maxSpeed,speedLimit\";\n let me = this;\n this.router.calculateRoute(params, (res) => me.successCalculate(res), this.error);\n }", "function addShipmentMarkers(shipment, index, orderSize) {\n displayLocation(shipment.origin.latitude, shipment.origin.longitude, \"origin\");\n displayLocation(shipment.current_location.latitude, shipment.current_location.longitude, \"current\");\n displayLocation(shipment.destination.latitude, shipment.destination.longitude, \"destination\");\n \n let pinColor;\n \n if (shipment.delivery_state === \"Ahead of Time\")\n pinColor = \"00C300\";\n else if (shipment.delivery_state === \"On Time\")\n pinColor = \"00C300\";\n else if (shipment.delivery_state === \"Likely to be On Time\")\n pinColor = \"DEE800\";\n else if (shipment.delivery_state === \"Likely to be Behind Schedule\")\n pinColor = \"FFBF0C\";\n else if (shipment.delivery_state === \"Behind Schedule\")\n pinColor = \"E85E00\";\n else if (shipment.delivery_state === \"Late\")\n pinColor = \"FF0000\";\n else {\n pinColor = \"999999\";\n }\n \n let origin = { lat: shipment.origin.latitude, lng: shipment.origin.longitude };\n let current = { lat: shipment.current_location.latitude, lng: shipment.current_location.longitude };\n let dest = { lat: shipment.destination.latitude, lng: shipment.destination.longitude };\n \n let formattedLocationOrigin;\n if(generalLocationOrigin[index] == \"\"){\n formattedLocationOrigin = '<p><b>Coordinates:</b></br>' + \n 'Latitude: ' + shipment.origin.latitude + \"</br>\" + \n 'Longitude: ' + shipment.origin.longitude + \"</br>\";\n }else{\n formattedLocationOrigin = '<p><b>Location:</b></br>' +\n generalLocationOrigin[index] + '</br>';\n }\n\n let formattedLocationCurrent;\n if(generalLocationCurrent[index] == \"\"){\n formattedLocationCurrent= '<p><b>Coordinates:</b></br>' + \n 'Latitude: ' + shipment.current_location.latitude + \"</br>\" + \n 'Longitude: ' + shipment.current_location.longitude + \"</br>\";\n }else{\n formattedLocationCurrent = '<p><b>Location:</b></br>' +\n generalLocationCurrent[index] + '</br>';\n }\n\n let formattedLocationDestination;\n if(generalLocationDestination[index] == \"\"){\n formattedLocationDestination = '<p><b>Coordinates:</b></br>' + \n 'Latitude: ' + shipment.destination.latitude + \"</br>\" + \n 'Longitude: ' + shipment.destination.longitude + \"</br>\";\n }else{\n formattedLocationDestination = '<p><b>Location:</b></br>' +\n generalLocationDestination[index] + '</br>';\n }\n\t let statusColor = '';\n\t switch (shipment.delivery_state) {\n case 'Ahead of Time':\n statusColor = '#00C300';\n break;\n case 'On Time':\n statusColor = '#00C300';\n break;\n case 'Likely to be On Time':\n statusColor = '#DEE800';\n break;\n case 'Likely to be Behind Schedule':\n statusColor = '#FFBF0C';\n break;\n case 'Behind Schedule':\n statusColor = '#E85E00';\n break;\n case 'Late':\n statusColor = '#FF0000';\n break;\n default:\n\t\t statusColor = '#000000';\n\t }\n let originContentString = '<div id=\"content\">' +\n '<div id=\"siteNotice\">' +\n '</div>' +\n '<h3 id=\"firstHeading\" class=\"firstHeading\">Consignment Origin ' +\n '(' + (index + 1) + ' of ' + orderSize + ')' +\n '</h3>' +\n '<div id=\"bodyContent\">' +\n\t\t\t\t'<b>Status: ' +\n\t\t\t\t'<span style=color:' +\n\t\t\t\tstatusColor +\n\t\t\t\t'>' +\n\t\t\t\tshipment.delivery_state +\n\t\t\t\t'</span></b>' +\n formattedLocationOrigin + \"</br>\" +\n '<b>Date: </b></br>' +\n shipment.ship_date +\n '</p>' +\n '</div>' +\n '<button id=\"markerInfo\" ng-click=\"vm.toggleRightSideBar()\"><i class=\"material-icons\">info</i></button></div>' +\n '</div>';\n \n var currentContentString = '<div id=\"content\">' +\n '<div id=\"siteNotice\">' +\n '</div>' +\n '<h3 id=\"firstHeading\" class=\"firstHeading\">Consignment Current Location ' +\n '(' + (index + 1) + ' of ' + orderSize + ')' +\n '</h3>' +\n '<div id=\"bodyContent\">' +\n\t\t\t\t'<b>Status: ' +\n\t\t\t\t'<span style=color:' +\n\t\t\t\tstatusColor +\n\t\t\t\t'>' +\n\t\t\t\tshipment.delivery_state +\n\t\t\t\t'</span></b>' +\n formattedLocationCurrent +\n \"</br>\" +\n '<b>Date: </b></br>' +\n shipment.ship_date +\n '</p>' +\n '</div>' +\n '<button id=\"markerInfo\" ng-click=\"vm.toggleRightSideBar()\"><i class=\"material-icons\">info</i></button></div>' +\n '</div>';\n \n var destinationContentString = '<div id=\"content\">' +\n '<div id=\"siteNotice\">' + '</div>' +\n '<h3 id=\"firstHeading\" class=\"firstHeading\">Consignment Destination ' +\n '(' + (index + 1) + ' of ' + orderSize + ')' +\n '</h3>' +\n '<div id=\"bodyContent\">' +\n\t\t\t\t'<b>Status: ' +\n\t\t\t\t'<span style=color:' +\n\t\t\t\tstatusColor +\n\t\t\t\t'>' +\n\t\t\t\tshipment.delivery_state +\n\t\t\t\t'</span></b>' +\n formattedLocationDestination +\n '</br>' +\n '<b>Date: </b></br>' +\n shipment.ship_date +\n // '</p>' +\n '</div>' +\n '<button id=\"markerInfo\" ng-click=\"vm.toggleRightSideBar()\"><i class=\"material-icons\">info</i></button></div>' +\n '</div>';\n\n var compiledOrigin = $compile(originContentString)($scope);\n var compiledCurrent = $compile(currentContentString)($scope);\n var compiledDestination = $compile(destinationContentString)($scope);\n\n let originPinImage = new google.maps.MarkerImage(\"https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%41|999999\");\n \n let currentPinImage = new google.maps.MarkerImage(\"https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=\"+(index + 1)+\"|\"+pinColor);\n \n let destinationPinImage = new google.maps.MarkerImage(\"https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%42|999999\");\n \n let originMarker = new google.maps.Marker({\n position: origin,\n map: map,\n optimized: false, \n icon: originPinImage\n });\n \n let currentMarker = new google.maps.Marker({\n position: current,\n map: map,\n optimized: false,\n icon: currentPinImage\n });\n \n let destinationMarker = new google.maps.Marker({\n position: dest,\n map: map,\n optimized: false,\n icon: destinationPinImage\n });\n \n originMarkersArray.push(originMarker);\n currentMarkersArray.push(currentMarker);\n destinationMarkersArray.push(destinationMarker);\n \n let originInfoWindow = new google.maps.InfoWindow({\n content: compiledOrigin[0]\n });\n let currentInfoWindow = new google.maps.InfoWindow({\n content: compiledCurrent[0]\n });\n let destinationInfoWindow = new google.maps.InfoWindow({\n content: compiledDestination[0]\n });\n \n originInfoWindowList.push(originInfoWindow);\n currentInfoWindowList.push(currentInfoWindow);\n destinationInfoWindowList.push(destinationInfoWindow);\n\n originMarkersArray[index].addListener('click', function () {\n closeAllInfoWindows();\n originInfoWindowList[index].open(map, originMarkersArray[index]);\n vm.currentIndices.shipment = index;\n displayRelativeShipmentLocation(true);\n customerInfo();\n shippingDetails();\n packageDetails();\n packageComments();\n });\n currentMarkersArray[index].addListener('click', function () {\n closeAllInfoWindows();\n currentInfoWindowList[index].open(map, currentMarkersArray[index]);\n vm.currentIndices.shipment = index;\n displayRelativeShipmentLocation(true);\n customerInfo();\n shippingDetails();\n packageDetails();\n packageComments();\n });\n destinationMarkersArray[index].addListener('click', function () {\n closeAllInfoWindows();\n destinationInfoWindowList[index].open(map, destinationMarkersArray[index]);\n vm.currentIndices.shipment = index;\n displayRelativeShipmentLocation(true);\n customerInfo();\n shippingDetails();\n packageDetails();\n packageComments();\n });\n \n currentMarkersArray[index].setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(function () { currentMarkersArray[index].setAnimation(null);}, 750);\n }", "function shipCost(large, medium, small){ //this is the \"normal\" function to find out the total cost of shipping based on the number of each sized packages being shipped multiplied by the individual cost to ship that particular size. \n\tvar largeRate = 9.95; //this variable represents the cost for one large package.\n\tvar medRate = 7.95; //this variable represents the cost for one medium package.\n\tvar smRate = 5.95; //this variable represents the cost for one small package.\n\tvar cost = (large * largeRate) + (medium * medRate) + (small * smRate); //this variable represents the total shipping cost based on the number of each sized packages multiplied by their individual costs to ship then added together.\n\treturn cost; //this represents the \"finished product\" or \"total\" of the function\n}", "function run() {\n\tvar shipping = new Shipping();\n\tvar credentials = {token: 'dijfowje'};\n\tvar adapter = new ShippingAdapter(credentials);\n\n\t//Old shipping object and interface\n\tvar cost = shipping.request('12345', '11373', '2 lbs');\n\n\t//New shipping object with adapated interface\n\tcost = adapter.request('12345', '11373', '2 lbs');\n}", "orderDelivery({ starterIndex = 1, mainIndex = 0, time = '20:00', address }) {\n console.log(\n `Order received! ${this.starterMenu[starterIndex]} and ${this.mainMenu[mainIndex]} will be delivered to ${address} at ${time}`\n );\n }", "function Shipping(){\n this.request = function(zipStart, zipEnd, weight){\n return \"Rs.750\";\n }\n}", "engageWarpDrive() {\n if (this.currentShip === 'Looking for a Rig' || this.position !== 'Pilot') {\n return 'had no effect'\n } else if (this.position === 'Pilot') {\n this.currentShip.warpDrive = 'engaged!'\n }\n }", "function Ship(port){\n _currentPort = port\n \n \n}", "function ship_placement_interface(n,shipplaced)\n{\n alert(\"Place your length \" + n + \" ship on the left green grid by clicking the starting and ending cells\");\n shiplength=n; \n \n \n}", "_customLocation() {\n if (this.state.somewhereElse) {\n this.getCoordsByAddress();\n } else {\n this._onForward();\n }\n }", "updateDynamic() {\n if ( this.route.length > 0) {\n this.calcBTWDTW(this.route[0],this.position);\n for (var i = 0; i < this.route.length; i++) {\n var mark = this.route[i];\n if ( mark !== undefined && mark.wp !== undefined) {\n mark.twa = this.toRelativeAngle(this.twd - mark.btw); \n mark.polars = this.polars.calc(this.tws, mark.twa);\n // calculate the starting point of the tidal vector.\n // we want the layline possitions to be 5min out so multiply all speeds by 300 as speed is in m/s\n mark.tidePoint = mark.wp.latlon.destinationPoint(this.current*300,this.toDeg(this.currentDirection+Math.PI));\n if ( mark.twa < Math.PI/2 && mark.twa > -Math.PI/2 ) {\n // calculate the starting point of the LL\n mark.stbdLLStart = mark.tidePoint.destinationPoint(mark.polars.targets.stw*300,this.toDeg(this.twd-this.tackvmgangle+Math.PI));\n mark.portLLStart = mark.tidePoint.destinationPoint(mark.polars.targets.stw*300,this.toDeg(this.twd+this.tackvmgangle+Math.PI));\n\n mark.tack = true;\n // calculate the bearings to the waypoint using the tidal vector calculations\n mark.stbdLLBTW = mark.stbdLLStart.rhumbBearingTo(mark.wp.latlon) * Math.PI/180;\n mark.portLLBTW = mark.portLLStart.rhumbBearingTo(mark.wp.latlon) * Math.PI/180;\n } else {\n mark.stbdLLStart = mark.tidePoint.destinationPoint(mark.polars.targets.stw*300,this.toDeg(this.twd-this.gybevmgangle+Math.PI));\n mark.portLLStart = mark.tidePoint.destinationPoint(mark.polars.targets.stw*300,this.toDeg(this.twd+this.gybevmgangle+Math.PI));\n mark.tack = false;\n mark.stbdLLBTW = mark.stbdLLStart.rhumbBearingTo(mark.wp.latlon) * Math.PI/180;\n mark.portLLBTW = mark.portLLStart.rhumbBearingTo(mark.wp.latlon) * Math.PI/180;\n }\n mark.twd = this.twd;\n mark.tws = this.tws;\n mark.gwd = this.gwd;\n mark.gws = this.gws;\n mark.tackvmgangle = this.tackvmgangle;\n mark.gybevmgangle = this.gybevmgangle; \n mark.twdDeg = mark.twd*180/Math.PI;\n mark.gwdDeg = mark.gwd*180/Math.PI;\n mark.twaDeg = mark.twa*180/Math.PI;\n mark.stbdLLBTWDeg = mark.stbdLLBTW*180/Math.PI;\n mark.portLLBTWDeg = mark.portLLBTW*180/Math.PI;\n mark.tackvmgangleDeg = mark.tackvmgangle*180/Math.PI;\n mark.gybevmgangleDeg = mark.gybevmgangle*180/Math.PI;\n }\n } \n }\n }", "buildCart() {\n return `bc ${this.pos.x} ${this.pos.y}`;\n }", "function displayShipHorz1(location, ship, point, fleet) {\n\tvar endPoint = location + ship.length - 2;\n\t// Ship Turned Horizontal Player 1 //\n\tif (!(endPoint % 10 >= 0 && endPoint % 10 < ship.length - 1)) {\n\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t$(\".bottom2 .\" + i).addClass(\"highlight\");\n\t\t}\n\t\t// Place Horizontal Ship On Board Player 1 //\n\t\t$(point).off(\"click\").on(\"click\", function() {\n\t\t\tsetShipMulti(location, ship, \"horz\", fleet, \"player\");\n\t\t});\n\t}\n\t// Placed Horizontal Ship No Longer Tracks Cursor Player 1 //\n\t$(point).off(\"mouseleave\").on(\"mouseleave\", function() {\n\t\tremoveShipHorz1(location, ship.length);\n\t});\n}", "function calculateShipping() {\n\t\treturn 0;\n\t}", "function displayShipHorz2(location, ship, point, fleet) {\n\tvar endPoint = location + ship.length - 2;\n\t// Ship Turned Horizontal Player 2 //\n\tif (!(endPoint % 10 >= 0 && endPoint % 10 < ship.length - 1)) {\n\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t$(\".bottom3 .\" + i).addClass(\"highlight\");\n\t\t}\n\t\t// Place Horizontal Ship On Board Player 2 //\n\t\t$(point).off(\"click\").on(\"click\", function() {\n\t\t\tsetShip(location, ship, \"horz\", fleet, \"player\");\n\t\t});\n\t}\n\t// Placed Horizontal Ship No Longer Tracks Cursor Player 2 //\n\t$(point).off(\"mouseleave\").on(\"mouseleave\", function() {\n\t\tremoveShipHorz2(location, ship.length);\n\t});\n}", "function Ship (battleid, playerid, xpos, ypos, stype, orientation, afloat) {\n\tthis.battleid = battleid;\n\tthis.playerid = playerid;\n\tthis.xpos = xpos;\n\tthis.ypos = ypos;\n\tthis.stype = stype;\n\tthis.orientation = orientation;\n\tthis.afloat = afloat;\n}", "function fnMarkClickedCellAsShip() {\n switch (gameState) {\n case SHIP_DEF_PHASE:\n fnDefineOwnShips();\n break;\n case CONFIG_PHASE:\n fnDefineCompsShips();\n break;\n default:\n alert(\"You can't change the position of your ships during the game.\");\n return;\n }\n}", "function createInitialShips() {\n\n entityManager.generateShip({\n cx : 200,\n cy : 200\n });\n \n}", "function moveShip(arrow) {\n switch (arrow) {\n case KEYS.left: // left arrow\n var newPos = parseInt(ship.css('left'))-SHIP_SPEED;\n if (newPos < 0) {\n newPos = 0;\n }\n ship.css('left', newPos);\n if(shieldOn == 1) {$('#S').css('left', newPos);}\n \n break;\n case KEYS.right: // right arrow\n var newPos = parseInt(ship.css('left'))+SHIP_SPEED;\n if (newPos > maxShipPosX) {\n newPos = maxShipPosX;\n }\n ship.css('left', newPos);\n if(shieldOn == 1) {$('#S').css('left', newPos);}\n break;\n case KEYS.up: // up arrow\n var newPos = parseInt(ship.css('top'))-SHIP_SPEED;\n if (newPos < 0) {\n newPos = 0;\n }\n ship.css('top', newPos);\n if(shieldOn == 1) {$('#S').css('top', newPos);}\n break;\n case KEYS.down: // down arrow\n var newPos = parseInt(ship.css('top'))+SHIP_SPEED;\n if (newPos > maxShipPosY) {\n newPos = maxShipPosY;\n }\n ship.css('top', newPos);\n if(shieldOn == 1) {$('#S').css('top', newPos);}\n break;\n }\n}", "function placeShip() {\r\n for(index of finalShipArray) {\r\n boardObj.message[index].ship = shipType;\r\n }\r\n}", "function setShipMulti(location, ship, orientation, genericFleet, type) {\n\t// Checking Ship For Overlap Player 1 //\n\tif (!(checkOverlapMulti(location, ship.length, orientation, genericFleet))) {\n\t\t// Player 1 Horizontal Ship Placement Details//\n\t\tif (orientation == \"horz\") {\n\t\t\t// Player 1 Horizontal Ship Hit Locations //\n\t\t\tgenericFleet.ships[genericFleet.currentShip].populateHorzHits(location);\n\t\t\t$(\".text\").text(coms.placed1(genericFleet.ships[genericFleet.currentShip].name + \" has\"));\n\t\t\t// Adding Player 1 Horizontal Ship To Board //\n\t\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t\t$(\".bottom2 .\" + i).addClass(genericFleet.ships[genericFleet.currentShip].name);\n\t\t\t\t$(\".bottom2 .\" + i).children().removeClass(\"hole\");\n\t\t\t}\n\t\t\t// When Player 1 Horizontal Ship Placed... //\n\t\t\tif (++genericFleet.currentShip == genericFleet.numOfShips) {\n\t\t\t\t// Naval Command Communicates... //\n\t\t\t\t$(\".text\").text(coms.placed1(\"ships have\"));\n\t\t\t\t// & Mouse Tracking Turns Off //\n\t\t\t\t$(\".bottom2\").find(\".points\").off(\"mouseenter\");\n\t\t\t\t// Player 2 Option Buttons Generated //\n\t\t\t\t$(\".horz\").addClass(\"player\").addClass(\"hide\").removeClass(\"horz\").text(\"Place My Own\");\t\n\t\t\t\t$(\".vert\").addClass(\"five\").removeClass(\"vert\").text(\"Player 2 Place Ships\");\n\t\t\t\t// Delay For Smoother User Experience //\t\t\t\t\t\t\t\t\n\t\t\t\tsetTimeout(gameSetupMultiP2, 500);\n\t\t\t} else {\n\t\t\t\t// Player 1 Random Ship Placement //\n\t\t\t\tif (type == \"random\") randomSetupMulti(genericFleet);\n\t\t\t\t// Player 1 Self Ship Placement //\n\t\t\t\telse placeShipP1(genericFleet.ships[genericFleet.currentShip], genericFleet);\n\t\t\t}\n\t\t} else {\n\t\t\tvar inc = 0;\n\t\t\t// Player 1 Vertical Ship Hit Locations //\n\t\t\tgenericFleet.ships[genericFleet.currentShip].populateVertHits(location);\n\t\t\t$(\".text\").text(coms.placed1(genericFleet.ships[genericFleet.currentShip].name + \" has\"));\n\t\t\t// Adding Player 1 Vertical Ship To Board //\n\t\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t\t$(\".bottom2 .\" + (location + inc)).addClass(genericFleet.ships[genericFleet.currentShip].name);\n\t\t\t\t$(\".bottom2 .\" + (location + inc)).children().removeClass(\"hole\");\n\t\t\t\tinc = inc + 10;\n\t\t\t}\n\t\t\t// When Player 1 Vertical Ship Placed... //\n\t\t\tif (++genericFleet.currentShip == genericFleet.numOfShips) {\n\t\t\t\t// Naval Command Communicates... //\n\t\t\t\t$(\".text\").text(coms.placed1(\"ships have\"));\n\t\t\t\t// & Mouse Tracking Turns Off //\n\t\t\t\t$(\".bottom2\").find(\".points\").off(\"mouseenter\");\n\t\t\t\t$(\".horz\").addClass(\"player\").addClass(\"hide\").removeClass(\"horz\").text(\"Place My Own\");\t\n\t\t\t\t$(\".vert\").addClass(\"five\").removeClass(\"vert\").text(\"Player 2 Place Ships\");\n\t\t\t\t// Delay For Smoother User Experience //\n\t\t\t\tsetTimeout(gameSetupMultiP2, 500);\n\t\t\t} else {\n\t\t\t\t// Player 1 Random Ship Placement //\n\t\t\t\tif (type == \"random\") randomSetupMulti(genericFleet);\n\t\t\t\t// Player 1 Self Ship Placement //\n\t\t\t\telse placeShipP1(genericFleet.ships[genericFleet.currentShip], genericFleet);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Player 1 Random Ship Placement //\n\t\tif (type == \"random\") randomSetupMulti(genericFleet);\n\t\t// Naval Command Communicates Error //\n\t\telse $(\".text\").text(coms.error);\n\t}\n }", "function Ship (x, y) {\n SpaceObject.call(this, x, y);\n}", "function displayShipVert2(location, ship, point, fleet) {\n\tvar endPoint = (ship.length * 10) - 10;\n\tvar inc = 0; \n\t// Ship Turned Vertical Player 2 //\n\tif (location + endPoint <= 100) {\n\t\tfor (var i = location; i < (location + ship.length); i++) {\n\t\t\t$(\".bottom3 .\" + (location + inc)).addClass(\"highlight\");\n\t\t\tinc = inc + 10;\n\t\t}\n\t\t// Place Vertical Ship On Board Player 2 //\n\t\t$(point).off(\"click\").on(\"click\", function() {\n\t\t\tsetShip(location, ship, \"vert\", fleet, \"player\");\n\t\t});\n\t}\n\t// Placed Vertical Ship No Longer Tracks Cursor Player 2 //\n\t$(point).off(\"mouseleave\").on(\"mouseleave\", function() {\n\t\tremoveShipVert2(location, ship.length);\n\t});\n}", "placeObjective() {\n if (this.team === 1) {\n this.x = 14;\n this.y = 1;\n } else if (this.team === 2) {\n this.x = 14;\n this.y = 37;\n }\n }", "placeAShip(letters, numbers) {\n if (myApp.shipPlacing == true) {\n //position vertical ships (shipAlign = 0)\n if (myApp.shipAlign == 0) {\n //console.log(myApp.numbers[numbers + 1 + myApp.shipToPlace])\n if (!myApp.shipCollision.includes(1)) {\n var spv = []; //creates an array that will be pushed with ship info for ajax call\n\n for (var x = 0; x < myApp.shipToPlace; x++) {\n document.getElementById(letters + (numbers + x)).classList.add(myApp.shipName, \"occupied\");\n document.getElementById(myApp.shipName).classList.remove(\"btn-warning\");\n //sets another class to the button\n document.getElementById(myApp.shipName).classList.add(\"btn-secondary\");\n myApp.shipPlacing = false; //and return to the false statmenet to start again\n spv.push(letters + (numbers + x))\n }\n myApp.shipButtons[myApp.shipName] = 1;\n myApp.shipPosition.push({\n shipType: myApp.shipName,\n shipPosition: spv\n }) //push ship info \n\n } else {\n\n }\n } else {\n //position horizontal ships (shipAlign = 1)\n for (var y = 0; y < myApp.letters.length; y++) {\n if (myApp.letters[y] == letters) {\n myApp.starting = y;\n\n\n }\n }\n if (!myApp.shipCollision.includes(1)) {\n var sph = [];\n for (var z = 0; z < myApp.shipToPlace; z++) {\n document.getElementById((myApp.letters[myApp.starting + z]) + numbers).classList.add(myApp.shipName, \"occupied\");\n document.getElementById(myApp.shipName).classList.add(\"btn-secondary\");\n document.getElementById(myApp.shipName).classList.remove(\"btn-warning\");\n myApp.shipPlacing = false;\n sph.push((myApp.letters[myApp.starting + z]) + numbers);\n }\n myApp.shipButtons[myApp.shipName] = 1;\n myApp.shipPosition.push({\n shipType: myApp.shipName,\n shipPosition: sph\n })\n }\n }\n }\n }", "function return_to_space (top, left) {\n\t\tvar ship = $('#ship');\n\t\tif (top < -20 && left < -20) {\n\t\t\t$(ship).animate({'top': '500px', 'left': '700px'}, 0);\n\t\t}\n\t\tif (top < -20 && left > 0) {\n\t\t\t$(ship).animate({'top': '500px', 'left': left + 'px'}, 0);\n\t\t}\n\t\tif (top > 0 && left < -20) {\n\t\t\t$(ship).animate({'top': top + 'px', 'left': '700px'}, 0);\n\t\t}\n\t\tif (top > 520 && left > 720) {\n\t\t\t$(ship).animate({'top': '0px', 'left': '0px'}, 0);\n\t\t}\n\t\tif (top > 520 && left < 720) {\n\t\t\t$(ship).animate({'top': '0px', 'left': left + 'px'}, 0);\n\t\t}\n\t\tif (top < 520 && left > 720) {\n\t\t\t$(ship).animate({'top': top + 'px', 'left': '0px'}, 0);\n\t\t};\n\t}", "function PlaceTank(type, x, y) {\n\tg_commandToBeSent += EncodeUInt8(COMMAND_CONTROL_PLACE);\n\tg_commandToBeSent += EncodeUInt8(type);\n\tg_commandToBeSent += EncodeUInt8(x >> 0);\n\tg_commandToBeSent += EncodeUInt8(y >> 0);\n}", "function Ship(parent, type, shipPieces, isPlaced, isSunk) {\n // Create basic variables\n this.parent = parent; \t\t\n this.type = type;\t\t\t\n this.isPlaced = isPlaced;\t\n this.isSunk = isSunk; \n this.id = \"g_\" + this.type;\t\n\n // Create the variables that will determine the location\n this.shipPieces = shipPieces;\n\n // Create the object\n this.object = new window[type](this);\t// Carrier, Cruiser, Battleship, Destroyer, Submarine\n this.g = this.object.g;\t\t\t // a shortcut to the actual svg g object\n this.setAtt(\"id\", this.id);\t\t\t\t\n\n document.getElementsByTagName('svg')[0].appendChild(this.g);\n\n // return this piece object\n return this;\n}", "function createShip(index) {\n\n // if the cannoneer isn't in the game, set it to a fixed (near maximum) level\n let cannons = [2, -1, -1, -1], cannoneerLvl = 0, cannoneerInGame = false;\n if(!cannoneerInGame) {\n cannons = [2, 2, 2, 2]\n cannoneerLvl = 3;\n }\n\n let randOrientation = Math.floor(Math.random() * 8);\n\n return {\n num: index,\n myUnitType: 0, \n players: [], \n shipTitle: 'Unnamed Ship',\n resources: [10, 0, 5, 0], // [5,1,1,0], \n workingCrew: 2,\n x: 0, \n y: 0, \n orientation: randOrientation, \n speed: 0,\n health: 100, \n roleStats: [\n { lvl: 0, lvlUp: false }, \n { lvl: 0, lvlUp: false }, \n { lvl: 0, lvlUp: false }, \n { lvl: 0, lvlUp: false, sailLvl: 0, peddleLvl: 0 }, \n { lvl: cannoneerLvl, lvlUp: false } ], \n cannons: cannons,\n errorMessages: [],\n delayedClues: [],\n }\n\n}", "orderDelivery({ startIndex = 2, mainIndex = 2, time = '20:00', address }) {\n console.log(\n `Order recived! ${this.starterMenu[startIndex]} and ${this.mainMenu[mainIndex]} will be delivered to ${address} at ${time}`\n );\n }", "function updateShip() {\n\tif (shipX <= 0) {\n\t\tshipX = 0;\n\t}\n\tif (shipX + ship.width >= canvas.width) {\n\t\tshipX = canvas.width - ship.width;\n\t}\n\tshipX = shipX + shipDx;\n\tif (shipY <= 0) {\n\t\tshipY = 0;\n\t}\n\tif (shipY + ship.height >= canvas.height) {\n\t\tshipY = canvas.height - ship.height;\n\t}\n\tshipY = shipY + shipDy;\n}", "function placeBuyOrder (p) {\n\n}", "function shortest_path(to_x, to_y, use_stations) {\n\t// {{{\n\tvar route = \"<br>\";\n\tvar from_x = current_x;\n\tvar from_y = current_y;\n\n\tvar dist_by_foot = distance_AP(from_x, from_y, to_x, to_y);\n\tvar dist_to_station = places_station[0][3];\n\n\tif (dist_by_foot == 0) {\n\t\troute += \"You are already there ! No need to move.<br>\";\n\t\t// generate_direction() is used to update the direction arrows\n\t\tgenerate_direction(current_x, current_y, to_x, to_y, enable_hud, true);\n\t\treturn route;\n\t}\n\n\tif ((!use_stations) || (dist_by_foot < dist_to_station)) {\n\t\troute += \"Walk to your destination (\" + dist_by_foot + action_point_str + \": \" +\n\t\t\t generate_direction(current_x, current_y, to_x, to_y, enable_hud, true) + \")<br>\";\n\t\treturn route;\n\t}\n\n\tvar places_station_tmp = new Array();\n\tfor (var i = 0; i < places_station.length; ++i) {\n\t\tplaces_station_tmp[i] = new Array();\n\t\tplaces_station_tmp[i][0] = places_station[i][0];\n\t\tplaces_station_tmp[i][1] = places_station[i][1];\n\t\tplaces_station_tmp[i][2] = places_station[i][2];\n\t\tplaces_station_tmp[i][3] = -1;\n\t}\n\t// Compute the distance from to_x, to_y to stations and sort them\n\tsort_places(to_x, to_y, places_station_tmp);\n\n\tvar best_dist_to_dest = dist_to_station + transit_cost_action_point + places_station_tmp[0][3];\n\n\t// Same AP cost ? then walk\n\tif (best_dist_to_dest >= dist_by_foot) {\n\t\troute += \"Walk to your destination (\" + dist_by_foot + action_point_str + \": \" +\n\t\t\t generate_direction(current_x, current_y, to_x, to_y, enable_hud, true) + \")<br>\";\n\t\treturn route;\n\t}\n\n\tif (dist_to_station > 0) {\n\t\troute += \"Walk to the \" + places_station[0][0] + \" station (\" + dist_to_station + action_point_str + \": \"+\n\t\t\t generate_direction(current_x, current_y, places_station[0][1], places_station[0][2], enable_hud, true) + \")<br>\";\n\t}\n\troute += \"Take the train up to \" + places_station_tmp[0][0] + \" station (\" + transit_cost_action_point + action_point_str + \" + \"+transit_cost_coins+\" \"+ money_unit_str + \").<br>\";\n\troute += \"Walk to your destination (\" + places_station_tmp[0][3] + action_point_str + \": \"+\n\t\t generate_direction(places_station_tmp[0][1], places_station_tmp[0][2], to_x, to_y, false, false) + \")<br>\";\n\n\troute += \"Total travel cost: \" + (parseInt(dist_to_station) + transit_cost_action_point + parseInt(places_station_tmp[0][3])) + action_point_str + \" & \" + transit_cost_coins + \" \" + money_unit_str + \".<br>\";\n\n\treturn route;\n\t// }}}\n}", "moveShip(xdir,ydir) {\n\t\t\t/*\n\t\t\tif (Math.abs(xdir) < 20) {\n\t\t\t\txdir = this.prevXDir;\n\t\t\t}\n\t\t\t\n\t\t\tif (Math.abs(ydir) < 20) {\n\t\t\t\tydir = this.prevYDir;\n\t\t\t}\n\t\t\t*/\n\t\t\t\n//\t\t\tconsole.log(\"prev: \",this.prevXDir, this.prevYDir);\n//\t\t\tconsole.log(\"prev: \",xdir, ydir);\n\t\t\tvar base = Math.sqrt(Math.pow(xdir,2) + Math.pow(ydir,2));\n\t\t\tvar base2 = Math.sqrt(Math.pow(this.prevXDir,2) + Math.pow(this.prevYDir,2));\n\t\t\tvar maxAngle = ((this.prevXDir*xdir)+(this.prevYDir*ydir))/(base*base2);\n\t\t\tif (maxAngle > 1)\n\t\t\t\tmaxAngle = 1;\n\n\t\t\tmaxAngle = Math.acos(maxAngle);\n//\t\t\tconsole.log(\"base :\" ,base,base2);\n//\t\t\tconsole.log(maxAngle);\n\t\t\tif (Math.abs((maxAngle*180)/Math.PI) > 15) {\n\t\t\t\tconsole.log((maxAngle*180)/Math.PI);\n\t\t\t\tconsole.log(this.prevXDir,this.prevYDir);\n\t\t\t\tvar dir = (maxAngle/Math.abs(maxAngle));\n\t\t\t\tvar temp1 = this.prevXDir*Math.cos(0.05*dir) + this.prevYDir*Math.sin(0.05*dir);\n\t\t\t\tvar temp2 = (-1*this.prevXDir*Math.sin(0.05*dir)) + this.prevYDir*Math.cos(0.05*dir);\n\t\t\t\tconsole.log(temp1,temp2);\n\t\t\t\tconsole.log();\n\t\t\t\txdir = temp1;\n\t\t\t\tydir = temp2;\n\t\t\t\tbase = Math.sqrt(Math.pow(xdir,2) + Math.pow(ydir,2));\n\t\t\t\t\n\t\t\t}\n\t\t\tvar angle=0;\n\t\t\tif (this.shootBullet == true) {\n\t\t\t\tthis.temp = new Bullet(this.x,this.y,xdir,ydir);\n//\t\t\t\tthis.temp.printValue();\n\t\t\t\tthis.shootBullet = false;\n\t\t\t}\n\t\t\tuserCoor[0] = this.x;\n\t\t\tuserCoor[1] = this.y;\n\t\t\tuserCoor[2] = (xdir*this.speed)/base;\n\t\t\tuserCoor[3] = (ydir*this.speed)/base;\n\t\t\t\n\t\t\tthis.x = this.x+userCoor[2]; // movement in x dir of ship\n\t\t\tthis.y = this.y+userCoor[3]; // movement in y dir of ship\n\t\t\t\n\t\t\tvar angle = (Math.PI/2) - Math.atan(ydir/xdir); // angle of vector given from origin and (1,0) vector\n//\t\t\tconsole.log(angle);\n//\t\t\tconsole.log(angle);\n\t\t\t\n\t\t\tif ((ydir < 0 && xdir > 0) || (ydir > 0 && xdir > 0)) { // determines side of screen the ship faces\n\t\t\t\tthis.drawShip(angle,-1);\n\t\t\t} else {\n\t\t\t\tthis.drawShip(angle,1);\n\t\t\t}\n//\t\t\tthis.prevMag = base;\n\t\t\tthis.prevXDir = xdir;\n\t\t\tthis.prevYDir = ydir;\n\t\t}", "route (curPt, pois, options = {}) {\n const includedNearbys = [];\n\n\n // NEW - once we've created the graph, snap the current and nearby panos to the nearest junction within 5m, if there is one\n const snappedNodes = [ curPt, null ];\n if(options.snapToJunction) {\n snappedNodes[0] = this.jMgr.snapToJunction(curPt, 0.005);\n }\n pois.forEach(p => {\n p.lon = parseFloat(p.lon);\n p.lat = parseFloat(p.lat);\n //nearby.poseheadingdegrees = parseFloat(nearby.poseheadingdegrees);\n p.bearing = 720;\n snappedNodes[1] = options.snapToJunction ? this.jMgr.snapToJunction([p.lon, p.lat], this.distThreshold) : [p.lon, p.lat];\n \n const route = this.calcPath(snappedNodes);\n\n if(route!=null && route.path.length>=2) {\n // Initial bearing of the route (for OTV arrows, Hikar signposts, etc)\n let bearing = turfBearing(turfPoint(route.path[0]), turfPoint(route.path[1]));\n\n if(bearing < 0) bearing += 360;\n p.bearing = bearing;\n p.weight = route.weight;\n\n // save the path so we can do something with it \n p.path = route.path;\n }\n });\n // Sort routes to each POI based on bearing\n const sorted = pois.filter( p => p.bearing<=360).sort((p1,p2)=>(p1.bearing-p2.bearing)); \n let lastBearing = 720;\n let curPOIsForThisBearing = [];\n const poisGroupedByBearing = [];\n \n for(let i=0; i<sorted.length; i++) {\n if(Math.abs(sorted[i].bearing-lastBearing) >= 5) {\n // new bearing\n curPOIsForThisBearing = { bearing: sorted[i].bearing, pois: [] };\n poisGroupedByBearing.push(curPOIsForThisBearing);\n }\n curPOIsForThisBearing.pois.push(sorted[i]);\n lastBearing = sorted[i].bearing;\n }\n\n // Return value: an array of pois grouped by bearing and\n // sorted by distance within each bearing group.\n // This could be used to generate a virtual signpost (Hikar) or\n // select the immediately linked panorama (OTV)\n const poisGroupedByBearingSortedByDistance = poisGroupedByBearing.map ( forThisBearing =>{ return { bearing: Math.round(forThisBearing.bearing), pois: forThisBearing.pois.sort((n1, n2) => n1.weight - n2.weight)} });\n return poisGroupedByBearingSortedByDistance; \n }", "chargePhasers() {\n if (this.currentShip === 'Looking for a Rig' || this.position !== 'Gunner') {\n return 'had no effect'\n } else if (this.position === 'Gunner') {\n this.currentShip.phasersCharge = 'charged!'\n }\n }", "flyToPlanet(stage, startPlanet, endPlanet) {\n // Hide the local ships and make the world ship\n // the only ship visible.\n this.pos = startPlanet.relativeLandingPoint;\n startPlanet.hideShip();\n endPlanet.hideShip();\n\n stage.planetParent.ignoreEvents = true;\n\n const startScale = this.scale.x;\n const endScale = endPlanet.radius / 120 / 2;\n let dest = endPlanet.relativeLandingPoint;\n let aboveOrbitDest = addPos(endPlanet.landingPoint, { x:0, y: -75 });\n let relativeAboveOrbitDest = addPos(dest, { x:0, y: -75 });\n let pointing = fromTo(this.pos, aboveOrbitDest);\n let pointAngle = Math.atan2(pointing.y, pointing.x);\n this.trail.opacity = 0;\n let _this = this;\n this.rotation = -Math.PI / 2.0; // make the ship face upright\n\n let start = startPlanet.relativeLandingPoint;\n let end = endPlanet.relativeLandingPoint;\n let control1 = {\n x: start.x + 10,\n y: start.y - 200,\n };\n let control2 = {\n x: end.x - 10,\n y: end.y + 200,\n };\n end.y -= 30;\n\n const travelDist = distBetweenPos(this.pos, dest);\n const duration = travelDist / 100 * 1000;\n\n let promisify = (x) => {\n return new Promise((resolve, reject) => {\n x.after(resolve);\n });\n };\n\n let stars = [];\n let starParent = new mag.Rect(0, 0, 0, 0);\n starParent.opacity = 0;\n stage.add(starParent);\n\n for (let i = 0; i < 120; i++) {\n let star = new MenuStar();\n star.pos = randomPointInRect({ x: 0, y: 0, w: stage.boundingSize.w, h: stage.boundingSize.h });\n let scale = Math.random() * 0.2 + 0.1;\n star.scale = { x: scale, y: scale };\n starParent.addChild(star);\n stars.push(star);\n }\n\n // The initial launch\n let launch = promisify(Animate.tween(this, {\n pos: addPos(this.pos, { x: 0, y: -100 }),\n }, 1000));\n let del = 0;\n let launchTrail = promisify(Animate.run((e) => {\n this.trail.opacity = Math.min(0.4, Math.pow(e, 0.05));\n this.trail.time += (e - del) * 4000;\n del = e;\n }, 1250));\n\n return launch.then(() => {\n let p = this.absolutePos;\n stage.planetParent.removeChild(this);\n stage.add(this);\n this.pos = p;\n this.parent = null;\n\n this.image = 'ship-large-starboy';\n\n let rotate = promisify(Animate.tween(this, {\n rotation: 0,\n }, 600));\n\n // Zoom in on Starchild\n let zoomShip = promisify(Animate.tween(this, {\n scale: { x: 5, y: 5 },\n pos: {\n x: (stage.boundingSize.w / 2 - 2.5 * this.size.w),\n y: (stage.boundingSize.h / 2 - 2.5*this.size.h),\n },\n }, 600));\n\n stage.starParent.opacity = 1.0;\n let fadeOutStars = promisify(Animate.tween(stage.starParent, {\n opacity: 0,\n }, 400));\n\n let fadeInStars = promisify(Animate.tween(starParent, {\n opacity: 0.7,\n }, 400));\n\n stage.planetParent.opacity = 1.0;\n let zoom = promisify(Animate.tween(stage.planetParent, {\n opacity: 0,\n }, 600));\n\n return Promise.all([zoomShip, zoom, launchTrail, fadeOutStars, fadeInStars]);\n }).then(() => {\n // Prepare for ignition\n this.trail.time = 0;\n return promisify(Animate.tween(this.trail, {\n opacity: 0,\n time: 500,\n }, 300)).then(() => promisify(Animate.tween(this.trail, {\n opacity: 1.0,\n time: 2500,\n }, 200)));\n }).then(() => {\n // Enter warp space!\n let mask = new Mask(0, 0, 0.01, \"#FFFFFF\");\n this.stage.add(mask);\n\n let flash = after(200)\n .then(() => promisify(Animate.tween(mask, {\n opacity: 1.0,\n }, 100)))\n .then(() => promisify(Animate.tween(mask, {\n opacity: 0.0,\n }, 100)))\n .then(() => this.stage.remove(mask));\n\n let jumpForward = promisify(Animate.tween(this, {\n pos: addPos(this.pos, { x: 300, y: 0 }),\n }, 300));\n\n return jumpForward;\n }).then(() => {\n // Cruising along\n let jumpBack = promisify(Animate.tween(this, {\n pos: addPos(this.pos, { x: -300, y: 0 }),\n }, 1000));\n\n const origSize = stars[0].size;\n let sizer = stars[0].size;\n stars.forEach((s) => s.size = sizer);\n let starStretch = promisify(Animate.tween(sizer, {\n w: 450,\n h: 6,\n }, 600));\n\n const flyingDuration = 6000;\n const deceleration = 0.75;\n\n let t0 = 0;\n let flying = promisify(Animate.run((t1) => {\n this.trail.time += 8000 * (t1 - t0);\n\n let dx = 15000 * (t1 - t0);\n if (t1 > deceleration) dx *= (-4 * t1 + 4);\n stars.forEach((s) => {\n s.pos = addPos(s.pos, { x: -dx, y: 0 });\n if (s.pos.x < 0) {\n s.pos = { x: stage.boundingSize.w * (0.9 + Math.random() / 5), y: s.pos.y };\n }\n });\n\n t0 = t1;\n }, flyingDuration));\n\n let slowing = after(flyingDuration - 500).then(() => {\n return promisify(Animate.tween(sizer, origSize, 500));\n });\n\n return Promise.all([flying, slowing]);\n }).then(() => {\n // Come out of warp space\n let turnOffEngine = promisify(Animate.tween(this.trail, {\n opacity: 0,\n }, 400));\n\n // Zoom back out\n let zoomShip = promisify(Animate.tween(this, {\n scale: { x: endScale, y: endScale },\n pos: aboveOrbitDest,\n }, 600));\n\n let fadeInStars = promisify(Animate.tween(stage.starParent, {\n opacity: 1.0,\n }, 400));\n\n let fadeOutStars = promisify(Animate.tween(starParent, {\n opacity: 0,\n }, 400));\n\n let rotate = after(400).then(() => {\n return promisify(Animate.tween(this, {\n rotation: -Math.PI / 2,\n }, 600));\n });\n\n let zoom = promisify(Animate.tween(stage.planetParent, {\n opacity: 1,\n }, 600));\n\n return Promise.all([turnOffEngine, rotate, zoomShip, zoom, fadeOutStars, fadeInStars]);\n }).then(() => {\n this.image = 'ship-large';\n stage.remove(this);\n stage.planetParent.addChild(this);\n this.pos = relativeAboveOrbitDest;\n let land = promisify(Animate.tween(this, {\n pos: dest,\n }, 1000));\n return land;\n }).then(() => {\n stage.planetParent.ignoreEvents = false;\n endPlanet.showShip(this);\n stage.remove(starParent);\n });\n }", "function AdvancedShipping() {\n\tthis.login = function(credentials) { /*..*/ };\n\tthis.setStart = function(start) { /*..*/ };\n\tthis.setDestination = function(destination) { /*..*/ };\n\tthis.calculate = function(weight) { return '$39.50' };\n}", "function placeShip(array,x,y,shipLength,axis){\n if (axis === 1){\n for(i=0; i<shipLength; i++){\n array[x+i][y] = 2\n }\n } \n if (axis === -1){\n for(i=0; i<shipLength; i++){\n array[x][y+i] = 2\n }\n }\n}", "function createInitialShips() {\n entityManager.generateShip({\n cx: 200,\n cy: 200,\n });\n}", "function placeShip(ships) {\n var shipChoice = \"\";\n\n let isHoriz = true;\n rotate[0].addEventListener(\"click\", (e) => {\n e.preventDefault();\n shipsDiv[0].style.transform = (shipsDiv[0].style.transform === \"rotate(90deg)\") ? \"rotate(0deg)\" : \"rotate(90deg)\"; // rotate ships visually\n isHoriz = (isHoriz === true) ? false : true;\n })\n\n for (let unit of grid) {\n let index = grid.indexOf(unit);\n unit.addEventListener(\"click\", (e) => { // attaches event listeners w/ this callback to each grid unit\n for (let ship of ships) {\n if (ship.selected === \"staged\") shipChoice = ship;\n }\n if (shipChoice !== \"\") {\n if (isHoriz) placeHoriz(shipChoice, index, unit, grid);\n else placeVert(shipChoice, index, unit, grid);\n // shipChoice.selection = \"placed\"; // different variable name, but changes original's property\n shipChoice = \"\";\n } else alert(\"ship already placed\");\n });\n }\n}", "function displayShipmentMapElements() {\n //Variables for the currently selected customer, order and shipment\n let currentCustomer = vm.customers[vm.currentIndices.customer];\n let currentOrder = currentCustomer.orders[vm.currentIndices.order];\n let currentShipment = currentOrder.shipments[vm.currentIndices.shipment];\n\n clearMarkers(); //Clears markers currently on the map\n setSingleShipmentOnMap(map, vm.currentIndices.shipment); //Places markers on the amp\n\n if (flightPathList != null)\n removeLine();\n\n //Draws lines between markers\n drawLine(currentShipment.origin, currentShipment.current_location, currentShipment.destination, currentShipment.delivery_state);\n }", "function goalOrientedRobot({place, parcels}, route) { //This robot takes \n if (route.length == 0) { //route.length is zero means the robot has not run yet\n let parcel = parcels[0]; //parcels is ready to be picked up but not yet\n if (parcel.place != place) {//place is the pickup point, parcel is the drop-off point, when the pickup and drop-off points are not the same, we do the following\n route = findRoute(roadGraph, place, parcel.place); //place is the location of the robot, parcel.place is the pickup point\n } else {\n route = findRoute(roadGraph, place, parcel.address); //parcel.address is drop-off point\n }\n }\n return {direction: route[0], memory: route.slice(1)}; //tell the robot to not to remember the route taken\n }", "setLocation() {\n if (this.order == null) {\n this.order = [\"location\"]\n } else {\n this.order.push(\"location\")\n }\n }", "function onShipMove() {\n if (!hasStarted) {\n ball.setStartLeft(ship);\n tail.start(ball);\n }\n }", "function ship(obj){\n this.ctx = obj.canvasContext;\n this.socket = obj.socket;\n this.canvas = obj.canvas;\n this.userName = obj.userName;\n this.startX = obj.startX;\n this.startY = obj.startY;\n this.startRotation = obj.startRotation;\n this.isInternet = obj.isInternet;\n \n this.myShip = new shipMath(this.startX, this.startY, this.startRotation, this.isInternet, this.canvas);\n this.position = this.myShip.updatePosition();\n \n}", "function Ship (id, grid, rooms, crew, doors) {\n\tthis.id = id;\n\t\n\tthis.hull = 40;\t\n\tthis.hullMax = 40;\n\t\n\tthis.grid = grid;\n\tthis.rooms = rooms;\n\t\n\tthis.crew = crew;\n\t\n\tthis.doors = doors;\n\t\n\tthis.evasion = 0;\n\tthis.pilot = 0;\n\tthis.engine = 0;\n}", "function newShip () {\n\treturn {\n\t\tx: canvas.width / 2,\n\t\ty: canvas.height / 2,\n\t\tr: shipSize / 2,\n\t\ta: 90 / 180 * Math.PI, // radiant\n\t\tblinkNumber: Math.ceil(shipInvisibilityDuration / shipBlinkDuration),\n\t\tblinkTime: Math.ceil(shipBlinkDuration * FPS),\n\t\tcanShoot: true,\n\t\tdead: false,\n\t\texplodeTime: 0,\n\t\tlasers:[],\n\t\trotation: 0,\n\t\tthrusting: false,\n\t\tthrust : {\n\t\t\tx: 0,\n\t\t\ty: 0\n\t\t}\n\t}\n}", "function createAndPlaceShip() {\n\t// only run this function if game object already exists\n\tif (typeof game != 'undefined') {\n\t\t// ships have no size yet, they're all just 1 square! but I left this here for later\n\t\tvar size = parseInt(document.getElementById('shipsize').value);\n\n\t\tif (size < game.rows) {\n\t\t\t// create a new ship, add it to game.ships array\n\t\t\tvar ship = new Ship(size);\n\t\t\tgame.ships.push(ship);\n\t\t\t// run function that generates ship's coordinates and displays it on the game board\n\t\t\tgame.placeRandomShip(ship, 10);\n\t\t\tconsole.log('Number of ships on the board: ' + game.ships.length)\n\t\t\tconsole.log(game.ships);\n\t\t} else {\n\t\t\talert('Invalid ship size. Enter a number from 1 to ' + game.rows);\t\t\n\t\t}\n\t} else {\n\t\talert('Create a grid first!');\n\t}\n}", "function getShipLocation(angle) {\n // Returns positive angle value\n function getActualAngle(angle) {\n if (angle >= 0 && angle < 270) {\n // rotates the 0 point to where player craft renders\n return angle + 90;\n } else if (angle >= 270) {\n return angle - 270;\n } else if (angle >= -90 && angle < 0) {\n return 360 + angle - 270;\n } else {\n return 360 + angle + 90;\n }\n }\n // Creates string used for index key\n let actualAngle = getActualAngle(angle).toString();\n // Calls the array with associated index key\n return getAllPossibleShipLocations()[actualAngle];\n}", "function getShipLocation(angle) {\r\n // Returns positive angle value\r\n function getActualAngle(angle) {\r\n if (angle >= 0 && angle < 270) {\r\n // rotates the 0 point to where player craft renders\r\n return angle + 90;\r\n } else if (angle >= 270) {\r\n return angle - 270;\r\n } else if (angle >= -90 && angle < 0) {\r\n return 360 + angle - 270;\r\n } else {\r\n return 360 + angle + 90;\r\n }\r\n }\r\n // Creates string used for index key\r\n let actualAngle = getActualAngle(angle).toString();\r\n // Calls the array with associated index key\r\n return getAllPossibleShipLocations()[actualAngle];\r\n}", "async function GpsPointsForAroute() {\n let routingService = new routing.RoutingService(process.env.MICRO_API_TOKEN);\n let rsp = await routingService.route({\n destination: {\n latitude: 52.529407,\n longitude: 13.397634,\n },\n origin: {\n latitude: 52.517037,\n longitude: 13.38886,\n },\n });\n console.log(rsp);\n}", "function encloseRightState(){\n if(shipY < 0){\n shipY = 0;\n }\n if(shipY > height - 50){\n shipY = height - 50;\n }\n if(shipX > width - 40){\n shipX = width - 40;\n }\n}", "function move_forward () {\n\t\tvar ship = $('#ship');\n\t\t$(ship).stop();\n\t\tclearTimeout(t);\n\n\t\tif (t) {\n\t\t\tgravity_stop();\n\t\t}\n\n\t\tif (agent.webkit) {\n\t\t\tvar deg = $(ship).css(transformation_html);\n\t\t}\n\t\tif (agent.mozilla) {\n\t\t\tvar deg = $(ship).attr('style');\n\t\t}\n\t\tdeg = parseInt(deg.replace(/[\\D]{1,200}/, ''));\n\n\t\tvar b = Math.cos(deg) + Math.sin(deg);\n\n\t\ttop = b * 15;\n\t\tleft = b * 15;\n\n\t\tif (top > 0) {\n\t\t\ttp = '-=';\n\t\t}\n\t\telse {\n\t\t\ttp = '+=';\n\t\t}\n\n\t\tif (left > 0) {\n\t\t\tlp = '-=';\n\t\t}\n\t\telse {\n\t\t\tlp = '+=';\n\t\t}\n\t\t\n\t\t/* var curr_top = parseInt($('#ship').css('top'));\n\t\tvar curr_left = parseInt($('#ship').css('left'));\n\n\t\tvar new_top = possible_directions[deg][0]*10;\n\t\tvar new_left = possible_directions[deg][1]*10;\n\n\t\tvar top = curr_top + new_top;\n\t\tvar left = curr_left + new_left;*/\n\n\t\t$(ship).css({'border-bottom': '5px solid #ff0'});\n\t\tsetTimeout(function() { $(ship).css({'border-bottom': '5px solid #f00'}); }, 400);\n\t\t$(ship).animate({'top': tp + top + 'px', 'left': lp + left + 'px'}, 1200, 'linear', function(){\n\t\t\t//keep_acceleration(ship, deg);\n\t\t});\n\t}", "function placeSellOrder (p) {\n\n}", "function delivery()\n {\n\n }", "function placeShip(ship, board)\r\n{ \r\n var rNum = getRandomNumber();\r\n var rX = Math.floor(rNum/10) ;\r\n var rY = rNum%10 ;\r\n var dir = rNum%2 ; // If rNum is even => horizontal else vertical.\r\n /*Get the inclusive final co-ordinate .. not exclusive.*/\r\n var rX1 = (dir==0)? (rX+ship.width -1) : (rX) ;\r\n var rY1 = (dir==1)? (rY+ship.width -1) : (rY) ;\r\n var retry= false;\r\n var i, j ;\r\n /* If ships new positions cross boudaries */\r\n if((dir == 0 && (ship.width + rX) > 9)||(dir == 1 && (ship.width + rY) > 9))\r\n {\r\n // alert(\"peice goes out of arena \");\r\n retry = true ;\r\n }\r\n /* If ship overlaps with a present ship.*/\r\n else\r\n {\r\n for(i = rX ; i <= rX1 ; i++)\r\n {\r\n for(j = rY ; j <= rY1 ; j++)\r\n {\r\n // alert(\"peice overlaps with another \");\r\n retry = (board[i][j]==1)? true : false ;\r\n }\r\n }\r\n }\r\n if(retry)\r\n {\r\n // alert(\"going recursion \");\r\n /* Go recursively until you find a right place */\r\n placeShip(ship, board);\r\n }\r\n else\r\n {\r\n // alert(\"peicing the board\");\r\n for(i = rX ; i <= rX1 ; i++)\r\n {\r\n for(j = rY ; j <= rY1 ; j++)\r\n {\r\n board[i][j] = 1 ;\r\n }\r\n }\r\n ship.x1 = rX ; ship.y1 = rY ; ship.x2 = rX1 ; ship.y2 = rY1 ;\r\n // alert(\"placed \"+ship.name+\" at x1 = \"+rX+\" ; y1 = \"+rY+\" ; x2 = \"+\r\n // rX1+\" ; y2 = \"+rY1+\" ; width = \"+ship.width );\r\n }\r\n return ship ;\r\n}", "function Ship () {\n\t this.radius = 5\n\t this.color = \"#FF0000\"\n\t this.pos = [150,150]\n\t this.vel = [0,0]\n\t}", "function moveAirplanePath(){\n\tvar distanceDot = getDistanceByValue(gameData.dotX, gameData.dotY, gameData.stageX, gameData.stageY);\n\tif(distanceDot > gameData.dotDistance){\n\t\tgameData.dotX = gameData.stageX;\n\t\tgameData.dotY = gameData.stageY;\n\t\tgameData.dotted = gameData.dotted == true ? false : true;\n\t}\n\t\n\tvar distance = getDistanceByValue(gameData.lastX, gameData.lastY, gameData.stageX, gameData.stageY);\n\tif(distance > 10){\n\t\tgameData.lastX = gameData.stageX;\n\t\tgameData.lastY = gameData.stageY;\n\t\tgameData.targetPlane.path.push({x:gameData.stageX, y:gameData.stageY, dotted:gameData.dotted});\n\t}\n\t\n\tvar drawingStroke = gameData.targetPlane.drawingStroke;\n\tif(gameData.dotted){\n\t\tvar drawingStroke = gameData.targetPlane.drawingStroke;\n\t\tdrawingStroke.graphics.beginStroke(drawStrokeColor)\n\t\t\t\t\t\t .setStrokeStyle(drawStrokeStyle)\n\t\t\t\t\t\t .moveTo(gameData.oldX, gameData.oldY)\n\t\t\t\t\t\t .lineTo(gameData.stageX, gameData.stageY);\n\t}else{\n\t\tgameData.oldX = gameData.stageX;\n\t\tgameData.oldY = gameData.stageY\n\t}\n}", "drawRoute(start, finish) {\n let params = {\n \"mode\": \"fastest;car\",\n \"waypoint0\": \"geo!\" + start.Latitude + \",\" + start.Longitude,\n \"waypoint1\": \"geo!\" + finish.Latitude + \",\" + finish.Longitude,\n \"representation\": \"display\"\n }\n this.router.calculateRoute(params, data => {\n if(data.response) {\n data = data.response.route[0];\n let lineString = new H.geo.LineString();\n data.shape.forEach(point => {\n let parts = point.split(\",\");\n lineString.pushLatLngAlt(parts[0], parts[1]);\n });\n let routeLine = new H.map.Polyline(lineString, {\n style: { strokeColor: \"blue\", lineWidth: 5 }\n });\n this.map.addObjects([routeLine]);\n }\n }, error => {\n console.error(error);\n });\n }", "orderDelivery({time='11pm',mainIndex=1,starterIndex}){\n console.log(`Order received! ${this.starterMenu[starterIndex]} and ${this.mainMenu[mainIndex]} deliverd at time of ${time}`);\n }", "function snapToDelivery() {\n\t\t\tvar currentState = $('#ctl00_PageContent_OnePageCheckout1_ShippingAddressEditUKView_LabelShipFirstName').length;\n\t\t\tif (exp.vars.previousState > currentState) {\n\t\t\t\t$('#ctl00_PageContent_OnePageCheckout1_PanelShippingMethod')[0].scrollIntoView({behavior: 'smooth'});\n\t\t\t}\n\t\t\texp.vars.previousState = currentState;\n\t\t}", "function shipBoom(data){\n var out = {};\n out[data.id] = {\n status: 'boom',\n stage: data.stage\n };\n io.sockets.emit('shipstat', out);\n }", "function SpaceShip(scene, x, y) {\n Actor.call(this, scene, x, y);\n this.points = 0;\n}", "function positionFlyout(){\n\n\t\t\t\t\t// set flyout width and height\n\t\t\t\t\t$flyout.css({\n\t\t\t\t\t\t\"width\": o.flyout.width + \"px\",\n\t\t\t\t\t\t\"height\": o.flyout.height + \"px\",\n\t\t\t\t\t\ttop: \"\",\n\t\t\t\t\t\tleft: \"\",\n\t\t\t\t\t\t\"margin-left\": \"\",\n\t\t\t\t\t\t\"margin-top\": \"\"\n\t\t\t\t\t});\n\n\t\t\t\t\t// set negative left or right value to match width\n\t\t\t\t\tvar flyoutSide = o.placement.match( /left|right/ );\n\n\t\t\t\t\tif( flyoutSide ){\n\t\t\t\t\t\t$flyout.css( flyoutSide[ 0 ], -o.flyout.width + \"px\" );\n\t\t\t\t\t}\n\t\t\t\t\t// if loupe mode, center offset\n\t\t\t\t\tvar loupe = o.placement.match( /loupe/ );\n\n\t\t\t\t\tif( loupe ) {\n\t\t\t\t\t\t// loupe\n\t\t\t\t\t\t$flyout.css({\n\t\t\t\t\t\t\t\"margin-left\": ( -o.flyout.width / 2 ) + \"px\",\n\t\t\t\t\t\t\t\"margin-top\": ( -o.flyout.height / 2 ) + \"px\"\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// add class to specify positioning spot for static css to apply\n\t\t\t\t\t$flyout[ 0 ].className = $flyout[ 0 ].className.replace( /enlarge_flyout\\-[^$\\s]+/, ' ' );\n\t\t\t\t\t$flyout.addClass( \"enlarge_flyout-\" +\t o.placement );\n\t\t\t\t}", "function next_shipment() {\n\tshow('page-home');\n\treset_image_box();\n\treset_image_pod();\n\treset_signature();\n\taction = '';\n $('#damage_info').val('');\n $('#id-shipment-value').val('');\n\tship_info.length = 0;\n\tinstruction.length = 0;\n\tdimensions = '';\n\tname = '';\n\tdest_phone = '';\n\tclear_current();\n}", "function aiPlace(pos){\n switch (pos[0]){\n case 0:\n switch (pos[1]){\n case 0:\n maybePlace(\"NW\");\n break;\n case 1:\n maybePlace(\"NC\");\n break;\n case 2:\n maybePlace(\"NE\");\n break;\n }\n break;\n case 1:\n switch (pos[1]){\n case 0:\n maybePlace(\"CW\");\n break;\n case 1:\n maybePlace(\"CC\");\n break;\n case 2:\n maybePlace(\"CE\");\n break;\n }\n break;\n case 2:\n switch (pos[1]){\n case 0:\n maybePlace(\"SW\");\n break;\n case 1:\n maybePlace(\"SC\");\n break;\n case 2:\n maybePlace(\"SE\");\n break;\n }\n break;\n }\n}", "function Ship(x, y) {\n this.x = x;\n this.y = y;\n this.width = 30;\n this.height = 23;\n}", "selectCoordinate(ship, position){\n if(this.checkCoordinates(ship, position)){\n this.removeShip(ship)\n this.placeShip(ship,position)\n }\n else{\n return this.message\n }\n }", "function dosc(shipp){\n if(gameMap.get(shipp.position).hasStructure ||\n gameMap.get(shipp.position.directionalOffset(Direction.getAllCardinals()[0])).hasStructure ||\n gameMap.get(shipp.position.directionalOffset(Direction.getAllCardinals()[1])).hasStructure ||\n gameMap.get(shipp.position.directionalOffset(Direction.getAllCardinals()[2])).hasStructure ||\n gameMap.get(shipp.position.directionalOffset(Direction.getAllCardinals()[3])).hasStructure){\n return false;\n }\n return true;\n }", "function addSquadronToOp(event) {\n if (event.target.id == \"\") return;\n\n var planeIdParts = event.target.id.split(\"-\"),\n missionTdSelector = \"#mission\" + planeIdParts[2],\n numDivSelector = \"#\" + event.target.id + \"-num\",\n source = getAircraftSourceById(planeIdParts[1], planeIdParts[0] == \"BAS\"),\n opSource = getAirOpSourceById(planeIdParts[1], planeIdParts[0] == \"BAS\"),\n offset = $(event.target).offset(),\n availSquads = source.TSquadrons,\n takenSquads = opSource.TSquadrons,\n adding = ((event.clientY - offset.top) < (event.target.offsetHeight / 2)),\n squadsToAdd = 0;\n \n if (planeIdParts[2] == \"F\") {\n availSquads = source.FSquadrons;\n takenSquads = opSource.FSquadrons;\n } else if (planeIdParts[2] == \"D\") {\n availSquads = source.DSquadrons;\n takenSquads = opSource.DSquadrons;\n }\n \n if (adding) {\n // add one squad to the mission\n if (availSquads > 0) {\n squadsToAdd = 1;\n availSquads--;\n takenSquads++;\n }\n } else {\n //remove one squadron\n if (takenSquads > 0) {\n squadsToAdd = -1;\n availSquads++;\n takenSquads--;\n }\n }\n if (planeIdParts[2] == \"T\") {\n source.TSquadrons = availSquads;\n opSource.TSquadrons = takenSquads;\n } else if (planeIdParts[2] == \"F\") {\n source.FSquadrons = availSquads;\n opSource.FSquadrons = takenSquads;\n } else {\n source.DSquadrons = availSquads;\n opSource.DSquadrons = takenSquads;\n }\n $(numDivSelector).text(availSquads.toString());\n $(missionTdSelector).text(textAdd($(missionTdSelector).text(), squadsToAdd));\n}", "takeAction(){\n let currentPosition = this.currentPlayer.positionOnBoard;\n let space = propertyData[currentPosition];\n\n // player lands on a property| railroad | utilities space (STATE)\n if (space.streetName) {\n console.log(\"I'm on a property\");\n } else if (space.name.includes('Railroad')) {\n console.log(\"I'm on a railroad\");\n } else if (space.name.includes('Electric')) {\n console.log(\"I'm on Electric utility space\");\n } else if (space.name.includes('Waterworks')) {\n console.log(\"I'm on WaterWorks utility space\");\n }\n \n // ✅ player lands on a TAX space\n else if (space.name.includes('Income Tax')) {\n this.currentPlayer.pay(space.price);\n\n } else if (space.name.includes('Luxury Tax')) {\n this.currentPlayer.pay(space.price);\n\n } \n \n // player lands on Community Chest | Chance space (STATE)\n else if (space.name.includes('Community')) {\n console.log(\"Pick a card from Comm chest deck\");\n } else if (space.name.includes('Chance')) {\n console.log(\"Pick a card from Chance deck\");\n } \n \n // player lands on spaces with NO actions\n else if (space.name.includes('Jail')) {\n console.log(\"I'm rotting in jail\");\n } else if (space.name.includes('Visiting')) {\n console.log(\"I'm just visiting. Do nothing\");\n } else if (space.name.includes('Parking')) {\n console.log(\"I'm on free parking. Do nothing\");\n } \n\n // player lands on GO TO JAIL space\n else if (space.name.includes('Go To')) {\n console.log(\"Time to go to jail\");\n this.currentPlayer.goToJail();\n } \n \n // player lands on GO, collect salary\n else if (currentPosition === 0) {\n console.log(\"Time to collect salary $200\");\n this.currentPlayer.collect(200);\n }\n}", "function ShippingHandling(){\n if (OverSize==true) {\n \t if(UPS==true){\n \tvar ship_Cost=Quantity*7.00;\n \t\n }\n else if(UsPostalAir==true){\n \tvar ship_Cost=Quantity*8.50;\n \t\n }\n else if(FedExGround==true){\n\t\t\t\tvar ship_Cost=Quantity*9.25\n\t\t \n\t\t\t\t\n }\n else if(FedExAir==true){\n \t var ship_Cost=Quantity*12.00;\n \t \n }\n\n var a=ship_Cost+5.00;\n }\n else{\n \t if(UPS==true){\n \tvar ship_Cost=Quantity*7.00;\n \t\n }\n else if(UsPostalAir==true){\n \tvar ship_Cost=Quantity*8.50;\n \t\n }\n else if(FedExGround==true){\n\t\t\t\tvar ship_Cost=Quantity*9.25\n\t\t \n\t\t\t\t\n }\n else if(FedExAir==true){\n \t var ship_Cost=Quantity*12.00;\n \t \n }\n var a=ship_Cost;\n }\n \n \n this.ShippingCost=a;\n document.formToyota.shipper.value=ShippingCost;\n \n }", "calculateNewRoute() {\n\t\tvar request = {\n\t\t\torigin: this.props.data.origin,\n\t\t\tdestination: this.props.data.destination,\n\t\t\ttravelMode: 'DRIVING'\n\t\t}\n\t\t\n\t\tthis.directionService.route(request, (response, status) => {\n\t\t\tif (status == 'OK') {\n\t\t\t\tthis.directionDisplay.setDirections(response);\n\t\t\t}\n\t\t});\n\t\t\n\t\tvar doneEvent = {\n\t\t\ttype: 'route-done',\n\t\t\tposition: null\n\t\t}\n\t\tthis.props.onChange(doneEvent);\n\t}" ]
[ "0.6277569", "0.606101", "0.6034509", "0.60007274", "0.5967282", "0.5920826", "0.5842553", "0.5789088", "0.57203084", "0.57110023", "0.56926155", "0.5686221", "0.56737554", "0.56446046", "0.56228864", "0.5613628", "0.5557849", "0.555779", "0.55187553", "0.54868704", "0.547642", "0.5469724", "0.5462136", "0.54440635", "0.5444035", "0.5427856", "0.5419119", "0.54159886", "0.54102695", "0.54090476", "0.540902", "0.5393274", "0.5390907", "0.53853095", "0.5382619", "0.5358025", "0.5351515", "0.53347975", "0.5321907", "0.53107536", "0.53101075", "0.53044033", "0.5302945", "0.5295691", "0.52812535", "0.52679956", "0.52644885", "0.52599716", "0.5258589", "0.52441543", "0.5240924", "0.5228146", "0.5227811", "0.52237", "0.52111936", "0.52095836", "0.5192386", "0.51917213", "0.5186372", "0.5179788", "0.5176143", "0.51745003", "0.5167707", "0.51635057", "0.5162519", "0.5161915", "0.516109", "0.5153105", "0.5147722", "0.5146244", "0.5143129", "0.5136908", "0.5135878", "0.513583", "0.5126874", "0.5122443", "0.51176375", "0.5112125", "0.5106852", "0.51000774", "0.5095338", "0.50949585", "0.5092107", "0.5081814", "0.5064736", "0.50617146", "0.5045301", "0.5038623", "0.5036438", "0.5033759", "0.50280386", "0.50209767", "0.50198716", "0.5004178", "0.5000475", "0.49989185", "0.49969572", "0.49942783", "0.49908248", "0.49889758", "0.498851" ]
0.0
-1
Add a document by given collecction and document
function addDocument(collection, document, callback){ MongoClient.connect(url, function(err, db){ if (err) throw err db.collection(collection).insert(document, function(err, result) { console.log(result) assert.equal(err, null); assert.equal(1, result.result.n); assert.equal(1, result.ops.length); db.close() callback(result); }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(doc){const idx=this.size();if(isString(doc)){this._addString(doc,idx);}else {this._addObject(doc,idx);}}", "async addDocument(_, { input: { doc, owner } }, { generalInfo }) {\n const document = { doc }\n const { insertedId } = await generalInfo.insertOne(document)\n document._id = insertedId\n\n return document\n }", "static async addANewDocument (document) {\n if (typeof document !== 'object') {\n throw new Error('Bad Parameter');\n }\n\n // Retrieve instance of Mongo\n const db = await Mongo.instance().getDb();\n const isValid = await Document.isDocument(document);\n if (isValid.valid) {\n // Create a new document\n return db.collection(Document.COLLECTION).insertOne({\n ...document,\n createdAt: moment().toDate(),\n updatedAt: moment().toDate()\n });\n } else {\n log.debug('Warning - couldn\\'t insert document \\n', document);\n return null;\n }\n }", "add(doc) {\n const idx = this.size()\n\n if (isString(doc)) {\n this._addString(doc, idx)\n } else {\n this._addObject(doc, idx)\n }\n }", "function addDocument(collectionName, newDoc) {\n var collection = data[collectionName];\n var nextId = Object.keys(collection).length;\n if (newDoc.hasOwnProperty('_id')) {\n throw new Error(`You cannot add a document that already has an _id. addDocument is for new documents that do not have an ID yet.`);\n }\n while (collection[nextId]) {\n nextId++;\n }\n newDoc._id = nextId;\n writeDocument(collectionName, newDoc);\n return newDoc;\n}", "function addDocument(collectionName, newDoc) {\n var collection = data[collectionName];\n var nextId = Object.keys(collection).length;\n if (newDoc.hasOwnProperty('_id')) {\n throw new Error(`You cannot add a document that already has an _id. addDocument is for new documents that do not have an ID yet.`);\n }\n while (collection[nextId]) {\n nextId++;\n }\n newDoc._id = nextId;\n writeDocument(collectionName, newDoc);\n return newDoc;\n}", "function addDocument(collectionName, newDoc) {\n var collection = data[collectionName];\n var nextId = Object.keys(collection).length;\n if (newDoc.hasOwnProperty('_id')) {\n throw new Error(`You cannot add a document that already has an _id. addDocument is for new documents that do not have an ID yet.`);\n }\n while (collection[nextId]) {\n nextId++;\n }\n newDoc._id = nextId;\n writeDocument(collectionName, newDoc);\n return newDoc;\n}", "function insert_doc(doc) {\n\tif (cloudant) {\n\t\tlogger.info(\"insert_doc() doc.id_str:\", doc.id_str);\n\t db.insert(doc, function (error, http_body, http_headers) {\n\t if(error) return logger.error(error);\n\t });\n // logger.debug(\"insert_doc() http_body:\", http_body);\n\t\t}\n}", "async add(collection, document) {\n console.log(\"adding collection\")\n console.log(collection) \n try {\n const docRef = await this.api\n .collection(collection)\n .add(document);\n return docRef.id;\n }\n catch (error) {\n return 'Error adding document: ' + error;\n }\n }", "function insertDoc(doc, db){\n\tdb.find({ _refObjectUUID: doc._refObjectUUID }, function(err, docs){\n\t\tif(!docs.length){\n\t\t\t// Insert New\n\t\t\tdb.insert(doc, function (err) {});\n\t\t} else {\n\t\t\t// Update Existing\n\t\t\tcompareDoc(doc, db);\n\t\t}\n\t});\n}", "function Add_Doc_WithAutoID() {\n // Collection is the table or collection of\n cloudDB\n .collection(\"Students\")\n .add({\n // This is creating a new entry in the DB\n NameOfStd: nameV,\n RollNo: Number(rollV),\n Section: secV,\n Gender: genV,\n })\n .then(function (docRef) {\n console.log(\"Document writeen with ID\", docRef.id);\n })\n .catch(function (error) {\n console.eroor(\"Error adding document\", error);\n });\n}", "addDocument (doc) {\n if (this._isOptimized) {\n throw new Error('Cannot add a document to an already-optimized index.');\n }\n\n if (typeof doc.id === 'undefined') {\n throw new Error(1000, 'ID is a required property of documents.');\n };\n\n const fieldsToIndex = [];\n for (let [ fieldName, fieldData ] of Object.entries(doc)) {\n /* The document ID is not a field... */\n if ('id' === fieldName) {\n continue;\n }\n\n /* Make sure this field should be indexed... */\n if (!(Object.hasOwnProperty.call(this._fields, this._intern(fieldName, false)))) {\n console.error(`Document field (${fieldName}) is not indexable.`);\n continue;\n }\n\n fieldsToIndex.push(fieldName);\n }\n\n if (0 === fieldsToIndex.length) {\n console.log(`Not indexing empty document ${doc.id}`);\n return;\n }\n\n doc.id = this._intern(doc.id);\n\n for (let [ _, fieldName ] of Object.entries(fieldsToIndex)) {\n let tokens = this._tokenize(doc[`${fieldName}`], true);\n\n fieldName = this._intern(fieldName, false);\n\n if (!(Object.hasOwnProperty.call(this._fields[`${fieldName}`].documents, doc.id))) {\n this._fields[`${fieldName}`].documents[`${doc.id}`] = tokens.length;\n }\n\n for (let [ _, term ] of Object.entries(tokens)) {\n if (!(Object.hasOwnProperty.call(this._fields[`${fieldName}`].terms, term))) {\n this._fields[`${fieldName}`].terms[`${term}`] = {};\n }\n\n if (!(Object.hasOwnProperty.call(this._fields[`${fieldName}`].terms[`${term}`], doc.id))) {\n this._fields[`${fieldName}`].terms[`${term}`][`${doc.id}`] = 0;\n }\n ++this._fields[`${fieldName}`].terms[`${term}`][`${doc.id}`];\n }\n }\n }", "function Add_Doc_CustomID() {\n // Collection is the table or collection of\n cloudDB\n .collection(\"Students\")\n .doc(rollV)\n .set({\n // This is creating a new entry in the DB\n NameOfStd: nameV,\n RollNo: Number(rollV),\n Section: secV,\n Gender: genV,\n })\n .then(function () {\n console.log(\"Document writeen with ID\", rollV);\n })\n .catch(function (error) {\n console.eroor(\"Error adding document\", error);\n });\n}", "function addNewDocument(data) {\n db.collection(\"notes\")\n .add(data)\n .then(function (doc) {\n // console.log(doc);\n console.log(\"Note added successfully\");\n })\n .catch(function (error) {\n console.log(error);\n });\n}", "function addDoc() {\n const docTable = document.getElementById('docTable');\n addRow(docTable);\n hideSelectedDoctypeOption();\n clearDoc();\n hideOrShowRightColumn();\n}", "addDocument(_id, _docType, _payload) {\n client.index({\n index: this.indexName,\n type: _docType,\n id: _id,\n body: _payload\n }, function (err, resp) {\n if (err) {\n console.log(err);\n }\n else {\n console.log(\"added or updated\", resp);\n }\n })\n }", "function addToDb(collectionName, document, callback)\r\n{ \r\n const collection = db.collection(collectionName); \r\n collection.insertOne(document,\r\n function(err){\r\n if(err) { \r\n console.log(\"failed to add a document to \" + collection + \" collection\");\r\n return callback(err);\r\n } \r\n return callback(null, document);\r\n }); \r\n}", "function addnewdoc() {\n currentuseruid = auth.currentUser.uid\n var newdoc1 = {\n title: 'A new doc by abca',\n desc: 'A new doc blah blah by abca',\n creator: currentuseruid\n }\n // console.log(newdoc1)\n // get the current user\n db.collection('new1').doc('newdoc2').set(newdoc1).then(d => {\n console.log('new doc added')\n });\n db.collection('new1').doc('newdoc2').set({ newfield: 'yes' }, { merge: true }).then(d => {\n console.log('new data merged into an existing doc')\n });\n }", "addDoc(){\n \n let dname = readline.question('\\nEnter Doctor name : ');\n let specialization = readline.question('Enter patient Speciality : ');\n let availability = readline.question('Enter availability Type \"AM\", \"PM\" or \"Both : ');\n \n var doctor = {\n \"DoctorName\" :dname,\n \"DocID\" :this.docid,\n \"Specialization\" : specialization,\n \"Availability\" : availability\n }\n this.dfile.Doctors.push(doctor);\n this.saveDocData();\n }", "add (docs = []) {\n Array.prototype.push.apply(this, (Array.isArray(docs) ? docs : [docs]).filter((doc) => {\n return doc.isDocument && !this.has(doc);\n }));\n\n return this;\n }", "addDocuments(collection, data, cb) {\n\t\tif (!Array.isArray(data)) return (cb('Data must be provived as an array.'));\n\t\tif (data.length == 0) return cb(null, []);\n\t\tif (!data) return (cb('Please provide a data (must be json object).'));\n\t\tif (data._id && !(data._id = this.toObjectId(data._id))) return (cb('Please provide a valid id.'));\n\t\tthis.mdb.collection(collection).insertMany(data, (err, insertedDoc) => {\n\t\t\tif (err) return (cb(err));\n\t\t\treturn (cb(null, insertedDoc));\n\t\t})\n\t}", "add(document) {\n if (\"id\" in document && \"data\" in document) this.addVertex(document)\n else if (\"from\" in document && \"to\" in document) this.addEdge(document)\n }", "insert(document) {\n document._id = id_1.id();\n return new this.model(document).save();\n }", "function _insertDocument(projectDoc, res, isLogo, isDocs, callbackObj) {\n saveDocument.save(function(err, docs) {\n if (err) {\n resultObj.status = FAIL;\n resultObj.result = err;\n res.send(resultObj);\n } else {\n callbackObj.cb(docs, res, callbackObj);\n }\n });\n}", "async function sendData() {\n let ref = doc(db, \"Student\", usn.value); //collection for two parameter , doc for 3 parameter\n const docref = await setDoc( //addDoc for two parametr ,setDoc for 3 parameter\n ref, {\n Name: name.value,\n Age: age.value,\n USN: usn.value\n }\n )\n .then(() => {\n alert(\"added data into db\");\n })\n .catch((err) => {\n alert(err);\n })\n}", "function insertDocument(db, coll, callback) {\n\t\tvar col = db.collection(coll);\n\t\tcol.insertOne(image, function(err, result) {\n\n\t\t});\n\t}", "async insertDoc(document) {\n let collection = await this.collection()\n\n await collection.insertOne(document)\n\n }", "async addContent(name, contentText) {\n //TODO\n allWords = await this.words(contentText);\n docCount++;\n await db.collection(docContent_table).insertOne(\n {_id: docCount,docN: name, content: contentText}\n );\n for(let [word,offsets] of allWords){\n await db.collection(docs_table).updateOne(\n {_id: {word, name}},\n {\n $inc: {score: 1},\n $setOnInsert: {\n words: word,\n docs: name,\n offset: offsets\n }\n },\n {upsert: true}\n );\n }\n }", "function escribir(){\n db\n .collection(\"users\")\n .add({\n first: \"Pepe\",\n last: \"Perez\",\n born: 1815\n })\n .then(function(docRef) {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch(function(error) {\n console.error(\"Error adding document: \", error);\n });\n}", "pushDataToDocument(collection, element, query, cb) {\n\t\tif (!query) return (cb('Please provide a query (must be json object).'));\n\t\tif (query._id && !(query._id = this.toObjectId(query._id))) return (cb('Please provide a valid id.'));\n\t\tthis.mdb.collection(collection).findOneAndUpdate(element, {$push : query}, {returnOriginal : false}, (err, inserted) => {\n\t\t\tif (err) return (cb(err));\n\t\t\treturn (cb(null, inserted));\n\t\t});\n\t}", "function guardarPedido2() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: Precio,\n Medida: medida,\n NombreProducto: NombreAmbientador.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadAmbientador.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\n\n}", "function createDocument(req, res, next) {\n const Token = _getToken(req, res)\n Token\n .then((token) => {\n const params = {\n method: 'set_entry',\n custom: false,\n rest_data: {\n session: token,\n modulo: 'Documents',\n data: [\n {\n name: 'document_name',\n value: req.params.filename,\n },\n {\n name: 'revision',\n value: 1,\n },\n ],\n },\n }\n\n _requestCRM(params)\n .then((result)=>{\n res.end(result.id)\n })\n .catch((e) => {\n logger.error('Controller::DefensaConsumidor::createDocument::_RequestCRM::Catch')\n next(APIError({ status: 500, devMessage: e.message, }))\n })\n })\n}", "function addDocument(docId, allWords) {\n let hist = createWordHistogram(allWords);\n let words = Object.keys(hist);\n\n // find the largest term frequency using hist \n let largestTF = words.map(k => hist[k]).reduce((a, b) => Math.max(a, b), 1);\n\n // make sure all words are in the database\n let wordObjects = getWords.bind(this)(words);\n\n // increase the document counter for every word in this document\n let wordIds = wordObjects.then(objs => objs.map(obj => obj._id));\n let docCounterIncremented = wordIds.then(ids => {\n return this.db.collection('words')\n .update(\n {'_id': {'$in': ids}}, \n {'$inc': {'documents': 1}},\n {'multi': true}\n );\n });\n\n // create word counters for this document \n let counters = wordObjects.then(objs => objs.map(obj => {\n return {\n 'document': docId, \n 'word': obj._id, \n 'count': hist[obj.word],\n 'normalizedCnt': hist[obj.word] / largestTF\n };\n }));\n let countersInserted = counters.then(documents => {\n if (documents.length > 0) {\n return this.db.collection('words_in_documents').insert(documents);\n } else {\n return 'nothing to do';\n }\n });\n\n // finished when all db queries are finished \n return Promise.all([docCounterIncremented, countersInserted]);\n}", "function saveDoc(doc){\n var db = $.couch.db(\"media\");\n db.saveDoc(doc, {\n success: function (response, textStatus, jqXHR) {\n console.log(response);\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.log(errorThrown)\n }\n })\n}", "function guardarPedido3() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: Precio,\n Medida: medida,\n NombreProducto: NombreJabonManos.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadJabonManos.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\n\n}", "function addNewRecipe(name,dif,ingridientsArray,photoLink,timeItTakes,howToMakeit){\n\n db.collection(\"Recepies\").add({\n recipeName: name,\n difficulty:dif,\n ingridients:ingridientsArray,\n recipePhoto:photoLink,\n time:timeItTakes,\n howToDo:howToMakeit\n })\n .then((docRef) => {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch((error) => {\n console.error(\"Error adding document: \", error);\n });\n\n }", "function guardarPedido4() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: PrecioJabonRopaColor,\n Medida: medida,\n NombreProducto: NombreJabonRopaColor.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadJabonRopaColor.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\n\n}", "function insertDocument(dbHandle, doc, callback) {\n dbHandle.collection('publications').insertOne(doc, function(err, result) {\n assert.equal(err, null);\n insertedCount++;\n console.log(\"Publications inserted: \" + insertedCount);\n callback();\n });\n}", "_appendChild(collectionPath, data) {\n this.editorSession.transaction(tx => {\n const node = tx.create(data);\n documentHelpers.append(tx, collectionPath, node.id);\n });\n }", "function _createDocument(token, doc) {\n return new Promise((resolve, reject) => {\n const params = {\n method: 'set_entry',\n custom: false,\n rest_data: {\n session: token,\n modulo: 'Documents',\n data: [\n {\n name: 'document_name',\n value: doc,\n },\n {\n name: 'revision',\n value: 1,\n },\n ],\n },\n }\n _requestCRM(params)\n .then((result)=>{\n resolve(result.id)\n }).catch((error) => {\n logger.error('Controller::DefensaConsumidor::_createDocument')\n reject(error)\n })\n })\n}", "function guardarPedido6() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: PrecioJabonLavadora,\n Medida: medida,\n NombreProducto: NombreJabonLavadora.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadJabonLavadora.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\n\n}", "function guardarPedido5() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: PrecioJabonRey,\n Medida: medida,\n NombreProducto: NombreJabonRey.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadJabonRey.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\n\n}", "function handleAdd() {\n let newId = docs.length + 1;\n setDocs([\n ...docs,\n {\n id: newId,\n title: `Boleto ${newId}`,\n description: `Descrição do boleto ${newId}`\n }\n ]);\n }", "async insert(document) {\n\n // Note: the this.mongoDb Node.js driver updates the document inserted with a new _id field if it did not have one.\n\n let client = await MongoClient.connect(this.mongoDb)\n let results = await client.db(this.database).collection(this.collection).insert(document)\n\n await client.close()\n\n return results.ops[0]\n }", "function guardarPedido() {\n \n db.collection(\"DatosDeCompra\").add({\n ValorUnitario: PrecioSuavisante1,\n Medida: medida,\n NombreProducto: NombreSuavisante1.innerHTML,\n Aroma: aroma,\n Cantidad: CantidadSuavisante1.value\n })\n\n .then(function (docRef) {\n console.log(\"Pedido hecho: \", docRef.id);\n \n })\n .catch(function (error) {\n console.error(\"Error: \", error);\n });\n\n}", "function upload_data(collection) {\n db.collection(collection).add({\n today_rating: today_rating,\n week_rating: week_rating,\n month_rating: month_rating,\n area_of_business: document.getElementById(\"survey_aob_dropdown\").value,\n date: `${Date()}`.substr(4,11)\n })\n .then(function(docRef) {\n console.log(\"Document written with ID: \", docRef.id);\n document.getElementById(\"survey_aob_dropdown\").value = \"Professional Services\";\n document.getElementById(\"aob_list\").value = \"All\";\n location.reload();\n })\n .catch(function(error) {\n console.error(\"Error adding document: \", error);\n });\n }", "insertDocument(collectionName, document, options) {\n return new Promise((resolve, reject) => {\n this.insertOne(collectionName, document, options)\n .then((result) => {\n resolve(result);\n })\n .catch(reject);\n });\n }", "function getUserDocument(documents) {\n for (let i = 0; i < documents.length; i++) {\n let documentUrl = `${collectionUrlcustomerBTDetail}/docs/${documents[i].id}`;\n\n client.readDocument(documentUrl, null, (err, result) => {\n if (err) {\n if (err.code == HttpStatusCodes.NOTFOUND) {\n client.createDocument(collectionUrlcustomerBTDetail, documents[i], (err, created) => {\n if (err) {\n console.log(JSON.stringify(err));\n\n }\n else {\n console.log(JSON.stringify(created));\n\n\n }\n });\n }\n else {\n console.log(JSON.stringify(err));\n }\n }\n else {\n console.log(JSON.stringify(result));\n }\n });\n }\n}", "_createDocument(req, res, next) {\n const { documentId, change } = req.body\n this.engine.createDocument(documentId, change, function(err, version) {\n if (err) return next(err)\n res.json(version)\n })\n }", "function setCollection(collection,document){\n return database.collection(collection).doc(document);\n}", "function writeDocument(collection, changedDocument) {\n var id = changedDocument._id;\n if (id === undefined) {\n throw new Error(`You cannot write a document to the database without an _id! Use AddDocument if this is a new object.`);\n }\n // Store a copy of the object into the database. Models a database's behavior.\n data[collection][id] = JSONClone(changedDocument);\n // Update our 'database'.\n updated = true;\n}", "function writeDocument(collection, changedDocument) {\n var id = changedDocument._id;\n if (id === undefined) {\n throw new Error(`You cannot write a document to the database without an _id! Use AddDocument if this is a new object.`);\n }\n // Store a copy of the object into the database. Models a database's behavior.\n data[collection][id] = JSONClone(changedDocument);\n // Update our 'database'.\n updated = true;\n}", "function writeDocument(collection, changedDocument) {\n var id = changedDocument._id;\n if (id === undefined) {\n throw new Error(`You cannot write a document to the database without an _id! Use AddDocument if this is a new object.`);\n }\n // Store a copy of the object into the database. Models a database's behavior.\n data[collection][id] = JSONClone(changedDocument);\n // Update our 'database'.\n updated = true;\n}", "static async modifyDocument (id, document) {\n if (typeof document !== 'object') {\n throw new Error('Bad Parameter');\n }\n const db = await Mongo.instance().getDb();\n const isValid = await Document.isDocument(document);\n if (isValid.valid) {\n // Create a new document\n // Uploaded document with new informations.\n const res = await db.collection(Document.COLLECTION).updateOne(\n {\n _id: ObjectId(id)\n },\n {\n $set: {\n ...document,\n updatedAt: moment().toDate()\n }\n }\n );\n return res;\n } else {\n log.debug('Warning - couldn\\'t modify document \\n', document);\n return null;\n }\n }", "function pushData(e){\n e.preventDefault();\n //Values\n const link = document.querySelector('.movie-link').value;\n if(link != '' && id != ''){\n db.collection(\"movie\").add({\n link: link,\n id: id,\n timestamp:today\n })\n .then(function(docRef) {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch(function(error) {\n console.error(\"Error adding document: \", error);\n });\n }\n else console.log('Missing')\n \n \n \n\n}", "function cargarData() {\n let tarjeta = document.getElementById('numerot').value;\n var db = firebase.firestore();\n db.collection('tarjetas').add({\n tarjeta: tarjeta\n\n })\n .then(function(docRef) {\n console.log('Document written with ID: ', docRef.id);\n document.getElementById('numerot').value = '' ;\n })\n .catch(function(error) {\n console.error('Error adding document: ', error);\n });\n\n}", "function writeDocument (doc) {\n return wsk.actions.invoke({\n actionName: packageName + \"/create-document\",\n params: { \"doc\": doc },\n blocking: true,\n })\n .then(activation => {\n console.log(\"Created new document with ID \" + activation.response.result.id);\n return activation.response.result;\n })\n .catch(function (err) {\n console.log(\"Error creating document\");\n return err;\n });\n}", "function enqueueDocument(doc, cb) {\n var message = {\n \"requestType\": constants.queues.action.GET_DOCUMENT,\n \"data\": {\n \"docId\": doc.docId,\n \"sourceId\": doc.sourceId\n }\n };\n\n return queueOut.sendMessage(message, function (err) {\n if (error) {\n console.error('There was an error queuing a document.');\n return cb(err);\n }\n\n // Test Dependency:\n // The following message is used as part of E2E testing\n console.info('Queued document %s from source %s', doc.docId, doc.sourceId)\n return cb();\n });\n }", "registerMood(rating, comment){\n this.db.collection(this.auth.currentUser.email).add({\n Date: Date.now(),\n Rate: rating,\n Comment: comment,\n \n })\n .then(function(docRef) {\n console.log(\"Document written with ID: \", docRef.id); // Get generated id for the new document\n }) \n .catch(function(error) {\n console.error(\"Error adding document: \", error);\n });\n }", "createDocument(content, a2) {\n let options = {};\n\n errors.assertArgCount(arguments, 1, 2);\n errors.assertParamValue(Buffer.isBuffer(content) ||\n typeof content === 'string' || nodbUtil.isObject(content), 1);\n if (arguments.length > 1) {\n errors.assertParamValue(nodbUtil.isObject(a2), 2);\n options = a2;\n errors.assertParamPropString(options, 2, \"key\");\n errors.assertParamPropString(options, 2, \"mediaType\");\n }\n\n if (typeof content === 'string') {\n content = Buffer.from(content);\n } else if (nodbUtil.isObject(content)) {\n content = Buffer.from(JSON.stringify(content));\n }\n\n const doc = new SodaDocument();\n doc._impl = this._impl.createDocument(content, options);\n return doc;\n }", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n service.findDuplicateDoc(moduleName, newDoc).then(function(){\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n }).catch(function(err){\n deferred.reject(err);\n });\n\n return deferred.promise;\n}", "function addKonan(userUID) {\n\n db.collection(\"konanim\").add({\n userUID: userUID,\n })\n // feedback, didn't work for me, but it's not necessary anyway\n // IGNORE this code for now\n .then(function (docRef) {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch(function (error) {\n console.error(\"Error adding document: \", error);\n });\n}", "function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n }\n });\n\n return deferred.promise;\n}", "function afficherDocument(documents) {\n let tr = document.createElement('tr');\n let td = document.createElement('td');\n\n td.innerText = documents.titre;\n tr.appendChild(td);\n td = document.createElement('td');\n\n td.innerText = documents.date;\n tr.appendChild(td);\n td = document.createElement('td');\n let linkDownload = document.createElement('a');\n linkDownload.href = \"../document/doc\" + documents.id + \".pdf\";\n linkDownload.download = \"doc\" + documents.id + \".pdf\";\n td.appendChild(linkDownload);\n\n let img2 = new Image();\n img2.src = \"../img/pdf.png\";\n img2.style.marginTop = \"5px\";\n img2.style.marginLeft = \"10px\";\n linkDownload.appendChild(img2);\n\n tr.appendChild(td);\n lesLignes.appendChild(tr)\n}", "function addDocToLibraries (doc) {\n //AppController.sharedInstance().librariesController().addAssetLibraryAtURL(doc.fileURL())\n\tdoc.saveAndAddLibrary()\n}", "function saveDoc(doc) {\n db.save(doc, function(err, res) {\n if (err) {\n console.log('Could not save document.');\n } else {\n console.log('Document saved: ' + res.id);\n }\n });\n}", "function designDocAdd(ddoc_type, ddoc_name, ddoc_data, callback) {\n var ddoc_url = db._resolve('_design/' + ddoc_type), serialised;\n\n hoodie.request('GET', ddoc_url, {}, function (err, ddoc, res) {\n if (res.statusCode === 404) {\n // not found, so we use new object.\n ddoc = {\n language: 'javascript'\n };\n ddoc[ddoc_type] = {};\n } else if (err) {\n return callback(err);\n }\n\n // View functions need to be serialised/stringified.\n if (ddoc_type === 'views' || ddoc_type === 'fulltext') {\n serialised = _.reduce(ddoc_data, function (memo, v, k) {\n memo[k] = _.isFunction(v) ? v.toString() : v;\n return memo;\n }, {});\n } else {\n serialised = ddoc_data.toString();\n }\n\n // If view code has not changed we don't need to do anything else.\n // NOTE: Not sure if this is the best way to deal with this. This\n // saves work and avoids unnecessarily overwriting the\n // `_design/views` document when no actual changes have been made to\n // the view code (map/reduce).\n if (_.isEqual(serialised, ddoc[ddoc_type][ddoc_name])) {\n return callback(null, {\n ok: true,\n id: ddoc._id,\n rev: ddoc._rev\n });\n }\n ddoc[ddoc_type][ddoc_name] = serialised;\n hoodie.request('PUT', ddoc_url, {data: ddoc}, function cb(err, ddoc, res) {\n if (res && res.statusCode === 409) {\n return designDocAdd(ddoc_type, ddoc_name, ddoc_data, callback);\n }\n callback(err, ddoc, res);\n });\n });\n }", "_register(collaboratorId, documentId, selection, collaboratorInfo) {\n let collaborator = this._collaborators[collaboratorId]\n\n if (!collaborator) {\n collaborator = this._collaborators[collaboratorId] = {\n collaboratorId: collaboratorId,\n documents: {}\n }\n }\n\n // Extend with collaboratorInfo if available\n collaborator.info = collaboratorInfo\n\n // Register document\n collaborator.documents[documentId] = {\n selection: selection\n }\n }", "function createDoc(resourceName, obj) {\n \tdelete obj._id; // Do not allow users to set ._id\n\n \tconst collection = getModel(resourceName);\n \tconst item = new collection(obj);\n\n \treturn item.save()\n \t.then(data => {\n\n \t\tconst resp = {\n \t\t\tdoc: data,\n \t\t\tmetadata: { modified: data.length}\n \t\t};\n\n \t\treturn resp;\n \t})\n \t.catch(err => {\n \t\tconsole.log(err);\n \t\tconsole.log(\"db.createDoc error\");\n \t});\n }", "function createDoc(store,unid) {\n var doc = store.loadDocument(unid,darwino.jstore.Store.DOCUMENT_CREATE);\n if(doc.isNewDocument()) {\n\tdoc.setJsonString(\"{field:'My field value'}\")\n doc.save()\n }\n return doc;\n}", "function addEntry(search) {\nmongo.connect(url, function(err, db) {\n if (err) throw err;\n db.createCollection('searches'); // creates collection or ignores if already exists\n var searches = db.collection('searches');\n searches.insert({\n search: search\n }, function(err,data) {\n if (err) throw err;\n db.close();\n });\n}); \n}", "function addDocument() {\n var $list = $(\".documentList\");\n var $item = $(\"#document-template\").clone(true).removeAttr(\"id\");\n $list.append($item);\n $item.show('slow');\n checkItems($list);\n updateDocument();\n\n}", "function insertDocs(docArray) {\n docArray.forEach(function(doc) {\n db.insert(doc, doc._id, function(err, body) {\n if (!err)\n console.log(body);\n else\n console.error(err);\n });\n });\n}", "function postDoc(username,fileName, fileType, doc){\n UserAccountService.postDoc(username, fileName, fileType, doc)\n .then(\n function(d) {\n vm.cancelModal();\n },\n function(errResponse){\n console.error('Error while updating doc');\n }\n );\n }", "function insertBook(authorForename, authorSurname, bookName, stockPrice, sellingPrice, stockAmount, synopsis, genres, image){\n let bookObj = {authorForename:authorForename, authorSurname: authorSurname, bookName:bookName, stockPrice:stockPrice, sellingPrice:sellingPrice, stockAmount:stockAmount, synopsis:synopsis, genres: genres, image:image};\n Book.collection.insertOne(bookObj, function(err){\n if(err){console.log(err);}\n });\n}", "parseDocument(doc) {\n // split the document to words\n const words = normalize(doc);\n // process each word individually\n words.map(word => {\n if (this.stopWords.find(stopWord => word === stopWord) !== undefined) {\n\t // do nothing, it's a stop word, and it doesn't add any meaning\n } else if (this.dictionary[word] !== undefined) {\n this.dictionary[word].push(this.documentCount)\n } else {\n this.dictionary[word] = [this.documentCount];\n\t\t\t}\n })\n this.documentCount++\n this.docs.push(doc)\n }", "function guardar() {\n let txtnombre = document.getElementById('name').value;\n let txtapellido = document.getElementById('surename').value;\n\n db.collection('Alumnos')\n .add({\n first: txtnombre,\n last: txtapellido,\n asistencia: 'No tomada'\n })\n .then(function(docRef) {\n console.log('Document written with ID: ', docRef.id);\n document.getElementById('name').value = '';\n document.getElementById('surename').value = '';\n })\n .catch(function(error) {\n console.error('Error adding document: ', error);\n });\n}", "function DocumentCreated(doc) {\n ReceiveUpdate(doc);\n}", "function buyDocument(court, caseNumber, docketSeq, partNumber) {\n const queryApi = new CourtApi.QueryApi();\n\n return new Promise((resolve, reject) => {\n queryApi.buyDocketDocument(court, caseNumber, docketSeq, partNumber,\n\n handlers.promiseCallback(resolve, reject)\n );\n });\n}", "function handleNewClick() {\n const newDoc = stubNewDocument()\n addUpdate(newDoc)\n appendToExtendedData([newDoc])\n }", "parseDocument(doc) {\n // split the document to words\n const words = normalize(doc);\n // process each word individually\n words.map(word => {\n if (this.stopWords.find(stopWord => word === stopWord) !== undefined) {\n // do nothing, it's a stop word, and it doesn't add any meaning\n } else if (this.dictionary[word] !== undefined) {\n this.dictionary[word].push(this.documentCount)\n } else {\n this.dictionary[word] = [this.documentCount];\n }\n })\n this.documentCount++\n this.docs.push(doc)\n }", "function insertNewCustomerDataInput(data) {\n client.createDocument(collectionUrlcustomerBTDetail, data, (err, created) => {\n if (err) {\n console.log(JSON.stringify(err));\n }\n else {\n console.log(JSON.stringify(created));\n }\n });\n}", "function addToFavourites(Id, title, link, content) { \nFavorites.push(Id) \nconsole.log(Favorites)\n\n db.collection(\"users\").doc(globaluser.uid).set({ \n favourites: Favorites\n \n},{ merge: true }) \n.then(() => {\n console.log(\"Document successfully written!\");\n})\n.catch((error) => {\n console.error(\"Error writing document: \", error);\n}); \n\n}", "function onAddDocumentClick() {\n\twindow.location = \"UserTaskDocument.action\";\n}", "function addReview(store) {\n db.collection(\"Stores\").doc(store).collection(\"Reviews\").doc(firebase.auth().currentUser.displayName).set({\n id: firebase.auth().currentUser.displayName,\n Reviewer_Name: firebase.auth().currentUser.displayName,\n Reviewer_Email: firebase.auth().currentUser.email,\n Reviewer_Rating: parseInt(rating),\n Reviewer_Comment: document.getElementById(\"comment_box\").value,\n Date_Time: firebase.firestore.FieldValue.serverTimestamp()\n })\n .then(() => {\n console.log(\"Document successfully written!\");\n })\n .catch((error) => {\n console.error(\"Error adding document: \", error);\n });\n}", "function guardar(){\n let nombre = document.getElementById('nombre').value;\n\n\n db.collection(\"users\").add({\n first: nombre,\n\n })\n .then(function(docRef) {\n console.log(\"Document written with ID: \", docRef.id);\n document.getElementById('nombre').value = \"\";\n\n })\n .catch(function(error) {\n console.error(\"Error adding document: \", error);\n });\n\n}", "async addDocuments(documents) {\n const typesenseDocuments = this._documentsToTypesenseRecords(documents, await this.embeddings.embedDocuments(documents.map((doc) => doc.pageContent)));\n await this.import(typesenseDocuments, this.schemaName);\n }", "async createDocument(ctx, documentId, value) {\n const exists = await this.documentExists(ctx, documentId);\n if (exists) {\n throw new Error(`The document ${documentId} already exists`);\n }\n const asset = { value };\n const buffer = Buffer.from(JSON.stringify(asset));\n await ctx.stub.putState(documentId, buffer);\n }", "function addCartForItem(docid) {\n document.getElementById(docid).addEventListener(\"click\", function () {\n console.log(\"adding \" + docid + \" to cart\");\n firebase.auth().onAuthStateChanged(function (user) {\n db.collection(\"users\") //part of the user's doc\n .doc(user.uid)\n .set({\n CartByID: firebase.firestore.FieldValue.arrayUnion({\n name: \"Organic Carrot\",\n quantity: 1,\n price: 1.78,\n description: \"Arrival Date: Apr 16\"\n })\n }, {\n merge: true\n });\n })\n })\n}", "function sendMessage(userName, userPhone, userAddress, userFoodName, userFoodType) {\n db.collection(\"formData\").add({\n name: userName,\n phone: userPhone,\n address: userAddress,\n foodname: userFoodName,\n foodtype: userFoodType\n })\n .then((docRef) => {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch((error) => {\n console.error(\"Error adding document: \", error);\n });\n}", "ensureDoc(modelName, doc, cb) {\n collection(modelName).deleteMany({_id:doc._id}, (ee, rr) => {\n collection(modelName).insertOne(doc, {new:true}, (e, r) => {\n cb(ee||e, r ? r.ops[0] : console.log(`ensureDoc.${modelName} failed: ${e.message}`.error))\n })\n })\n }", "saveItem(event, data) {\n data = convertToLowerCase(data);\n itemsDB.insert(data, (err, newDoc) => {\n yearsDB.find({}, (err, docs) => {\n docs.forEach(doc => {\n let setupData = {\n item: newDoc._id,\n year: doc._id,\n rent: 1,\n avakHammali: 1,\n javakHammali: 1\n };\n setupsDB.insert(setupData, (err, newDoc) => {\n let response = {};\n response.error = err;\n this.mainWindow.webContents.send('saveItemResponse', response);\n });\n });\n });\n });\n }", "function commitSample( db, doc ) {\n db.post( doc )\n}", "function insert(type, data) {\n db.collection(type).insertOne(data, function(err, res) {\n if (err) throw err;\n //if succesfully inserted log the details of data and client\n console.log(\"Document inserted of type \" + type + ' from userId ' + data.userId);\n });\n}", "function loadDocOnAddPage(id) {\n searchedDocs = db.findOne({ _id: id }, function (err, doc) {\n if (err) console.log(err);\n\n dbState.editingID = doc._id;\n dbState.editingDate = doc.date;\n\n let inputs = document.querySelectorAll(\"#add-page input\");\n let textArea = document.querySelectorAll(\"#add-page textarea\");\n\n [inputs[1].value, inputs[0].value] = doc.name.split(\", \");\n [inputs[3].value, inputs[2].value] = doc.contact.split(\", \");\n inputs[4].value = doc.address;\n inputs[5].value = doc.email;\n inputs[6].value = doc.phone;\n textArea.value = doc.notes;\n\n editMap.editingPosition.x = doc.position.x;\n editMap.editingPosition.y = doc.position.y;\n });\n}", "function addSavedDocs(data, callback){\n console.log(data);\n MongoClient.connect(uri, function (err, db) {\n assert.equal(null, err);\n\n //try find the user's existing list of saved doctors\n db.collection('savedDoctors').find({'email':data.email}).toArray(function(err, docs){\n assert.equal(null, err);\n //console.log(docs);\n\n if(docs.length === 0){\n console.log('New entry detected, creating saved doctor list');\n db.collection('savedDoctors').insertOne({email:data.email, savedDocs: [data.docName]}, function (err, r) {\n if (err === null) {\n assert.equal(1, r.insertedCount);\n console.log('Doctor added to saved list');\n callback('Doctor saved');\n db.close();\n } else {\n //cb('Invalid Review data');\n console.log(err.message);\n callback('Adding Doctor Failed');\n }\n });\n }else{\n var docAlreadSaved = 0;\n var myNewDoc = docs[0];\n //console.log(myNewDoc);\n\n for( var j=0; j<myNewDoc.savedDocs.length;j++){\n if(myNewDoc.savedDocs[j] === data.docName){\n docAlreadSaved = 1;\n console.log(\"Doctor already part of client's saved list\");\n callback('Doctor already in your list of saved doctors');\n }\n }\n\n if(docAlreadSaved === 0){\n console.log('Adding doc to client\\'s saved doctors');\n myNewDoc.savedDocs[myNewDoc.savedDocs.length] = data.docName;\n //console.log(myNewDoc);\n var res = db.collection('savedDoctors').updateOne({email: data.email},myNewDoc,{ upsert: false });\n console.log('Doctor Saved');\n callback('Doctor saved');\n }\n\n }\n db.close();\n });\n });\n}", "function _uploadDocument(req, res) {\n if (req && req.file) {\n var absolutePath = path.join(path.dirname(require.main.filename), req.file.path);\n req.file.absolutePath = absolutePath;\n var saveDocument = new Document({\n docPath: absolutePath,\n docName: req.file.filename\n });\n saveDocument.save(function(err, docs) {\n if (err) {\n resultObj.status = FAIL;\n resultObj.result = err;\n res.send(resultObj);\n } else {\n resultObj.status = OK;\n resultObj.result = docs;\n res.send(resultObj);\n }\n });\n } else {\n resultObj.status = FAIL;\n resultObj.result = 'Server Error';\n res.send(resultObj);\n }\n}", "static mapDocument(document) {\n if (!document.exists) {\n return null;\n }\n\n const item = Object.assign({}, document.data(), {\n id: document.id,\n });\n\n this.replaceAllTimestampToDate(item);\n\n return item;\n }", "function addData(name, poem){\n db.collection(\"haikus\", function(err, collection){\n collection.insert({\"name\": name, \"poem\": poem});\n })\n }", "static createDocumentWithBlob(parentDoc, docParams, file) {\n\n let properties = this.properties;\n\n return new Promise(\n function(resolve, reject) {\n\n let uploadedBlob = null;\n\n // If file not empty, process blob and upload\n if (file) {\n let blob = new Nuxeo.Blob({\n content: file,\n name: file.name,\n mimeType: file.type,\n size: file.size\n });\n\n properties.client\n .batchUpload()\n .upload(blob)\n .then((res) => {\n if (res) {\n // Create document\n properties.client\n .operation('Document.Create')\n .params(docParams)\n .input(parentDoc)\n .execute()\n .then((newDoc) => {\n // If blob uploaded, attach to created document\n if (res != null) {\n properties.client.operation('Blob.AttachOnDocument')\n .param('document', newDoc.uid)\n .input(res.blob)\n .execute({ schemas: ['dublincore', 'file']});\n\n // Finally, resolve create document\n resolve(newDoc);\n }\n })\n .catch((error) => { reject('Could not create document.'); } );\n } else {\n reject('No ' + type +' found');\n }\n }).catch((error) => { reject('Could not upload file.'); } );\n }\n });\n }" ]
[ "0.72200406", "0.71269244", "0.69567025", "0.69169676", "0.6706773", "0.6706773", "0.6706773", "0.6609426", "0.6559072", "0.6519775", "0.65146273", "0.64679414", "0.64276755", "0.6423943", "0.6304233", "0.6277262", "0.6253428", "0.620708", "0.6202558", "0.6160706", "0.61494285", "0.6104169", "0.6075142", "0.60672474", "0.6064087", "0.6063775", "0.60630965", "0.6041869", "0.60378855", "0.60255146", "0.6025238", "0.6008577", "0.60047877", "0.600109", "0.59724593", "0.5957741", "0.5951937", "0.5949449", "0.59453446", "0.59406126", "0.5935494", "0.590804", "0.58977747", "0.5889784", "0.58884317", "0.5844444", "0.5841608", "0.58285475", "0.5816602", "0.5804038", "0.5793472", "0.5793472", "0.5793472", "0.5791394", "0.57811874", "0.57375896", "0.57054955", "0.56864685", "0.56741", "0.5667022", "0.5655355", "0.56448746", "0.5635129", "0.5627972", "0.5625293", "0.5621522", "0.56106585", "0.56094164", "0.5580369", "0.5578601", "0.55715716", "0.5545829", "0.5529145", "0.5515416", "0.5506033", "0.54976517", "0.54795957", "0.5478932", "0.54775774", "0.5473574", "0.54619116", "0.5423982", "0.54134005", "0.5404136", "0.5394422", "0.53873205", "0.53561646", "0.53530025", "0.5347225", "0.5334152", "0.5332966", "0.53217065", "0.5320238", "0.53187525", "0.5309402", "0.5309025", "0.53075063", "0.5300345", "0.5287775", "0.5281481" ]
0.6680174
7
create template document by given template name and array of fields required to be added
function createTemplate(templateName, fieldsArray, callback){ var readyTemplate = { template: templateName, fields:fieldsArray } callback(readyTemplate) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTemplate(templateName, fieldsArray,callback){\n\tcreateTemplate(templateName,fieldsArray, function(readyTemplate){\n\taddDocument('templates',readyTemplate,function(result){\n\tcallback(result)})})\n}", "function Template(style, fields) {\n if (!~STYLES.indexOf(style))\n throw new Error(\"Unsupported passbook style \" + style);\n this.style = style;\n this.fields = cloneObject(fields);\n this.keysPath = \"keys\";\n}", "function addTemplateElement(request, template_json){\n var element = templateElementArray(template_json);\n addElement(element,dataTable_templates);\n updateTemplateSelect();\n}", "function createTemplate(style, fields) {\n return new Template(style, fields);\n}", "function useTemplate(tblName,template_sysid){ \n var tmp = new GlideRecord(tblName); \n tmp.initialize();\n var gtemp= new GlideTemplate.get(template_sysid).apply(tmp); // apply template to new record\n return tmp.insert(); \n}", "static async addNew(template) {\n const sql =\n \"INSERT INTO templates (template_name, visible, created, sections) VALUES (?,?,?,?)\";\n\n const { name, visible, createdAt, sections } = template;\n\n try {\n return await query(sql, [name, visible, createdAt, sections]);\n } catch (error) {\n console.log(\"exception: \", error);\n throw error;\n }\n }", "constructor (template, name) {\n\t\tif (template instanceof DataType) {\n\t\t\tthis.type = template;\n\t\t\tthis.name = null;\n\t\t\tthis.modelName = null;\n\t\t\tthis.model = null;\n\t\t\tthis.notNull = false;\n\t\t\tthis.primary = false;\n\t\t\tthis.unique = false;\n\t\t\tthis.check = null;\n\t\t\tthis.foreign = null;\n\t\t\tthis.env = null;\n\t\t}\n\t\telse {\n\t\t\tassert.type(template, \"object\", AttributeError, \"template\", \"constructor\");\n\t\t\tassert.fieldTypes(template, SCHEMA.TEMPLATE_FIELDS_T, AttributeError, \"template\", \"constructor\");\n\t\t\tassert.optionalFieldTypes(template, SCHEMA.TEMPLATE_OPTIONAL_T, AttributeError, \"template\", \"constructor\");\n\n\t\t\tthis.name = template.name ? template.name : null;\n\t\t\tif (name)\n\t\t\t\tthis.name = name;\n\t\t\tthis.modelName = template.model ? template.model : null;\n\t\t\tthis.model = null;\n\t\t\tthis.type = template.type;\n\t\t\tthis.notNull = !!template.notNull;\n\t\t\tthis.primary = !!template.primary;\n\t\t\tthis.unique = !!template.unique;\n\t\t\tthis.check = template.check ? template.check : null;\n\t\t\tthis.foreign = template.foreign ? template.foreign : null;\n\n\t\t\tlet typeProperties = {};\n\t\t\t[ \"enumerable\", \"comparable\", \"searchable\", \"fragmentable\", \"absentValue\" ].map((key) => {\n\t\t\t\tif (template[key] !== undefined)\n\t\t\t\t\ttypeProperties[key] = template[key];\n\t\t\t});\n\t\t\tthis.type.applyProperties(typeProperties);\n\n\t\t\tthis.env = template.env ? template.env : null;\n\t\t}\n\t}", "function addTemplateInput(sectionOption, templateOptions, mayRepeat) {\n var objectKey;\n var templateSelectElem;\n var optionElem;\n var templateTitleInputElem;\n var templateNumber = 0; // how many of these is the user trying to create\n var spanForDelete = null;\n var divForInput = $(document.createElement(\"div\"));\n\n if (mayRepeat) {\n // multiple fields allowed, so count the number of existing ones; web service seems to expect the provided\n // values to be zero indexed, so we do not add one\n templateNumber = $(\".inputTemplateType\").length;\n if (templateNumber > 0) {\n spanForDelete = $(document.createElement(\"span\"));\n spanForDelete.html(\"<img src='/rsuite-cms/plugin/@pluginId@/cmsui/images/16/delete.png' title='Delete' alt='Delete' />\");\n spanForDelete.attr(\"onclick\", instantiatedHandlerName + \".removeTemplateInputRow('template\" + templateNumber + \"')\");\n spanForDelete.css(\"cursor\", \"pointer\");\n }\n }\n\n divForInput.attr(\"id\", \"template\" + templateNumber);\n divForInput.attr(\"class\", \"template\");\n\n if (templateOptions !== undefined && templateOptions !== null) {\n // templateOptions looks good, so we are likely doing this from the section's initialization\n\n // Create the select element\n templateSelectElem = $(document.createElement(\"select\"));\n // Create the input element for the new section's title\n templateTitleInputElem = $(document.createElement(\"input\"));\n templateTitleInputElem.attr(\"class\", \"inputTemplateType\");\n templateTitleInputElem.attr(\"name\", \"title[\" + templateNumber + \"]\");\n\n // Not sure why we have to do this, for some reason the templateOptions object has a default 0 key with all added\n // ones as parameter; this same technique works in the NBE code base without issue; some weird Ember object prototype\n // extension? Would be supremely weird\n templateOptions = templateOptions[\"0\"];\n\n // Further setup the select dropdown\n templateSelectElem.attr(\"class\", \"selectTemplateType\");\n templateSelectElem.attr(\"name\", \"templateId[\" + templateNumber + \"]\");\n\n // Create the options for the select element\n for (objectKey in templateOptions) {\n if (templateOptions.hasOwnProperty(objectKey)) {\n optionElem = $(document.createElement(\"option\"));\n optionElem.val(objectKey);\n optionElem.html(templateOptions[objectKey]);\n templateSelectElem.append(optionElem);\n }\n }\n } else {\n // templateOptions null or undefined; meaning user had to have clicked the icon to add another of the same section type\n templateSelectElem = $(\".selectTemplateType\").first().clone();\n templateSelectElem.attr(\"name\", \"templateId[\" + templateNumber + \"]\");\n templateTitleInputElem = $(\".inputTemplateType\").first().clone();\n templateTitleInputElem.attr(\"name\", \"title[\" + templateNumber + \"]\");\n }\n\n // Stitch the HTML together\n divForInput.append(\"<div style='margin-top:20px;'><strong>Template</strong> \" + templateSelectElem.prop(\"outerHTML\") + \"</div>\");\n divForInput.append(\"<div><strong>Title</strong> \" + templateTitleInputElem.prop(\"outerHTML\"));\n\n if (spanForDelete !== null) {\n divForInput.append(spanForDelete.prop(\"outerHTML\"));\n }\n\n divForInput.append(\"</div>\");\n\n // Insert the html into the form\n $(\"#createProductTemplateHolder\").append(divForInput.prop(\"outerHTML\"));\n \n // Scroll to the bottom of the div containing these fields. Using a dynamic value like \n // $(\"div.fieldset\").innerHeight() worked for a while but then gave out. If someone \n // goes beyond 10,000, they need something better to do :)\n $(\"div.fieldset\").scrollTop(10000);\n }", "function renderTemplate(dataFromDb) {\n let template = { data: [] };\n const blackList = ['id', 'created_at', 'updated_at', 'book_id']; // for doing filtering in array. you cant put/post this parameters and they will not be shown in template\n// making array with keys from first object in array and moving id, createdAt and UpdatedAt from array\n const arrayWithKeys = Object.keys(dataFromDb[0]).filter( (element, index) =>{\n return !blackList.includes(element);\n });\n //pushing data in template pattern\n arrayWithKeys.forEach( (element, index) => {\n //console.log(arrayWithKeys[index]);\n if(arrayWithKeys[index] === 'url'){\n let columnName = 'pdf';\n template.data.push( {\n 'name': columnName,\n 'value': \"\",\n 'prompt': 'insert pdf file into book resource to store url in pdfs/{nameOfDocument}'\n } );\n }\n else {\n let columnName = arrayWithKeys[index];\n template.data.push( {\n 'name': columnName,\n 'value': \"\",\n 'prompt': columnName\n } );\n }\n});\n\n cj.collection.template = template;\n\n}", "function getTemplatefromMap(req,templatesList){\n req.s3link=[]\n return _.map(templatesList,function(i){\n let doc=i\n let template={}\n template.ref=doc,\n template.inputFile=docContants.TemplatePath+_.get(docContants,doc)\n template.OutputFile=docContants.OutputPath+_.get(docContants,doc)\n req.s3link.push(docContants.s3linkpath+_.get(docContants,doc))\n return template\n })\n }", "create(title, cost, description, thumbnail, image){\n let template = {\n \"title\": title,\n \"cost\": cost,\n //VERY BAD, USE Object.Id (mongoose)\n // \"id\": this.guid(),\n \"id\": Math.floor(1000 + Math.random() * 9000),\n \"description\": description,\n \"thumbnail\": thumbnail,\n \"image\": image\n }\n this.templates.push(template)\n this.saveTemplates((err, data) => {\n if (err){\n console.log(err)\n return\n }\n })\n return template\n }", "function TemplateInput() {}", "function createWithAdminId(req,res){\n var newTemplate = new TemplateForm();\n newTemplate._admin_id = req.params.adminid;\n newTemplate.template = req.body.template;\n\n newTemplate.save(function(err, template) {\n if(err)\n return res.status(400).json(err);\n else\n return res.status(200).json(template);\n });\n}", "_createTemplates() {\n // User's custom templates\n const callbackTemplate = this.config.callbackOnCreateTemplates;\n let userTemplates = {};\n if (callbackTemplate && isType('Function', callbackTemplate)) {\n userTemplates = callbackTemplate.call(this, strToEl);\n }\n\n this.config.templates = extend(TEMPLATES, userTemplates);\n }", "function createFormTemplate( itcb ) {\n // if no form to look up then we can skip this step\n\n formOptions.callback = onFormTemplateCreated;\n Y.dcforms.createTemplate( formOptions );\n\n function onFormTemplateCreated( err, newFormTemplate ) {\n if ( !err && !newFormTemplate ) { err = 'Could not create form template'; }\n if ( err ) { return itcb( err ); }\n\n template = newFormTemplate;\n template.highlightEditable = false;\n template.fromDict( editTemplate.toDict() );\n template.mode = 'locked';\n itcb( null );\n }\n }", "function createElementFileFromTemplate(outputPath, context, name) {\n createFileFromTemplate(outputPath, context, figureElementPath(name))\n}", "function Passbook(template, fields) {\n this.template = template;\n this.fields = cloneObject(fields);\n // Structure is basically reference to all the fields under a given style\n // key, e.g. if style is coupon then structure.primaryFields maps to\n // fields.coupon.primaryFields.\n var style = template.style;\n this.structure = this.fields[style];\n if (!this.structure)\n this.structure = this.fields[style] = {};\n this.images = {};\n}", "function createFormTemplate() {\n var timesheet = getTimesheet();\n var folder = getFolder();\n var ff = FormApp.create('Time Tracking');\n \n ff.setCollectEmail(true);\n ff.setAllowResponseEdits(true);\n ff.setLimitOneResponsePerUser(true);\n \n createFormFields(ff);\n \n //DELETE FORM\n var ffId = ff.getId();\n var ffFile = DriveApp.getFileById(ffId); \n ffFile.setTrashed(true);\n //MOVE FORM\n var formId = ffFile.makeCopy(folder).setName('1 NEW Form Template - DO NOT DELETE').getId();\n var form = FormApp.openById(formId);\n \n Logger.log(formId);\n}", "function createTemplates(dataObject){\n\tvar templateNames = [\"hoverTip\", \"tip\"];\n\tvar tiplate ;\n\t//var fragment = document.createDocumentFragment();\n\ttemplateNames.forEach(function (name) {\n\t\tvar tiplates = dataObject[\"tiplates\"];\n\t\ttiplate = tiplates[name];\n\t\tvar templateObj = document.createElement(\"template\");\n\t\ttemplateObj.id = name;\n\t\ttemplateObj.innerHTML = tiplate;\n\t\t\tdocument.body.appendChild(templateObj);\n\t})\n\n}", "function populateTemplate(template, data) {\n for (let key in data) {\n let regex = new RegExp('{{' + key + '}}', 'g');\n template = template.replace(regex, data[key]);\n }\n return template;\n}", "constructor(templateInfo){\n\t\tthis.templateInfo = templateInfo;\n\t}", "async function createDoc(){\n const { success, results, error } = await quickdb.doc.create(\n 'sweetTemplate.html',\n '<h1>Sweet Template Bro</h1>'\n );\n console.log(success);\n console.log(results);\n console.log(error);\n}", "function fromTemplate(template_name,data) {\n template_name = template_name.match(/[^\\/].+[^\\/]/)[0].replace(/\\//g,\"-\");\n riot.compile(\n uR.static(\"templates/\"+template_name+\".html\"),\n function(html) { uR.mountElement(template_name,data); }\n );\n }", "function addTemplates(group, service, section, resourceType, path, cols) {\n if (cols === undefined) {\n cols = 2\n }\n addTemplate(group, service, section, resourceType, path, 'details')\n if (cols > 1) {\n addTemplate(group, service, section, resourceType, path, 'list')\n }\n}", "function createModel(entityName) {\n // entityName = \"Catalog\"\n\n // call entityName.json\n let obj = loadEntityData('templates/' + entityName);\n let template = loadTemplates();\n \n // create topModel\n let t = {};\n Object.assign(t,obj);\n t.fields = [];\n\n // expand permissionsTemplate if provided\n if (t.permissionsTemplate){\n t.permissions = template.getTemplate(t.permissionsTemplate).permissions;\n }\n\n // expand fields by template\n t.model = {};\n t.db = {};\n obj.fields.forEach(function(f,index) {\n let n = {} // empty model\n Object.assign(n,template.getTemplate(\"base\")); //extends with base template\n if (f.templateId === \"status\"){ // if field is status, extend with integer template\n Object.assign(n,template.getTemplate(\"integer\"));\n }\n Object.assign(n,template.getTemplate(f.templateId),f); // extend with template if provided for field\n Object.assign(n,template.getTemplate(\"order\")); // extend with order template\n n.templateId = f.templateId; \n f.order = f.order || index;\n if (f.order){\n n.gridOrder = f.order;\n n.orderOnNew = f.order;\n n.orderOnDetails = f.order;\n n.orderOnEdit = f.order;\n n.orderOnImport = f.order;\n }\n \n if (n.dbName[0] === \"_\"){\n n.dbName = obj.prefix + n.dbName;\n }\n\n if (n.linkedField[0] === \"_\"){\n n.linkedField = obj.prefix + n.linkedField;\n }\n\n if (f.templateId === \"catalog\"){ // extend with catalog template\n // copy from linkedField data\n let linkedField = t.fields.find((e) => e.dbName === n.linkedField);\n if (linkedField){\n n.dbName = linkedField.dbName.replace(\"_ctg_\",\"_txt_\");\n n.dbComment = linkedField.dbComment;\n n.entName = f.entName ? f.entName : `Text${linkedField.entName}`;\n n.displayName = f.displayName ? f.displayName : linkedField.displayName;\n n.catalogId = f.catalogId ? f.catalogId : linkedField.catalogId;\n n.allowNull = true;\n }\n }\n\n if (f.templateId === \"table\"){ // extend with table template for linked fields\n // copy from linkedField data\n let linkedField = t.fields.find((e) => e.dbName === n.linkedField);\n if (linkedField){\n n.dbComment = linkedField.dbComment;\n n.entName = f.entName ? f.entName : `Text${linkedField.entName}`;\n n.displayName = f.displayName ? f.displayName : linkedField.displayName;\n n.catalogId = f.catalogId ? f.catalogId : linkedField.catalogId;\n n.allowNull = true;\n }\n }\n \n // initial value \n switch(n.dbType){\n case \"integer\":\n case \"long\":\n case \"double\":\n n.value = 0;\n break;\n case \"string\":\n case \"date\":\n case \"datetime\":\n n.value = null;\n break;\n }\n\n // getter/setter\n t.plainDBValues = {};\n t.model[n.entName] = function (value) {\n if (value !== undefined){\n n.value = value;\n } else {\n return n.value;\n }\n };\n t.db[n.dbName] = function (value) {\n if (value !== undefined){\n n.value = value;\n } else {\n return n.value;\n }\n };\n\n t.fields.push(n);\n }); \n\n // expand any additional data\n t.tableName = obj.name.toLowerCase();\n t.viewName = \"vi\" + obj.name.toLowerCase();\n\n // add methods\n\n // create SQL\n t.createSQL = function(){\n let x = this;\n let sql = \"\";\n let dbType;\n \n x.fields.filter(function(f){\n return f.isTableField;\n }).forEach(function(f){\n switch(f.dbType){\n case \"integer\":\n case \"long\":\n case \"double\":\n dbType = `NUMERIC(${f.size},${f.decimal})`;\n break;\n case \"string\":\n dbType = `VARCHAR(${f.size})`;\n break;\n case \"date\":\n dbType = `DATE`;\n break;\n case \"datetime\":\n dbType = `DATETIME`;\n break;\n }\n sql = MoGen.concat(sql,\", \") + `${f.dbName} ${dbType} ${f.allowNull ? \"\":\"NOT NULL\"}`;\n });\n\n sql = `create table ${x.tableName} (${sql})`;\n\n return sql;\n };\n\n t.createPK = function(){\n let x = this;\n let sql = \"\";\n let dbType;\n \n x.fields.forEach(function(f){\n if(f.isPK){\n sql = MoGen.concat(sql,\", \") + `${f.dbName}`;\n }\n });\n\n sql = `create unique index ${x.tableName}_pk on ${x.tableName} (${sql})`;\n\n return sql;\n }\n\n // create view SQL\n t.createViewSQL = function(){\n let x = this;\n let sql = \"\";\n let fields = \"\";\n let dbType;\n let containsJoinToSelf = x.view.filter(j => j.joinTable.toLowerCase().startsWith(x.tableName.toLowerCase()+' '));\n // create view {name} as select {fields} from {table} inner join ...\n \n x.fields.forEach(function(f){\n if (f.isTableField){\n fields = MoGen.concat(fields,\", \") + (containsJoinToSelf ? x.tableName + '.' : '') + f.dbName;\n } else {\n if (f.originTable === \"CATALOG\"){\n if (x.tableName !== \"catalog\"){\n fields = MoGen.concat(fields,\", \") + `(select ctg_name from catalog where ctg_id = '${f.catalogId}' and ctg_sequential = ${f.linkedField}) as ${f.dbName}`;\n } else {\n fields = MoGen.concat(fields,\", \") + `(select catalog2.ctg_name from catalog catalog2 where ctg_id = '${f.catalogId}' and catalog2.ctg_sequential = catalog.${f.linkedField}) as ${f.dbName}`;\n }\n } else {\n fields = MoGen.concat(fields,\", \") + `(${f.linkedField}) as ${f.dbName}`;\n }\n }\n });\n\n x.view.forEach(function(f){\n sql = MoGen.concat(sql,\" \") + `${f.joinType} JOIN ${f.joinTable} ON (${f.joinStatement})`;\n });\n\n sql = `create view ${x.viewName} as select ${fields} from ${x.tableName} ${sql}`;\n\n return sql;\n };\n\n // insert\n t.toInsertSQL = function () {\n var x = this;\n var sql = \"\", headers = \"\";\n var dateValue = null;\n\n x.fields.filter(function(f){\n return f.isTableField;\n }).forEach(function(f) {\n headers = MoGen.concat(headers,\",\") + f.dbName;\n if (f.value === null){\n sql = MoGen.concat(sql,\",\") + `null`;\n } else if ([\"integer\",\"long\",\"double\"].indexOf(f.dbType) !== -1){\n sql = MoGen.concat(sql,\",\") + f.value;\n } else if (f.dbType === \"date\"){\n sql = MoGen.concat(sql,\",\") + `'${formatDate(f.value)}'`;\n } else if (f.dbType === \"datetime\"){\n sql = MoGen.concat(sql,\",\") + `'${formatDate(f.value,\"yyyy-MM-dd HH:mm:ss\")}'`;\n } else {\n sql = MoGen.concat(sql,\",\") + `'${parseSimpleQuoteForSQL(f.value)}'`;\n }\n });\n\n sql = \"insert into \" + x.tableName + \" (\" + headers + \") values (\" + sql + \")\";\n return sql;\n };\n\n t.datesAreEqual = function(date1, date2){\n return (new Date(date1)).getTime() === (new Date(date2)).getTime();\n };\n\n // changes based on other object\n t.changesWith = function (otherObj) {\n var x = this;\n let changes = [];\n var n;\n if (otherObj !== null && typeof otherObj === \"object\"){\n // other object with different values on some members\n Object.keys(x.db).forEach(dbName => {\n n = x.getMetadataByDatabaseName(dbName);\n if (!n.isPK && otherObj.db[dbName]()){\n if (n.dbType === 'date' || n.dbType === 'datetime'){\n if (!x.datesAreEqual(otherObj.db[dbName](), x.db[dbName]())){ // change value diff from current\n changes.push({\n dbName: n.dbName\n , value: x.getValueFormattedForSQL(n.entName,n.dbType,otherObj.db[dbName]())\n });\n }\n } else {\n if (otherObj.db[dbName]() !== x.db[dbName]()){ // change value diff from current\n changes.push({\n dbName: n.dbName\n , value: x.getValueFormattedForSQL(n.entName,n.dbType,otherObj.db[dbName]())\n });\n }\n }\n }\n });\n }\n return changes;\n };\n\n // update\n t.toUpdateSQL = function (changes) { // changes is either an Array of changes or an Object with same PK and different values on members\n var x = this;\n var sql = \"\", sqlChanges = \"\";\n var pkFields = x.getPK();\n var n;\n // iterate changes: entName, entNameOrig, value\n if (Array.isArray(changes)){\n changes.forEach(function(ch){\n n = x.getMetadataByEntityName(ch.entName);\n if (n.dbType === 'date' || n.dbType === 'datetime'){\n if (!x.datesAreEqual(ch.value, x.model[ch.entName]())){ // change value diff from current\n console.log(`changes detection, field ${ch.entName}, previous: ${x.model[ch.entName]()}, newValue: ${ch.value}`);\n sqlChanges = MoGen.concat(sqlChanges,\", \") + n.dbName + \" = \" + x.getValueFormattedForSQL(n.entName,n.dbType,ch.value);\n }\n } else {\n if (ch.value !== x.model[ch.entName]()){ // change value diff from current\n console.log(`changes detection, field ${ch.entName}, previous: ${x.model[ch.entName]()}, newValue: ${ch.value}`);\n sqlChanges = MoGen.concat(sqlChanges,\", \") + n.dbName + \" = \" + x.getValueFormattedForSQL(n.entName,n.dbType,ch.value);\n }\n }\n });\n }\n if (changes !== null && typeof changes === \"object\"){\n // other object with different values on some members\n Object.keys(x.db).forEach(dbName => {\n n = x.getMetadataByDatabaseName(dbName);\n if (!n.isPK/* && changes.db[dbName]()*/){\n if (n.dbType === 'date' || n.dbType === 'datetime'){\n if (!x.datesAreEqual(changes.db[dbName](), x.db[dbName]())){ // change value diff from current\n console.log(`changes detection, field ${dbName}, previous: ${new Date(x.db[dbName]())}, newValue: ${new Date(changes.db[dbName]())}`);\n sqlChanges = MoGen.concat(sqlChanges,\", \") + n.dbName + \" = \" + x.getValueFormattedForSQL(n.entName,n.dbType,changes.db[dbName]()); \n }\n } else {\n if (changes.db[dbName]() !== x.db[dbName]()){ // change value diff from current\n console.log(`changes detection, field ${dbName}, previous: ${x.db[dbName]()}, newValue: ${changes.db[dbName]()}`);\n sqlChanges = MoGen.concat(sqlChanges,\", \") + n.dbName + \" = \" + x.getValueFormattedForSQL(n.entName,n.dbType,changes.db[dbName]()); \n }\n }\n }\n });\n }\n\n // iterate PKs\n pkFields.forEach(function(f) {\n if ([\"integer\",\"long\",\"double\"].indexOf(f.dbType) !== -1){\n sql = MoGen.concat(sql,\" and \") + `${f.dbName} = ${f.value}`;\n } else if (f.dbType === \"date\"){\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '${formatDate(f.value)}'`;\n } else if (f.dbType === \"datetime\"){\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '${formatDate(f.value,\"yyyy-MM-dd HH:mm:ss\")}'`;\n } else {\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '${parseSimpleQuoteForSQL(f.value)}'`;\n }\n });\n\n sql = `update ${x.tableName} set ${sqlChanges} where ${sql}`;\n return sql;\n };\n\n\n // delete\n t.toDeleteSQL = function () {\n var x = this;\n var sql = \"\";\n var pkFields = x.getPK();\n\n pkFields.forEach(function(f) {\n if ([\"integer\",\"long\",\"double\"].indexOf(f.dbType) !== -1){\n sql = MoGen.concat(sql,\" and \") + `${f.dbName} = ${f.value}`;\n } else if (f.dbType === \"date\"){\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '${formatDate(f.value)}'`;\n } else if (f.dbType === \"datetime\"){\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '${formatDate(f.value,\"yyyy-MM-dd HH:mm:ss\")}'`;\n } else {\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '${f.value}'`;\n }\n });\n\n sql = \"delete from \" + x.tableName + \" where (\" + sql + \")\";\n return sql;\n };\n\n // get PK fields\n t.getPK = function(){\n return this.fields.filter((e) => {\n return e.isPK;\n });\n };\n\n // get value formatted for sql\n t.getValueFormattedForSQL = function(fieldName,dbType,value){\n // , 'test'\n let sql = \"\";\n if ([\"integer\",\"long\",\"double\"].indexOf(dbType) !== -1){\n sql = MoGen.concat(sql,\",\") + value;\n } else if (dbType === \"date\"){\n sql = MoGen.concat(sql,\",\") + `'${formatDate(value)}'`;\n } else if (dbType === \"datetime\"){\n sql = MoGen.concat(sql,\",\") + `'${formatDate(value,\"yyyy-MM-dd HH:mm:ss\")}'`;\n } else {\n sql = MoGen.concat(sql,\",\") + `'${parseSimpleQuoteForSQL(value)}'`;\n }\n return sql;\n }\n\n // get field metadata by name\n t.getMetadataByEntityName = function(name){\n let x = this;\n let found = x.fields.filter((e) => {\n return e.entName === name;\n });\n return found[0];\n };\n \n // get field metadata by dbName\n t.getMetadataByDatabaseName = function(dbName){\n let x = this;\n let found = x.fields.filter((e) => {\n return e.dbName === dbName;\n });\n return found[0];\n };\n\n // constructor\n t.setAll = function(data){\n Object.keys(data).forEach(k => {\n t.model[k](data[k]);\n });\n return t;\n };\n \n t.setDBAll = function(data){\n Object.keys(t.db).forEach(k => {\n t.db[k](data[k]);\n });\n return t;\n };\n\n t.getRecordNameFields = function(){\n return t.fields.filter(f => f.isRecordName);\n };\n\n // method to return a name that identifies the record\n t.recordName = function(){\n let name = '';\n t.getRecordNameFields().forEach(f => {\n name = MoGen.concat(name,' / ') + f.value;\n });\n return name;\n };\n\n /**\n * Returns the SQL select query for the view.\n * @return {string} SQL select query for the view.\n */\n t.sqlList = function(){\n return `select * from ${t.viewName}`;\n }\n\n /**\n * Returns the SQL select query for getting this record with its Primary Key from database.\n * @return {string} SQL select query with PK for getting this single record from DB.\n */\n t.sqlSelect = function(){\n let sql = '';\n t.getPK().forEach(f => {\n if ([\"integer\",\"long\",\"double\"].indexOf(f.dbType) !== -1){\n sql = MoGen.concat(sql,\" and \") + `${f.dbName} = ${f.value}`;\n } else if (f.dbType === \"date\"){\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '${formatDate(f.value)}'`;\n } else if (f.dbType === \"datetime\"){\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '${formatDate(f.value,\"yyyy-MM-dd HH:mm:ss\")}'`;\n } else {\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '${f.value}'`;\n }\n });\n return `${t.sqlList()} where ${sql}`;\n }\n\n /**\n * Returns the SQL select query for getting this record with its Primary Key as placeholders from database.\n * @return {string} SQL select query with PK for getting a single record (with placeholders) from DB.\n */\n t.sqlSelectGeneric = function(){\n let sql = '';\n let counter = 0;\n t.getPK().forEach(f => {\n if ([\"integer\",\"long\",\"double\"].indexOf(f.dbType) !== -1){\n sql = MoGen.concat(sql,\" and \") + `${f.dbName} = {${counter++}}`;\n } else if (f.dbType === \"date\"){\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '{${counter++}}'`;\n } else if (f.dbType === \"datetime\"){\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '{${counter++}}'`;\n } else {\n sql = MoGen.concat(sql,\",\") + `${f.dbName} = '{${counter++}}'`;\n }\n });\n return `${t.sqlList()} where ${sql}`;\n }\n\n return t;\n }", "function addNewTemplate() {\n\n\tvar templateHtml = $(\"#template\").html();\n\tvar template = new Template();\n\ttemplate.makeHtml(\"templateContent\", templateHtml, function(templateName) {\n\t\tconsole.log('template call back!!..');\n\n\t\t// jquery日付の呼び出す初期化\n\t\t$(\".datepicker\").datepicker();\n\n\t\t// 連動呼び出す\n\t\titemAreaHide(templateName + 'item');\n\t});\n}", "function create_person(data) {\n\t\t$('#submissions').loadTemplate($('#submission-template'), data, {append: true});\n\t}", "function projectTemplate(){\n importInDoc('11zdES1xBa8l765h0vqJtJlRZgM5dshofg1trHUj7eXE');\n}", "function generateNewTemplate(TemplateModelInfo) {\n if (vm.configure_template != undefined) {\n if (vm.configure_template.template_type == 'new') {\n var templateInfo = {}, resetParams = {}, params = {};\n templateInfo = angular.copy(vm.TemplateModelInfo);\n /**\n * validation on generate template\n */\n // if ((templateInfo.template_code == \"F1_46\" && templateInfo.secondaryDefendantsAttorney.length > 5) || (templateInfo.template_code == \"F1_45\" && templateInfo.secondaryDefendantsAttorney.length > 5)) {\n // notificationService.error(\"Please select only 5 secondary defendants attorney\");\n // return;\n // }\n params = [];\n params = angular.copy(vm.configure_template.request_params.params);\n // params.templateid = templateInfo.template_id;\n params.intakeId = utils.isNotEmptyVal(templateInfo.intakeId) ? templateInfo.intakeId : 0;\n params.templatetype = vm.templateDetailFromJava.template_type;\n _.forEach(vm.configure_template.request_params.params, function (value, key) {\n switch (value) {\n case \"plaintiffs\":\n _.forEach(templateInfo, function (templateValue, templateKey) {\n if (templateKey == value) {\n /*plantiffs model value returned by radio input is JSON, so it has to be convert into array*/\n if (typeof templateInfo.plaintiffs != \"object\") {\n if (!Array.isArray(templateInfo.plaintiffs) && utils.isNotEmptyVal(templateInfo.plaintiffs)) {\n params.plaintiff = JSON.parse(templateInfo.plaintiffs);\n }\n } else {\n params.plaintiff = templateInfo.plaintiffs;\n }\n }\n });\n break;\n\n case \"plaintiffEmployerIds\":\n params.plaintiffEmployerIds = (templateInfo.plaintiffEmployerIds != undefined) ? templateInfo.plaintiffEmployerIds : undefined;\n break;\n case \"plaintiffEmployerIdsNew\":\n params.plaintiffEmployerIdsNew = (templateInfo.plaintiffEmployerIdsNew != undefined) ? templateInfo.plaintiffEmployerIdsNew : undefined;\n break;\n case \"plaintiffEmployerIds_sec\":\n params.plaintiffEmployerIds_sec = (templateInfo.plaintiffEmployerIds_sec != undefined) ? templateInfo.plaintiffEmployerIds_sec : undefined;\n break;\n case \"serviceDates\":\n params.serviceDates = (templateInfo.serviceDates != undefined) ? templateInfo.serviceDates : undefined;\n break;\n case \"insuredParty\":\n params.insuredParty = (templateInfo.insuredParty != undefined) ? templateInfo.insuredParty : undefined;\n break;\n case \"medicalProviderPhysicians\":\n params.medicalProviderPhysicians = (templateInfo.medicalProviderPhysicians != undefined) ? templateInfo.medicalProviderPhysicians : undefined;\n break;\n case \"medicalServiceProvider\":\n params.medicalServiceProvider = (templateInfo.medicalServiceProvider != undefined) ? templateInfo.medicalServiceProvider : undefined;\n break;\n case \"plaintiffEmployerIds_ter\":\n params.plaintiffEmployerIds_ter = (templateInfo.plaintiffEmployerIds_ter != undefined) ? templateInfo.plaintiffEmployerIds_ter : undefined;\n break;\n case \"onlyInsuranceId\":\n params.onlyInsuranceId = (templateInfo.onlyInsuranceId != undefined) ? templateInfo.onlyInsuranceId : undefined;\n break;\n case \"medicalproviderId\":\n params.medicalproviderId = (templateInfo.medicalproviderId != undefined) ? templateInfo.medicalproviderId : undefined;\n break;\n case \"medicalproviderId2\":\n params.medicalproviderId2 = (templateInfo.medicalproviderId2 != undefined) ? templateInfo.medicalproviderId2 : undefined;\n break;\n case \"medicalproviderId3\":\n params.medicalproviderId3 = (templateInfo.medicalproviderId3 != undefined) ? templateInfo.medicalproviderId3 : undefined;\n break;\n case \"ServiceDate\":\n params.ServiceDate = (templateInfo.ServiceDate != undefined) ? templateInfo.ServiceDate : undefined;\n break;\n case \"assign_user\":\n params.assign_user = (templateInfo.assign_user != undefined) ? templateInfo.assign_user : undefined;\n break;\n case \"witnessId\":\n params.witnessId = (templateInfo.witnessId != undefined) ? templateInfo.witnessId : undefined;\n break;\n case \"medicalServiceDates\":\n params.medicalServiceDates = (templateInfo.medicalServiceDates != undefined) ? templateInfo.medicalServiceDates : undefined;\n break;\n case \"witnessId1\":\n params.witnessId1 = (templateInfo.witnessId1 != undefined) ? templateInfo.witnessId1 : undefined;\n break;\n case \"physicianId\":\n params.physicianId = (templateInfo.physicianId != undefined) ? templateInfo.physicianId : undefined;\n break;\n case \"custom_date\":\n (templateInfo.custom_date == undefined) ? params.custom_date = undefined : params.custom_date = utils.getUTCTimeStamp(templateInfo.custom_date);\n break;\n case \"marriage_date\":\n (templateInfo.marriage_date == undefined) ? params.marriage_date = undefined : params.marriage_date = utils.getUTCTimeStamp(templateInfo.marriage_date);\n break;\n case \"filling_date\":\n (templateInfo.filling_date == undefined) ? params.filling_date = undefined : params.filling_date = utils.getUTCTimeStamp(templateInfo.filling_date);\n break;\n case \"date_Employed_From1\":\n (templateInfo.date_Employed_From1 == undefined) ? params.date_Employed_From1 = undefined : params.date_Employed_From1 = utils.getUTCTimeStamp(templateInfo.date_Employed_From1);\n break;\n case \"date_Employed_From2\":\n (templateInfo.date_Employed_From2 == undefined) ? params.date_Employed_From2 = undefined : params.date_Employed_From2 = utils.getUTCTimeStamp(templateInfo.date_Employed_From2);\n break;\n case \"date_Employed_From3\":\n (templateInfo.date_Employed_From3 == undefined) ? params.date_Employed_From3 = undefined : params.date_Employed_From3 = utils.getUTCTimeStamp(templateInfo.date_Employed_From3);\n break;\n case \"date_Employed_To1\":\n (templateInfo.date_Employed_To1 == undefined) ? params.date_Employed_To1 = undefined : params.date_Employed_To1 = utils.getUTCTimeStamp(templateInfo.date_Employed_To1);\n break;\n case \"date_Employed_To2\":\n (templateInfo.date_Employed_To2 == undefined) ? params.date_Employed_To2 = undefined : params.date_Employed_To2 = utils.getUTCTimeStamp(templateInfo.date_Employed_To2);\n break;\n case \"date_Employed_To3\":\n (templateInfo.date_Employed_To3 == undefined) ? params.date_Employed_To3 = undefined : params.date_Employed_To3 = utils.getUTCTimeStamp(templateInfo.date_Employed_To3);\n break;\n case \"textBoxOne\":\n (templateInfo.textBoxOne == undefined) ? params.textBoxOne = undefined : params.textBoxOne = templateInfo.textBoxOne;\n break;\n case \"textBoxTwo\":\n (templateInfo.textBoxTwo == undefined) ? params.textBoxTwo = undefined : params.textBoxTwo = templateInfo.textBoxTwo;\n break;\n case \"accidentTime\":\n (templateInfo.accidentTime == undefined) ? params.accidentTime = undefined : params.accidentTime = templateInfo.accidentTime;\n break;\n case \"vehicleInformation\":\n (templateInfo.vehicleInformation == undefined) ? params.vehicleInformation = undefined : params.vehicleInformation = templateInfo.vehicleInformation;\n break;\n case \"textBoxThree\":\n (templateInfo.textBoxThree == undefined) ? params.textBoxThree = undefined : params.textBoxThree = templateInfo.textBoxThree;\n break;\n case \"textBoxFour\":\n (templateInfo.textBoxFour == undefined) ? params.textBoxFour = undefined : params.textBoxFour = templateInfo.textBoxFour;\n break;\n case \"textBoxFive\":\n (templateInfo.textBoxFive == undefined) ? params.textBoxFive = undefined : params.textBoxFive = templateInfo.textBoxFive;\n break;\n case \"textBoxSix\":\n (templateInfo.textBoxSix == undefined) ? params.textBoxSix = undefined : params.textBoxSix = templateInfo.textBoxSix;\n break;\n case \"textBoxSeven\":\n (templateInfo.textBoxSeven == undefined) ? params.textBoxSeven = undefined : params.textBoxSeven = templateInfo.textBoxSeven;\n break;\n case \"textBoxEight\":\n (templateInfo.textBoxEight == undefined) ? params.textBoxEight = undefined : params.textBoxEight = templateInfo.textBoxEight;\n break;\n case \"textBoxNine\":\n (templateInfo.textBoxNine == undefined) ? params.textBoxNine = undefined : params.textBoxNine = templateInfo.textBoxNine;\n break;\n case \"textBoxTen\":\n (templateInfo.textBoxTen == undefined) ? params.textBoxTen = undefined : params.textBoxTen = templateInfo.textBoxTen;\n break;\n case \"userValueOne\":\n (templateInfo.userValueOne == undefined) ? params.userValueOne = undefined : params.userValueOne = templateInfo.userValueOne;\n break;\n case \"userValueTwo\":\n (templateInfo.userValueTwo == undefined) ? params.userValueTwo = undefined : params.userValueTwo = templateInfo.userValueTwo;\n break;\n case \"userValueThree\":\n (templateInfo.userValueThree == undefined) ? params.userValueThree = undefined : params.userValueThree = templateInfo.userValueThree;\n break;\n case \"userValueFour\":\n (templateInfo.userValueFour == undefined) ? params.userValueFour = undefined : params.userValueFour = templateInfo.userValueFour;\n break;\n case \"userValueFive\":\n (templateInfo.userValueFive == undefined) ? params.userValueFive = undefined : params.userValueFive = templateInfo.userValueFive;\n break;\n case \"userValueSix\":\n (templateInfo.userValueSix == undefined) ? params.userValueSix = undefined : params.userValueSix = templateInfo.userValueSix;\n break;\n case \"amountInWords\":\n params.amountInWords = (templateInfo.amountInWords != undefined) ? templateInfo.amountInWords : undefined;\n break;\n case \"amountInNumbers\":\n params.amountInNumbers = (templateInfo.amountInNumbers != undefined) ? templateInfo.amountInNumbers : undefined;\n break;\n case \"amountInNumbers1\":\n params.amountInNumbers1 = (templateInfo.amountInNumbers1 != undefined) ? templateInfo.amountInNumbers1 : undefined;\n break;\n case \"amountInNumbers2\":\n params.amountInNumbers2 = (templateInfo.amountInNumbers2 != undefined) ? templateInfo.amountInNumbers2 : undefined;\n break;\n case \"amountInNumbers3\":\n params.amountInNumbers3 = (templateInfo.amountInNumbers3 != undefined) ? templateInfo.amountInNumbers3 : undefined;\n break;\n case \"amountInNumbers4\":\n params.amountInNumbers4 = (templateInfo.amountInNumbers4 != undefined) ? templateInfo.amountInNumbers4 : undefined;\n break;\n case \"amountInNumbers5\":\n params.amountInNumbers5 = (templateInfo.amountInNumbers5 != undefined) ? templateInfo.amountInNumbers5 : undefined;\n break;\n case \"amountInNumbers6\":\n params.amountInNumbers6 = (templateInfo.amountInNumbers6 != undefined) ? templateInfo.amountInNumbers6 : undefined;\n break;\n case \"amountInNumbers7\":\n params.amountInNumbers7 = (templateInfo.amountInNumbers7 != undefined) ? templateInfo.amountInNumbers7 : undefined;\n break;\n case \"amountInNumbers8\":\n params.amountInNumbers8 = (templateInfo.amountInNumbers8 != undefined) ? templateInfo.amountInNumbers8 : undefined;\n break;\n case \"amountInNumbers9\":\n params.amountInNumbers9 = (templateInfo.amountInNumbers9 != undefined) ? templateInfo.amountInNumbers9 : undefined;\n break;\n case \"amountInNumbers10\":\n params.amountInNumbers10 = (templateInfo.amountInNumbers10 != undefined) ? templateInfo.amountInNumbers10 : undefined;\n break;\n\n }\n });\n /** add extra paramters to template */\n extraParams(templateInfo, params);\n var APIFlag = vm.generatorTemplateData.template_api_call;\n var templateCode = vm.configure_template.template_code;\n var templateName = vm.templateDetailFromJava.template_name;\n resetParams = setParams(templateInfo.template_code, params);\n if (APIFlag == \"java2\") {\n intakeTemplatestDatalayer.GenerateNewTemplateRecord(resetParams, APIFlag, templateName)\n .then(function (response) {\n var filename = templateName.replace('.', '-');\n var linkElement = document.createElement('a');\n try {\n var blob = new Blob([response], { type: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" });\n var url = window.URL.createObjectURL(blob);\n\n linkElement.setAttribute('href', url);\n linkElement.setAttribute(\"download\", filename + \".docx\");\n\n var clickEvent = new MouseEvent(\"click\", {\n \"view\": window,\n \"bubbles\": true,\n \"cancelable\": false\n });\n linkElement.dispatchEvent(clickEvent);\n vm.close();\n } catch (ex) {\n console.log(ex);\n }\n }, function (error) {\n\n if (localStorage.getItem('templateError') == \"true\") {\n notificationService.error('' + error.data);\n localStorage.setItem('templateError', \"false\");\n }\n });\n }\n }\n } else {\n\n if (vm.TemplateModelInfo.matterId) {\n vm.TemplateModelInfo.matterId = vm.TemplateModelInfo.matterId;\n } else {\n vm.TemplateModelInfo.matterId = 0;\n }\n\n //user ids are seperated from object\n //for each user id GenerateTemplateRecord will be called\n var plaintiffids = [];\n var defendantids = [];\n var associate_party_id = '';\n var templateInfo = {};\n templateInfo = angular.copy(vm.TemplateModelInfo);\n /*plantiffs model value returned by radio input is JSON, so it has to be convert into array*/\n if (!Array.isArray(templateInfo.plaintiffs) && utils.isNotEmptyVal(templateInfo.plaintiffs)) {\n plaintiffids.push(JSON.parse(templateInfo.plaintiffs));\n templateInfo.plaintiffs = plaintiffids;\n }\n if (!Array.isArray(templateInfo.defendants) && utils.isNotEmptyVal(templateInfo.defendants)) {\n defendantids.push(JSON.parse(templateInfo.defendants));\n templateInfo.defendants = defendantids;\n }\n /*set the parameters for generating template by type id and type of selected template*/\n switch (vm.option) {\n case 'Plaintiff':\n if (templateInfo.typeId == 18) {\n templateInfo.userlist = _.pluck(templateInfo.plaintiffs, 'contactid');\n } else if (templateInfo.typeId == 23) {\n templateInfo.userlist = _.pluck(templateInfo.plaintiffs, 'plaintiffid');\n templateInfo.associate_party_id = templateInfo.plaintiffs[0].employerid\n } else {\n templateInfo.userlist = _.pluck(templateInfo.plaintiffs, 'plaintiffid');\n }\n break;\n\n }\n //download template for entered template info \n downloadTemplate(templateInfo);\n }\n }", "function template(index,templateFn,consts,vars,tagName,attrs,localRefs,localRefExtractor){var lView=getLView();var tView=lView[TVIEW];// TODO: consider a separate node type for templates\nvar tNode=containerInternal(index,tagName||null,attrs||null);if(getFirstTemplatePass()){tNode.tViews=createTView(-1,templateFn,consts,vars,tView.directiveRegistry,tView.pipeRegistry,null);}createDirectivesAndLocals(tView,lView,localRefs,localRefExtractor);var currentQueries=lView[QUERIES];var previousOrParentTNode=getPreviousOrParentTNode();var _native18=getNativeByTNode(previousOrParentTNode,lView);attachPatchData(_native18,lView);if(currentQueries){lView[QUERIES]=currentQueries.addNode(previousOrParentTNode);}queueLifecycleHooks(tView,tNode);setIsParent(false);}", "function template(index, templateFn, consts, vars, tagName, attrs, localRefs, localRefExtractor) {\n // TODO: consider a separate node type for templates\n var tNode = containerInternal(index, tagName || null, attrs || null);\n if (firstTemplatePass) {\n tNode.tViews = createTView(-1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n createDirectivesAndLocals(localRefs, localRefExtractor);\n currentQueries &&\n (currentQueries = currentQueries.addNode(previousOrParentTNode));\n queueLifecycleHooks(tNode.flags, tView);\n isParent = false;\n}", "function generateApiSet(templateId) {\n return {\n create: function(options, callback) {\n\n options.data = Object(options.data);\n options.data._tp = [ObjectId(templateId)];\n\n CRUD.create({\n templateId: templateId,\n data: options.data,\n options: options.options,\n callback: callback\n });\n },\n read: function(options, callback) {\n CRUD.read({\n templateId: templateId,\n noJoins: options.noJoins,\n query: options.query,\n options: options.options,\n callback: callback\n });\n },\n update: function(options, callback) {\n CRUD.update({\n templateId: templateId,\n query: options.query,\n data: options.data,\n options: options.options,\n callback: callback\n });\n },\n delete: function(options, callback) {\n CRUD.delete({\n templateId: templateId,\n query: options.query,\n options: options.options,\n callback: callback\n });\n }\n };\n}", "function createContent(data, templateNum) {\n $(document).ready(function() {\n //iterate through templates\n for (i = 0; i < templateList.length; i++) {\n let source = $(templateList[i][0]).html();\n let template = Handlebars.compile(source);\n let html = template(data);\n //write data into template\n $(templateList[i][1]).append(html);\n }\n\n contentLoaded();\n });\n}", "function template(index, templateFn, consts, vars, tagName, attrs, localRefs, localRefExtractor) {\n var lView = getLView();\n var tView = lView[TVIEW];\n // TODO: consider a separate node type for templates\n var tNode = containerInternal(index, tagName || null, attrs || null);\n if (getFirstTemplatePass()) {\n tNode.tViews = createTView(-1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n createDirectivesAndLocals(tView, lView, localRefs, localRefExtractor);\n var currentQueries = lView[QUERIES];\n var previousOrParentTNode = getPreviousOrParentTNode();\n var native = getNativeByTNode(previousOrParentTNode, lView);\n attachPatchData(native, lView);\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, tNode);\n setIsParent(false);\n}", "function template(index, templateFn, consts, vars, tagName, attrs, localRefs, localRefExtractor) {\n var lView = getLView();\n var tView = lView[TVIEW];\n // TODO: consider a separate node type for templates\n var tNode = containerInternal(index, tagName || null, attrs || null);\n if (getFirstTemplatePass()) {\n tNode.tViews = createTView(-1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n createDirectivesAndLocals(tView, lView, localRefs, localRefExtractor);\n var currentQueries = lView[QUERIES];\n var previousOrParentTNode = getPreviousOrParentTNode();\n var native = getNativeByTNode(previousOrParentTNode, lView);\n attachPatchData(native, lView);\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, tNode);\n setIsParent(false);\n}", "function templateSet(file, template, header, offset){\r\n\tvar view = new DataView(file.buffer);\r\n\ttemplate.forEach(function(item){\r\n\t\tvar value = item.name ? header[item.name] : item.value;\r\n\t\tvar arg = item.arg===undefined ? true : item.arg;\r\n\t\tview[\"set\"+item.type](item.pos+ +offset,value,arg);\r\n\t});\r\n}", "handleTemplateFormSubmit({ data, submitAction }) {\n const documentFieldArray = [];\n const deletedDocumentFieldIdArray = [];\n // deletedDocumentFieldTranslationsArray array of objects\n const deletedDocumentFieldTranslationsArray = [];\n const paramsObject = {\n flat_id: this.props.flat.id,\n booking_id: this.props.booking ? this.props.booking.id : null,\n document_name: this.props.agreement.document_name,\n document_field: documentFieldArray,\n deleted_document_field_id_array: deletedDocumentFieldIdArray,\n deleted_document_field_translations_array: deletedDocumentFieldTranslationsArray,\n // new_document_field: newDocumentFieldArray,\n agreement_id: this.props.agreement ? this.props.agreement.id : null,\n document_language_code: this.props.documentLanguageCode,\n use_main_document_insert: this.state.useMainDocumentInsert,\n pages_in_viewport: this.state.documentPagesObject.pagesInViewport\n // deleted_document_field: this.state.modifiedPersistedElementsArray,\n };\n\n const object = {\n templateElements: { modifiedObject: this.state.modifiedPersistedElementsObject },\n templateTranslationElements: { modifiedObject: this.state.modifiedPersistedTranslationElementsObject, translations: true }\n }\n\n _.each(Object.keys(object), eachElementTypeKey => {\n _.each(Object.keys(object[eachElementTypeKey].modifiedObject), eachKey => {\n let documentField = null;\n // if elements have ids with 'a' or 'b' and are deleted in the modified object\n if (object[eachElementTypeKey].modifiedObject[eachKey].deleted === true && eachKey.indexOf('a') === -1 && eachKey.indexOf('b') === -1) {\n deletedDocumentFieldIdArray.push(parseInt(eachKey, 10));\n } else {\n // if not deleted === true, its been modified or newly created\n // eachElementTypeKey is this.props[templateElements] or templateTranslationElements\n documentField = this.props[eachElementTypeKey][eachKey];\n // Keep track of which document_field_translations were deleted\n // if the documentField is a translation element and not a new element with id 'b'\n // and has document_field_translations\n if (documentField\n && object[eachElementTypeKey].translations\n && documentField.translation_element\n && documentField.document_field_translations\n && (documentField.id.indexOf('b') === -1)) {\n _.each(Object.keys(documentField.document_field_translations), languageCodeKey => {\n if (documentField.document_field_translations[languageCodeKey].id && documentField.document_field_translations[languageCodeKey].deleted) {\n // deletedDocumentFieldTranslationsArray.push({ document_field_id: documentField.id, document_field_translation_id: documentField.document_field_translations[languageCodeKey].id })\n deletedDocumentFieldTranslationsArray.push(documentField.document_field_translations[languageCodeKey].id)\n }\n });\n } // end of if (object[eachElementTypeKey].translations\n } // end of if (object[eachElementTypeKey].modifiedObject[eachKey].deleted\n\n if (documentField) {\n // const value = data[documentField.name];\n let array = null;\n let arrayTranslation = null;\n\n if (documentField.translation_element) documentField.value = data[`${documentField.name}+translation`];\n if (!documentField.translation_element) documentField.value = data[documentField.name];\n // if custom field, assign value for custom_name in initialValuesObject\n if (documentField.custom_name) documentField.value = data[documentField.custom_name];\n\n if (documentField.document_field_choices) {\n array = [];\n const selectArray = [];\n _.each(Object.keys(documentField.document_field_choices), each => {\n if (documentField.document_field_choices[each].selectChoices || documentField.document_field_choices[each].select_choices) {\n const selectChoices = documentField.document_field_choices[each].selectChoices || documentField.document_field_choices[each].select_choices;\n _.each(Object.keys(selectChoices), eachSelect => {\n if (eachSelect < 10) selectArray.push(selectChoices[eachSelect])\n });\n documentField.document_field_choices[each].select_choices_attributes = selectArray;\n } // end of if (documentField.document_field_choices[each].\n array.push(documentField.document_field_choices[each]);\n }); // end of _.each(Object.keys(documentField.document_field_choices)\n // documentField.document_field_choices = null;\n } // end of if (documentField.document_field_choices)\n\n if (documentField.document_field_translations) {\n arrayTranslation = [];\n _.each(Object.keys(documentField.document_field_translations), eachLanguageCodeKey => {\n if (documentField.id.indexOf('b') !== -1) {\n // if a new element with a 'b' in the id, and not deleted\n if (!documentField.document_field_translations[eachLanguageCodeKey].deleted) arrayTranslation.push(documentField.document_field_translations[eachLanguageCodeKey]);\n } else {\n arrayTranslation.push(documentField.document_field_translations[eachLanguageCodeKey]);\n }\n });\n }\n\n documentField.document_field_choices_attributes = array;\n documentField.document_field_translations_attributes = arrayTranslation;\n documentFieldArray.push(documentField);\n } // end of if (documentField) {\n }); // end of _.each(Object.keys(object[eachElementTypeKey].modifiedObject\n }); // end of _.each(Object.keys(object), eachElementTypeKey => {\n // If creating pdf or updating\n if (submitAction === 'save_and_create' || submitAction === 'create') {\n paramsObject.save_and_create = true;\n paramsObject.document_language_code = this.props.documentLanguageCode;\n this.props.saveTemplateDocumentFields(paramsObject, submitAction, (saveOrCreate) => this.handleTemplateSubmitCallback(saveOrCreate));\n } else {\n this.props.saveTemplateDocumentFields(paramsObject, submitAction, (saveOrCreate) => this.handleTemplateSubmitCallback(saveOrCreate));\n }\n console.log('in create_edit_document, handleTemplateFormSubmit, paramsObject, data: ', paramsObject, data);\n this.props.showLoading();\n // Do not call setProgressStatus here so that if action cable is disconnected, the progress bar will come up and not dismount\n // this.props.setProgressStatus({ progress_percentage: 0, message: 'Received request' });\n }", "function simpleTemplateGenerator({\n name,\n template,\n params\n}) {\n return {\n name,\n regex: placeholderRegexCallback(`template:${name}`),\n template: () => template,\n params\n };\n}", "_saveTemplate(type, template, callback) {\n template.id = this._createTemplateId(template.name + template.title + template.body)\n template.created_at = this._now()\n\n this._fetch((fullyTemplates) => {\n if (!fullyTemplates.hasOwnProperty(type)) {\n fullyTemplates[type] = {}\n }\n\n fullyTemplates[type][template.id] = template\n this._save(fullyTemplates, callback)\n })\n }", "function form_generate(target,json_txt){\n\t\tvar div_main = document.createElement(\"div\");\n\t\tdiv_main.classList.add('container');\n\n\t\tvar div_main_title = document.createElement(\"h2\");\n\t\tdiv_main_title.textContent = \"Create Form Template\";\n\t\tdiv_main.appendChild(div_main_title);\n\t\t\n\t\tvar div_main_intro = document.createElement(\"p\");\n\t\tdiv_main_intro.textContent = \"Click on the \\\"Add Field\\\" button to add a form element\";\n\t\tdiv_main.appendChild(div_main_intro);\n\n\t\tvar div_main_add_button_top = document.createElement(\"button\");\n\t\tdiv_main_add_button_top.type = 'button';\n\t\tdiv_main_add_button_top.classList.add('btn');\n\t\tdiv_main_add_button_top.classList.add('btn-outline-success');\n\t\tdiv_main_add_button_top.classList.add('far');\n\t\tdiv_main_add_button_top.classList.add('fa-plus-square');\n\t\tdiv_main_add_button_top.textContent = \" Add Field\";\n\t\tdiv_main.appendChild(div_main_add_button_top);\n\n\t\tvar form_fields = document.createElement(\"form\");\n\t\tform_fields.classList.add('needs');\n\t\t// form_fields.textContent = \" Add Field\";\n\t\tdiv_main.appendChild(form_fields);\n\n\t\tvar div_main_add_button_bottom = document.createElement(\"button\");\n\t\tdiv_main_add_button_bottom.type = 'button';\n\t\tdiv_main_add_button_bottom.classList.add('btn');\n\t\tdiv_main_add_button_bottom.classList.add('btn-outline-success');\n\t\tdiv_main_add_button_bottom.classList.add('far');\n\t\tdiv_main_add_button_bottom.classList.add('fa-plus-square');\n\t\tdiv_main_add_button_bottom.textContent = \" Add Field\";\n\t\tdiv_main.appendChild(div_main_add_button_bottom);\n\n\t\tvar rownum = 0;\n\n\t\t[\"keyup\", \"mouseup\"].forEach(function(event) {\n\t\t\t[div_main_add_button_top, div_main_add_button_bottom].forEach(function(button) {\n\t\t\t\tbutton.addEventListener(event,function(e){\n\t\t\t\t\tswitch(event){\n\t\t\t\t\t\tcase 'keyup':\n\t\t\t\t\t\t\tswitch(e.key){\n\t\t\t\t\t\t\t\tcase 'Enter':\n\t\t\t\t\t\t\t\t\tform_fields.appendChild(form_generate_add_field(rownum));\n\t\t\t\t\t\t\t\t\trownum++;\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\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mouseup':\n\t\t\t\t\t\t\tform_fields.appendChild(form_generate_add_field(rownum));\n\t\t\t\t\t\t\trownum++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\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\n\t\tvar json = null;\n\t\ttry {\n\t\t\tif(json_txt){\n\t\t\t\tjson = JSON.parse(json_txt);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(\"Malformed JSON\");\n\t\t\tconsole.log(e);\n\t\t\tconsole.log(json_txt);\n\t\t\treturn false;\n\t\t}\n\n\t\tif(target){\n\t\t\ttarget.innerHTML = '';\n\t\t\ttarget.appendChild(div_main);\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n var lView = getLView();\n var tView = getTView();\n var adjustedIndex = index + HEADER_OFFSET;\n var tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) : tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n var comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n }", "static initialize(obj, name, templateType, tokenizerType) { \n obj['name'] = name;\n obj['template-type'] = templateType;\n obj['tokenizer-type'] = tokenizerType;\n }", "function prepareTemplateProps(userName,firstName, lastName, email, password, rejectReason, reviewer){\n var templateProps = {};\n templateProps[\"creator\"] = {firstname: reviewer.properties[\"firstName\"], lastname: reviewer.properties[\"lastName\"]};\n templateProps[\"username\"] = userName;\n templateProps[\"password\"] = password;\n templateProps[\"firstname\"] = firstName;\n templateProps[\"lastname\"] = lastName;\n templateProps[\"rejectReason\"] = rejectReason;\n return templateProps;\n}", "function Template(uid, name, tid, content) {\n\t\tthis.uid = uid;\n\t\tthis.name = name;\n\t\tthis.tid = tid;\n\t\tthis.content = content;\n\t}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, consts, vars, tagName, attrs, localRefs, localRefExtractor) {\n var lView = getLView();\n var tView = lView[TVIEW];\n // TODO: consider a separate node type for templates\n var tContainerNode = containerInternal(index, tagName || null, attrs || null);\n if (tView.firstTemplatePass) {\n tContainerNode.tViews = createTView(-1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null, null);\n }\n createDirectivesAndLocals(tView, lView, localRefs, localRefExtractor);\n addTContainerToQueries(lView, tContainerNode);\n attachPatchData(getNativeByTNode(tContainerNode, lView), lView);\n registerPostOrderHooks(tView, tContainerNode);\n setIsNotParent();\n}", "createTemplate(templateString) {\n const template = document.createElement('template');\n template.innerHTML = templateString;\n\n return template;\n }", "function buildTemplateDataObject(template) {\n Object.keys(data).forEach(k => delete data[k])\n let templateCopy = JSON.parse(template);\n for (let i = 0; i < templateCopy.structure.length; i++) {\n let structure = templateCopy.structure[i];\n let files = templateCopy.files;\n let absolutePath = templateCopy.structure[i].absolutePath\n let templateNode = {\n [absolutePath]: {\n path: absolutePath,\n type: structure.fileType,\n isRoot: i === 0 ? true : false,\n isOpen: true,\n children: structure.children,\n content: files.find(x => x.fileName === structure.name)\n }\n }\n if (typeof templateNode[absolutePath].content === 'undefined') templateNode[absolutePath].content = '';\n data[absolutePath] = templateNode[absolutePath];\n }\n}", "function createTableTemplates() {\n\t/*\n\t * Initialize the codes (from the xml in templates, the names in xml, and the transcription to cover all information)\n\t */\n\tvar done = {};\n\tif (trjs.data.codesxml) {\n\t\t/*\n\t\t * if template exists\n\t\t */\n\t\tfor (var i=0 ; i < trjs.data.codesxml.length; i++) {\n\t\t\tdone[trjs.data.codesxml[i][\"code\"]] = true;\n\t\t}\n\t} else {\n trjs.data.codesxml = {}; // creates it\n }\n\n\t/*\n\t * Initialize now codesxml with data from transcription if missing information.\n\t */\n\tfor (var i in trjs.data.codesdata) {\n\t\tif (done[i] !== true)\n trjs.data.codesxml.push({\n\t\t\t\t'code': i,\n\t\t\t\t'type': '-',\n\t\t\t\t'parent': 'none',\n\t\t\t\t'description': '',\n\t\t\t});\n\t}\n\n\t/*\n\t * Initialize the tiers (from the xml in templates, and the transcription to cover all information)\n\t */\n\tdone = {};\n\n\tif (trjs.data.tiersxml) {\n\t\t/*\n\t\t * if template exists\n\t\t */\n\t\tfor (var i=0 ; i < trjs.data.tiersxml.length; i++) {\n\t\t\tvar code = trjs.data.tiersxml[i][\"code\"];\n\t\t\tdone[code] = true;\n\t\t}\n\t} else {\n trjs.data.tiersxml = {};\n }\n\t/*\n\t * Initialize now pdata with data from transcription if missing information.\n\t */\n\tfor (var i in trjs.data.tiersdata) {\n\t\tif (done[i] !== true)\n trjs.data.tiersxml.push({\n\t\t\t\t'code': i,\n\t\t\t\t'type': trjs.data.ASSOC,\n\t\t\t\t'parent': 'main',\n\t\t\t\t'description': '',\n\t\t\t});\n\t}\n}", "function addTableTemplate(type, template) {\n var init = initTemplateTable(type);\n var $toAdd = init.toAdd;\n var addFunc = init.addFunc;\n $toAdd[addFunc](template);\n}", "function fillTemplate(template, data){\r\n var result = template;\r\n\r\n for(var el in data){\r\n var mark = \"{{ \" + el + \" }}\";\r\n result = result.replace(mark, data[el]);\r\n }\r\n\r\n return result;\r\n }", "function PdfDocumentTemplate(){//\n}", "function createDocument(req, res, next) {\n const Token = _getToken(req, res)\n Token\n .then((token) => {\n const params = {\n method: 'set_entry',\n custom: false,\n rest_data: {\n session: token,\n modulo: 'Documents',\n data: [\n {\n name: 'document_name',\n value: req.params.filename,\n },\n {\n name: 'revision',\n value: 1,\n },\n ],\n },\n }\n\n _requestCRM(params)\n .then((result)=>{\n res.end(result.id)\n })\n .catch((e) => {\n logger.error('Controller::DefensaConsumidor::createDocument::_RequestCRM::Catch')\n next(APIError({ status: 500, devMessage: e.message, }))\n })\n })\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n var lView = getLView();\n var tView = getTView();\n var adjustedIndex = index + HEADER_OFFSET;\n var tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) : tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n var comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function fillTemplate(state, template) {\n if (template instanceof Array) {\n return template.map(v => fillTemplate(state, v));\n }\n if ({}.constructor === template.constructor) {\n return Object.entries(template).reduce((p, [k, v]) => ({\n ...p,\n [k]: fillTemplate(state, v),\n }));\n }\n return template.replace(\n /{{([a-z_-]+)}}/g,\n (_, name) => state[name].submitValue || state[name],\n );\n}", "function makeWithTemplateDetails(withTemplate) {\n\n // Create the details object\n var details = { first: undefined, last: undefined, nth: [] };\n\n // Loop over the elements\n for (var i = 0; i < withTemplate.dom.children.length; i++) {\n\n // Access the child\n var child = withTemplate.dom.children[i];\n\n // Access the child node name\n var name = getNodeName(child);\n\n // Detarmine if the element is a collection item target\n if (name == \"FIRST\") {\n\n // Set the \"first\"\n details.first = child;\n\n }\n else if (name == \"LAST\") {\n\n // Set the \"last\"\n details.last = child;\n\n }\n else if (name == \"NTH\") {\n\n // Add the \"nth\"\n details.nth.push({ template: child, at: undefined });\n\n // Access the root NTH\n var rootNTH = details.nth[details.nth.length - 1];\n\n // Set the NTH properties\n rootNTH.at = child.getAttribute('at');\n\n // Process the \"at\" attrbiute further if its 0,1,2\n if ((rootNTH.at != undefined) && (rootNTH.at.indexOf(',') > -1)) {\n\n // Split the indicies\n var indicies = rootNTH.at.split(',');\n\n // Set the first nth item\n rootNTH.at = indicies[0];\n\n // Loop over the other indicies pushing more NTH items\n for (var iidx = 1; iidx < indicies.length; iidx++)\n details.nth.push({ template: child, at: indicies[iidx] });\n\n }\n\n }\n\n }\n\n // Return\n return details;\n\n }", "function citeTemplate(templatename, shortform, basicfields, expandedfields) {\n // Properties\n this.templatename = templatename; // The template name - \"cite web\", \"cite book\", etc.\n this.shortform = shortform; // A short form, used for the dropdown box\n this.basic = basicfields; // Basic fields - author, title, publisher...\n // Less common - quote, archiveurl - should be everything the template supports minus the basic ones\n this.extra = expandedfields;\n \n // Add it to the list\n CiteTB.Templates[this.templatename] = this;\n // Methods\n this.makeFormInner = function(fields) {\n var i=0;\n var trs = new Array();\n for (i=0; i<fields.length; i++) {\n var fieldobj = fields[i];\n var field = fieldobj.field;\n var ad = false;\n if ($j.inArray(field, CiteTB.getOption('autodate fields')) != -1 ) {\n im = $j('<img />').attr('src', 'http://upload.wikimedia.org/wikipedia/commons/thumb/7/7b/Nuvola_apps_date.svg/20px-Nuvola_apps_date.svg.png');\n im.attr('alt', mw.usability.getMsg('cite-insert-date')).attr('title', mw.usability.getMsg('cite-insert-date'));\n var ad = $j('<a />').attr('href', '#');\n ad.append(im);\n ad.attr('id', 'cite-date-'+CiteTB.escStr(this.shortform)+'-'+field);\n $j('#cite-date-'+CiteTB.escStr(this.shortform)+'-'+field).live('click', CiteTB.fillAccessdate);\n }\n \n if (fieldobj.autofillid) {\n var autotype = fieldobj.autofillid;\n im = $j('<img />').attr('src', 'http://upload.wikimedia.org/wikipedia/commons/thumb/1/17/System-search.svg/20px-System-search.svg.png');\n im.attr('alt', mw.usability.getMsg('cite-autofill-alt')).attr('title', mw.usability.getMsg('cite-autofill-alt'));\n var ad = $j('<a />').attr('href', '#');\n ad.append(im);\n ad.attr('id', 'cite-auto-'+CiteTB.escStr(this.shortform)+'-'+field+'-'+autotype);\n $j('#cite-auto-'+CiteTB.escStr(this.shortform)+'-'+field+'-'+autotype).live('click', CiteTB.initAutofill);\t \n }\n \n var display = fieldobj.label ? fieldobj.label : CiteTB.fixStr(field);\n var tooltip = fieldobj.tooltip ? $j('<abbr />').attr('title', fieldobj.tooltip).text('*') : false;\n \n var input = '';\n if (ad) {\n input = $j('<input tabindex=\"1\" style=\"width:85%\" type=\"text\" />');\n } else {\n input = $j('<input tabindex=\"1\" style=\"width:100%\" type=\"text\" />');\n }\n input.attr('id', 'cite-'+CiteTB.escStr(this.shortform)+'-'+field);\n\t if (fieldobj.autofillprop) {\n\t input.addClass('cite-'+CiteTB.escStr(this.shortform)+'-'+fieldobj.autofillprop);\n\t }\n var label = $j('<label />');\n label.attr('for', 'cite-'+CiteTB.escStr(this.shortform)+'-'+field).text(display);\n if (tooltip) {\n label.append(tooltip);\n }\n var style = 'text-align:right; width:20%;';\n if (i%2 == 1) {\n style += ' padding-left:1em;';\n } else {\n var tr = $j('<tr />');\n }\n var td1 = $j('<td class=\"cite-form-td\" />').attr('style', style);\n td1.append(label);\n tr.append(td1);\n var td2 = $j('<td class=\"cite-form-td\" style=\"width:30%\" />');\n td2.append(input);\n if (ad) {\n td2.append(ad);\n }\n tr.append(td2);\n if (i%2 == 0) {\n trs.push(tr);\n }\n }\n return trs;\n \n }\n \n // gives a little bit of HTML so the open form can be identified\n this.getInitial = function() {\n var hidden = $j('<input type=\"hidden\" class=\"cite-template\" />');\n hidden.val(this.templatename);\n return hidden;\n }\n \n // makes the form used in the dialog boxes\n this.getForm = function() {\n var main = $j(\"<div class='cite-form-container' />\");\n var form1 = $j('<table style=\"width:100%; background-color:transparent;\" class=\"cite-basic-fields\" />');\n var i=0;\n var trs = this.makeFormInner(this.basic);\n for (var i=0; i<trs.length; i++) {\n form1.append(trs[i]);\n }\n \n var form2 = $j('<table style=\"width:100%; background-color:transparent; display:none\" class=\"cite-extra-fields\">');\n trs = this.makeFormInner(this.extra);\n for (var i=0; i<trs.length; i++) {\n form2.append(trs[i]);\n } \n main.append(form1).append(form2);\n \n var form3 = $j('<table style=\"width:100%; background-color:transparent;padding-top:1em\" class=\"cite-other-fields\">');\n var tr = $j('<tr />');\n var td1 = $j('<td class=\"cite-form-td\" style=\"text-align:right; width:20%\" />');\n var label1 = $j('<label />');\n label1.attr('for', \"cite-\"+CiteTB.escStr(this.shortform)+'-name').text(mw.usability.getMsg('cite-name-label'));\n td1.append(label1);\n var td2 = $j('<td class=\"cite-form-td\" style=\"width:30%\" />');\n var input1 = $j('<input tabindex=\"1\" style=\"width:100%\" type=\"text\" />');\n input1.attr('id', 'cite-'+CiteTB.escStr(this.shortform)+'-name');\n td2.append(input1);\n var td3 = $j('<td class=\"cite-form-td\" style=\"text-align:right; padding-left:1em; width:20%\">');\n var label2 = $j('<label />');\n label2.attr('for', 'cite-'+CiteTB.escStr(this.shortform)+'-group').text(mw.usability.getMsg('cite-group-label'));\n td3.append(label2);\n var td4 = $j('<td class=\"cite-form-td\" style=\"width:30%\" />');\n var input2 = $j('<input tabindex=\"1\" style=\"width:100%\" type=\"text\" />');\n input2.attr('id', 'cite-'+CiteTB.escStr(this.shortform)+'-group');\n td4.append(input2);\n tr.append(td1).append(td2).append(td3).append(td4);\n form3.append(tr);\n main.append(form3);\n var extras = $j('<div />');\n extras.append('<input type=\"hidden\" class=\"cite-form-status\" value=\"closed\" />');\n var hidden = $j('<input type=\"hidden\" class=\"cite-template\" />');\n hidden.val(this.templatename);\n extras.append(hidden);\n var span1 = $j('<span class=\"cite-preview-label\" style=\"display:none;\" />');\n span1.text(mw.usability.getMsg('cite-raw-preview'));\n extras.append(span1).append('<div class=\"cite-ref-preview\" style=\"padding:0.5em; font-size:110%\" />');\n var span2 = $j('<span class=\"cite-prev-parsed-label\" style=\"display:none;\" />');\n span2.text(mw.usability.getMsg('cite-parsed-label'));\n extras.append(span2).append('<div class=\"cite-preview-parsed\" style=\"padding-bottom:0.5em; font-size:110%\" />');\n var link = $j('<a href=\"#\" class=\"cite-prev-parse\" style=\"margin:0 1em 0 1em; display:none; color:darkblue\" />');\n link.text(mw.usability.getMsg('cite-form-parse'));\n extras.append(link); \n main.append(extras);\n \n return main;\n }\n}", "function test_dynamic_dialog_fields_ansible_tower_templates() {}", "function fillTemplate(source, dest, obj) {\n var content = fs.readFileSync(source, {encoding: \"utf8\"});\n for (var prop in obj) {\n content = content.replace(new RegExp('{' + prop + '}', 'g'), obj[prop]);\n }\n\n fs.writeFileSync(dest, content);\n}", "function createMergedDocument(naming, template, fldr, obj, opt) {\n var name = findReplaceInString(naming, obj);\n var file = copyFileToFolder(template, fldr).setName(name);\n var doc = openFileAsType(file, \"document\");\n findReplaceInDoc(doc, obj);\n return file;\n}", "function createDoc(resourceName, obj) {\n \tdelete obj._id; // Do not allow users to set ._id\n\n \tconst collection = getModel(resourceName);\n \tconst item = new collection(obj);\n\n \treturn item.save()\n \t.then(data => {\n\n \t\tconst resp = {\n \t\t\tdoc: data,\n \t\t\tmetadata: { modified: data.length}\n \t\t};\n\n \t\treturn resp;\n \t})\n \t.catch(err => {\n \t\tconsole.log(err);\n \t\tconsole.log(\"db.createDoc error\");\n \t});\n }", "function createTemplate(data, options) {\n\t\tvar _getBody = getBody(data, options),\n\t\t compiler = _getBody.compiler,\n\t\t parsers = _getBody.parsers,\n\t\t body = _getBody.body;\n\n\t\treturn generateCode(body, {\n\t\t\thelpers: helpers,\n\t\t\tparsers: parsers,\n\t\t\tcustomDirectives: customDirectives,\n\t\t\tparser: compiler.parser,\n\t\t\tdebug: !!options.debug\n\t\t});\n\t}", "function formTemplate() {\n\n\t\ttemplate = {\n\n\t\t\tdiv0: {\n\n\t\t\t\tclass: 'formTitle',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\ttext: 'Name',\n\n\t\t\t\t\tclosing: true\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tdiv2: {\n\n\t\t\t\tclass: 'formTitle',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\ttext: 'Email',\n\n\t\t\t\t\tclosing: true\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tdiv4: {\n\n\t\t\t\tclass: 'formTitle',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\ttext: 'Message',\n\n\t\t\t\t\tclosing: true\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tinput1: {\n\n\t\t\t\tclass: 'formInput',\n\n\t\t\t\ttype: 'text',\n\n\t\t\t\tplaceholder: 'John Smith...',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\tclosing: false\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tinput3: {\n\n\t\t\t\tclass: 'formInput',\n\n\t\t\t\ttype: 'text',\n\n\t\t\t\tplaceholder: 'example@gmail.com...',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\tclosing: false\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tinput6: {\n\n\t\t\t\tclass: 'formSubmit',\n\n\t\t\t\ttype: 'button',\n\n\t\t\t\tvalue: 'Submit',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\tclosing: false\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\ttextarea5: {\n\n\t\t\t\tclass: 'formTextArea',\n\n\t\t\t\tspecial: {\n\n\t\t\t\t\tclosing: true\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\ttemplate.tag();\n\n\t}", "function createDoc(store,unid) {\n var doc = store.loadDocument(unid,darwino.jstore.Store.DOCUMENT_CREATE);\n if(doc.isNewDocument()) {\n\tdoc.setJsonString(\"{field:'My field value'}\")\n doc.save()\n }\n return doc;\n}", "function insertNewCustomerDataInput(data) {\n client.createDocument(collectionUrlcustomerBTDetail, data, (err, created) => {\n if (err) {\n console.log(JSON.stringify(err));\n }\n else {\n console.log(JSON.stringify(created));\n }\n });\n}", "function createTemplates(ul) {\n for (firstI=0; firstI<numberOfPages; firstI++) {\n for (secondI=0; secondI<10; secondI++){\n if (aNumber == numberOfStudents) {break;}\n newArray += ul[loopAll(aNumber,addToANumber())].outerHTML;\n }\n secondArray[firstI] = newArray;\n newArray = [];\n }\n}", "function generatePDF(template) {\n // Create PDF document with template size.\n var doc = new PDFDocument({size: [template.width, template.height]});\n var stream = doc.pipe(blobStream());\n\n\t//\n // Iterate over fields until none is left or displayable. As some fields use relative placement,\n\t// they must be displayed after the fields they depend on. So we make several passes until we\n\t// get enough info to display such fields properly.\n\t//\n\t\n\t// Remember fields done so far.\n\tvar doneFields = [];\n\t\n\t// Array of field coordinates. This is simply a string map whose key is a simple specifier such as \"FIELDNAME.left\".\n\t// Field types may define extra dimension specifiers (e.g. \"price\" fields define \"FIELDNAME.separator for x position \n\t// of price separator). There are also template-wide coordinates for page dimensions.\n\tvar fieldCoords = {\n\t\t\"width\" : template.width,\n\t\t\"height\" : template.height\n\t};\n\t\n\twhile (Object.keys(doneFields).length < Object.keys(template.fields).length)\n\t{\n\t\tvar progress = false;\n\t\t\n\t\t$.each(template.fields, function(id, field) {\n\t\t\tif (doneFields[id]) return;\n\t\t\t\n\t\t\t// Get or retrieve box coordinates.\n\t\t\tvar left = (typeof(field.left) == 'number') ? field.left : fieldCoords[field.left],\n\t\t\t\tright = (typeof(field.right) == 'number') ? field.right : fieldCoords[field.right],\n\t\t\t\ttop = (typeof(field.top) == 'number') ? field.top : fieldCoords[field.top],\n\t\t\t\tbottom = (typeof(field.bottom) == 'number') ? field.bottom : fieldCoords[field.bottom];\n\t\t\t\t\n\t\t\t// Remember coordinates that we know at this stage.\n\t\t\tif (typeof(left) == 'number') fieldCoords[id + \".left\"] = left;\n\t\t\tif (typeof(right) == 'number') fieldCoords[id + \".right\"] = right;\n\t\t\tif (typeof(top) == 'number') fieldCoords[id + \".top\"] = top;\n\t\t\tif (typeof(bottom) == 'number') fieldCoords[id + \".bottom\"] = bottom;\n\t\t\t\n\t\t\tif (typeof(left) == 'number' && typeof(right) == 'number') fieldCoords[id + \".width\"] = right - left;\n\t\t\tif (typeof(top) == 'number' && typeof(bottom) == 'number') fieldCoords[id + \".height\"] = bottom - top;\n\t\t\t\n\t\t\tif ( typeof(left) != 'number'\n\t\t\t\t|| typeof(right) != 'number'\n\t\t\t\t|| typeof(top) != 'number'\n\t\t\t\t|| typeof(bottom) != 'number') {\n\t\t\t\t// We're still missing some info, try next loop iteration.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Compute box dimensions.\n\t\t\tvar width = right - left,\n\t\t\t\theight = bottom - top;\n\t\t\t\n\t\t\t\t\n\t\t\tdoc.save();\n\t\t\t\n\t\t\t// Box origin.\n\t\t\tdoc.translate(left, top);\n\t\t\t\n\t\t\tif (DEBUG) {\n\t\t\t\tdoc.rect(0, 0, width, height).stroke();\n\t\t\t\tif (field.mainHeight) doc.rect(0, 0, width, field.mainHeight).stroke();\n\t\t\t}\n\n\t\t\tif (field.inverted) {\n\t\t\t\t// White on black.\n\t\t\t\tdoc.rect(0, 0, width, height).fill('black');\n\t\t\t\tdoc.fill('white');\n\t\t\t}\n\t \n\t\t\t// Get & normalize field value.\n\t\t\tvar text = normalizeString($(\"#\"+id).val());\n\t\t\tmaxLength = field.actualMaxLength || template.actualMaxLength || globalMaxLength;\n\t\t\tif (maxLength) text = text.substring(0, maxLength);\n\t\t\tif (text.length > 0) {\n\t\t\t\t// Text origin.\n\t\t\t\tvar padX = (field.padX || template.padX || 0),\n\t\t\t\t\tpadY = (field.padY || template.padY || 0);\n\t\t\t\tdoc.translate(padX, padY);\n\n\t\t\t\tdoc.font(field.font || template.font);\n\t\t\t\tvar type = (field.type || 'text');\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 'text': {\n\t\t\t\t\t\t// Regular text field: use harmonious word wrapping.\n\t\t\t\t\t\tvar options = {\n\t\t\t\t\t\t\twidth: width - padX*2,\n\t\t\t\t\t\t\theight: height - padY*2,\n\t\t\t\t\t\t\tmaxRatio: (field.maxRatio || template.maxRatio || 2)\n\t\t\t\t\t\t};\n\t\t\t\t\t\tvar fit = wrapText(doc, text.split(\" \"), 1, options);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Output wrapped text line by line.\n\t\t\t\t\t\tvar scaleX = options.width / fit.width,\n\t\t\t\t\t\t\tscaleY = options.height / (doc.currentLineHeight() * fit.lines.length);\n\t\t\t\t\t\tdoc.scale(scaleX, scaleY, {/*empty block needed*/});\n\t\t\t\t\t\tvar y = 0;\n\t\t\t\t\t\tfor (var i = 0; i < fit.lines.length; i++) {\n\t\t\t\t\t\t\t// Centered on line\n\t\t\t\t\t\t\tvar lineWidth = doc.widthOfString(fit.lines[i]);\n\t\t\t\t\t\t\tdoc.text(fit.lines[i], (fit.width-lineWidth)/2, y);\n\t\t\t\t\t\t\ty += doc.currentLineHeight();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'price': {\n\t\t\t\t\t\t// Price field have 3 parts:\n\t\t\t\t\t\t// - Currency sign\n\t\t\t\t\t\t// - Main part (taller)\n\t\t\t\t\t\t// - Decimal part\n\t\t\t\t\t\t// All 3 parts use the same X scaling (i.e. the char widths\n\t\t\t\t\t\t// are the same), but the main part is taller and so uses\n\t\t\t\t\t\t// a greater Y factor.\n\t\t\t\t\t\tvar currency = (field.currency || \"$\");\n\t\t\t\t\t\tvar separator = (field.separator || \".\");\n\t\t\t\t\t\tvar parts = text.split(currency);\n\t\t\t\t\t\tparts = parts[parts.length-1].split(separator);\n\t\t\t\t\t\tvar main = parts[0];\n\t\t\t\t\t\tvar decimal = parts[1] || \" \";\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Compute X scaling of currency+main+decimal parts.\n\t\t\t\t\t\tvar scaleX = (width - padX) / doc.widthOfString(currency+main+decimal);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Compute Y scaling of currency+decimal and main parts.\n\t\t\t\t\t\tvar scaleY = (height - padY*2) / doc.currentLineHeight(),\n\t\t\t\t\t\t\tscaleYMain = (field.mainHeight - padY*2) / doc.currentLineHeight();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Output parts.\n\t\t\t\t\t\tvar x = 0;\n\t\t\t\t\t\t// - Currency.\n\t\t\t\t\t\tdoc.save();\n\t\t\t\t\t\tdoc.scale(scaleX, scaleY, {/*empty block needed*/});\n\t\t\t\t\t\tdoc.text(currency, x, 0);\n\t\t\t\t\t\tdoc.restore();\n\t\t\t\t\t\tx += doc.widthOfString(currency);\n\t\t\t\t\t\tfieldCoords[id + \".currency\"] = left + x*scaleX;\n\t\t\t\t\t\t// - Main.\n\t\t\t\t\t\tdoc.save();\n\t\t\t\t\t\tvar mainShift = (field.mainShift || 0);\n\t\t\t\t\t\tdoc.translate(0, mainShift);\n\t\t\t\t\t\tdoc.scale(scaleX, scaleYMain, {/*empty block needed*/});\n\t\t\t\t\t\tdoc.text(main, x, 0);\n\t\t\t\t\t\tdoc.restore();\n\t\t\t\t\t\tx += doc.widthOfString(main);\n\t\t\t\t\t\tfieldCoords[id + \".separator\"] = left + x*scaleX;\n\t\t\t\t\t\t// - Decimal.\n\t\t\t\t\t\tdoc.scale(scaleX, scaleY, {/*empty block needed*/});\n\t\t\t\t\t\tdoc.text(decimal, x, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdoc.restore();\n\t\t\t\n\t\t\t// Done!\n\t\t\tdoneFields[id] = true;\n\t\t\tprogress = true;\n\t\t});\n\t\t\n\t\t// Check progress.\n\t\tif (!progress) {\n\t\t\t// No progress, stop there.\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return stream to caller, which should typically bind the 'finish' event to get \n\t// the generated data.\n doc.end();\n return stream;\n}", "function transaction_create(req, res) {\n let req_arr = req.body;\n let bulk_updates = [];\n\n _.forEach(req_arr, function (doc, callback) {\n doc['company'] = getCompany(doc.name);\n bulk_updates.push({\n \"updateOne\": {\n \"filter\": {\n \"trans_id\": doc.trans_id\n },\n \"update\": {\n \"$set\": {\n \"name\": doc.name,\n \"company\": doc.company,\n \"amount\": doc.amount,\n \"date\": doc.date,\n \"user_id\": doc.user_id,\n \"trans_id\": doc.trans_id\n }\n },\n \"upsert\": true, // Avoid duplication of transactions\n \"multi\": true\n }\n });\n });\n\n // Break the txns array into smaller chunks based on the size set in config file\n let bulks = chunk_array(bulk_updates, config.BULK_INSERT_SIZE);\n let total_bulks = bulks.length;\n async.every(bulks, function (bulk, callback) {\n Transaction.bulkWrite(bulk, function () {\n // Only send the response when all the chunks of transactions have been written to db.\n if (--total_bulks == 0) callback();\n });\n }, function () {\n transaction_get_recurring(req, res);\n });\n}", "function setupTemplates(app, dir) {\n app.templates = {};\n for (let fname of fs.readdirSync(dir)) {\n console.log(\"field name -> \" + fname);\n const m = fname.match(/^([\\w\\-]+)\\.ms$/);\n if (!m) continue;\n try {\n app.templates[m[1]] =\n //String(fs.readFileSync(`${TEMPLATES_DIR}/create.ms`));\n //console.log(\"app.templates[m[1]] -> \"+app.templates[m[1]]);\n String(fs.readFileSync(`${TEMPLATES_DIR}/${fname}`));\n }\n catch (e) {\n console.error(`cannot read ${fname}: ${e}`);\n process.exit(1);\n }\n }\n}", "function createElement(template) {\n const el = document.createElement(\"template\");\n el.innerHTML = template;\n return el;\n}", "appendCreateFields(input, embed = false) {\n // id, createdAt, updatedAt\n const timestamp = new Date();\n if (embed && !input.id && this.idKey()) input.id = this.idValue();\n if (!input.createdAt) input.createdAt = timestamp;\n input.updatedAt = timestamp;\n\n // Generate embedded default values\n this.getEmbeddedFields().filter(field => field.isPersistable()).forEach((field) => {\n if (input[field]) map(input[field], v => field.getModelRef().appendCreateFields(v, true));\n });\n\n return input;\n }", "function generateFormSection(arr, targetElId, editable) {\n\n for (i = 0; i < arr.length; i++) {\n\n var cleanName = arr[i].internalName;\n var specialClasses = arr[i].specialClasses;\n var dataField = '#data-' + cleanName;\n var newRow = '#field-' + cleanName;\n\n var newEl = '<div id=\"field-' + cleanName + '\" class=\"field-row ' + specialClasses + '\"><div class=\"field-title\">' + arr[i].displayName + '</div><div id=\"field-data-' + cleanName + '\" class=\"field-data\"></div><div class=\"field-help\">' + arr[i].helpText + '</div></div>';\n\n //Insert new element into target div\n document.querySelector('#' + targetElId).insertAdjacentHTML('beforeend', newEl);\n \n if (editable) {\n //Find the actual SP form data field\n var spFieldId = '[id^=\"' + arr[i].internalName + '_\"]';\n var spFieldEl = document.querySelector(spFieldId);\n document.querySelector(newRow + ' .field-data').appendChild(spFieldEl);\n } else {\n var spFieldLabel = '[name=\"SPBookmark_' + arr[i].internalName + '\"]';\n var spFieldRow = $(spFieldLabel).closest('tr');\n var rowClass = 'row-' + arr[i].internalName;\n $(spFieldRow).addClass(rowClass);\n var target = '.' + rowClass + ' .ms-formbody';\n $(newRow + ' .field-data').append($(target));\n } \n }\n}", "function createFile(){\n if (projectType == \"Basic\") {\n internalReference = idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId,internalReference,documentType,description,dateCreated,diffusionDate,externalReference,localization,form,status);\n //Internal Reference as Full\n } else if (projectType == \"Full\") {\n internalReference = documentType + \"-\" + padToFour(projectCode) + \"-\" + padToTwo(avenant) + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n //Internal Reference as Full Without Project \n } else {\n\n internalReference = documentType + \"-\" + idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId, internalReference, documentType, description, dateCreated, diffusionDate, externalReference, localization, form, status);\n }\n }", "function createReportOrders() {\n \n var TEMPLATE_ID = '1IQKKvDM8AMvvxi5VsNmARzzFdiWWk3nstC6POTQzDNQ' // dry pack list template\n var FOLDER_ID = '1Ur9LaAUeYzlIFxQ77bO3oj0hJ0UIDULc' // reports go to dry/reports\n \n var packDate = getPackDateFromFilename()\n var PDF_FILE_NAME = Utilities.formatDate(packDate, \"GMT+12:00\", \"yyyy-MM-dd\") + ' Orders'\n \n if (TEMPLATE_ID === '') { \n SpreadsheetApp.getUi().alert('TEMPLATE_ID needs to be defined in code.gs')\n return\n }\n \n // Set up the docs and the spreadsheet access\n \n var copyFile = DriveApp.getFileById(TEMPLATE_ID).makeCopy(DriveApp.getFolderById(FOLDER_ID)) \n var doc = DocumentApp.openById(copyFile.getId())\n var body = doc.getBody()\n var header = doc.getHeader()\n \n // get a copy of templated tables and clear the document\n var templateMemberTable = body.getTables()[0]\n var templateOrdersTable = body.getTables()[1]\n body.clear()\n \n // copy and remove the template order row\n var dataRow = templateOrdersTable.getRow(1).removeFromParent()\n \n // Document Heading - set the packdate\n header.replaceText('%PACKDATE%', Utilities.formatDate(packDate, \"GMT+12:00\", \"EEEE, d MMMM yyyy\"))\n\n // Get orders\n var memberOrders = getDryOrdersByMember() //.reverse()\n\n \n //------------------------------------------------------------------------------------------------\n // for each member, on a new page, add a member header and then a table for each type of product\n //------------------------------------------------------------------------------------------------\n \n for (var i = 0; i < memberOrders.length; i++){\n var member = memberOrders[i]\n \n if (i>0) {body.appendPageBreak()}\n\n // create and insert member header\n var memberTable = templateMemberTable.copy()\n memberTable.replaceText(\"%member%\", member.name)\n memberTable.replaceText(\"%id%\", member.id)\n memberTable = body.appendTable(memberTable)\n \n \n // create a separate table for each measuring-type of product\n var weighables = templateOrdersTable.copy().replaceText(\"%type%\", \"Weighables (kg)\")\n var countables = templateOrdersTable.copy().replaceText(\"%type%\", \"Countables\")\n var pourables = templateOrdersTable.copy().replaceText(\"%type%\", \"Pourables (litres)\")\n \n // add a row for each order to one of the tables\n for (var j = 0; j < member.orders.length; j++) {\n var order = member.orders[j]\n var newRow = dataRow.copy()\n \n // newRow.replaceText(\"%tweak%\", (order.tweak == 0 ? \"\" : order.tweak))\n newRow.replaceText(\"%product%\", order.product)\n newRow.replaceText(\"%qty%\", order.qty)\n \n if (order.unit == \"kg\" || order.product.toLowerCase() == \"coconut oil\") {\n newRow = weighables.appendTableRow(newRow)\n } else if (order.unit == \"litre\") {\n newRow = pourables.appendTableRow(newRow)\n } else {\n newRow = countables.appendTableRow(newRow) \n }\n } \n if (countables.getNumRows() > 1) {body.appendTable(countables)}\n if (weighables.getNumRows() > 1) {body.appendTable(weighables)}\n if (pourables.getNumRows() > 1) {body.appendTable(pourables)}\n }\n\n //------------------------------------------\n // Create PDF from doc, rename it if required and delete the doc\n \n doc.saveAndClose()\n \n var pdf = DriveApp.getFolderById(FOLDER_ID).createFile(copyFile.getAs('application/pdf')) \n if (PDF_FILE_NAME !== '') {\n pdf.setName(PDF_FILE_NAME)\n } \n sharePdfPacksheets(pdf)\n \n copyFile.setTrashed(true)\n\n}", "function serializeTemplate(template,options) {\r\n var buildObjectsText = template.buildObjectsText;\r\n var decodeFunctionsText = template.decodeFunctionsText;\r\n var encodeFunctionsText = template.encodeFunctionsText;\r\n \r\n //var dataToSend = {\"type\":\"unpack\",\"template\":\"object1\"};\r\n var rawTemplate = {numbers:[], strings:[], booleans:[], nulls:[]};\r\n\r\n //save the options that were used to serialize so we can correctly deserialize\r\n if (typeof options != \"object\") {\r\n options = {};\r\n }\r\n rawTemplate.strings.push(JSON.stringify(options));\r\n\r\n //dataToSend[\"buildObjectsCount\"] = buildObjectsText.length;\r\n rawTemplate.numbers.push(buildObjectsText.length);\r\n for (var i=0; i<buildObjectsText.length; i++) {\r\n //dataToSend[\"structure_\" + i] = buildObjectsText[i];\r\n rawTemplate.strings.push(buildObjectsText[i]);\r\n }\r\n\r\n //dataToSend[\"decodeFunctionCount\"] = decodeFunctionsText.length; \r\n rawTemplate.numbers.push(decodeFunctionsText.length);\r\n for (var i=0; i<decodeFunctionsText.length; i++) {\r\n //dataToSend[\"decode_\" + i] = decodeFunctionsText[i];\r\n rawTemplate.strings.push(decodeFunctionsText[i]);\r\n }\r\n\r\n //dataToSend[\"encodeFunctionCount\"] = encodeFunctionsText.length; \r\n rawTemplate.numbers.push(encodeFunctionsText.length);\r\n for (var i=0; i<encodeFunctionsText.length; i++) {\r\n //dataToSend[\"encode_\" + i] = encodeFunctionsText[i];\r\n rawTemplate.strings.push(encodeFunctionsText[i]);\r\n }\r\n\r\n if (options.encodeValues) {\r\n rawTemplate.numbers = rawTemplate.numbers.concat(template.typeValues.numbers);\r\n rawTemplate.strings = rawTemplate.strings.concat(template.typeValues.strings);\r\n rawTemplate.booleans = rawTemplate.booleans.concat(template.typeValues.booleans);\r\n rawTemplate.nulls = rawTemplate.nulls.concat(template.typeValues.nulls);\r\n }\r\n\r\n return(rawTemplate);\r\n}", "function addField(fieldIndex){\n if(!fieldIndex){\n return;\n }\n var fieldTypes = [\n //Single Line Text Field\n {\"label\": \"New Text Field\", \"type\": \"TEXT\", \"placeholder\": \"New Field\"},\n //Date Field\n {\"label\": \"New Date Field\", \"type\": \"DATE\"},\n //DropDownField\n {\"label\": \"New Dropdown\", \"type\": \"OPTIONS\", \"options\": [\n {\"label\": \"Option 1\", \"value\": \"OPTION_1\"},\n {\"label\": \"Option 2\", \"value\": \"OPTION_2\"},\n {\"label\": \"Option 3\", \"value\": \"OPTION_3\"}\n ]},\n //Checkboxes Field\n {\"label\": \"New Checkboxes\", \"type\": \"CHECKBOXES\", \"options\": [\n {\"label\": \"Option A\", \"value\": \"OPTION_A\"},\n {\"label\": \"Option B\", \"value\": \"OPTION_B\"},\n {\"label\": \"Option C\", \"value\": \"OPTION_C\"}\n ]},\n //Radio Buttons Field\n {\"label\": \"New Radio Buttons\", \"type\": \"RADIOS\", \"options\": [\n {\"label\": \"Option X\", \"value\": \"OPTION_X\"},\n {\"label\": \"Option Y\", \"value\": \"OPTION_Y\"},\n {\"label\": \"Option Z\", \"value\": \"OPTION_Z\"}\n ]},\n //Multi Line Text Field\n {\"label\": \"New Text Field\", \"type\": \"TEXTAREA\", \"placeholder\": \"New Field\"},\n //Email Text field\n {\"label\": \"New Email Field\", \"type\": \"EMAIL\", \"placeholder\": \"New Field\"},\n //Password field\n {\"label\": \"New Password Field\", \"type\": \"PASSWORD\", \"placeholder\": \"New Field\"}\n\n ];\n\n FieldService\n .createFieldForForm(vm.formId, fieldTypes[fieldIndex])\n .then(function (response) {\n vm.fields = response.data;\n },\n function (error) {\n console.log(error.statusText);\n });\n\n\n }", "function generateTemplate(name, data, basicElement) {\n var template = document.getElementById(name).innerHTML;\n var element = document.createElement(basicElement || 'div');\n Mustache.parse(template);\n element.innerHTML = Mustache.render(template, data);\n return element;\n}", "async process_fields() {\n\n const fields_template = this._blockkit_conifg.block_kit.fields;\n\n const result = {};\n result.type = \"section\";\n result.fields = [];\n\n for (const template_index in fields_template) {\n const template_value = fields_template[template_index];\n result.fields.push({\n type: \"mrkdwn\",\n text: \"*\" + template_index + \":*\\n\" + await helper.str_dot_walk_obj(this._obj, template_value)\n });\n }\n\n return result;\n }", "function main(\n projectId,\n templateId,\n displayName,\n infoTypes,\n includeQuote,\n minLikelihood,\n maxFindings\n) {\n infoTypes = transformCLI(infoTypes);\n // [START dlp_create_inspect_template]\n // Imports the Google Cloud Data Loss Prevention library\n const DLP = require('@google-cloud/dlp');\n\n // Instantiates a client\n const dlp = new DLP.DlpServiceClient();\n\n // The project ID to run the API call under\n // const projectId = 'my-project';\n\n // The minimum likelihood required before returning a match\n // const minLikelihood = 'LIKELIHOOD_UNSPECIFIED';\n\n // The maximum number of findings to report per request (0 = server maximum)\n // const maxFindings = 0;\n\n // The infoTypes of information to match\n // const infoTypes = [{ name: 'PHONE_NUMBER' }, { name: 'EMAIL_ADDRESS' }, { name: 'CREDIT_CARD_NUMBER' }];\n\n // Whether to include the matching string\n // const includeQuote = true;\n\n // (Optional) The name of the template to be created.\n // const templateId = 'my-template';\n\n // (Optional) The human-readable name to give the template\n // const displayName = 'My template';\n\n async function createInspectTemplate() {\n // Construct the inspection configuration for the template\n const inspectConfig = {\n infoTypes: infoTypes,\n minLikelihood: minLikelihood,\n includeQuote: includeQuote,\n limits: {\n maxFindingsPerRequest: maxFindings,\n },\n };\n\n // Construct template-creation request\n const request = {\n parent: `projects/${projectId}/locations/global`,\n inspectTemplate: {\n inspectConfig: inspectConfig,\n displayName: displayName,\n },\n templateId: templateId,\n };\n\n const [response] = await dlp.createInspectTemplate(request);\n const templateName = response.name;\n console.log(`Successfully created template ${templateName}.`);\n }\n createInspectTemplate();\n // [END dlp_create_inspect_template]\n}", "function massageCreateIndexRequest(requestDef) {\n requestDef = clone$1(requestDef);\n\n if (!requestDef.index) {\n requestDef.index = {};\n }\n\n ['type', 'name', 'ddoc'].forEach(function (key) {\n if (requestDef.index[key]) {\n requestDef[key] = requestDef.index[key];\n delete requestDef.index[key];\n }\n });\n\n if (requestDef.fields) {\n requestDef.index.fields = requestDef.fields;\n delete requestDef.fields;\n }\n\n if (!requestDef.type) {\n requestDef.type = 'json';\n }\n return requestDef;\n}", "function getDocGeneratorForTopLevelFields(fieldNameArr) {\n return function(seed) {\n return setNFields({}, fieldNameArr, 0, [seed], fieldNameArr.length);\n };\n }", "function massageCreateIndexRequest(requestDef) {\n requestDef = Object(__WEBPACK_IMPORTED_MODULE_0_pouchdb_utils__[\"b\" /* clone */])(requestDef);\n\n if (!requestDef.index) {\n requestDef.index = {};\n }\n\n ['type', 'name', 'ddoc'].forEach(function (key) {\n if (requestDef.index[key]) {\n requestDef[key] = requestDef.index[key];\n delete requestDef.index[key];\n }\n });\n\n if (requestDef.fields) {\n requestDef.index.fields = requestDef.fields;\n delete requestDef.fields;\n }\n\n if (!requestDef.type) {\n requestDef.type = 'json';\n }\n return requestDef;\n}", "async createFile(name, filePath, fileKeys) {\n let auth = this.auth;\n let res = {\"fileId\": \"\", \"keyId\": \"\", \"name\": name, keys: fileKeys};\n var drive = google.drive({ version: 'v3', auth });\n var fileMetadata = {\n 'name': name\n };\n var media = {\n mimeType: 'text/plain', \n body: fs.createReadStream(filePath+\".enc\")\n };\n var key_media = {\n mimeType: 'text/plain', \n body: fs.createReadStream(filePath+\".key\")\n }\n \n const fileRes = await drive.files.create({\n resource: fileMetadata,\n media: media,\n fields: 'id'\n });\n res.fileId = fileRes.data.id;\n fs.unlinkSync(filePath+\".enc\");\n \n const keyRes = await drive.files.create({\n resource: {\n 'name': fileMetadata[\"name\"] + \".key\"\n },\n media: key_media,\n fields: 'id'\n });\n res.keyId = keyRes.data.id;\n fs.unlinkSync(filePath+\".key\");\n this.db.collection('filesCollection').insertOne(res);\n var jsonUpload= {\n \"$class\": \"org.example.mynetwork.Document\",\n \"DocumentId\" : res.fileId.toString(),\n \"owner\": \"u1\",\n \"description\": \"test\",\n \"UsersWithAccess\": [\n \"u1\"\n ]\n };\n request.post(this.BLOCKCHAIN_URL+'/api/Document',{json: jsonUpload}, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body)\n }\n });\n return res;\n }", "function massageCreateIndexRequest(requestDef) {\n requestDef = clone(requestDef);\n\n if (!requestDef.index) {\n requestDef.index = {};\n }\n\n ['type', 'name', 'ddoc'].forEach(function (key) {\n if (requestDef.index[key]) {\n requestDef[key] = requestDef.index[key];\n delete requestDef.index[key];\n }\n });\n\n if (requestDef.fields) {\n requestDef.index.fields = requestDef.fields;\n delete requestDef.fields;\n }\n\n if (!requestDef.type) {\n requestDef.type = 'json';\n }\n return requestDef;\n}", "function generateTemplate (info, next) {\n //get what the full response would look like in hash form\n let rpcHash = generateRpcObjectHash(info.rpcs, info.permissionRelations, info.hmiValues);\n\n //convert the hash into an array\n rpcHashToArray(rpcHash, function (err, rpcs) {\n let template = baseTemplate();\n template.rpcs = rpcs;\n next(err, template);\n });\n}", "create(data) {\n //eventually will need to do manipulation to convert template string into this format, but start simple for now\n return null;\n }", "create(data) {\n //eventually will need to do manipulation to convert template string into this format, but start simple for now\n return null;\n }", "static postTemplate(req, res) {\n let type = req.params.type;\n let id = req.params.id;\n let template = req.body;\n\n ConnectionHelper.getTemplateProvider(req.project, req.environment)\n .then((connection) => {\n if(!connection) { return Promise.reject(new Error('No template provider found')); }\n \n return connection.setTemplateById(type, id, template);\n })\n .then(() => {\n res.status(200).send('OK');\n })\n .catch((e) => {\n res.status(404).send(ApiController.printError(e, false));\n }); \n }", "function requestDocusignSignatureUsingConfigTemplate(name, email) {\n payload = {\n \"emailSubject\": DOCUSIGN_EMAIL_SUBJECT,\n \"status\": \"sent\",\n \"templateId\": DOCUSIGN_TEMPLATE_ID,\n \"templateRoles\": [\n {\n \"email\": email,\n \"name\": name,\n \"roleName\": DOCUSIGN_TEMPLATE_ROLE,\n }\n ]\n }\n return callDocusignAPI(\"envelopes\", 'post', payload)\n}", "function createVuePages(createPage, nodes) {\n nodes.forEach(function (node) {\n if (node && node._url && node._url.length && node._template && node._template.length) {\n const template = node._template[0].toUpperCase() + node._template.substring(1);\n createPage({\n path: `/${node._url.slice(1, -1)}`,\n component: `./src/templates/${template}.vue`,\n context: node\n })\n }\n });\n}", "function makeInsertTestForDocType(name, pre, documentGenerator, additionalTags) {\n if (typeof(additionalTags) === \"undefined\") {\n additionalTags = [];\n }\n\n var opsList = [];\n for (var i = 0; i < 1000; i++) {\n opsList.push({op: \"insert\", doc: documentGenerator(i)});\n }\n addTest({\n type: \"Insert\",\n name: name + \".InsertDoc\",\n pre: pre,\n ops: opsList,\n tags: kInsertTags.concat(additionalTags)\n });\n }", "function Template (arrDOM,parentHead,vars) {\n\tDOM.apply(this,arguments);\n\tthis.mods = {\n\t\tdom: new DOM(this)\n\t\t,html: new fdom.html(this)\n\t\t,md: new fdom.md(this)\n\t\t,emmet: new fdom.emmet(this)\n\t\t,jsonml: new fdom.jsonml(this)\n\t\t,'3390': this\n\t};\n\tthis.mods.markdown = this.mods.md;\n\tthis.mods.json = this.mods.templar;\n\tthis.mods.zen = this.mods.emmet;\n\tthis.vars = vars || {};\n}", "function AddNewPageToDoc(name,doc){\n var tempPage = MSPage.new();\n doc.addPage(tempPage);\n tempPage.setName(name);\n}", "async addDocument(_, { input: { doc, owner } }, { generalInfo }) {\n const document = { doc }\n const { insertedId } = await generalInfo.insertOne(document)\n document._id = insertedId\n\n return document\n }", "function make_template_function(templateName) { // 346\n\tif (!templateName) { // 347\n\t\tthrow new Error(\"templateName is not specified\"); // 348\n\t} // 349\n // 350\n\tvar tmpl = Template[templateName]; // 351\n\tif (!tmpl) { // 352\n\t\tthrow new Error(\"Template '\" + templateName + \"' is not defined\"); // 353\n\t} // 354\n // 355\n\treturn function(context) { // 356\n\t\tvar div = $(\"<div/>\"); // 357\n\t\tif ($.isFunction(Blaze.renderWithData)) { // 358\n\t\t\tBlaze.renderWithData(tmpl, context, div[0]); // 359\n\t\t} else { // for meteor < v0.9 // 360\n\t\t\tvar range = UI.renderWithData(tmpl, context); // 361\n\t\t\tUI.insert(range, div[0]); // 362\n\t\t} // 363\n\t\t// return html wrapped into div to avoid visual issues // 364\n\t\treturn div[0].outerHTML; // 365\n\t}; // 366\n} // 367" ]
[ "0.7970951", "0.61272025", "0.6053861", "0.5956159", "0.57502514", "0.56741035", "0.562444", "0.55815834", "0.5574609", "0.55380154", "0.55362004", "0.54940426", "0.5479189", "0.5460542", "0.5450835", "0.54419816", "0.54292387", "0.5385388", "0.5380933", "0.5360706", "0.53575784", "0.533182", "0.53115416", "0.5309398", "0.529392", "0.52773494", "0.5272141", "0.52605236", "0.52557737", "0.52279854", "0.5212119", "0.52015203", "0.5176", "0.5173357", "0.5173357", "0.516914", "0.5149803", "0.5147837", "0.514506", "0.5143509", "0.5133595", "0.5133094", "0.5122935", "0.5116699", "0.51155984", "0.51155984", "0.51155984", "0.51155984", "0.51155984", "0.51155984", "0.5107848", "0.51002884", "0.5088246", "0.508331", "0.5081942", "0.50785226", "0.50401384", "0.50374556", "0.5034787", "0.50316286", "0.50177586", "0.49976942", "0.49792764", "0.49664533", "0.49629137", "0.4949868", "0.49483785", "0.4947795", "0.4947627", "0.49466228", "0.4940339", "0.49380094", "0.49345082", "0.49343622", "0.49224442", "0.4905905", "0.4905218", "0.49046308", "0.4901218", "0.48935968", "0.4892811", "0.48876294", "0.4886188", "0.48861602", "0.4879334", "0.48785406", "0.48711464", "0.48664016", "0.4862844", "0.48612127", "0.48570758", "0.48570758", "0.4852095", "0.4851164", "0.48497415", "0.48468012", "0.4840238", "0.48399898", "0.48389134", "0.4836514" ]
0.7424708
1
1. creates template 2. adds it to 'templates' collection as any other document, using addDocument function
function addTemplate(templateName, fieldsArray,callback){ createTemplate(templateName,fieldsArray, function(readyTemplate){ addDocument('templates',readyTemplate,function(result){ callback(result)})}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create(title, cost, description, thumbnail, image){\n let template = {\n \"title\": title,\n \"cost\": cost,\n //VERY BAD, USE Object.Id (mongoose)\n // \"id\": this.guid(),\n \"id\": Math.floor(1000 + Math.random() * 9000),\n \"description\": description,\n \"thumbnail\": thumbnail,\n \"image\": image\n }\n this.templates.push(template)\n this.saveTemplates((err, data) => {\n if (err){\n console.log(err)\n return\n }\n })\n return template\n }", "_saveTemplate(type, template, callback) {\n template.id = this._createTemplateId(template.name + template.title + template.body)\n template.created_at = this._now()\n\n this._fetch((fullyTemplates) => {\n if (!fullyTemplates.hasOwnProperty(type)) {\n fullyTemplates[type] = {}\n }\n\n fullyTemplates[type][template.id] = template\n this._save(fullyTemplates, callback)\n })\n }", "_createTemplates() {\n // User's custom templates\n const callbackTemplate = this.config.callbackOnCreateTemplates;\n let userTemplates = {};\n if (callbackTemplate && isType('Function', callbackTemplate)) {\n userTemplates = callbackTemplate.call(this, strToEl);\n }\n\n this.config.templates = extend(TEMPLATES, userTemplates);\n }", "function addTemplateElement(request, template_json){\n var element = templateElementArray(template_json);\n addElement(element,dataTable_templates);\n updateTemplateSelect();\n}", "function getTemplatefromMap(req,templatesList){\n req.s3link=[]\n return _.map(templatesList,function(i){\n let doc=i\n let template={}\n template.ref=doc,\n template.inputFile=docContants.TemplatePath+_.get(docContants,doc)\n template.OutputFile=docContants.OutputPath+_.get(docContants,doc)\n req.s3link.push(docContants.s3linkpath+_.get(docContants,doc))\n return template\n })\n }", "function insertTemplate() {\n\n mainTag.insertAdjacentHTML(\"afterbegin\", templateApp);\n\n let templateContent = document.getElementById(\"tiny-example\").content;\n let cloneNode = templateContent.cloneNode(true);\n\n mainTag.lastChild.remove();\n mainTag.append(cloneNode);\n\n}", "function addNewTemplate() {\n\n\tvar templateHtml = $(\"#template\").html();\n\tvar template = new Template();\n\ttemplate.makeHtml(\"templateContent\", templateHtml, function(templateName) {\n\t\tconsole.log('template call back!!..');\n\n\t\t// jquery日付の呼び出す初期化\n\t\t$(\".datepicker\").datepicker();\n\n\t\t// 連動呼び出す\n\t\titemAreaHide(templateName + 'item');\n\t});\n}", "function compileTemplates(){\n\tvar siteMap = config();//JSON.parse( fs.readFileSync( config() ) );\n\n\t//generate paths to the example sources\n\tvar sources = [];\n\tsiteMap.examples.forEach(function( example ){\n\t\tsources.push( source( example.src ) );\n\t});\n\t//pass to docco, then jade, then clean up\n\tdocco.document(sources, { language: \"javascript\", template: view(\"docco-template.jst\") }, function( err ){\n\t\tif( err ) throw err;\n\t\tasync.forEach( siteMap.examples, generateExample, function exit( err ) {\n\t\t\tif( err ) throw err;\n\t\t\tsetTimeout(function(){\n\t\t\t\t//clean();\n\t\t\t}, 500);\n\t\t});\n\t});\n\n\t//handle pages\n\tsiteMap.pages.forEach(function( page ){\n\t\tgeneratePage( page );\n\t});\n\n\n\t//remove the docs folder\n\tfunction clean(){\n\t\twrench.rmdirRecursive( __dirname + '/docs/', function(){\n\t\t\tmsg('docs deleted');\n\t\t});\n\t}\n}", "function useTemplate(tblName,template_sysid){ \n var tmp = new GlideRecord(tblName); \n tmp.initialize();\n var gtemp= new GlideTemplate.get(template_sysid).apply(tmp); // apply template to new record\n return tmp.insert(); \n}", "function template(index, templateFn, consts, vars, tagName, attrs, localRefs, localRefExtractor) {\n // TODO: consider a separate node type for templates\n var tNode = containerInternal(index, tagName || null, attrs || null);\n if (firstTemplatePass) {\n tNode.tViews = createTView(-1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n createDirectivesAndLocals(localRefs, localRefExtractor);\n currentQueries &&\n (currentQueries = currentQueries.addNode(previousOrParentTNode));\n queueLifecycleHooks(tNode.flags, tView);\n isParent = false;\n}", "function renderTemplate(dataFromDb) {\n let template = { data: [] };\n const blackList = ['id', 'created_at', 'updated_at', 'book_id']; // for doing filtering in array. you cant put/post this parameters and they will not be shown in template\n// making array with keys from first object in array and moving id, createdAt and UpdatedAt from array\n const arrayWithKeys = Object.keys(dataFromDb[0]).filter( (element, index) =>{\n return !blackList.includes(element);\n });\n //pushing data in template pattern\n arrayWithKeys.forEach( (element, index) => {\n //console.log(arrayWithKeys[index]);\n if(arrayWithKeys[index] === 'url'){\n let columnName = 'pdf';\n template.data.push( {\n 'name': columnName,\n 'value': \"\",\n 'prompt': 'insert pdf file into book resource to store url in pdfs/{nameOfDocument}'\n } );\n }\n else {\n let columnName = arrayWithKeys[index];\n template.data.push( {\n 'name': columnName,\n 'value': \"\",\n 'prompt': columnName\n } );\n }\n});\n\n cj.collection.template = template;\n\n}", "async function createDoc(){\n const { success, results, error } = await quickdb.doc.create(\n 'sweetTemplate.html',\n '<h1>Sweet Template Bro</h1>'\n );\n console.log(success);\n console.log(results);\n console.log(error);\n}", "async addDocument(_, { input: { doc, owner } }, { generalInfo }) {\n const document = { doc }\n const { insertedId } = await generalInfo.insertOne(document)\n document._id = insertedId\n\n return document\n }", "function createTemplate(templateName, fieldsArray, callback){\n\t\n\tvar readyTemplate = { \n\t\ttemplate: templateName, \n\t\tfields:fieldsArray\n\t}\n\tcallback(readyTemplate)\t\n}", "static async addNew(template) {\n const sql =\n \"INSERT INTO templates (template_name, visible, created, sections) VALUES (?,?,?,?)\";\n\n const { name, visible, createdAt, sections } = template;\n\n try {\n return await query(sql, [name, visible, createdAt, sections]);\n } catch (error) {\n console.log(\"exception: \", error);\n throw error;\n }\n }", "function setup() {\n var docId = DocumentApp.getActiveDocument().getId();\n var file = DriveApp.getFileById(docId);\n var folders = file.getParents();\n \n // var folder is the folder that contains the script\n while (folders.hasNext()) {\n var folder = folders.next();\n } \n \n var folderId = folder.getId();\n \n // check if archive folder created - create if not\n try {\n var archive = folder.getFoldersByName(\"Archive\").next();\n }\n catch(e) {\n var archive = folder.createFolder(\"Archive\").getId();\n }\n \n // check if today folder create - create if not\n try {\n var todayFolder = folder.getFoldersByName(\"Today\").next();\n }\n catch(e) {\n var todayFolder = folder.createFolder(\"Today\").getId();\n }\n \n // check if template file create - create if not\n try {\n var template = DriveApp.getFilesByName(\"meetingTemplate\").next();\n }\n catch(e) {\n var template = DocumentApp.create(\"meetingTemplate\");\n var templateFile = DriveApp.getFileById(template.getId());\n DriveApp.getFolderById(folderId).addFile(templateFile);\n DriveApp.getRootFolder().removeFile(templateFile)\n }\n\n // Deletes all triggers in the current project.\n var triggers = ScriptApp.getProjectTriggers();\n for (var i = 0; i < triggers.length; i++) {\n ScriptApp.deleteTrigger(triggers[i]);\n }\n \n // Creates triggers for creating and cleaning up docs\n // Runs at 1am in the timezone of the script\n ScriptApp.newTrigger(\"cleanupDocs\")\n .timeBased()\n .atHour(1)\n .everyDays(1) // Frequency is required if you are using atHour() or nearMinute()\n .create();\n\n // Runs every 10m\n ScriptApp.newTrigger(\"createDocForEvents\")\n .timeBased()\n .everyMinutes(10)\n .create();\n \n}", "function createContent(data, templateNum) {\n $(document).ready(function() {\n //iterate through templates\n for (i = 0; i < templateList.length; i++) {\n let source = $(templateList[i][0]).html();\n let template = Handlebars.compile(source);\n let html = template(data);\n //write data into template\n $(templateList[i][1]).append(html);\n }\n\n contentLoaded();\n });\n}", "function createWithAdminId(req,res){\n var newTemplate = new TemplateForm();\n newTemplate._admin_id = req.params.adminid;\n newTemplate.template = req.body.template;\n\n newTemplate.save(function(err, template) {\n if(err)\n return res.status(400).json(err);\n else\n return res.status(200).json(template);\n });\n}", "function addDocument() {\n var $list = $(\".documentList\");\n var $item = $(\"#document-template\").clone(true).removeAttr(\"id\");\n $list.append($item);\n $item.show('slow');\n checkItems($list);\n updateDocument();\n\n}", "function createDoc(callback) {\n var connection = backend.connect();\n var doc = connection.get('examples', 'richtext');\n doc.fetch(function(err) {\n if (err) throw err;\n if (doc.type === null) {\n doc.create([{insert: ''}], 'rich-text', callback);\n return;\n }\n callback();\n });\n}", "function createTemplates(dataObject){\n\tvar templateNames = [\"hoverTip\", \"tip\"];\n\tvar tiplate ;\n\t//var fragment = document.createDocumentFragment();\n\ttemplateNames.forEach(function (name) {\n\t\tvar tiplates = dataObject[\"tiplates\"];\n\t\ttiplate = tiplates[name];\n\t\tvar templateObj = document.createElement(\"template\");\n\t\ttemplateObj.id = name;\n\t\ttemplateObj.innerHTML = tiplate;\n\t\t\tdocument.body.appendChild(templateObj);\n\t})\n\n}", "function createMergedDocument(naming, template, fldr, obj, opt) {\n var name = findReplaceInString(naming, obj);\n var file = copyFileToFolder(template, fldr).setName(name);\n var doc = openFileAsType(file, \"document\");\n findReplaceInDoc(doc, obj);\n return file;\n}", "function generateApiSet(templateId) {\n return {\n create: function(options, callback) {\n\n options.data = Object(options.data);\n options.data._tp = [ObjectId(templateId)];\n\n CRUD.create({\n templateId: templateId,\n data: options.data,\n options: options.options,\n callback: callback\n });\n },\n read: function(options, callback) {\n CRUD.read({\n templateId: templateId,\n noJoins: options.noJoins,\n query: options.query,\n options: options.options,\n callback: callback\n });\n },\n update: function(options, callback) {\n CRUD.update({\n templateId: templateId,\n query: options.query,\n data: options.data,\n options: options.options,\n callback: callback\n });\n },\n delete: function(options, callback) {\n CRUD.delete({\n templateId: templateId,\n query: options.query,\n options: options.options,\n callback: callback\n });\n }\n };\n}", "function template(index,templateFn,consts,vars,tagName,attrs,localRefs,localRefExtractor){var lView=getLView();var tView=lView[TVIEW];// TODO: consider a separate node type for templates\nvar tNode=containerInternal(index,tagName||null,attrs||null);if(getFirstTemplatePass()){tNode.tViews=createTView(-1,templateFn,consts,vars,tView.directiveRegistry,tView.pipeRegistry,null);}createDirectivesAndLocals(tView,lView,localRefs,localRefExtractor);var currentQueries=lView[QUERIES];var previousOrParentTNode=getPreviousOrParentTNode();var _native18=getNativeByTNode(previousOrParentTNode,lView);attachPatchData(_native18,lView);if(currentQueries){lView[QUERIES]=currentQueries.addNode(previousOrParentTNode);}queueLifecycleHooks(tView,tNode);setIsParent(false);}", "function template(index, templateFn, consts, vars, tagName, attrs, localRefs, localRefExtractor) {\n var lView = getLView();\n var tView = lView[TVIEW];\n // TODO: consider a separate node type for templates\n var tNode = containerInternal(index, tagName || null, attrs || null);\n if (getFirstTemplatePass()) {\n tNode.tViews = createTView(-1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n createDirectivesAndLocals(tView, lView, localRefs, localRefExtractor);\n var currentQueries = lView[QUERIES];\n var previousOrParentTNode = getPreviousOrParentTNode();\n var native = getNativeByTNode(previousOrParentTNode, lView);\n attachPatchData(native, lView);\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, tNode);\n setIsParent(false);\n}", "function template(index, templateFn, consts, vars, tagName, attrs, localRefs, localRefExtractor) {\n var lView = getLView();\n var tView = lView[TVIEW];\n // TODO: consider a separate node type for templates\n var tNode = containerInternal(index, tagName || null, attrs || null);\n if (getFirstTemplatePass()) {\n tNode.tViews = createTView(-1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n createDirectivesAndLocals(tView, lView, localRefs, localRefExtractor);\n var currentQueries = lView[QUERIES];\n var previousOrParentTNode = getPreviousOrParentTNode();\n var native = getNativeByTNode(previousOrParentTNode, lView);\n attachPatchData(native, lView);\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, tNode);\n setIsParent(false);\n}", "async create(commit) {\n\n\t\tif (!this.changed) {\n\t\t\t// TODO should probably handle this better..\n\t\t\tconsole.warn(\"Update called but content hasn't changed\");\n\t\t}\n\n\t\tlet path = `${config.api}/directories/${this.path}/documents`\n\n\t\ttry {\n\t\t\tlet response = await fetch(path, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: store.state.auth.authHeader(),\n\t\t\t\tbody: JSON.stringify(commit.prepareJSON())\n\t\t\t});\n\n\t\t\treturn response;\n\t\t}\n\t\tcatch(err) {\n\t\t\tconsole.error(`There was a problem creating new document in ${this.path}, ${err}`);\n\t\t}\n\t}", "function PdfDocumentTemplate(){//\n}", "function addTableTemplate(type, template) {\n var init = initTemplateTable(type);\n var $toAdd = init.toAdd;\n var addFunc = init.addFunc;\n $toAdd[addFunc](template);\n}", "async function initializeTemplates() {\n // Fetch templates simultaneously\n const blockTemplateRequest = fetch(BLOCK_TEMPLATE);\n const sidebarItemTemplateRequest = fetch(SIDEBAR_ITEM_TEMPLATE);\n const chartBarTemplateRequest = fetch(CHART_BAR_TEMPLATE);\n const chartLineTemplateRequest = fetch(CHART_LINE_TEMPLATE);\n const chartMapTemplateRequest = fetch(CHART_MAP_TEMPLATE);\n const chartRankingTemplateRequest = fetch(CHART_RANKING_TEMPLATE);\n\n // Wait for content\n const blockTemplateContent = await (await blockTemplateRequest).text();\n const sidebarItemTemplateContent = await (\n await sidebarItemTemplateRequest\n ).text();\n const chartBarTemplateContent = await (await chartBarTemplateRequest).text();\n const chartLineTemplateContent = await (\n await chartLineTemplateRequest\n ).text();\n const chartMapTemplateContent = await (await chartMapTemplateRequest).text();\n const chartRankingTemplateContent = await (\n await chartRankingTemplateRequest\n ).text();\n\n // Build templates\n TEMPLATES.block = _.template(blockTemplateContent);\n TEMPLATES.sidebarItem = _.template(sidebarItemTemplateContent);\n TEMPLATES.chartBar = _.template(chartBarTemplateContent);\n TEMPLATES.chartLine = _.template(chartLineTemplateContent);\n TEMPLATES.chartMap = _.template(chartMapTemplateContent);\n TEMPLATES.chartRanking = _.template(chartRankingTemplateContent);\n}", "_createDocument(req, res, next) {\n const { documentId, change } = req.body\n this.engine.createDocument(documentId, change, function(err, version) {\n if (err) return next(err)\n res.json(version)\n })\n }", "function createDoc(resourceName, obj) {\n \tdelete obj._id; // Do not allow users to set ._id\n\n \tconst collection = getModel(resourceName);\n \tconst item = new collection(obj);\n\n \treturn item.save()\n \t.then(data => {\n\n \t\tconst resp = {\n \t\t\tdoc: data,\n \t\t\tmetadata: { modified: data.length}\n \t\t};\n\n \t\treturn resp;\n \t})\n \t.catch(err => {\n \t\tconsole.log(err);\n \t\tconsole.log(\"db.createDoc error\");\n \t});\n }", "function createTemplates(ul) {\n for (firstI=0; firstI<numberOfPages; firstI++) {\n for (secondI=0; secondI<10; secondI++){\n if (aNumber == numberOfStudents) {break;}\n newArray += ul[loopAll(aNumber,addToANumber())].outerHTML;\n }\n secondArray[firstI] = newArray;\n newArray = [];\n }\n}", "function Add_Doc_WithAutoID() {\n // Collection is the table or collection of\n cloudDB\n .collection(\"Students\")\n .add({\n // This is creating a new entry in the DB\n NameOfStd: nameV,\n RollNo: Number(rollV),\n Section: secV,\n Gender: genV,\n })\n .then(function (docRef) {\n console.log(\"Document writeen with ID\", docRef.id);\n })\n .catch(function (error) {\n console.eroor(\"Error adding document\", error);\n });\n}", "function applyTemplate() {\n return through.obj(function(file, enc, cb) {\n var data = {\n site: site,\n page: file.page,\n content: file.contents.toString()\n };\n\n var templateFile = path.join(\n __dirname, 'docs', '_templates', file.page.layout + '.html');\n var tpl = swig.compileFile(templateFile, {cache: false});\n file.contents = new Buffer(tpl(data), 'utf8');\n this.push(file);\n cb();\n });\n}", "static async addANewDocument (document) {\n if (typeof document !== 'object') {\n throw new Error('Bad Parameter');\n }\n\n // Retrieve instance of Mongo\n const db = await Mongo.instance().getDb();\n const isValid = await Document.isDocument(document);\n if (isValid.valid) {\n // Create a new document\n return db.collection(Document.COLLECTION).insertOne({\n ...document,\n createdAt: moment().toDate(),\n updatedAt: moment().toDate()\n });\n } else {\n log.debug('Warning - couldn\\'t insert document \\n', document);\n return null;\n }\n }", "function insertNodeIntoTemplate(e,t,n=null){const{element:{content:a},parts:r}=e;// If there's no refNode, then put node at end of template.\n// No part indices need to be shifted in this case.\nif(null===n||void 0===n)return void a.appendChild(t);const s=document.createTreeWalker(a,walkerNodeFilter,null,!1);let o=nextActiveIndexInTemplateParts(r),i=0,d=-1;for(;s.nextNode();){d++;const e=s.currentNode;for(e===n&&(i=countNodes(t),n.parentNode.insertBefore(t,n));-1!==o&&r[o].index===d;){// If we've inserted the node, simply adjust all subsequent parts\nif(0<i){for(;-1!==o;)r[o].index+=i,o=nextActiveIndexInTemplateParts(r,o);return}o=nextActiveIndexInTemplateParts(r,o)}}}/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */ // Get a key to lookup in `templateCaches`.", "function Template(style, fields) {\n if (!~STYLES.indexOf(style))\n throw new Error(\"Unsupported passbook style \" + style);\n this.style = style;\n this.fields = cloneObject(fields);\n this.keysPath = \"keys\";\n}", "function addTemplateInput(sectionOption, templateOptions, mayRepeat) {\n var objectKey;\n var templateSelectElem;\n var optionElem;\n var templateTitleInputElem;\n var templateNumber = 0; // how many of these is the user trying to create\n var spanForDelete = null;\n var divForInput = $(document.createElement(\"div\"));\n\n if (mayRepeat) {\n // multiple fields allowed, so count the number of existing ones; web service seems to expect the provided\n // values to be zero indexed, so we do not add one\n templateNumber = $(\".inputTemplateType\").length;\n if (templateNumber > 0) {\n spanForDelete = $(document.createElement(\"span\"));\n spanForDelete.html(\"<img src='/rsuite-cms/plugin/@pluginId@/cmsui/images/16/delete.png' title='Delete' alt='Delete' />\");\n spanForDelete.attr(\"onclick\", instantiatedHandlerName + \".removeTemplateInputRow('template\" + templateNumber + \"')\");\n spanForDelete.css(\"cursor\", \"pointer\");\n }\n }\n\n divForInput.attr(\"id\", \"template\" + templateNumber);\n divForInput.attr(\"class\", \"template\");\n\n if (templateOptions !== undefined && templateOptions !== null) {\n // templateOptions looks good, so we are likely doing this from the section's initialization\n\n // Create the select element\n templateSelectElem = $(document.createElement(\"select\"));\n // Create the input element for the new section's title\n templateTitleInputElem = $(document.createElement(\"input\"));\n templateTitleInputElem.attr(\"class\", \"inputTemplateType\");\n templateTitleInputElem.attr(\"name\", \"title[\" + templateNumber + \"]\");\n\n // Not sure why we have to do this, for some reason the templateOptions object has a default 0 key with all added\n // ones as parameter; this same technique works in the NBE code base without issue; some weird Ember object prototype\n // extension? Would be supremely weird\n templateOptions = templateOptions[\"0\"];\n\n // Further setup the select dropdown\n templateSelectElem.attr(\"class\", \"selectTemplateType\");\n templateSelectElem.attr(\"name\", \"templateId[\" + templateNumber + \"]\");\n\n // Create the options for the select element\n for (objectKey in templateOptions) {\n if (templateOptions.hasOwnProperty(objectKey)) {\n optionElem = $(document.createElement(\"option\"));\n optionElem.val(objectKey);\n optionElem.html(templateOptions[objectKey]);\n templateSelectElem.append(optionElem);\n }\n }\n } else {\n // templateOptions null or undefined; meaning user had to have clicked the icon to add another of the same section type\n templateSelectElem = $(\".selectTemplateType\").first().clone();\n templateSelectElem.attr(\"name\", \"templateId[\" + templateNumber + \"]\");\n templateTitleInputElem = $(\".inputTemplateType\").first().clone();\n templateTitleInputElem.attr(\"name\", \"title[\" + templateNumber + \"]\");\n }\n\n // Stitch the HTML together\n divForInput.append(\"<div style='margin-top:20px;'><strong>Template</strong> \" + templateSelectElem.prop(\"outerHTML\") + \"</div>\");\n divForInput.append(\"<div><strong>Title</strong> \" + templateTitleInputElem.prop(\"outerHTML\"));\n\n if (spanForDelete !== null) {\n divForInput.append(spanForDelete.prop(\"outerHTML\"));\n }\n\n divForInput.append(\"</div>\");\n\n // Insert the html into the form\n $(\"#createProductTemplateHolder\").append(divForInput.prop(\"outerHTML\"));\n \n // Scroll to the bottom of the div containing these fields. Using a dynamic value like \n // $(\"div.fieldset\").innerHeight() worked for a while but then gave out. If someone \n // goes beyond 10,000, they need something better to do :)\n $(\"div.fieldset\").scrollTop(10000);\n }", "static postTemplate(req, res) {\n let type = req.params.type;\n let id = req.params.id;\n let template = req.body;\n\n ConnectionHelper.getTemplateProvider(req.project, req.environment)\n .then((connection) => {\n if(!connection) { return Promise.reject(new Error('No template provider found')); }\n \n return connection.setTemplateById(type, id, template);\n })\n .then(() => {\n res.status(200).send('OK');\n })\n .catch((e) => {\n res.status(404).send(ApiController.printError(e, false));\n }); \n }", "configureTemplates() {\n var templateHeader = this.el.querySelector('template[header]');\n var templateItem = this.el.querySelector('template[item]');\n var noTemplates = !templateItem && !templateHeader;\n\n // If no exact templates found, use unlabeled <template> for item\n if (noTemplates) templateItem = this.el.querySelector('template');\n\n if (templateHeader) {\n this.templateHeader = templateHeader.innerHTML;\n templateHeader.remove();\n }\n\n if (templateItem) {\n this.templateItem = templateItem.innerHTML;\n templateItem.remove();\n }\n }", "function docInterface(doc, path, request) {\n\treturn {\n\t\tdesc: doc,\n\t\tpath: path,\n\t\trenderDoc: function() {\n\t\t\tvar templateName = doc._template || request.path.slice(1).replace(/\\//g, '_');\n\t\t\tvar template = require('templates/' + templateName + '.html') || '<h2>Error</h2><p>Template not found at <code>templates/'+templateName+'.html</code></p>';\n\t\t\ttemplate = template.replace(/\\{\\{domain\\}\\}/g, config.domain);\n\t\t\ttemplate = template.replace(/\\{\\{sidenav\\}\\}/g, renderSidenav());\n\t\t\tif (doc._template_vars) {\n\t\t\t\tfor (var k in doc._template_vars) {\n\t\t\t\t\tvar v = doc._template_vars[k];\n\t\t\t\t\ttemplate = template.replace(RegExp('{{'+k+'}}', 'g'), v);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn template;\n\t\t}\n\t};\n}", "function loadTemplatesCrud() {\n plugin.loadTemplates(self.settings().templates, true);\n // more templates can be provided in the page controller settings\n var settingsMethod = self.settings().controller.settings;\n if(settingsMethod) {\n plugin.loadTemplates(settingsMethod().templates, true);\n }\n }", "function createDoc(callback) {\n var connection = backend.connect();\n var doc = connection.get('examples', 'counter');\n doc.fetch(function(err) {\n if (err) throw err;\n if (doc.type === null) {\n doc.create({numClicks: 0}, json1.type.uri, callback);\n return;\n }\n callback();\n });\n}", "function createDocumentForHtml(html, images) {\n var name = DocumentApp.getActiveDocument().getName()+\".html\";\n var newDoc = DocumentApp.create(name);\n newDoc.getBody().setText(html);\n for(var j=0; j < images.length; j++)\n newDoc.getBody().appendImage(images[j].blob);\n newDoc.saveAndClose();\n}", "function genTemplates() {\n console.log(\"Generating client-side jade javascript functions.\");\n let templatePath = path.normalize(path.join(__dirname.substr(0, __dirname.lastIndexOf(path.sep)), 'views', 'app-search-entry.pug'));\n fs.readFile(templatePath, \"ASCII\", function (err, data) {\n console.log(\"Generating client-side search entry templates.\");\n if (err !== null) console.log(\"Error from file read:\", err);\n else searchFn = jade.compileClient(data, null);\n });\n templatePath = path.normalize(path.join(__dirname.substr(0, __dirname.lastIndexOf(path.sep)), 'views', 'app-sidebar-entry.pug'));\n fs.readFile(templatePath, \"ASCII\", function (err, data) {\n console.log(\"Generating client-side sidebar entry templates.\");\n if (err !== null) console.log(\"Error from file read:\", err);\n else sidebarFn = jade.compileClient(data, null);\n });\n templatePath = path.normalize(path.join(__dirname.substr(0, __dirname.lastIndexOf(path.sep)), 'views', 'app-profile-owned-entry.pug'));\n fs.readFile(templatePath, \"ASCII\", function (err, data) {\n console.log(\"Generating client-side sidebar entry templates.\");\n if (err !== null) console.log(\"Error from file read:\", err);\n else profileOwnedFn = jade.compileClient(data, null);\n });\n templatePath = path.normalize(path.join(__dirname.substr(0, __dirname.lastIndexOf(path.sep)), 'views', 'app-profile-subscribed-entry.pug'));\n fs.readFile(templatePath, \"ASCII\", function (err, data) {\n console.log(\"Generating client-side sidebar entry templates.\");\n if (err !== null) console.log(\"Error from file read:\", err);\n else profileSubscribedFn = jade.compileClient(data, null);\n });\n}", "function createDocument(req, res, next) {\n const Token = _getToken(req, res)\n Token\n .then((token) => {\n const params = {\n method: 'set_entry',\n custom: false,\n rest_data: {\n session: token,\n modulo: 'Documents',\n data: [\n {\n name: 'document_name',\n value: req.params.filename,\n },\n {\n name: 'revision',\n value: 1,\n },\n ],\n },\n }\n\n _requestCRM(params)\n .then((result)=>{\n res.end(result.id)\n })\n .catch((e) => {\n logger.error('Controller::DefensaConsumidor::createDocument::_RequestCRM::Catch')\n next(APIError({ status: 500, devMessage: e.message, }))\n })\n })\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n var lView = getLView();\n var tView = getTView();\n var adjustedIndex = index + HEADER_OFFSET;\n var tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) : tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n var comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n }", "function TemplateOperations() {\n this.deploymentTemplate = path.normalize(fileDir + '\\\\' + deploymentTemplate);\n}", "function projectTemplate(){\n importInDoc('11zdES1xBa8l765h0vqJtJlRZgM5dshofg1trHUj7eXE');\n}", "static addView(options = {}) {\n new SimpleSchema({\n identifier: { type: String },\n sourceCollection: { type: Mongo.Collection },\n viewCollection: { type: Mongo.Collection },\n filter: { type: Function, blackbox: true, optional: true },\n postHook: { type: Function, blackbox: true, optional: true },\n pick: { type: [String], optional: true },\n postSync: { type: Object, blackbox: true, optional: true },\n sync: { type: Object, blackbox: true },\n }).validate(options)\n\n const { identifier, sourceCollection, viewCollection, sync } = options\n\n // Validate options\n // validate that identifier is NOT yet registered\n if (_.contains(_.pluck(SyncronisationStore, 'identifier'), identifier)) {\n throw new Meteor.Error(`${ERROR_IDENTIFIERT_EXISTS}: ${identifier}`)\n }\n // validate that collections are NOT the same\n if (sourceCollection===viewCollection) {\n throw new Meteor.Error(ERROR_SOURCE_AND_TARGET_COLLECTIONS_NEED_TO_BE_DIFFERENT)\n }\n if (_.isEmpty(sync)) {\n throw new Meteor.Error(ERROR_SYNC_NEEDS_TO_HAVE_CONTENT)\n }\n if (_.find(SyncronisationStore,\n store => (store.sourceCollection===sourceCollection\n && store.viewCollection===viewCollection))) {\n throw new Meteor.Error(ERROR_SYNC_ALREADY_EXISTS_FOR_SOURCE_TARGET_COLLECTIONS)\n }\n // is valid? Register it\n debug(`addView from sourceCollection \"${sourceCollection._name}\" to \"${viewCollection._name}\"`)\n SyncronisationStore.push(options)\n\n // register hooks to sourceCollection\n // those hooks wil sync to viewCollection\n sourceCollection.after.insert(function (userId, doc) { // eslint-disable-line prefer-arrow-callback\n debug(`${sourceCollection._name}.after.insert`)\n // Filter?\n if (DenormalizedViews._isDocValidToBeProcessed({ doc, userId, syncronisation: options })) {\n // fix for insert-hook\n // doc._id = doc._id.insertedIds[0]\n const processedDoc = DenormalizedViews._processDoc({\n doc,\n userId,\n syncronisation: options,\n })\n DenormalizedViews._executeDatabaseComand(() => {\n debug(`inserting doc with id ${processedDoc._id}`)\n viewCollection.insert(processedDoc)\n })\n DenormalizedViews._callPostHookIfExists({ doc, userId, postHook: options.postHook })\n } else {\n // filter OUT doc, if it exists\n DenormalizedViews._removeDocFromViewCollectionIfExists({ doc, viewCollection: options.viewCollection })\n }\n })\n\n sourceCollection.after.update(function (userId, doc) { // eslint-disable-line prefer-arrow-callback\n debug(`${sourceCollection._name}.after.update`)\n // Filter?\n if (DenormalizedViews._isDocValidToBeProcessed({ doc, userId, syncronisation: options })) {\n const processedDoc = DenormalizedViews._processDoc({\n doc,\n userId,\n syncronisation: options,\n })\n DenormalizedViews._executeDatabaseComand(() => {\n debug(`updating doc with id ${processedDoc._id}`)\n viewCollection.update(processedDoc._id, { $set: processedDoc }, {\n upsert: true, // important: it might be that doc has passed the filter AFTER an update\n // and did NOT exist yet in \"view\"-collection, p.e. because on \"insert\"\n // it did NOT pass the filter. So let's upsert\n })\n })\n DenormalizedViews._callPostHookIfExists({ doc, userId, postHook: options.postHook })\n } else {\n // filter OUT doc, if it exists\n DenormalizedViews._removeDocFromViewCollectionIfExists({ doc, viewCollection: options.viewCollection })\n }\n })\n\n sourceCollection.after.remove(function (userId, doc) { // eslint-disable-line prefer-arrow-callback\n debug(`${sourceCollection._name}.after.remove`)\n DenormalizedViews._executeDatabaseComand(() => {\n debug(`removing doc with id ${doc._id}`)\n viewCollection.remove(doc._id)\n })\n DenormalizedViews._callPostHookIfExists({ doc, userId, postHook: options.postHook })\n })\n }", "function setupDocument(docname, docver, docstage, docrev, docdate, tcfullname, tcshortname, dociprmode) {\n tcshortname = tcshortname.toLowerCase();\n setupFrontMatter(docname, docver, docstage, docrev, docdate, tcfullname, tcshortname);\n setupStatusSection(tcfullname, tcshortname);\n setupIPR(tcshortname, dociprmode);\n setupCitation(docname, docver, docstage, docrev, tcshortname);\n resetFooter();\n setupFooter(docname, docver, docstage, docrev, docdate);\n}", "Template(templateData) {\n\t\tthis.utils.logger.debug({description: 'Template Action called.', templateData: templateData, template: new Template(templateData), func: 'Template', obj: 'Grout'});\n\t\treturn new Template(templateData);\n\t}", "add(doc){const idx=this.size();if(isString(doc)){this._addString(doc,idx);}else {this._addObject(doc,idx);}}", "createdCallback () {\n this._template = document.createElement('template');\n this._template.innerHTML = tmpl;\n }", "_save(fullyTemplates, callback) {\n const data = {}\n data[this.STORAGE_KEY_TEMPLATE] = fullyTemplates\n\n this.set(data, callback)\n }", "createTemplate(templateString) {\n const template = document.createElement('template');\n template.innerHTML = templateString;\n\n return template;\n }", "async addContent(name, contentText) {\n //TODO\n allWords = await this.words(contentText);\n docCount++;\n await db.collection(docContent_table).insertOne(\n {_id: docCount,docN: name, content: contentText}\n );\n for(let [word,offsets] of allWords){\n await db.collection(docs_table).updateOne(\n {_id: {word, name}},\n {\n $inc: {score: 1},\n $setOnInsert: {\n words: word,\n docs: name,\n offset: offsets\n }\n },\n {upsert: true}\n );\n }\n }", "function ɵɵtemplate(index, templateFn, consts, vars, tagName, attrs, localRefs, localRefExtractor) {\n var lView = getLView();\n var tView = lView[TVIEW];\n // TODO: consider a separate node type for templates\n var tContainerNode = containerInternal(index, tagName || null, attrs || null);\n if (tView.firstTemplatePass) {\n tContainerNode.tViews = createTView(-1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null, null);\n }\n createDirectivesAndLocals(tView, lView, localRefs, localRefExtractor);\n addTContainerToQueries(lView, tContainerNode);\n attachPatchData(getNativeByTNode(tContainerNode, lView), lView);\n registerPostOrderHooks(tView, tContainerNode);\n setIsNotParent();\n}", "loadTemplates(templates) {\n if (!this.#isInit) {\n for (let i = 0; i < templates.length; i++) {\n if (templates[i].type.toLowerCase().trim() === 'profile box') {\n if (templates[i].group.toLowerCase().trim() === 'research note box') {\n let researchNote = {\n name: \"\",\n status: \"\",\n };\n researchNote.name = templates[i].name.toLowerCase().trim();\n researchNote.status = templates[i].status.toLowerCase().trim();\n this.#rnb.push(researchNote);\n }\n }\n if (templates[i].type.toLowerCase().trim() === 'navigation profile box') {\n this.#navBox.push(templates[i].name.toLowerCase().trim());\n }\n if (templates[i].type.toLowerCase().trim() === 'project box') {\n this.#projectBox.push(templates[i].name.toLowerCase().trim());\n }\n if (templates[i].type.toLowerCase().trim() === 'sticker') {\n this.#sticker.push(templates[i].name.toLowerCase().trim());\n }\n }\n this.#isInit = true;\n }\n }", "function insertDesignDocs(db){\n db.insert({language: \"javascript\", views: remitters}, \"_design/remitters\", function(err, body, header){\n if (err) {\n console.log('[_design/remitters.insert] ', err.message);\n return;\n }\n console.log(\"[INF]\", 'inserted _design/remitters')\n console.log(body);\n });\n \n db.insert({language: \"javascript\", views: merchants}, \"_design/merchants\", function(err, body, header){\n if (err) {\n console.log('[_design/merchants.insert] ', err.message);\n return;\n }\n console.log(\"[INF]\", 'inserted _design/merchants')\n console.log(body);\n });\n\n db.insert({language: \"javascript\", views: invoices}, \"_design/invoices\", function(err, body, header){\n if (err) {\n console.log('[_design/invoices.insert] ', err.message);\n return;\n }\n console.log(\"[INF]\", 'inserted _design/invoices')\n console.log(body);\n });\n}", "function create(textDocument, edits) {\n return {\n textDocument: textDocument,\n edits: edits\n };\n }", "function create(textDocument, edits) {\n return {\n textDocument: textDocument,\n edits: edits\n };\n }", "function create(textDocument, edits) {\n return {\n textDocument: textDocument,\n edits: edits\n };\n }", "function AddNewPageToDoc(name,doc){\n var tempPage = MSPage.new();\n doc.addPage(tempPage);\n tempPage.setName(name);\n}", "async function generateWordDocument(event) {\n event.preventDefault();\n \n // Create a new instance of Document for the docx module\n let doc = new docx.Document();\n \n // Word file的內容\n doc.addSection({\n properties: {},\n children: [\n new docx.Paragraph({\n children: [\n new docx.TextRun({\n text: \"Building Inspection Report\",\n bold: true,\n }),\n new docx.TextRun({\n text: \"\\n\\tClient:\\tTecky Properties Deveopment Limited\",\n text: \"\\n\\tProperty Name:\\tThe Carmel\",\n text: \"\\n\\tProperty Location:\\t 168 Castle Peak Road (Tai Lam), Tai Lam\",\n }),\n ],\n }),\n ],\n });\n\n // doc.addSection({\n // children: [\n // new docx.Paragraph({\n // children: [\n // new TextRun(\"Hello World\")\n // ],\n // }),\n // ],\n // });\n\n\n // Call saveDocumentToFile with the document instance and a filename\n await saveDocumentToFile(doc, \"New Document - Project2.docx\");\n}", "function templateEngine () { }", "create({ body }, res) {\n console.log(`${dateFormat(null, \"isoUtcDateTime\")} - REQUEST create`);\n\n if (!validateNote(body)) {\n res.sendStatus(400);\n return;\n }\n\n body.id = uuidv1();\n body._id = uuidv1();\n body.tags = []\n .concat(getTagsInText(body.title))\n .concat(getTagsInText(body.description));\n\n db.collection(\"notes\").save(body, (err, result) => {\n if (err) {\n return console.log(err);\n }\n res.sendStatus(204);\n\n db\n .collection(\"notes\")\n .find()\n .toArray(function(err, results) {\n broadcast(results);\n });\n });\n }", "function createFormTemplate( itcb ) {\n // if no form to look up then we can skip this step\n\n formOptions.callback = onFormTemplateCreated;\n Y.dcforms.createTemplate( formOptions );\n\n function onFormTemplateCreated( err, newFormTemplate ) {\n if ( !err && !newFormTemplate ) { err = 'Could not create form template'; }\n if ( err ) { return itcb( err ); }\n\n template = newFormTemplate;\n template.highlightEditable = false;\n template.fromDict( editTemplate.toDict() );\n template.mode = 'locked';\n itcb( null );\n }\n }", "function insertNodeIntoTemplate(template,node,refNode=null){const{element:{content},parts}=template;// If there's no refNode, then put node at end of template.\n// No part indices need to be shifted in this case.\nif(refNode===null||refNode===undefined){content.appendChild(node);return;}const walker=document.createTreeWalker(content,walkerNodeFilter,null,false);let partIndex=nextActiveIndexInTemplateParts(parts);let insertCount=0;let walkerIndex=-1;while(walker.nextNode()){walkerIndex++;const walkerNode=walker.currentNode;if(walkerNode===refNode){insertCount=countNodes(node);refNode.parentNode.insertBefore(node,refNode);}while(partIndex!==-1&&parts[partIndex].index===walkerIndex){// If we've inserted the node, simply adjust all subsequent parts\nif(insertCount>0){while(partIndex!==-1){parts[partIndex].index+=insertCount;partIndex=nextActiveIndexInTemplateParts(parts,partIndex);}return;}partIndex=nextActiveIndexInTemplateParts(parts,partIndex);}}}", "async addDocuments(documents) {\n const typesenseDocuments = this._documentsToTypesenseRecords(documents, await this.embeddings.embedDocuments(documents.map((doc) => doc.pageContent)));\n await this.import(typesenseDocuments, this.schemaName);\n }", "function insertNodeIntoTemplate(template,node,refNode=null){const{element:{content},parts}=template;// If there's no refNode, then put node at end of template.\n// No part indices need to be shifted in this case.\nif(null===refNode||refNode===void 0){content.appendChild(node);return}const walker=document.createTreeWalker(content,walkerNodeFilter,null,!1);let partIndex=nextActiveIndexInTemplateParts(parts),insertCount=0,walkerIndex=-1;while(walker.nextNode()){walkerIndex++;const walkerNode=walker.currentNode;if(walkerNode===refNode){insertCount=countNodes(node);refNode.parentNode.insertBefore(node,refNode)}while(-1!==partIndex&&parts[partIndex].index===walkerIndex){// If we've inserted the node, simply adjust all subsequent parts\nif(0<insertCount){while(-1!==partIndex){parts[partIndex].index+=insertCount;partIndex=nextActiveIndexInTemplateParts(parts,partIndex)}return}partIndex=nextActiveIndexInTemplateParts(parts,partIndex)}}}", "function saveDocuments(objects, otherParams, callback){\n var obj = {};\n var pwd = crypto.randomBytes(32).toString('base64'); // password for comm server credentials\n var infra_id = objects[\"infrastructure-id\"];\n delete objects[\"infrastructure-id\"]; // remove infrastructure-id, no need to pass it further\n if(!otherParams.semanticValidation && objects.hasOwnProperty(\"adapter-id\")){delete objects[\"adapter-id\"];} // Unnecessary if no semantic validation\n\n // Create one item document\n obj.typeOfItem = findType(objects.type, otherParams.types); // Use collection of semanticTypes to find if service/device/unknown\n // Adding important fields for Vicinity\n obj.adid = {'id': otherParams.nodeId, 'extid': otherParams.adid, 'type': otherParams.adapterType, 'name': otherParams.nodeName};\n obj.name = objects.name; // Name in commServer\n obj.cid = otherParams.cid; // CID, obtained from mongo\n obj.accessLevel = 0; // private by default\n obj.avatar = config.avatarItem; // Default avatar provided by VCNT\n obj.infrastructureId = infra_id; // Need to map with agent\n obj.status = 'disabled';\n if(!objects.credentials && !objects.oid){ // Create a new instance in Mongo\n oidExist(uuid()) // Username in commServer & semanticRepo\n .then(function(response){\n obj.oid = response;\n if(otherParams.semanticValidation){\n objects.oid = response;\n semanticValidation(objects, obj, pwd, infra_id, callback);\n } else {\n obj.info = objects;\n obj.info.oid = obj.oid;\n createInstance(obj, pwd, infra_id, callback);\n }\n }) // Register TD in semantic repository\n .catch(function(err){callback({\"infrastructure-id\": infra_id, error: err}, err); });\n } else { // if the TD contains an OID, then we need to update the instance in Mongo (not create a new one)\n callback({\"infrastructure-id\": infra_id, error: \"Your TD contained an OID, please consider update service instead\"}, \"Update service disabled, you cannot register TDs with OID\");\n }\n}", "async insertDoc(document) {\n let collection = await this.collection()\n\n await collection.insertOne(document)\n\n }", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "constructor(templateInfo){\n\t\tthis.templateInfo = templateInfo;\n\t}", "function loadTemplates(){\n let template = loadJSON(\"template\");\n template.getTemplate = function (name) {\n return getTemplate(this,name);\n };\n return template;\n }", "function makeNewClass() {\n var name = document.getElementById(\"classInput\").value;\n var day = document.getElementById(\"dayInput\").value;\n var sHr = document.getElementById(\"startTimeHrInput\").value;\n var sMin = document.getElementById(\"startTimeMinInput\").value;\n\n var eMin = document.getElementById(\"endTimeMinInput\").value;\n var eHr = document.getElementById(\"endTimeHrInput\").value;\n\n var location = document.getElementById(\"locationInput\").value;\n var teacher = document.getElementById(\"teacherInput\").value;\n var type = document.getElementById(\"typeInput\").value;\n\n // Add a new document with a generated id.\n db.collection(\"Classes\").add({\n name: name,\n day: day,\n startDateHr: sHr,\n startDateMin: sMin,\n endDateHr: eHr,\n endDateMin: eMin,\n location: location,\n type: type,\n teacher: teacher\n })\n .then((docRef) => {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch((error) => {\n console.error(\"Error adding document: \", error);\n alert(\"Error adding document: \", error);\n });\n\n resetForm();\n}", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "function create(textDocument, edits) {\r\n return { textDocument: textDocument, edits: edits };\r\n }", "function storeTemplate(db) {\n db.set({\n cams: {\n cam1: {shot: 0, status: 0, changedAt: Date.now()},\n cam2: {shot: 0, status: 0, changedAt: Date.now()},\n cam3: {shot: 0, status: 0, changedAt: Date.now()}\n }\n });\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {\n const lView = getLView();\n const tView = getTView();\n const adjustedIndex = index + HEADER_OFFSET;\n const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :\n tView.data[adjustedIndex];\n setCurrentTNode(tNode, false);\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n appendChild(tView, lView, comment, tNode);\n attachPatchData(comment, lView);\n addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));\n if (isDirectiveHost(tNode)) {\n createDirectivesInstances(tView, lView, tNode);\n }\n if (localRefsIndex != null) {\n saveResolvedLocalsInData(lView, tNode, localRefExtractor);\n }\n}", "function createTemplate(style, fields) {\n return new Template(style, fields);\n}", "function addQuestionsFromDB() {\n questions.forEach(question => {\n addNewTemplate(question[\"ID\"]);\n populateQuestionTemplate(question[\"ID\"], question);\n });\n\n // after all questions from database have been added, update current question ID and add a new template \n questionId = questions[questions.length - 1][\"ID\"] + 1;\n addNewTemplate(questionId);\n}", "function addTemplateToDB(data, key, objectStore) {\n var request = window.indexedDB.open('formsAdministrationDB', 1);\n var data1;\n var formhtml;\n request.onsuccess = function (event) {\n var db = event.target.result;\n var tx = db.transaction(\"administratorTemplate\", 'readwrite');\n var store = tx.objectStore(\"administratorTemplate\");\n data1 = store.get(key);\n data1.onsuccess = function (event) {\n\n store.put(data, key);\n \n }\n\n\n\n\n };\n\n}", "function fromTemplate(template_name,data) {\n template_name = template_name.match(/[^\\/].+[^\\/]/)[0].replace(/\\//g,\"-\");\n riot.compile(\n uR.static(\"templates/\"+template_name+\".html\"),\n function(html) { uR.mountElement(template_name,data); }\n );\n }", "function loadTemplate() {\n if ($.isEmptyObject(oTemplate) === true) {\n oTemplate = $('.template').clone();\n }\n }", "function insert_doc(doc) {\n\tif (cloudant) {\n\t\tlogger.info(\"insert_doc() doc.id_str:\", doc.id_str);\n\t db.insert(doc, function (error, http_body, http_headers) {\n\t if(error) return logger.error(error);\n\t });\n // logger.debug(\"insert_doc() http_body:\", http_body);\n\t\t}\n}", "function registerTemplate(node, itemName, collection, template) {\n var mainFrag;\n if (typeof collection === 'object') {\n if (Object.prototype.toString.call(collection) === '[object Array]') {\n // it is an array\n mainFrag = document.createDocumentFragment();\n collection.forEach(function (item) {\n // item could be an object or just a property like a\n // string (in case of it is direct a list of strings)\n template.forEach(function (childTpl) {\n // TODO works also with fragment but then the qunit test fails\n // - there is a problem with the phantomjs\n// var fragment = document.createDocumentFragment();\n var fragment = document.createElement('div');\n fragment.appendChild(childTpl.cloneNode(true));\n \n handleIfCondition(fragment, item, itemName);\n // if conditions can remove elements from clone - it's important that this is executed first\n if (fragment.children && fragment.children.length === 1) {\n handleRPBindAttribute(fragment, item, itemName);\n }\n // rp-bind attribute can also remove elements so need to check again if node exists\n if (fragment.children && fragment.children.length === 1) {\n handleEvents(fragment, item, itemName);\n handleAttributes(fragment, item, itemName);\n // replace texts:\n mainFrag.appendChild(compile(fragment.children[0], item, itemName));\n } else {\n // console.log('repeat:element has been removed from DOM');\n }\n });\n });\n node.appendChild(mainFrag);\n } else {\n // it is an object\n console.error('repeat detect object but object currently not supported');\n // what render? - property name or value? - Both?\n }\n } else {\n console.error('repeat:registerTemplate detect none acceptable data argument', collection);\n }\n }", "function createUntitledDocument(filename, counter, fileExt) {\n var fullfilename = filename + counter + fileExt,\n fullPath = DocumentManager._untitledDocumentPath + \"/\" + fullfilename,\n now = new Date(),\n file = new InMemoryFile(fullPath, FileSystem);\n\n FileSystem.addEntryForPathIfRequired(file, fullPath);\n\n return new DocumentManager.Document(file, now, \"\");\n }", "function create(textDocument, edits) {\n return { textDocument: textDocument, edits: edits };\n }", "postNewUser (){\n\n try{\n console.log(\"creating document\")\n const docRef = db.collection('Users').doc(`${this.firstName}${this.lastName}`);\n\n docRef.set({\n FirstName: this.firstName,\n LastName: this.lastName,\n Department: this.department,\n Submissions:[\n {\n mask: this.mask,\n travel: this.travel,\n travelUS: this.travelUS,\n fever: this.fever,\n cough: this.cough,\n shortBreath: this.shortBreath,\n cold: this.cold,\n weakness: this.weakness,\n soreThroat: this.soreThroat,\n smell: this.smell, \n date: this.date,\n work: this.work,\n workCOVID: this.workCOVID\n }\n ]\n });\n \n }catch(e){\n console.error(e)\n }\n \n console.log(\"New User \" + this.firstName + \" \" + this.lastName + \" created\")\n }" ]
[ "0.61595595", "0.6001832", "0.5951343", "0.59362054", "0.5834552", "0.58092976", "0.57732886", "0.57645494", "0.57587427", "0.57551444", "0.5728691", "0.5703054", "0.57015073", "0.5653954", "0.56371397", "0.5611637", "0.56008595", "0.5599949", "0.55592513", "0.5515634", "0.5508368", "0.54810005", "0.5459981", "0.54356146", "0.54301214", "0.54301214", "0.5407316", "0.5369183", "0.53226906", "0.5308438", "0.5296367", "0.5294467", "0.5270053", "0.5257893", "0.5248566", "0.52445364", "0.52429646", "0.5240332", "0.5225722", "0.5210592", "0.52023524", "0.5198859", "0.5191376", "0.51841396", "0.5180274", "0.51801026", "0.5174436", "0.5170751", "0.51699525", "0.51672405", "0.51628894", "0.5162196", "0.51550967", "0.51550126", "0.51550096", "0.51539636", "0.51531625", "0.5148343", "0.5147087", "0.514579", "0.51426667", "0.5119913", "0.5119913", "0.5119913", "0.5110638", "0.51074576", "0.51036566", "0.5103384", "0.51023495", "0.51019067", "0.50913775", "0.50860864", "0.5076604", "0.5074814", "0.50726765", "0.50726765", "0.5072159", "0.5071184", "0.50602007", "0.50570375", "0.50570375", "0.50570375", "0.50570375", "0.50543517", "0.5052854", "0.5052854", "0.5052854", "0.5052854", "0.5052854", "0.5052854", "0.50468045", "0.5042786", "0.5039725", "0.503198", "0.5031864", "0.50261194", "0.50255895", "0.5024029", "0.50224954", "0.5020076" ]
0.7559686
0
webpackBootstrap install a JSONP callback for chunk loading
function webpackJsonpCallback(data) { /******/ var chunkIds = data[0]; /******/ var moreModules = data[1]; /******/ /******/ /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) { /******/ resolves.push(installedChunks[chunkId][0]); /******/ } /******/ installedChunks[chunkId] = 0; /******/ } /******/ for(moduleId in moreModules) { /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { /******/ modules[moduleId] = moreModules[moduleId]; /******/ } /******/ } /******/ if(parentJsonpFunction) parentJsonpFunction(data); /******/ /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ /******/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/ \t\tvar prefetchChunks = data[3] || [];\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/ \t\t// chunk prefetching for javascript\n/******/ \t\tprefetchChunks.forEach(function(chunkId) {\n/******/ \t\t\tif(installedChunks[chunkId] === undefined) {\n/******/ \t\t\t\tinstalledChunks[chunkId] = null;\n/******/ \t\t\t\tvar link = document.createElement('link');\n/******/\n/******/ \t\t\t\tif (__webpack_require__.nc) {\n/******/ \t\t\t\t\tlink.setAttribute(\"nonce\", __webpack_require__.nc);\n/******/ \t\t\t\t}\n/******/ \t\t\t\tlink.rel = \"prefetch\";\n/******/ \t\t\t\tlink.as = \"script\";\n/******/ \t\t\t\tlink.href = jsonpScriptSrc(chunkId);\n/******/ \t\t\t\tdocument.head.appendChild(link);\n/******/ \t\t\t}\n/******/ \t\t});\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\t\tvar chunkIds = data[0];\n/******/ \t\t\tvar moreModules = data[1];\n/******/ \t\t\n/******/ \t\t\tvar runtime = data[3];\n/******/ \t\t\t// add \"moreModules\" to the modules object,\n/******/ \t\t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\t\tchunkId = chunkIds[i];\n/******/ \t\t\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t\t}\n/******/ \t\t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t\t}\n/******/ \t\t\tfor(moduleId in moreModules) {\n/******/ \t\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n/******/ \t\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t\tif(runtime) runtime(__webpack_require__);\n/******/ \t\t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/ \t\t\twhile(resolves.length) {\n/******/ \t\t\t\tresolves.shift()();\n/******/ \t\t\t}\n/******/ \t\t\n/******/ \t\t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}", "function webpackJsonpCallback(data) {\n/******/ \t\tvar chunkIds = data[0];\n/******/ \t\tvar moreModules = data[1];\n/******/ \t\tvar executeModules = data[2];\n/******/\n/******/ \t\t// add \"moreModules\" to the modules object,\n/******/ \t\t// then flag all \"chunkIds\" as loaded and fire callback\n/******/ \t\tvar moduleId, chunkId, i = 0, resolves = [];\n/******/ \t\tfor(;i < chunkIds.length; i++) {\n/******/ \t\t\tchunkId = chunkIds[i];\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n/******/ \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n/******/ \t\t\t}\n/******/ \t\t\tinstalledChunks[chunkId] = 0;\n/******/ \t\t}\n/******/ \t\tfor(moduleId in moreModules) {\n/******/ \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n/******/ \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n/******/\n/******/ \t\twhile(resolves.length) {\n/******/ \t\t\tresolves.shift()();\n/******/ \t\t}\n/******/\n/******/ \t\t// add entry modules from loaded chunk to deferred list\n/******/ \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n/******/\n/******/ \t\t// run deferred modules when all chunks ready\n/******/ \t\treturn checkDeferredModules();\n/******/ \t}" ]
[ "0.77749467", "0.7585046", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.7549729", "0.75380653", "0.75380653", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.74099153", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731", "0.7409731" ]
0.7522832
38
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. import Group from 'zrender/src/container/Group';
function makeStyleCoord(out, zr, zrX, zrY) { out[0] = zrX; out[1] = zrY; out[2] = out[0] / zr.getWidth(); // The ratio of left to width out[3] = out[1] / zr.getHeight(); // The ratio of top to height }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n return (\n <g className=\"chart-legend-group\"/>\n );\n }", "function Group(options) {\n // parent can be position(global level) or another group\n\n\n this.children = [];\n this.points = [];\n this.circles = [];\n\n this.state = {\n inAir: false\n };\n\n this.dPos = [0,0];\n this.velocity = [0,0];\n this.acceleration = [0,0];\n\n this.childrenAngle = 0;\n this.childrenSpin = 0;\n\n this.lines = {\n fromOrigin: false,\n //ctx.strokeStyle\n color: 'black',\n //ctx.lineWidth\n width: '5',\n\n connectEnds: true,\n };\n\n this.fill = {\n filled: false,\n //\n fillMode: 'object',\n };\n\n}", "function Group(/* null | group */)\n{\n this.internals = []; \t\t\t\t // a list of internal objects\n\tthis.transformationMarker = new Transformation(); // transformation marker\n\tthis.axes = [];\n\tGroup.count++;\n\tthis.name = \"Group\"+Group.count;\n\tthis.viewPoint = new Transformation();\n\tthis.vpd = 500;\n\t\n\tthis.initializeAxes();\n \n\t// not available yet\n\t//this.scenarioMarker = new Scenario(); // scenario marker\n\t\n\tif(arguments.length == 1 )\n\t{\n\t\tthis.internals = arguments[0].internals;\n\t\tthis.transformationMarker = arguments[0].transformationMarker;\n\t\tthis.axes = arguments[0].axes;\n\t\tthis.name = arguments[0].name;\n\t\tthis.viewPoint = arguments[0].viewPoint;\n\t\tthis.vpd = arguments[0].vpd;\n\t}\n}", "addGroup() {\n this.mapping.groups.push({\n toPrefix: this.loaderPath ? this.loaderPath : null,\n properties: []\n });\n }", "get canvasElt(){\n return this.group; \n }", "componentDidMount() {\n const { data, options, layerOptions } = this.props;\n this.layer = this.plot.overlay_array(data, options, layerOptions);\n }", "function Group() {\n var group = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Group);\n\n if (!group.sketchObject) {\n // eslint-disable-next-line no-param-reassign\n group.sketchObject = _Factory__WEBPACK_IMPORTED_MODULE_4__[\"Factory\"].createNative(Group).alloc().initWithFrame(new _models_Rectangle__WEBPACK_IMPORTED_MODULE_2__[\"Rectangle\"](0, 0, 100, 100).asCGRect());\n }\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Group).call(this, group));\n } // @deprecated", "function RenderingGroup(index,scene,opaqueSortCompareFn,alphaTestSortCompareFn,transparentSortCompareFn){if(opaqueSortCompareFn===void 0){opaqueSortCompareFn=null;}if(alphaTestSortCompareFn===void 0){alphaTestSortCompareFn=null;}if(transparentSortCompareFn===void 0){transparentSortCompareFn=null;}this.index=index;this._opaqueSubMeshes=new BABYLON.SmartArray(256);this._transparentSubMeshes=new BABYLON.SmartArray(256);this._alphaTestSubMeshes=new BABYLON.SmartArray(256);this._particleSystems=new BABYLON.SmartArray(256);this._spriteManagers=new BABYLON.SmartArray(256);this._edgesRenderers=new BABYLON.SmartArray(16);this._scene=scene;this.opaqueSortCompareFn=opaqueSortCompareFn;this.alphaTestSortCompareFn=alphaTestSortCompareFn;this.transparentSortCompareFn=transparentSortCompareFn;}", "function Group(parent) {\n var _this = this;\n\n this.visualElement = sf.base.createElement('div', {\n className: 'e-cloneproperties e-dragclone e-gdclone',\n styles: 'line-height:23px',\n attrs: {\n action: 'grouping'\n }\n });\n\n this.helper = function (e) {\n var gObj = _this.parent;\n var target = e.sender.target;\n var element = target.classList.contains('e-groupheadercell') ? target : parentsUntil(target, 'e-groupheadercell');\n\n if (!element || !target.classList.contains('e-drag') && _this.parent.options.groupReordering) {\n return false;\n }\n\n _this.column = gObj.getColumnByField(element.firstElementChild.getAttribute('ej-mappingname'));\n _this.visualElement.textContent = element.textContent;\n _this.visualElement.style.width = element.offsetWidth + 2 + 'px';\n _this.visualElement.style.height = element.offsetHeight + 2 + 'px';\n\n _this.visualElement.setAttribute('e-mappinguid', _this.column.uid);\n\n gObj.element.appendChild(_this.visualElement);\n return _this.visualElement;\n };\n\n this.dragStart = function (e) {\n _this.parent.element.classList.add('e-ungroupdrag');\n\n document.body.classList.add('e-prevent-select');\n e.bindEvents(e.dragElement);\n };\n\n this.drag = function (e) {\n // if (this.groupSettings.allowReordering) {\n // this.animateDropper(e);\n // }\n var target = e.target;\n\n var cloneElement = _this.parent.element.querySelector('.e-cloneproperties'); // this.parent.trigger(events.columnDrag, { target: target, draggableType: 'headercell', column: this.column });\n\n\n if (!_this.parent.options.groupReordering) {\n sf.base.classList(cloneElement, ['e-defaultcur'], ['e-notallowedcur']);\n\n if (!(parentsUntil(target, 'e-gridcontent') || parentsUntil(target, 'e-headercell'))) {\n sf.base.classList(cloneElement, ['e-notallowedcur'], ['e-defaultcur']);\n }\n }\n };\n\n this.dragStop = function (e) {\n document.body.classList.remove('e-prevent-select');\n\n _this.parent.element.classList.remove('e-ungroupdrag');\n\n var preventDrop = !(parentsUntil(e.target, 'e-gridcontent') || parentsUntil(e.target, 'e-gridheader')); // if (this.groupSettings.allowReordering && preventDrop) { //TODO: reordering\n // remove(e.helper);\n // if (parentsUntil(e.target, 'e-groupdroparea')) {\n // this.rearrangeGroup(e);\n // } else if (!(parentsUntil(e.target, 'e-grid'))) {\n // let field: string = this.parent.getColumnByUid(e.helper.getAttribute('e-mappinguid')).field;\n // if (this.groupSettings.columns.indexOf(field) !== -1) {\n // this.ungroupColumn(field);\n // }\n // }\n // return;\n // } else\n\n if (preventDrop) {\n sf.base.remove(e.helper);\n return;\n }\n }; //TODO: reordering\n // private animateDropper: Function = (e: { target: HTMLElement, event: MouseEventArgs, helper: Element }) => {\n // let uid: string = this.parent.element.querySelector('.e-cloneproperties').getAttribute('e-mappinguid');\n // let dragField: string = this.parent.getColumnByUid(uid).field;\n // let parent: Element = parentsUntil(e.target, 'e-groupdroparea');\n // let dropTarget: Element = parentsUntil(e.target, 'e-group-animator');\n // // tslint:disable-next-line\n // let grouped: string[] = [].slice.call(this.element.querySelectorAll('.e-groupheadercell'))\n // .map((e: Element) => e.querySelector('div').getAttribute('ej-mappingname'));\n // let cols: string[] = JSON.parse(JSON.stringify(grouped));\n // if (dropTarget || parent) {\n // if (dropTarget) {\n // let dropField: string = dropTarget.querySelector('div[ej-mappingname]').getAttribute('ej-mappingname');\n // let dropIndex: number = +(dropTarget.getAttribute('index'));\n // if (dropField !== dragField) {\n // let dragIndex: number = cols.indexOf(dragField);\n // if (dragIndex !== -1) {\n // cols.splice(dragIndex, 1);\n // }\n // let flag: boolean = dropIndex !== -1 && dragIndex === dropIndex;\n // cols.splice(dropIndex + (flag ? 1 : 0), 0, dragField);\n // }\n // } else if (parent && cols.indexOf(dragField) === -1) {\n // cols.push(dragField);\n // }\n // this.element.innerHTML = '';\n // if (cols.length && !this.element.classList.contains('e-grouped')) {\n // this.element.classList.add('e-grouped');\n // }\n // this.reorderingColumns = cols;\n // for (let c: number = 0; c < cols.length; c++) {\n // this.addColToGroupDrop(cols[c]);\n // }\n // } else {\n // this.addLabel();\n // this.removeColFromGroupDrop(dragField);\n // }\n // }\n // private rearrangeGroup(e: { target: HTMLElement, event: MouseEventArgs, helper: Element }): void {\n // this.sortRequired = false;\n // this.updateModel();\n // }\n\n\n this.preventTouchOnWindow = function (e) {\n e.preventDefault();\n };\n\n this.drop = function (e) {\n var gObj = _this.parent;\n var column = gObj.getColumnByUid(e.droppedElement.getAttribute('e-mappinguid'));\n gObj.element.querySelector('.e-groupdroparea').classList.remove('e-hover');\n sf.base.remove(e.droppedElement);\n\n if (gObj.options.allowGrouping) {\n sf.base.EventHandler.remove(window, 'touchmove', _this.preventTouchOnWindow);\n }\n\n _this.parent.element.querySelector('.e-groupdroparea').removeAttribute(\"aria-dropeffect\");\n\n _this.parent.element.querySelector('[aria-grabbed=true]').setAttribute(\"aria-grabbed\", 'false');\n\n if (sf.base.isNullOrUndefined(column) || column.allowGrouping === false || parentsUntil(gObj.getColumnHeaderByUid(column.uid), 'e-grid').getAttribute('id') !== gObj.element.getAttribute('id')) {\n return;\n }\n\n gObj.dotNetRef.invokeMethodAsync(\"GroupColumn\", column.field, 'Group');\n };\n\n this.parent = parent;\n\n if (this.parent.options.allowGrouping && this.parent.options.showDropArea) {\n this.initDragAndDrop();\n }\n }", "_draw(callback) {\n super._draw(callback);\n\n const height = this._height - this._margin.top - this._margin.bottom,\n width = this._width - this._margin.left - this._margin.right;\n\n const diameter = Math.min(height, width);\n const transform = `translate(${(width - diameter) / 2}, ${(height - diameter) / 2})`;\n\n let nestedData = nest();\n for (let i = 0; i <= this._drawDepth; i++) nestedData.key(this._groupBy[i]);\n nestedData = nestedData.entries(this._filteredData);\n\n const packData = this._pack\n .padding(this._layoutPadding)\n .size([diameter, diameter])(\n hierarchy({key: nestedData.key, values: nestedData}, d => d.values).sum(this._sum).sort(this._sort)\n )\n .descendants();\n\n packData.forEach((d, i) => {\n d.__d3plus__ = true;\n d.i = i;\n d.id = d.parent ? d.parent.data.key : null;\n d.data.__d3plusOpacity__ = d.height ? this._packOpacity(d.data, i) : 1;\n d.data.__d3plusTooltip__ = !d.height ? true : false;\n });\n\n this._shapes.push(\n new Circle()\n .data(packData)\n .select(\n elem(\"g.d3plus-Pack\", {\n parent: this._select,\n enter: {transform},\n update: {transform}\n }).node()\n )\n .config(configPrep.bind(this)(this._shapeConfig, \"shape\", \"Circle\"))\n .render()\n );\n\n return this;\n }", "constructor() { \n \n Group.initialize(this);\n }", "function LineChartDemoComponent(charts) {\n this.charts = charts;\n this.dateArray = [];\n this.userArray = [];\n this.tagArray = [];\n this.groupArray = [];\n this.lineChartData = [{ data: [], label: '' }, { data: [], label: '' }, { data: [], label: '' }];\n this.lineChartLabels = []; //Users \n this.lineChartOptions = {\n responsive: true,\n scales: {\n xAxes: [{\n stacked: true\n }],\n yAxes: [{\n stacked: true\n }]\n },\n height: '500px',\n width: '720px'\n };\n this.lineChartColors = [\n {\n backgroundColor: 'rgba(148,159,177,0.2)',\n borderColor: 'rgba(148,159,177,1)',\n pointBackgroundColor: 'rgba(148,159,177,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(148,159,177,0.8)'\n },\n {\n backgroundColor: 'rgba(77,83,96,0.3)',\n borderColor: 'rgba(77,83,96,1)',\n pointBackgroundColor: 'rgba(77,83,96,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(77,83,96,1)'\n },\n {\n backgroundColor: 'rgba(148,159,177,0.4)',\n borderColor: 'rgba(148,159,177,1)',\n pointBackgroundColor: 'rgba(148,159,177,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(148,159,177,0.8)'\n }\n ];\n this.lineChartLegend = true;\n this.lineChartType = 'line';\n }", "render() {\n // Add loader if any point's data is being loading.\n let loader = null;\n if (this.state.loading) {\n let style = {\n position: 'absolute',\n top: 10,\n left: 50,\n zIndex: 999\n };\n\n loader = (\n <div style={style}>\n <ScaleLoader/>\n </div>\n );\n }\n\n const columns = this.state.dataColumnRanges;\n\n return (\n <MuiThemeProvider theme={theme}>\n <div className=\"App\">\n <CssBaseline/>\n {loader}\n <AppMap\n points={this.state.points}\n selectedPoints={this.state.groups[this.state.selectedGroup].selection}\n addPoint={this.addPoint}\n removePoint={this.removePoint}\n />\n <AppMenu\n height={this.state.window.height}\n >\n <SelectionComponent\n key={'Seleccionar'}\n groups={this.state.groups}\n selectedGroup={this.state.selectedGroup}\n selectGroup={this.changeSelectedGroup}\n changeGroupName={(group, name) => this.changeGroupName(group, name)}\n newGroup={() => this.newGroup()}\n deleteGroup={(group) => this.deleteGroup(group)}\n deleteAllGroups={() => this.deleteAllGroups()}\n changeManualSelection={() => this.changeManualSelection()}\n pointColumnRanges={this.state.pointColumnRanges}\n changeFilters={(group, filters) => this.changeFilters(group, filters)}\n />\n <FilterComponent\n key={'Filtrar'}\n dataColumnRanges={this.state.dataColumnRanges}\n getDates={this.getSelectionDates}\n dataFilters={this.state.dataFilters}\n timeFilters={this.state.groups[this.state.selectedGroup].timeFilters}\n dateFilters={this.state.groups[this.state.selectedGroup].months}\n changeDataFilters={this.changeDataFilters}\n changeDateFilters={this.changeDateFilters}\n changeTimeFilters={this.changeTimeFilters}\n />\n <DisaggregationComponent\n key={'Desagregar'}\n columns={columns}\n disaggregators={this.state.disaggregators}\n changeDisaggregators={(agg) => this.setState({disaggregators: agg})}\n />\n <AggregationComponent\n key={'Agregar'}\n columns={columns}\n aggregators={this.state.aggregators}\n disaggregators={this.state.disaggregators}\n changeAggregators={(agg) => this.setState({aggregators: agg})}\n />\n <GraphComponent\n key={'Graficar'}\n getFilteredData={this.getFilteredData}\n getGroupedData={this.getGroupedData}\n groupInfo={this.state.groups}\n />\n </AppMenu>\n </div>\n {this.renderErrorWindow()}\n </MuiThemeProvider>\n );\n }", "function getConstructor() {\n /**\n * Construct the component and return exposed functions and objects\n * @param {String} id that identifies instance of constructed component\n * @return {Object} THREE.js Group, Draw fn, id\n */\n function construct(id, debug) {\n\n const _debug = (debug === true);\n const selectedColor = '#ff0000';\n const unselectedColor = '#eeeeee';\n\n // Array of element names to update on each frame\n let toUpdate = [];\n let toUpdateTypes = ['video'];\n let drawPerType = {\n image: applyMaterialImage,\n text: applyMaterialText,\n video: applyMaterialVideo\n };\n let elements = {\n main: { \n name: 'main',\n position: new THREE.Vector3(0, 0, 1),\n type: 'drawable',\n object: createDrawable('main')\n },\n leftSide: { \n name: 'leftSide',\n position: new THREE.Vector3(-1, .5, 1.2),\n type: 'drawable',\n object: createDrawable('leftSide')\n },\n rightSide: { \n name: 'rightSide',\n position: new THREE.Vector3(.8, .8, -1),\n type: 'drawable',\n object: createDrawable('rightSide')\n },\n frame: {\n name: 'frame',\n position: new THREE.Vector3(0, 0, 0),\n type: 'helper',\n object: createFrame(elementOptions.frame, debug) \n }\n };\n\n let component = new THREE.Group();\n let elementNames = Object.keys(elements);\n\n component.name = 'componentGroup';\n\n elementNames.forEach(elementName => {\n let element = elements[elementName];\n\n component.add(element.object);\n element.object.position.copy(element.position);\n });\n // mainObject.position.set(0,0,opt.radius/opt.vCutOff);\n draw(sampleData);\n\n /**\n * Draw data point value onto drawable.\n * @param {Object} value: '', drawableId: String, draw_type: String\n * @return {void}\n */\n function draw(data) {\n if (data instanceof Array) {\n data.forEach(renderDrawable);\n } else renderDrawable(data);\n }\n\n function renderDrawable(data) {\n let element = elements[data.drawableId] || {};\n let object = element.object;\n let drawFn = drawPerType[data.type];\n\n if (\n data.drawableId && object && element.type === 'drawable' &&\n typeof(drawFn) === 'function'\n ) {\n drawFn(data, object);\n object.visible = true;\n\n if (~toUpdateTypes.indexOf(data.type) && !~toUpdate.indexOf(element.name)) {\n toUpdate.push(element.name);\n }\n }\n }\n\n function deactivate() {\n draw(sampleData);\n elements.leftSide.object.visible = false;\n }\n\n function highlight(inView) {\n if (_debug && elements.frame.object.material) {\n elements.frame.material.color.set(\n inView ? selectedColor : unselectedColor\n );\n }\n }\n\n /**\n * Update data on any element that is marked for keeping updated.\n * @param {Object} value: '', drawableId: String, draw_type: String\n * @return {void}\n */\n\n function update() {\n toUpdate.forEach(elementName => {\n let element = elements[elementName];\n\n if (\n element && element.object && element.object.userData && \n typeof(element.object.userData.update) === 'function'\n ) element.object.userData.update();\n });\n }\n\n return {\n draw,\n update,\n highlight,\n deactivate,\n component,\n id,\n frame: elements.frame.object,\n timeStamp: Date.now(),\n };\n }\n\n console.log('timeStamp:', Date.now());\n\n return construct;\n}", "function Group(domoticz) {\n this.domoticz = domoticz;\n}", "function Group(parent, groupSettings, sortedColumns, serviceLocator) {\n var _this = this;\n this.isAppliedGroup = false;\n this.isAppliedUnGroup = false;\n this.visualElement = createElement('div', {\n className: 'e-cloneproperties e-dragclone e-gdclone',\n styles: 'line-height:23px', attrs: { action: 'grouping' }\n });\n this.helper = function (e) {\n var gObj = _this.parent;\n var target = e.sender.target;\n var element = target.classList.contains('e-groupheadercell') ? target :\n parentsUntil(target, 'e-groupheadercell');\n if (!element) {\n return false;\n }\n _this.column = gObj.getColumnByField(element.firstElementChild.getAttribute('ej-mappingname'));\n _this.visualElement.textContent = element.textContent;\n _this.visualElement.style.width = element.offsetWidth + 2 + 'px';\n _this.visualElement.style.height = element.offsetHeight + 2 + 'px';\n _this.visualElement.setAttribute('e-mappinguid', _this.column.uid);\n gObj.element.appendChild(_this.visualElement);\n return _this.visualElement;\n };\n this.dragStart = function (e) {\n _this.parent.element.classList.add('e-ungroupdrag');\n if (isBlazor()) {\n e.bindEvents(e.dragElement);\n }\n };\n this.drag = function (e) {\n var target = e.target;\n var cloneElement = _this.parent.element.querySelector('.e-cloneproperties');\n _this.parent.trigger(columnDrag, { target: target, draggableType: 'headercell', column: _this.column });\n classList(cloneElement, ['e-defaultcur'], ['e-notallowedcur']);\n if (!(parentsUntil(target, 'e-gridcontent') || parentsUntil(target, 'e-headercell'))) {\n classList(cloneElement, ['e-notallowedcur'], ['e-defaultcur']);\n }\n };\n this.dragStop = function (e) {\n _this.parent.element.classList.remove('e-ungroupdrag');\n if (!(parentsUntil(e.target, 'e-gridcontent') || parentsUntil(e.target, 'e-gridheader'))) {\n remove(e.helper);\n return;\n }\n };\n this.drop = function (e) {\n var gObj = _this.parent;\n var column = gObj.getColumnByUid(e.droppedElement.getAttribute('e-mappinguid'));\n _this.element.classList.remove('e-hover');\n remove(e.droppedElement);\n _this.aria.setDropTarget(_this.parent.element.querySelector('.e-groupdroparea'), false);\n _this.aria.setGrabbed(_this.parent.getHeaderTable().querySelector('[aria-grabbed=true]'), false);\n if (isNullOrUndefined(column) || column.allowGrouping === false ||\n parentsUntil(gObj.getColumnHeaderByUid(column.uid), 'e-grid').getAttribute('id') !==\n gObj.element.getAttribute('id')) {\n _this.parent.log('action_disabled_column', { moduleName: _this.getModuleName(), columnName: column.headerText });\n return;\n }\n _this.groupColumn(column.field);\n };\n this.contentRefresh = true;\n this.aria = new AriaService();\n this.parent = parent;\n this.groupSettings = groupSettings;\n this.serviceLocator = serviceLocator;\n this.sortedColumns = sortedColumns;\n this.focus = serviceLocator.getService('focus');\n this.addEventListener();\n this.groupGenerator = new GroupModelGenerator(this.parent);\n }", "function AxisGroupLayout() {\n go.Layout.call(this);\n // go.GridLayout.call(this);\n // this.cellSize = new go.Size(1, 1);\n // this.wrappingColumn = Infinity;\n // this.wrappingWidth = Infinity;\n // this.spacing = new go.Size(0, 0);\n // this.alignment = go.GridLayout.Position;\n}", "triggerToggleLayerGroup() {\n const datasetID = this.props.dataset.id;\n const addLayerGroup = !this.props.isLayerGroupAdded(datasetID);\n this.props.toggleLayerGroup(datasetID, addLayerGroup);\n }", "onStoreGroup({ groupers }) {\n const grid = this.grid,\n element = grid.element,\n curGroupHeaders = element && DomHelper.children(element, '.b-grid-header.b-group');\n\n if (element) {\n for (let header of curGroupHeaders) {\n // IE11 doesnt support this\n //header.classList.remove('b-group', 'b-asc', 'b-desc');\n header.classList.remove('b-group');\n header.classList.remove('b-asc');\n header.classList.remove('b-desc');\n }\n\n for (let groupInfo of groupers) {\n let header = grid.getHeaderElementByField(groupInfo.field);\n // IE11 doesnt support this\n //header && header.classList.add('b-group', groupInfo.ascending ? 'b-asc' : 'b-desc');\n if (header) {\n header.classList.add('b-group');\n header.classList.add(groupInfo.ascending ? 'b-asc' : 'b-desc');\n }\n }\n }\n }", "constructor(props){\n super(props);\n this.state ={\n chartItems:[], //[{group:string, type:stirng, data:[{dataName:string, data:{}}]}]\n isLoaded:false,\n labels:[]\n }\n }", "static get name() {\n return \"DrawingsLayer\"\n }", "function getFeatureGroup() {\n return getMarkerFeatureGroup('_layers');\n }", "function ShapeGroupData() {\n this.it = [];\n this.prevViewData = [];\n this.gr = createNS('g');\n }", "addLegend () {\n \n }", "function add_to_fabric_group(fabric_obj) {\n\tfabric_group.addWithUpdate(fabric_obj);\n\tcanvas.add(fabric_obj);\n\t// canvas._activeObject = null;\n}", "static template() { return 'CanvasComponent'; }", "showFeatureGroup (groupId, map) {\n this.currentLayer = this.indexedFeatures()[groupId]\n map.addLayer(this.currentLayer)\n }", "init() {\n this.groups = {};\n }", "renderHeader(headerContainerElement) {\n let me = this,\n grid = me.grid,\n groupers = me.store.groupers;\n\n // Sorted from start, reflect in rendering\n for (let groupInfo of groupers) {\n // Might be grouping by field without column, which is valid\n const column = grid.columns.get(groupInfo.field),\n header = column && grid.getHeaderElement(column.id);\n // IE11 doesnt support this\n //header && header.classList.add('b-group', groupInfo.ascending ? 'b-asc' : 'b-desc');\n if (header) {\n header.classList.add('b-group');\n header.classList.add(groupInfo.ascending ? 'b-asc' : 'b-desc');\n }\n }\n }", "function top10VAChart(group) {\n\tvar dataArray = [];\n\tvar vaArray = roleCountOfVA();\n\tfor(var i = 10*(group-1); i < 10*group; i++) {\n\t\tdataArray.push(vaArray[0].dataPoints[i]);\n\t}\n\t//console.log(dataArray);\n\tvar chart = new CanvasJS.Chart(\"chart_div\", {\n\t\tbackgroundColor: \"#FFD90F\",\n\t\t//theme: \"theme3\",\n\t\ttitle: {\n\t\t\ttext: \"The Simpsons VA\",\n\t\t\tfontSize: 30\n\t\t},\n\t\taxisX: {\n\t\t\ttitle: \"Voice Actors\",\n\t\t\ttitleFontColor: \"black\",\n\t\t\ttitleFontSize: 24,\n\t\t\tlabelAutoFit: true,\n\t\t\tlabelFontSize: 14.5,\n\t\t\tlabelFontColor: \"black\",\n\t\t\tinterval: 1,\n\t\t\tmargin: 0,\n\t\t\tgridColor: \"gray\",\n\t\t\ttickColor: \"gray\"\n\t\t},\n\t\taxisY: {\n\t\t\ttitle: \"Roles Played\",\n\t\t\ttitleFontSize: 24,\n\t\t\ttitleFontColor: \"black\",\n\t\t\tlabelFontColor: \"black\",\n\t\t\tgridColor: \"gray\",\n\t\t\ttickColor: \"gray\"\n\t\t},\n\t\tlegend: {\n\t\t\tfontFamily: \"sans-serif\",\n\t\t\tverticalAlign: \"bottom\",\n\t\t\thorizontalAlign: \"center\",\n\t\t\tcursor: \"pointer\",\n\t\t\t//itemclick: function\n\t\t},\n\t\tcreditText: \"\",\n\t\tdata: [\n\t\t\t{\n\t\t\t\ttype: \"column\",\n\t\t\t\tdataPoints: dataArray,\n\t\t\t}\n\t\t],\n\t});\n\tchart.render();\n}", "function CardGroup(props) {\n var children = props.children,\n className = props.className,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(doubling, 'doubling'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(stackable, 'stackable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"f\" /* useWidthProp */])(itemsPerRow), className, 'cards');\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"b\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"c\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n var content = __WEBPACK_IMPORTED_MODULE_1_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ key: key }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n}", "function CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(doubling, 'doubling'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(stackable, 'stackable'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"D\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"G\" /* useWidthProp */])(itemsPerRow), 'cards', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), children);\n }\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* childrenUtils */].isNil(content)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), content);\n }\n\n var itemsJSX = __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({\n key: key\n }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), itemsJSX);\n}", "onCreateGroup() {\n this.createGroup.visible = true;\n }", "function Layer () {\n this._components = [];\n this._componentIsDirty = [];\n}", "function Group() {\n this.cells = []; //array of cell objects\n }", "function GroupingBar(parent){/* eslint-enable */this.parent=parent;this.parent.groupingBarModule=this;this.resColWidth=this.parent.isAdaptive?180:249;this.addEventListener();this.parent.axisFieldModule=new AxisFields(this.parent);this.touchObj=new sf.base.Touch(this.parent.element,{tapHold:this.tapHoldHandler.bind(this)});}", "function LayerGroupView(base) {\n var GMapsCartoDBLayerGroupView = function(layerModel, gmapsMap) {\n var self = this;\n var hovers = [];\n\n _.bindAll(this, 'featureOut', 'featureOver', 'featureClick');\n\n var opts = _.clone(layerModel.attributes);\n\n opts.map = gmapsMap;\n\n var // preserve the user's callbacks\n _featureOver = opts.featureOver,\n _featureOut = opts.featureOut,\n _featureClick = opts.featureClick;\n\n var previousEvent;\n var eventTimeout = -1;\n\n opts.featureOver = function(e, latlon, pxPos, data, layer) {\n if (!hovers[layer]) {\n self.trigger('layerenter', e, latlon, pxPos, data, layer);\n }\n hovers[layer] = 1;\n _featureOver && _featureOver.apply(this, arguments);\n self.featureOver && self.featureOver.apply(this, arguments);\n\n // if the event is the same than before just cancel the event\n // firing because there is a layer on top of it\n if (e.timeStamp === previousEvent) {\n clearTimeout(eventTimeout);\n }\n eventTimeout = setTimeout(function() {\n self.trigger('mouseover', e, latlon, pxPos, data, layer);\n self.trigger('layermouseover', e, latlon, pxPos, data, layer);\n }, 0);\n previousEvent = e.timeStamp;\n };\n\n opts.featureOut = function(m, layer) {\n if (hovers[layer]) {\n self.trigger('layermouseout', layer);\n }\n hovers[layer] = 0;\n if(!_.any(hovers)) {\n self.trigger('mouseout');\n }\n _featureOut && _featureOut.apply(this, arguments);\n self.featureOut && self.featureOut.apply(this, arguments);\n };\n\n opts.featureClick = _.debounce(function() {\n _featureClick && _featureClick.apply(this, arguments);\n self.featureClick && self.featureClick.apply(opts, arguments);\n }, 10);\n\n \n //CartoDBLayerGroup.call(this, opts);\n base.call(this, opts);\n cdb.geo.GMapsLayerView.call(this, layerModel, this, gmapsMap);\n };\n\n _.extend(\n GMapsCartoDBLayerGroupView.prototype,\n cdb.geo.GMapsLayerView.prototype,\n base.prototype,\n {\n\n _update: function() {\n this.setOptions(this.model.attributes);\n },\n\n reload: function() {\n this.model.invalidate();\n },\n\n remove: function() {\n cdb.geo.GMapsLayerView.prototype.remove.call(this);\n this.clear();\n },\n\n featureOver: function(e, latlon, pixelPos, data, layer) {\n // dont pass gmaps LatLng\n this.trigger('featureOver', e, [latlon.lat(), latlon.lng()], pixelPos, data, layer);\n },\n\n featureOut: function(e, layer) {\n this.trigger('featureOut', e, layer);\n },\n\n featureClick: function(e, latlon, pixelPos, data, layer) {\n // dont pass leaflet lat/lon\n this.trigger('featureClick', e, [latlon.lat(), latlon.lng()], pixelPos, data, layer);\n },\n\n error: function(e) {\n if(this.model) {\n //trigger the error form _checkTiles in the model\n this.model.trigger('error', e?e.errors:'unknown error');\n this.model.trigger('tileError', e?e.errors:'unknown error');\n }\n },\n\n ok: function(e) {\n this.model.trigger('tileOk');\n },\n\n tilesOk: function(e) {\n this.model.trigger('tileOk');\n },\n\n loading: function() {\n this.trigger(\"loading\");\n },\n\n finishLoading: function() {\n this.trigger(\"load\");\n }\n\n\n });\n return GMapsCartoDBLayerGroupView;\n}", "_getRenderers() {\n return this.getRenderersMapper.mapTree(this.state.rendererDataTree, this.props.shape);\n }", "function render(){var createNodes=require(\"./create-nodes\"),createClusters=require(\"./create-clusters\"),createEdgeLabels=require(\"./create-edge-labels\"),createEdgePaths=require(\"./create-edge-paths\"),positionNodes=require(\"./position-nodes\"),positionEdgeLabels=require(\"./position-edge-labels\"),positionClusters=require(\"./position-clusters\"),shapes=require(\"./shapes\"),arrows=require(\"./arrows\");var fn=function(svg,g){preProcessGraph(g);svg.selectAll(\"*\").remove();var outputGroup=createOrSelectGroup(svg,\"output\"),clustersGroup=createOrSelectGroup(outputGroup,\"clusters\"),edgePathsGroup=createOrSelectGroup(outputGroup,\"edgePaths\"),edgeLabels=createEdgeLabels(createOrSelectGroup(outputGroup,\"edgeLabels\"),g),nodes=createNodes(createOrSelectGroup(outputGroup,\"nodes\"),g,shapes);layout(g);positionNodes(nodes,g);positionEdgeLabels(edgeLabels,g);createEdgePaths(edgePathsGroup,g,arrows);var clusters=createClusters(clustersGroup,g);positionClusters(clusters,g);postProcessGraph(g)};fn.createNodes=function(value){if(!arguments.length)return createNodes;createNodes=value;return fn};fn.createClusters=function(value){if(!arguments.length)return createClusters;createClusters=value;return fn};fn.createEdgeLabels=function(value){if(!arguments.length)return createEdgeLabels;createEdgeLabels=value;return fn};fn.createEdgePaths=function(value){if(!arguments.length)return createEdgePaths;createEdgePaths=value;return fn};fn.shapes=function(value){if(!arguments.length)return shapes;shapes=value;return fn};fn.arrows=function(value){if(!arguments.length)return arrows;arrows=value;return fn};return fn}", "function loadModel() {\n if (g.object.type === 'Group') {\n g.object.traverse( function ( child ) {\n if ( child.isMesh ) {\n child.material.map = g.mat.map;\n child.material.normalMap = g.mat.normalMap;\n //child.material.roughnessMap = g.mat.roughnessMap;\n //child.material.displacementMap = g.mat.displacementMap;\n child.material.normalMap = g.mat.normalMap;\n child.material.shininess = 2000;\n }\n } );\n }\n\t}", "render() {\n return (\n <div>\n <FeatureGoup featureGroups={this.state.featureGroups}/>\n </div>\n );\n }", "function CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(doubling, 'doubling'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(stackable, 'stackable'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"E\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"H\" /* useWidthProp */])(itemsPerRow), 'cards', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(content)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n\n var itemsJSX = __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ key: key }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n itemsJSX\n );\n}", "function CardGroup(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"a\" /* useKeyOnly */])(doubling, 'doubling'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"a\" /* useKeyOnly */])(stackable, 'stackable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"o\" /* useTextAlignProp */])(textAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"h\" /* useWidthProp */])(itemsPerRow), 'cards', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"b\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(content)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n\n var itemsJSX = __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ key: key }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n itemsJSX\n );\n}", "constructor(idVertex, groupVertex) {\n this.id = idVertex;\n this.label = String(idVertex);\n this.group = groupVertex;\n }", "function CardGroup(props) {\n var children = props.children,\n className = props.className,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"z\" /* useKeyOnly */])(doubling, 'doubling'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"z\" /* useKeyOnly */])(stackable, 'stackable'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"F\" /* useWidthProp */])(itemsPerRow), 'cards', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"p\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n var content = __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ key: key }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n}", "renderCell(renderData) {\n const me = this; // no need to run the code below if not grouping or of feature is disabled\n\n if (!me.store.isGrouped || me.disabled) {\n return;\n }\n\n const {\n cellElement,\n rowElement,\n column\n } = renderData,\n grid = me.grid,\n meta = renderData.record.meta,\n firstColumn = grid.columns.visibleColumns[0],\n firstSubGridColumns = grid.subGrids[grid.regions[0]].columns.visibleColumns;\n\n if ('groupRowFor' in meta) {\n // do nothing with action column to make possible using actions for groups\n if (column.type === 'action') {\n return;\n } // let column clear the cell, in case it needs to do some cleanup\n\n column.clearCell(cellElement); // this is a group row, add css classes\n // IE11 doesnt support this\n //rowElement.classList.toggle('b-grid-group-collapsed', meta.collapsed === undefined ? false : meta.collapsed);\n\n rowElement.classList[meta.collapsed ? 'add' : 'remove']('b-grid-group-collapsed');\n rowElement.classList.add('b-group-row');\n\n if (firstColumn.type === 'rownumber' && column === firstSubGridColumns[1] || firstColumn.type !== 'rownumber' && column === firstSubGridColumns[0]) {\n cellElement.classList.add('b-group-title');\n }\n\n me.buildGroupHeader(renderData);\n } else {\n // not a group row, remove css classes\n // TODO: use dom query to remove before render instead?\n if (cellElement === rowElement.firstElementChild) {\n // IE11 doesnt support this\n //rowElement.classList.remove('b-group-row', 'b-grid-group-collapsed');\n rowElement.classList.remove('b-group-row');\n rowElement.classList.remove('b-grid-group-collapsed');\n cellElement.classList.remove('b-group-title');\n }\n }\n }", "function AbstractChartPainter() {\n\n}", "function BasicLinechartComponent(renderer) {\n this.renderer = renderer;\n /**\n * Input width of the component\n * Default value : 900\n */\n this.width = 900;\n /**\n * Input height of the compenent\n * Default value : 200\n */\n this.height = 200;\n /**\n * Input data array that the component display\n * Default value : []\n */\n this.data = [];\n /**\n * Input domain of the Axis Y\n * Works only for continuous values\n * Default value : [0,0]\n */\n this.domain = [0, 0];\n /**\n * Input speed of zoom between 0 and 1\n * Default value : 0.2\n */\n this.speedZoom = 0.2;\n /**\n * Input range of timestamp\n * Default value : [0,0]\n */\n this.range = [0, 0];\n /**\n * Output rangeChange that emit range\n */\n this.rangeChange = new i0.EventEmitter();\n /**\n * Input currentTime\n * Default value : 0\n */\n this.currentTime = 0;\n /**\n * Output currentTimeChange that emit currentTime\n */\n this.currentTimeChange = new i0.EventEmitter();\n /**\n * Title of the component\n */\n this.title = 'Timeline : ';\n /**\n * Margin of the component\n */\n this.margin = { top: 20, right: 20, bottom: 20, left: 50 }; //marge interne au svg \n /**\n * dataZoom is a copy of data with the range specify\n */\n this.dataZoom = [];\n /**\n * idZoom is the number of wheel notch\n */\n this.idZoom = 0;\n /**\n * It's the smallest timestamp of data\n */\n this.minTime = 0;\n /**\n * It's the biggest timestamp of data\n */\n this.maxTime = 0;\n /**\n * It's the difference between the smallest and the biggest\n */\n this.lengthTime = 0;\n /**\n * Width of the svg\n */\n this.svgWidth = 0;\n /**\n * Height of the svg\n */\n this.svgHeight = 0;\n /**\n * Scale of the X axis\n */\n this.scaleX = d3__namespace.scaleTime();\n /**\n * Scale of the Y axis\n */\n this.scaleY = d3__namespace.scaleLinear();\n /**\n * Array of area definition\n */\n this.area = [];\n /**\n * Array of line definition\n */\n this.line = [];\n /**\n * data length before the new change\n */\n this.lastDatalength = 0;\n /**\n * Mode of the tooltip\n */\n this.modeToolTips = \"normal\";\n /**\n * true if the currentTimeline is selected\n */\n this.currentTimeSelected = false;\n /**\n * true if the scrollbar is selected\n */\n this.scrollbarSelected = false;\n /**\n * Last position of the mouse\n */\n this.lastPos = 0;\n /**\n * true if the CTRL Key of keyBoard is push\n */\n this.zoomSelected = false;\n }", "function buildContainerGroups() {\n let container = svg\n .append('g')\n .classed('container-group', true)\n .attr('transform', `translate(${margin.left + yAxisPaddingBetweenChart}, ${margin.top-2})`);\n\n container\n .append('g').classed('grid-lines-group', true);\n\n container\n .append('g').classed('chart-group', true);\n\n // labels on the bottom\n container\n .append('g').classed('x-axis-group axis', true);\n\n // this is the labels on the left, and the line\n container\n .append('g')\n .attr('transform', `translate(${-1 * (yAxisPaddingBetweenChart)}, 0)`)\n .classed('y-axis-group axis', true);\n\n\n // the tooltip and also labels on the right\n container\n .append('g').classed('metadata-group', true);\n }", "componentWillMount() {\n\n this.groups = {\n 'Date' : this.props.data.dimensions['_date'].object.group(d=> {\n const year = d.getFullYear()\n const month = d.getMonth()+1\n\n return year + '\\n' + ((month <= 9) ? '0' : '') + month\n }),\n 'Manager' : this.props.data.dimensions['Manager'].group(),\n 'Category' : this.props.data.dimensions['Category'].group(),\n 'Brand' : this.props.data.dimensions['Brand'].group(),\n 'Customer' : this.props.data.dimensions['Customer'].group(),\n 'Year' : this.props.data.dimensions['Year'].group()\n }\n\n this.componentWillReceiveProps(this.props)\n }", "function createChart(options){var data=Chartist.normalizeData(this.data,options.reverseData,true);// Create new svg object\nthis.svg=Chartist.createSvg(this.container,options.width,options.height,options.classNames.chart);// Create groups for labels, grid and series\nvar gridGroup=this.svg.elem('g').addClass(options.classNames.gridGroup);var seriesGroup=this.svg.elem('g');var labelGroup=this.svg.elem('g').addClass(options.classNames.labelGroup);var chartRect=Chartist.createChartRect(this.svg,options,defaultOptions.padding);var axisX,axisY;if(options.axisX.type===undefined){axisX=new Chartist.StepAxis(Chartist.Axis.units.x,data.normalized.series,chartRect,Chartist.extend({},options.axisX,{ticks:data.normalized.labels,stretch:options.fullWidth}));}else {axisX=options.axisX.type.call(Chartist,Chartist.Axis.units.x,data.normalized.series,chartRect,options.axisX);}if(options.axisY.type===undefined){axisY=new Chartist.AutoScaleAxis(Chartist.Axis.units.y,data.normalized.series,chartRect,Chartist.extend({},options.axisY,{high:Chartist.isNumeric(options.high)?options.high:options.axisY.high,low:Chartist.isNumeric(options.low)?options.low:options.axisY.low}));}else {axisY=options.axisY.type.call(Chartist,Chartist.Axis.units.y,data.normalized.series,chartRect,options.axisY);}axisX.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);axisY.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);if(options.showGridBackground){Chartist.createGridBackground(gridGroup,chartRect,options.classNames.gridBackground,this.eventEmitter);}// Draw the series\ndata.raw.series.forEach(function(series,seriesIndex){var seriesElement=seriesGroup.elem('g');// Write attributes to series group element. If series name or meta is undefined the attributes will not be written\nseriesElement.attr({'ct:series-name':series.name,'ct:meta':Chartist.serialize(series.meta)});// Use series class from series data or if not set generate one\nseriesElement.addClass([options.classNames.series,series.className||options.classNames.series+'-'+Chartist.alphaNumerate(seriesIndex)].join(' '));var pathCoordinates=[],pathData=[];data.normalized.series[seriesIndex].forEach(function(value,valueIndex){var p={x:chartRect.x1+axisX.projectValue(value,valueIndex,data.normalized.series[seriesIndex]),y:chartRect.y1-axisY.projectValue(value,valueIndex,data.normalized.series[seriesIndex])};pathCoordinates.push(p.x,p.y);pathData.push({value:value,valueIndex:valueIndex,meta:Chartist.getMetaData(series,valueIndex)});}.bind(this));var seriesOptions={lineSmooth:Chartist.getSeriesOption(series,options,'lineSmooth'),showPoint:Chartist.getSeriesOption(series,options,'showPoint'),showLine:Chartist.getSeriesOption(series,options,'showLine'),showArea:Chartist.getSeriesOption(series,options,'showArea'),areaBase:Chartist.getSeriesOption(series,options,'areaBase')};var smoothing=typeof seriesOptions.lineSmooth==='function'?seriesOptions.lineSmooth:seriesOptions.lineSmooth?Chartist.Interpolation.monotoneCubic():Chartist.Interpolation.none();// Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n// index, value and meta data\nvar path=smoothing(pathCoordinates,pathData);// If we should show points we need to create them now to avoid secondary loop\n// Points are drawn from the pathElements returned by the interpolation function\n// Small offset for Firefox to render squares correctly\nif(seriesOptions.showPoint){path.pathElements.forEach(function(pathElement){var point=seriesElement.elem('line',{x1:pathElement.x,y1:pathElement.y,x2:pathElement.x+0.01,y2:pathElement.y},options.classNames.point).attr({'ct:value':[pathElement.data.value.x,pathElement.data.value.y].filter(Chartist.isNumeric).join(','),'ct:meta':Chartist.serialize(pathElement.data.meta)});this.eventEmitter.emit('draw',{type:'point',value:pathElement.data.value,index:pathElement.data.valueIndex,meta:pathElement.data.meta,series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,group:seriesElement,element:point,x:pathElement.x,y:pathElement.y});}.bind(this));}if(seriesOptions.showLine){var line=seriesElement.elem('path',{d:path.stringify()},options.classNames.line,true);this.eventEmitter.emit('draw',{type:'line',values:data.normalized.series[seriesIndex],path:path.clone(),chartRect:chartRect,index:seriesIndex,series:series,seriesIndex:seriesIndex,seriesMeta:series.meta,axisX:axisX,axisY:axisY,group:seriesElement,element:line});}// Area currently only works with axes that support a range!\nif(seriesOptions.showArea&&axisY.range){// If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n// the area is not drawn outside the chart area.\nvar areaBase=Math.max(Math.min(seriesOptions.areaBase,axisY.range.max),axisY.range.min);// We project the areaBase value into screen coordinates\nvar areaBaseProjected=chartRect.y1-axisY.projectValue(areaBase);// In order to form the area we'll first split the path by move commands so we can chunk it up into segments\npath.splitByCommand('M').filter(function onlySolidSegments(pathSegment){// We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\nreturn pathSegment.pathElements.length>1;}).map(function convertToArea(solidPathSegments){// Receiving the filtered solid path segments we can now convert those segments into fill areas\nvar firstElement=solidPathSegments.pathElements[0];var lastElement=solidPathSegments.pathElements[solidPathSegments.pathElements.length-1];// Cloning the solid path segment with closing option and removing the first move command from the clone\n// We then insert a new move that should start at the area base and draw a straight line up or down\n// at the end of the path we add an additional straight line to the projected area base value\n// As the closing option is set our path will be automatically closed\nreturn solidPathSegments.clone(true).position(0).remove(1).move(firstElement.x,areaBaseProjected).line(firstElement.x,firstElement.y).position(solidPathSegments.pathElements.length+1).line(lastElement.x,areaBaseProjected);}).forEach(function createArea(areaPath){// For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n// and adding the created DOM elements to the correct series group\nvar area=seriesElement.elem('path',{d:areaPath.stringify()},options.classNames.area,true);// Emit an event for each area that was drawn\nthis.eventEmitter.emit('draw',{type:'area',values:data.normalized.series[seriesIndex],path:areaPath.clone(),series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,chartRect:chartRect,index:seriesIndex,group:seriesElement,element:area});}.bind(this));}}.bind(this));this.eventEmitter.emit('created',{bounds:axisY.bounds,chartRect:chartRect,axisX:axisX,axisY:axisY,svg:this.svg,options:options});}", "function ArrayGroup(arrayTypes) {\n var LayoutVertexArrayType = arrayTypes.layoutVertexArrayType;\n this.layoutVertexArray = new LayoutVertexArrayType();\n\n var ElementArrayType = arrayTypes.elementArrayType;\n if (ElementArrayType) this.elementArray = new ElementArrayType();\n\n var ElementArrayType2 = arrayTypes.elementArrayType2;\n if (ElementArrayType2) this.elementArray2 = new ElementArrayType2();\n\n this.paintVertexArrays = util.mapObject(arrayTypes.paintVertexArrayTypes, function (PaintVertexArrayType) {\n return new PaintVertexArrayType();\n });\n}", "addAxes () {\n }", "renderGroup(group) {\n let section = [];\n section.push(\n <View style={styles.groupDateRow} key={group.item[0]}>\n <Icon name=\"date-range\" type=\"MaterialIcons\" size={16} color=\"#fff\" />\n <Text style={styles.groupDate}>{group.item[0]}</Text>\n </View>\n );\n group.item[1].map((item, index) => {\n section.push(this.renderRow(item, index));\n });\n return section;\n }", "render() {\n\t\tvar layers = Object.keys(this.props.layers).map(function(layer_id, i) {\n\t\t\tvar layer = this.props.layers[layer_id];\n var style = \"info\";\n var active = (layer_id == this.state.active_layer);\n var glyphicon = (this.state.visible_layers.indexOf(layer_id) < 0) ? \"ban-circle\" : \"eye-open\";\n\n\t\t\treturn (\n\t\t\t\t<ListGroupItem\n\t\t\t\t\tdata-id={ i } key={ i }\n\t\t\t\t\tbsStyle={style} active={active}>\n <Button className=\"layer-visible-button\" bsSize=\"xsmall\" onClick={this.toggleLayerVisibility(layer_id).bind(this)}><Glyphicon glyph={glyphicon} /></Button>\n <span className=\"active-layer-clickable\" onClick={this.toggleLayerActive(layer_id).bind(this)}>{layer.layer_name}</span>\n <Button className=\"layer-delete-button\" bsSize=\"xsmall\" onClick={this.deleteLayer(layer_id).bind(this)}><Glyphicon glyph=\"glyphicon glyphicon-remove\" /></Button>\n\t\t\t\t</ListGroupItem>\n\t\t\t);\n\t\t}.bind(this));\n\n\t\treturn <ListGroup id=\"layers\">{ layers }</ListGroup>\n\t}", "function YunGroupLayout() {\n go.Layout.call(this);\n // go.GridLayout.call(this);\n // this.cellSize = new go.Size(1, 1);\n // this.wrappingColumn = Infinity;\n // this.wrappingWidth = Infinity;\n // this.spacing = new go.Size(0, 0);\n // this.alignment = go.GridLayout.Position;\n}", "function YunGroupLayout() {\n go.Layout.call(this);\n // go.GridLayout.call(this);\n // this.cellSize = new go.Size(1, 1);\n // this.wrappingColumn = Infinity;\n // this.wrappingWidth = Infinity;\n // this.spacing = new go.Size(0, 0);\n // this.alignment = go.GridLayout.Position;\n}", "pieTemplate1() {\n const pieData = [\n { 'x': 'Chrome', y: 37, text: '37%' },\n { 'x': 'UC Browser', y: 17, text: '17%' },\n { 'x': 'iPhone', y: 19, text: '19%' },\n { 'x': 'Others', y: 4, text: '4%' },\n { 'x': 'Opera', y: 11, text: '11%' },\n { 'x': 'Android', y: 12, text: '12%' }\n ];\n const dataLabel = { visible: true, position: 'Inside', name: 'text', font: { fontWeight: '600' } };\n const enableAnimation = false;\n return (<div className=\"template\">\n <AccumulationChartComponent style={{ \"height\": \"162px\" }} enableAnimation={enableAnimation} legendSettings={{ visible: false }} tooltip={{ enable: true, format: `${10} : <b>${10}%</b>` }}>\n <Inject services={[AccumulationTooltip]}/>\n <AccumulationSeriesCollectionDirective>\n <AccumulationSeriesDirective dataSource={pieData} dataLabel={dataLabel} xName='x' yName='y' radius=\"70%\" name='Browser'/>\n </AccumulationSeriesCollectionDirective>\n </AccumulationChartComponent>\n </div>);\n }", "function Group2D(settings){var _this=this;if(settings==null){settings={};}if(settings.origin==null){settings.origin=new BABYLON.Vector2(0,0);}_this=_super.call(this,settings)||this;var size=!settings.size&&!settings.width&&!settings.height?null:settings.size||new BABYLON.Size(settings.width||0,settings.height||0);if(!(_this instanceof BABYLON.WorldSpaceCanvas2D)){_this._trackedNode=settings.trackNode==null?null:settings.trackNode;_this._trackedNodeOffset=settings.trackNodeOffset==null?null:settings.trackNodeOffset;if(_this._trackedNode&&_this.owner){_this.owner._registerTrackedNode(_this);}}_this._cacheBehavior=settings.cacheBehavior==null?Group2D_1.GROUPCACHEBEHAVIOR_FOLLOWCACHESTRATEGY:settings.cacheBehavior;var rd=_this._renderableData;if(rd){rd._noResizeOnScale=(_this.cacheBehavior&Group2D_1.GROUPCACHEBEHAVIOR_NORESIZEONSCALE)!==0;}_this.size=size;_this._viewportPosition=BABYLON.Vector2.Zero();_this._viewportSize=BABYLON.Size.Zero();return _this;}", "function DecorationGroup(groupId, groupName) {\n var items = [];\n var lastItemId = 0;\n var container = null;\n var activable = false;\n\n function isActivable() {\n return activable;\n }\n\n function setActivable() {\n activable = true;\n }\n\n /**\n * Adds a new decoration to the group.\n */\n function add(decoration) {\n let id = groupId + \"-\" + lastItemId++;\n\n let range = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.rangeFromLocator)(decoration.locator);\n if (!range) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.log)(\"Can't locate DOM range for decoration\", decoration);\n return;\n }\n\n let item = { id, decoration, range };\n items.push(item);\n layout(item);\n }\n\n /**\n * Removes the decoration with given ID from the group.\n */\n function remove(decorationId) {\n let index = items.findIndex((i) => i.decoration.id === decorationId);\n if (index === -1) {\n return;\n }\n\n let item = items[index];\n items.splice(index, 1);\n item.clickableElements = null;\n if (item.container) {\n item.container.remove();\n item.container = null;\n }\n }\n\n /**\n * Notifies that the given decoration was modified and needs to be updated.\n */\n function update(decoration) {\n remove(decoration.id);\n add(decoration);\n }\n\n /**\n * Removes all decorations from this group.\n */\n function clear() {\n clearContainer();\n items.length = 0;\n }\n\n /**\n * Recreates the decoration elements.\n *\n * To be called after reflowing the resource, for example.\n */\n function requestLayout() {\n clearContainer();\n items.forEach((item) => layout(item));\n }\n\n /**\n * Layouts a single Decoration item.\n */\n function layout(item) {\n let groupContainer = requireContainer();\n\n let style = styles.get(item.decoration.style);\n if (!style) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.logErrorMessage)(`Unknown decoration style: ${item.decoration.style}`);\n return;\n }\n\n let itemContainer = document.createElement(\"div\");\n itemContainer.setAttribute(\"id\", item.id);\n itemContainer.setAttribute(\"data-style\", item.decoration.style);\n itemContainer.style.setProperty(\"pointer-events\", \"none\");\n\n let viewportWidth = window.innerWidth;\n let columnCount = parseInt(\n getComputedStyle(document.documentElement).getPropertyValue(\n \"column-count\"\n )\n );\n let pageWidth = viewportWidth / (columnCount || 1);\n let scrollingElement = document.scrollingElement;\n let xOffset = scrollingElement.scrollLeft;\n let yOffset = scrollingElement.scrollTop;\n\n function positionElement(element, rect, boundingRect) {\n element.style.position = \"absolute\";\n\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${rect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"viewport\") {\n element.style.width = `${viewportWidth}px`;\n element.style.height = `${rect.height}px`;\n let left = Math.floor(rect.left / viewportWidth) * viewportWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${boundingRect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"page\") {\n element.style.width = `${pageWidth}px`;\n element.style.height = `${rect.height}px`;\n let left = Math.floor(rect.left / pageWidth) * pageWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n }\n\n let boundingRect = item.range.getBoundingClientRect();\n\n let elementTemplate;\n try {\n let template = document.createElement(\"template\");\n template.innerHTML = item.decoration.element.trim();\n elementTemplate = template.content.firstElementChild;\n } catch (error) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.logErrorMessage)(\n `Invalid decoration element \"${item.decoration.element}\": ${error.message}`\n );\n return;\n }\n\n if (style.layout === \"boxes\") {\n let doNotMergeHorizontallyAlignedRects = true;\n let clientRects = (0,_rect__WEBPACK_IMPORTED_MODULE_0__.getClientRectsNoOverlap)(\n item.range,\n doNotMergeHorizontallyAlignedRects\n );\n\n clientRects = clientRects.sort((r1, r2) => {\n if (r1.top < r2.top) {\n return -1;\n } else if (r1.top > r2.top) {\n return 1;\n } else {\n return 0;\n }\n });\n\n for (let clientRect of clientRects) {\n const line = elementTemplate.cloneNode(true);\n line.style.setProperty(\"pointer-events\", \"none\");\n positionElement(line, clientRect, boundingRect);\n itemContainer.append(line);\n }\n } else if (style.layout === \"bounds\") {\n const bounds = elementTemplate.cloneNode(true);\n bounds.style.setProperty(\"pointer-events\", \"none\");\n positionElement(bounds, boundingRect, boundingRect);\n\n itemContainer.append(bounds);\n }\n\n groupContainer.append(itemContainer);\n item.container = itemContainer;\n item.clickableElements = Array.from(\n itemContainer.querySelectorAll(\"[data-activable='1']\")\n );\n if (item.clickableElements.length === 0) {\n item.clickableElements = Array.from(itemContainer.children);\n }\n }\n\n /**\n * Returns the group container element, after making sure it exists.\n */\n function requireContainer() {\n if (!container) {\n container = document.createElement(\"div\");\n container.setAttribute(\"id\", groupId);\n container.setAttribute(\"data-group\", groupName);\n container.style.setProperty(\"pointer-events\", \"none\");\n document.body.append(container);\n }\n return container;\n }\n\n /**\n * Removes the group container.\n */\n function clearContainer() {\n if (container) {\n container.remove();\n container = null;\n }\n }\n\n return {\n add,\n remove,\n update,\n clear,\n items,\n requestLayout,\n isActivable,\n setActivable,\n };\n}", "function ArrayGroup(arrayTypes) {\n\t var LayoutVertexArrayType = arrayTypes.layoutVertexArrayType;\n\t this.layoutVertexArray = new LayoutVertexArrayType();\n\t\n\t var ElementArrayType = arrayTypes.elementArrayType;\n\t if (ElementArrayType) this.elementArray = new ElementArrayType();\n\t\n\t var ElementArrayType2 = arrayTypes.elementArrayType2;\n\t if (ElementArrayType2) this.elementArray2 = new ElementArrayType2();\n\t\n\t this.paintVertexArrays = util.mapObject(arrayTypes.paintVertexArrayTypes, function (PaintVertexArrayType) {\n\t return new PaintVertexArrayType();\n\t });\n\t}", "createAxes () {\n }", "getOptions() {\n let grids = []\n let xAxies = []\n let yAxies = []\n let series = []\n \n let sampleRate = store.getState().sampleRate\n let keysArray = Object.keys(this.state.eegData)\n // Remove deleted keys\n keysArray = keysArray.filter((key) => {\n return !this.removedAxies.includes(key);\n });\n\n // Layout configuration\n function generateGridTops(grid_height, num_grids) {\n // Returns an array of the top value for each\n // grid to be represented by keysArray\n let padding = 4\n let render_limits = [0+padding, 100-padding]\n let jump_width = (100 - 2*padding) / num_grids\n var list = [];\n for (var i = render_limits[0]; i <= render_limits[1]; i += jump_width) {\n let adjusted_top = i - (grid_height / 2) \n list.push(Math.ceil(adjusted_top));\n }\n return list\n }\n let height = 40\n let topsList = generateGridTops(height, keysArray.length)\n\n keysArray.forEach((key) => {\n let i = keysArray.indexOf(key)\n let grid_top = topsList[i] + \"%\"\n\n grids.push({\n id: key,\n left: '10%',\n right: '2%',\n top: grid_top,\n height: height + \"%\",\n show: true,\n name: key,\n tooltip: {\n show: false,\n trigger: 'axis',\n showDelay: 25\n },\n containLabel: false, // Help grids aligned by axis\n borderWidth: 0\n })\n\n xAxies.push({\n id: key,\n name: key,\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[key].length).keys()],\n type: 'category',\n gridIndex: i,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: (i == keysArray.length - 1), // Only show on last grid\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return (this.bufferStartIndex + parseInt(value)) / sampleRate\n }\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: true,\n interval: sampleRate - 1,\n },\n // Trigger event means you can click on name to register event\n triggerEvent: true,\n nameLocation: 'start',\n })\n\n // let scaleMax = new MyMaths().roundToNextDigit(Math.max(...this.state.eegData[key]))\n let scaleMax = 1\n let scaleMin = -scaleMax\n\n yAxies.push({\n id: key,\n type: 'value',\n gridIndex: i,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n // Programatically scale min/max\n min: scaleMin,\n max: scaleMax\n })\n\n // Add a line config to series object\n series.push({\n name: key,\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0.5,\n color: 'black',\n },\n gridIndex: i,\n yAxisIndex: i,\n xAxisIndex: i,\n smooth: false,\n sampling: 'lttb',\n\n data: this.state.eegData[key],\n })\n })\n\n /**\n * Configure backsplash grid for highlights and such\n * Adds a grid at backsplashGridIndex that takes full height\n * Adds an xAxis identical to the others\n * Adds a series of 0s meant to be undisplayed,\n * just for markAreas to be applied to\n */\n let timestampFormatter = (value) => {\n let secs = ((value + this.bufferStartIndex) / sampleRate) + this.time_adjustment_secs\n var date = new Date(0);\n date.setSeconds(secs);\n return date.toISOString().substr(11, 8);\n }\n\n this.backsplashGridIndex = keysArray.length\n let backsplashGridIndex = this.backsplashGridIndex\n let configureBacksplashGrid = () => {\n if (backsplashGridIndex == 0) {\n // Catch before data loads in\n return\n }\n let arbitraryKey = keysArray[0]\n\n grids.push({\n left: '10%',\n right: '4%',\n top: '0%',\n bottom: '4%',\n show: false,\n containLabel: false, // Help grids aligned by axis\n })\n yAxies.push({\n type: 'value',\n gridIndex: backsplashGridIndex,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n min: -1e-3,\n max: 1e-3,\n })\n xAxies.push({\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[arbitraryKey].length).keys()],\n type: 'category',\n gridIndex: backsplashGridIndex,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: true,\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return timestampFormatter(value)\n }\n },\n axisLine: {\n show: false,\n },\n })\n series.push({\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0,\n color: '#00000000',\n },\n gridIndex: backsplashGridIndex,\n yAxisIndex: backsplashGridIndex,\n xAxisIndex: backsplashGridIndex,\n sampling: 'lttb',\n \n name: 'backSplashSeries',\n \n data: new Array(this.state.eegData[arbitraryKey].length).fill(0),\n })\n }\n configureBacksplashGrid()\n\n /**\n * \n * The actual configuration for the chart\n * Loads in all of the previously filled grids, xAxies, yAxies, and series\n * \n */\n let options = {\n // Use the values configured above\n grid: grids,\n xAxis: xAxies,\n yAxis: yAxies,\n series: series,\n\n // Other Configuration options\n animation: false,\n\n tooltip: {\n show: false,\n },\n\n // toolbox hidden\n toolbox: {\n orient: 'vertical',\n show: false,\n },\n\n // Brush allows for selection that gets turned into markAreas\n brush: {\n toolbox: ['lineX', 'keep'],\n xAxisIndex: backsplashGridIndex\n },\n\n dataZoom: [\n {\n show: false,\n xAxisIndex: Object.keys(series),\n type: 'slider',\n bottom: '2%',\n startValue: this.dz_start,\n endValue: this.dz_end,\n preventDefaultMouseMove: true,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n },\n {\n yAxisIndex: Object.keys(series),\n type: 'slider',\n top: '45%',\n filterMode: 'none',\n show: false,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n\n id: 'eegGain',\n start: 50 - this.yZoom,\n end: 50 + this.yZoom,\n },{\n type: 'inside',\n yAxisIndex: Object.keys(series),\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n }\n ],\n }\n\n return options\n }", "function CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])('ui', Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(doubling, 'doubling'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(stackable, 'stackable'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useWidthProp\"])(itemsPerRow), 'cards', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getUnhandledProps\"])(CardGroup, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getElementType\"])(CardGroup, props);\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), children);\n }\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(content)) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), content);\n }\n\n var itemsJSX = Object(lodash_es_map__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_Card__WEBPACK_IMPORTED_MODULE_7__[\"default\"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n key: key\n }, item));\n });\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), itemsJSX);\n}", "componentWillReceiveProps(nextProps) {\n let allGroups = [];\n let allLayers = this.state.allLayers;\n const nextLayers = allLayers[nextProps.group.value];\n if (nextProps.sortAlpha !== this.props.sortAlpha) {\n this.sortLayers(this.state.layers, nextProps.sortAlpha);\n }\n\n if (nextProps.group.value !== this.props.group.value) {\n const layers = this.state.allLayers[this.props.group.value];\n if (layers !== undefined) {\n // DISABLE LAYER VISIBILITY FROM PREVIOUS GROUP\n TOCHelpers.disableLayersVisiblity(layers, newLayers => {\n allLayers[this.props.group.value] = newLayers;\n this.setState({ allLayers: allLayers }, () => {\n // ENABLE LAYER VISIBILITY FROM PREVIOUS GROUP\n\n if (nextLayers !== undefined) {\n TOCHelpers.enableLayersVisiblity(nextLayers, newLayers => {\n let allLayers = this.state.allLayers;\n allLayers[nextProps.group.value] = newLayers;\n this.setState({ layers: newLayers, allLayers: allLayers, allGroups: allGroups }, () => {\n this.refreshLayers(nextProps.group, nextProps.sortAlpha, nextProps.allGroups);\n });\n });\n } else {\n this.refreshLayers(nextProps.group, nextProps.sortAlpha, nextProps.allGroups);\n }\n });\n });\n } else this.refreshLayers(nextProps.group, nextProps.sortAlpha, nextProps.allGroups);\n }\n }", "render() {\n\n\n return (\n <section className=\"chart\">\n\n <div className=\"chart-contain\">\n <Line\n width={550}\n\t height={300}\n \tdata={this.state.chartData}\n \toptions={{title:{display:true, text:\"Closing Prices of Each Month for the Past Year\", fontSize: 20}, legend:{display: true, position: 'bottom'}}}\n redraw\n />\n </div>\n\n </section>\n );\n }", "function makeOverlayLyrGroups() {\r\n\r\n for (var key in lyrGroups) {\r\n // create the ardLayer\r\n map.doubleClickZoom.disable();\r\n\r\n function style(feature) { // this is the styling for the ARD grid\r\n return {\r\n //weight: 2,\r\n opacity: 1,\r\n color: '#51b9ff',\r\n dashArray: '1,1,1',\r\n fillOpacity: 0.0,\r\n fillColor: '#ffffff'\r\n };\r\n }\r\n\r\n function highlightFeature(e) {\r\n var layer = e.target;\r\n layer.setStyle({\r\n weight: 5,\r\n color: '#666',\r\n dashArray: '',\r\n fillOpacity: 0.7\r\n });\r\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\r\n layer.bringToFront();\r\n }\r\n\r\n }\r\n\r\n var ardLayer;\r\n\r\n function markFeature(e) { // this is the style for that show if a tile is selected.\r\n\r\n a = 2;\r\n var layer = e.target;\r\n layer.setStyle({\r\n weight: 7,\r\n \r\n dashArray: '',\r\n fillOpacity: 0.7\r\n });\r\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { // this brings styling to the front\r\n layer.bringToFront();\r\n }\r\n // information for the dataListcontrol function\r\n dataListControl(e, a)\r\n\r\n //$(\".hvcount\").remove()\r\n //$('#download').append(\"<span class='hvcount'> \"+hvlist.length+\" selected</span>\")\r\n\r\n\r\n }\r\n\r\n function resetHighlight(e) { // resets the the style when the tile is unselected\r\n ardLayer.resetStyle(e.target);\r\n a = 1; // information for the dataListcontrol function\r\n dataListControl(e, a)\r\n //$(\".hvcount\").remove()\r\n //$('#download').append(\"<span class='hvcount'> \"+hvlist.length+\" selected</span>\")\r\n }\r\n\r\n\r\n function dataListControl(e, a) {\r\n var e_info = e.target.label; // gets the the <pre>h00v00</pre>\r\n if (a === 2) {\r\n hvlist.push(e_info); // adds the e_info to the hvlist list\r\n hvlist.filter(function (value, index) {\r\n return hvlist.indexOf(value) == index\r\n }); // removes any double values\r\n } else if (a === 1) {\r\n for (p in hvlist) {\r\n if (e_info === hvlist[p]) {\r\n hvlist.splice(hvlist.indexOf(hvlist[p]), 1); // removes a value from hvList if unselected\r\n } else {\r\n // nothing\r\n }\r\n }\r\n }\r\n\r\n if (hvlist.length < 1) {\r\n $('#download').removeClass('w3-green').addClass('w3-grey').css('cursor', 'not-allowed').text('Select Tile(s)')\r\n } else {\r\n $('#download').removeClass('w3-grey').addClass('w3-green').css('cursor', 'pointer').text(\"Download: \" + hvlist.length + \" tile(s)\")\r\n }\r\n return hvlist\r\n }\r\n\r\n function onEachFeature(feature, layer) {\r\n //layer.bindTooltip(feature.properties.name, {permanent: true, direction: 'center'})//.openTooltip();\r\n //layer.bindPopup('<pre>'+JSON.stringify(feature.properties,null,' ').replace(/[\\{\\}\"]/g,'')+'</pre>');\r\n // //layer.bindPopup(label);\r\n\r\n layer['label'] = '<pre>' + JSON.stringify(feature.properties.ARD_tile, null, ' ').replace(/[\\{\\}\"]/g, '') + '</pre>';\r\n\r\n //layer.on({mouseover: highlightFeature});//high ligths layer when mouse is over it\r\n\r\n //layer.on({mouseout: resetHighlight});\r\n\r\n\r\n layer.on({dblclick: markFeature});\r\n\r\n layer.on({click: resetHighlight});\r\n }\r\n\r\n var ardLayer = L.geoJSON(ard, {\r\n style: style,\r\n onEachFeature: onEachFeature\r\n });\r\n overlays.ard.maps[key] = {'layer': ardLayer}\r\n }\r\n\r\n}", "function ButtonGroup(props) {\n var attached = props.attached,\n basic = props.basic,\n children = props.children,\n className = props.className,\n color = props.color,\n compact = props.compact,\n floated = props.floated,\n fluid = props.fluid,\n icon = props.icon,\n inverted = props.inverted,\n labeled = props.labeled,\n negative = props.negative,\n positive = props.positive,\n primary = props.primary,\n secondary = props.secondary,\n size = props.size,\n toggle = props.toggle,\n vertical = props.vertical,\n widths = props.widths;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(basic, 'basic'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(compact, 'compact'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(fluid, 'fluid'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(icon, 'icon'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(inverted, 'inverted'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(labeled, 'labeled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(negative, 'negative'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(positive, 'positive'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(primary, 'primary'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(secondary, 'secondary'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(toggle, 'toggle'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(vertical, 'vertical'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"h\" /* useValueAndKey */])(attached, 'attached'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"h\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"f\" /* useWidthProp */])(widths), 'buttons', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"b\" /* getUnhandledProps */])(ButtonGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"c\" /* getElementType */])(ButtonGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "get group(){ return this.__group; }", "get [Symbol.toStringTag]() {\n return 'GroupedList';\n }", "display_group_all() {\n this.hide_labels();\n this.force.gravity(this.layout_gravity)\n .charge(this.charge)\n .friction(0.9)\n .on(\"tick\", e => {\n return this.circles.each(this.move_towards_center(e.alpha))\n .attr(\"cx\", d => d.x)\n .attr(\"cy\", d => d.y);\n });\n return this.force.start();\n }", "function CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('ui', Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(doubling, 'doubling'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(stackable, 'stackable'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useWidthProp\"])(itemsPerRow), 'cards', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getUnhandledProps\"])(CardGroup, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getElementType\"])(CardGroup, props);\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), children);\n }\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(content)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), content);\n }\n\n var itemsJSX = lodash_map__WEBPACK_IMPORTED_MODULE_2___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_Card__WEBPACK_IMPORTED_MODULE_7__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n key: key\n }, item));\n });\n\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), itemsJSX);\n}", "function CardGroup(props) {\n var centered = props.centered,\n children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('ui', Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(doubling, 'doubling'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(stackable, 'stackable'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useWidthProp\"])(itemsPerRow), 'cards', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getUnhandledProps\"])(CardGroup, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getElementType\"])(CardGroup, props);\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), children);\n }\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(content)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), content);\n }\n\n var itemsJSX = lodash_map__WEBPACK_IMPORTED_MODULE_2___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(_Card__WEBPACK_IMPORTED_MODULE_7__[\"default\"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n key: key\n }, item));\n });\n\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), itemsJSX);\n}", "function Layer() {\n return {\n name: 'layer',\n template: __WEBPACK_IMPORTED_MODULE_1__layer_ejs___default()({\n name: '模板',\n arr: ['oppop', 'iphone', 'HUAWEI']\n })\n };\n}", "renderHeader(headerContainerElement) {\n const {\n store,\n grid\n } = this;\n\n if (store.isGrouped) {\n // Sorted from start, reflect in rendering\n for (const groupInfo of store.groupers) {\n // Might be grouping by field without column, which is valid\n const column = grid.columns.get(groupInfo.field),\n header = column && grid.getHeaderElement(column.id); // IE11 doesnt support this\n //header && header.classList.add('b-group', groupInfo.ascending ? 'b-asc' : 'b-desc');\n\n if (header) {\n header.classList.add('b-group');\n header.classList.add(groupInfo.ascending ? 'b-asc' : 'b-desc');\n }\n }\n }\n }", "function ArrayGroup(arrayTypes) {\n\t var LayoutVertexArrayType = arrayTypes.layoutVertexArrayType;\n\t this.layoutVertexArray = new LayoutVertexArrayType();\n\n\t var ElementArrayType = arrayTypes.elementArrayType;\n\t if (ElementArrayType) this.elementArray = new ElementArrayType();\n\n\t var ElementArrayType2 = arrayTypes.elementArrayType2;\n\t if (ElementArrayType2) this.elementArray2 = new ElementArrayType2();\n\n\t this.paintVertexArrays = util.mapObject(arrayTypes.paintVertexArrayTypes, function (PaintVertexArrayType) {\n\t return new PaintVertexArrayType();\n\t });\n\t}", "function App() {\n return (\n <div>\n <Dummy/>\n {/* <MyChart/> */}\n <ChartJsTest/>\n <Avg />\n </div>\n );\n}", "function ButtonGroup(props) {\n var attached = props.attached,\n basic = props.basic,\n children = props.children,\n className = props.className,\n color = props.color,\n compact = props.compact,\n floated = props.floated,\n fluid = props.fluid,\n icon = props.icon,\n inverted = props.inverted,\n labeled = props.labeled,\n negative = props.negative,\n positive = props.positive,\n primary = props.primary,\n secondary = props.secondary,\n size = props.size,\n toggle = props.toggle,\n vertical = props.vertical,\n widths = props.widths;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(basic, 'basic'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(compact, 'compact'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(fluid, 'fluid'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(icon, 'icon'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(inverted, 'inverted'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(labeled, 'labeled'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(primary, 'primary'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(secondary, 'secondary'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(toggle, 'toggle'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(vertical, 'vertical'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"D\" /* useValueAndKey */])(attached, 'attached'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"D\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"F\" /* useWidthProp */])(widths), 'buttons', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(ButtonGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(ButtonGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "beforeDatasetsDraw(chart) {\n if (!this._enabled(chart)) {\n return;\n }\n const scale = this._findScale(chart);\n const flat = chart.data.flatLabels;\n const visible = chart.data.labels;\n const roots = chart.data.rootNodes;\n const visibles = new Set(visible);\n const ctx = chart.ctx;\n const hor = scale.isHorizontal();\n\n const boxSize = scale.options.hierarchyBoxSize;\n const boxSize05 = boxSize * 0.5;\n const boxSize01 = boxSize * 0.1;\n const boxRow = scale.options.hierarchyBoxLineHeight;\n const boxColor = scale.options.hierarchyBoxColor;\n const boxWidth = scale.options.hierarchyBoxWidth;\n const boxSpanColor = scale.options.hierarchySpanColor;\n const boxSpanWidth = scale.options.hierarchySpanWidth;\n const renderLabel = scale.options.hierarchyLabelPosition;\n const groupLabelPosition = scale.options.hierarchyGroupLabelPosition;\n\n const scaleLabel = scale.options.scaleLabel;\n const scaleLabelFontColor = helpers.valueOrDefault(scaleLabel.fontColor, defaults.global.defaultFontColor);\n const scaleLabelFont = parseFontOptions(scaleLabel);\n\n ctx.save();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n ctx.fillStyle = scaleLabelFontColor; // render in correct color\n ctx.font = scaleLabelFont.font;\n\n const renderHorLevel = (node) => {\n if (node.children.length === 0) {\n return false;\n }\n const offset = node.level * boxRow;\n\n if (!node.expand) {\n if (visibles.has(node)) {\n // expand button\n ctx.strokeRect(node.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(node.center - boxSize05 + 2, offset + boxSize05 - 1, boxSize - 4, 2);\n ctx.fillRect(node.center - 1, offset + 2, 2, boxSize - 4);\n }\n return false;\n }\n const r = spanLogic(node, flat, visibles, groupLabelPosition);\n if (!r) {\n return false;\n }\n const {\n hasFocusBox,\n hasCollapseBox,\n leftVisible,\n rightVisible,\n leftFirstVisible,\n rightLastVisible,\n groupLabelCenter\n } = r;\n\n // render group label\n if (renderLabel === 'below') {\n ctx.fillText(node.label, groupLabelCenter, offset + boxSize);\n } else if (renderLabel === 'above') {\n ctx.fillText(node.label, groupLabelCenter, offset - boxSize);\n }\n\n if (hasCollapseBox) {\n // collapse button\n ctx.strokeRect(leftVisible.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(leftVisible.center - boxSize05 + 2, offset + boxSize05 - 1, boxSize - 4, 2);\n }\n\n if (hasFocusBox) {\n // focus button\n ctx.strokeRect(rightVisible.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(rightVisible.center - 2, offset + boxSize05 - 2, 4, 4);\n }\n\n if (leftVisible !== rightVisible) {\n // helper span line\n ctx.strokeStyle = boxSpanColor;\n ctx.lineWidth = boxSpanWidth;\n ctx.beginPath();\n if (hasCollapseBox) {\n // stitch to box\n ctx.moveTo(leftVisible.center + boxSize05, offset + boxSize05);\n } else if (leftFirstVisible) {\n // add starting group hint\n ctx.moveTo(leftVisible.center, offset + boxSize01);\n ctx.lineTo(leftVisible.center, offset + boxSize05);\n } else {\n // just a line\n ctx.moveTo(leftVisible.center, offset + boxSize05);\n }\n\n if (hasFocusBox) {\n ctx.lineTo(rightVisible.center - boxSize05, offset + boxSize05);\n } else if (rightLastVisible) {\n ctx.lineTo(rightVisible.center, offset + boxSize05);\n ctx.lineTo(rightVisible.center, offset + boxSize01);\n } else {\n ctx.lineTo(rightVisible.center, offset + boxSize05);\n }\n ctx.stroke();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n }\n\n return true;\n };\n\n const renderVertLevel = (node) => {\n if (node.children.length === 0) {\n return false;\n }\n const offset = node.level * boxRow * -1;\n\n if (!node.expand) {\n if (visibles.has(node)) {\n ctx.strokeRect(offset - boxSize, node.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize + 2, node.center - 1, boxSize - 4, 2);\n ctx.fillRect(offset - boxSize05 - 1, node.center - boxSize05 + 2, 2, boxSize - 4);\n }\n return false;\n }\n const r = spanLogic(node, flat, visibles);\n if (!r) {\n return false;\n }\n const {\n hasFocusBox,\n hasCollapseBox,\n leftVisible,\n rightVisible,\n leftFirstVisible,\n rightLastVisible,\n groupLabelCenter\n } = r;\n\n // render group label\n ctx.fillText(node.label, offset - boxSize, groupLabelCenter);\n\n if (hasCollapseBox) {\n // collapse button\n ctx.strokeRect(offset - boxSize, leftVisible.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize + 2, leftVisible.center - 1, boxSize - 4, 2);\n }\n\n if (hasFocusBox) {\n // focus\n ctx.strokeRect(offset - boxSize, rightVisible.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize05 - 2, rightVisible.center - 2, 4, 4);\n }\n\n if (leftVisible !== rightVisible) {\n // helper span line\n ctx.strokeStyle = boxSpanColor;\n ctx.lineWidth = boxSpanWidth;\n ctx.beginPath();\n if (hasCollapseBox) {\n // stitch to box\n ctx.moveTo(offset - boxSize05, leftVisible.center + boxSize05);\n } else if (leftFirstVisible) {\n // add starting group hint\n ctx.moveTo(offset - boxSize01, leftVisible.center);\n ctx.lineTo(offset - boxSize05, leftVisible.center);\n } else {\n // just a line\n ctx.lineTo(offset - boxSize05, leftVisible.center);\n }\n\n if (hasFocusBox) {\n ctx.lineTo(offset - boxSize05, rightVisible.center - boxSize05);\n } else if (rightLastVisible) {\n ctx.lineTo(offset - boxSize05, rightVisible.center - boxSize05);\n ctx.lineTo(offset - boxSize01, rightVisible.center - boxSize05);\n } else {\n ctx.lineTo(offset - boxSize05, rightVisible.center);\n }\n ctx.stroke();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n }\n\n return true;\n };\n\n if (hor) {\n ctx.textAlign = 'center';\n ctx.textBaseline = renderLabel === 'above' ? 'bottom' : 'top';\n ctx.translate(scale.left, scale.top + scale.options.padding);\n roots.forEach((n) => preOrderTraversal(n, renderHorLevel));\n } else {\n ctx.textAlign = 'right';\n ctx.textBaseline = 'center';\n ctx.translate(scale.left - scale.options.padding, scale.top);\n\n roots.forEach((n) => preOrderTraversal(n, renderVertLevel));\n }\n\n ctx.restore();\n }", "function addShapes() {\n scene.add(group);\n scene.add(camera);\n scene.add(ambientlight);\n}", "getGroup() {\r\n return this.builder.group;\r\n }", "function makeCircleSelectable( _group, _type ){\n\tif( typeof _group == 'string' ){\n\t\t_group = master.canvas.stage.find( '#' + _group )[0];\n\t}\n\t\n\tif( _group == undefined )\n\t\treturn;\n\t\t\n\tvar hasOutter = false;\n\t\n\tvar maxRadius = -1;\n\t\n\tvar children = _group.getChildren().toArray();\n\tfor( var i = 0; i < children.length; i++ ){\n\t\tvar child = children[i];\n\t\tif( child.getName() === 'outter' ){\n\t\t\thasOutter = true;\n\t\t} else if ( child.getClassName() === 'Circle' ) {\n\t\t\tchild.offsetX( child.radius() * -1 );\n\t\t\tchild.offsetY( child.radius() * -1 );\n\t\t\tif( child.radius() > maxRadius )\n\t\t\t\tmaxRadius = child.radius();\n\t\t}\n\t}\n\t\n\tif( hasOutter === true )\n\t\treturn;\n\t\n\tvar outter = new Kinetic.Circle({\n\t\tname: \"outter\",\n\t\tradius: maxRadius + 3,\n\t\toffsetX: ( maxRadius + 3 ) * -1, \n\t\toffsetY: ( maxRadius + 3 ) * -1,\n\t\tx: -3,\n\t\ty: -3,\n\t\tstroke: SELECTED_HEX,\n\t\tstrokeWidth: 3\n\t});\n\toutter.hide();\n\t_group.add( outter );\n\t\n\t_group.setAttr( 'selected', false );\n\t_group.setAttr( 'disabled', false );\n\t\n\t_group.on('click touchstart', function(e){\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tif( !_group.getAttr( 'selected' ) || Kinetic.multiSelect != null || !e.evt.shiftKey || !e.evt.ctrlKey ){\n\t\t\t//If shif and cntrl were not held during the click\n\t\t\tif( !e.evt.shiftKey && !e.evt.ctrlKey ){\n\t\t\t\tdeselect();\n\t\t\t\tselect( _group );\n\t\t\t} else if ( _group.getAttr( 'selected' ) ) {\n\t\t\t//If shif or cntrl were held during the click and object was already selected\n\t\t\t\tdeselect( _group );\n\t\t\t} else {\n\t\t\t//If shif and cntrl were held during the click and object was not already selected\n\t\t\t\tselect( _group );\n\t\t\t}\n\t\t\t\n\t\t\tselectStyle();\n\t\t}\n\t});\n\t\n\t_group.on('dragstart', function(e){\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tif( !_group.getAttr( 'selected' ) ){\n\t\t\t//If shif and cntrl were not held during the click\n\t\t\tif( !e.evt.shiftKey && !e.evt.ctrlKey ){\n\t\t\t\tdeselect();\n\t\t\t\tselect( _group );\n\t\t\t} else if ( _group.getAttr( 'selected' ) ) {\n\t\t\t//If shif or cntrl were held during the click and object was already selected\n\t\t\t\tdeselect( _group );\n\t\t\t} else {\n\t\t\t//If shif and cntrl were held during the click and object was not already selected\n\t\t\t\tselect( _group );\n\t\t\t}\n\t\t\t\n\t\t\tselectStyle();\n\t\t}\n\t});\n\t\n\t_group.on('mouseover', function() {\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tdocument.body.style.cursor = 'all-scroll';\n\t});\n\t\n\t_group.on('mouseout', function() {\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\n\t\tdocument.body.style.cursor = 'default';\n \t});\n \t\n \t_group.on('dragend', function() {\n\t\tif( _group.getAttr( 'disabled' ) ) return;\n \t\t\n\t\tmaster.canvas.ormObj.visualOnlySync();\n\t});\n\t\n\tif( typeof _type !== 'undefined' && _type === 'objects' ){\n\t\t_group.on('dblclick dbltap', function(){\n\t\t\tif( _group.getAttr( 'disabled' ) ) return;\n\t\t\t\n\t\t\tmaster.ormObj.openProperties( _group.id() );\n\t\t\tdeselect( _group );\n\t\t});\n\t} else if ( typeof _type !== 'undefined' && _type === 'predicate' ){\n\t\t_group.on('dblclick dbltap', function(){\n\t\t\tif( _group.getAttr('disabled') ) return;\n\t\t\t\n\t\t\tmaster.canvas.line.editPredicate( _group.id() );\n\t\t});\n\t} else if ( typeof _type !== 'undefined' && _type === 'rule' ){\n\t\t_group.on('dblclick dbltap', function(){\n\t\t\tif( _group.getAttr('disabled') ) return;\n\t\t\t\n\t\t\tmaster.rule.openChangeSymbol( _group.id() );\n\t\t});\n\t}\n}", "get sourceButtonGroup() {\n return {\n type: \"button-group\",\n subtype: \"source-button-group\",\n buttons: [this.sourceButton],\n };\n }", "function ChartsContainer() {\n return (\n <div className=\"row\">\n <AreaChart />\n <PieChart />\n </div>\n );\n}", "function ButtonGroup(props) {\n var attached = props.attached,\n basic = props.basic,\n children = props.children,\n className = props.className,\n color = props.color,\n compact = props.compact,\n content = props.content,\n floated = props.floated,\n fluid = props.fluid,\n icon = props.icon,\n inverted = props.inverted,\n labeled = props.labeled,\n negative = props.negative,\n positive = props.positive,\n primary = props.primary,\n secondary = props.secondary,\n size = props.size,\n toggle = props.toggle,\n vertical = props.vertical,\n widths = props.widths;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(basic, 'basic'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(compact, 'compact'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(fluid, 'fluid'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(icon, 'icon'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(inverted, 'inverted'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(labeled, 'labeled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(negative, 'negative'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(positive, 'positive'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(primary, 'primary'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(secondary, 'secondary'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(toggle, 'toggle'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(vertical, 'vertical'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"k\" /* useKeyOrValueAndKey */])(attached, 'attached'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"j\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"h\" /* useWidthProp */])(widths), 'buttons', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(ButtonGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(ButtonGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "makeMarkerLayerGroup() {\n this._markerLayerGroup = new L.layerGroup().addTo(this.getMap());\n }", "function buildContainerGroups() {\n const container = svg\n .append(\"g\")\n .classed(\"container-group\", true)\n .attr(\"transform\", `translate(${margin.left},${margin.top})`);\n\n container.append(\"g\").classed(\"chart-group\", true);\n container.append(\"g\").classed(\"x-axis-group axis\", true);\n container.append(\"g\").classed(\"y-axis-group axis\", true);\n }", "function CardGroup(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n doubling = props.doubling,\n items = props.items,\n itemsPerRow = props.itemsPerRow,\n stackable = props.stackable,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('ui', Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(doubling, 'doubling'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(stackable, 'stackable'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"E\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"H\" /* useWidthProp */])(itemsPerRow), 'cards', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(CardGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(CardGroup, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(content)) return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n\n var itemsJSX = __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(items, function (item) {\n var key = item.key || [item.header, item.description].join('-');\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__Card__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({ key: key }, item));\n });\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n itemsJSX\n );\n}", "render(renderer, frame) {\n if (typeof frame === 'undefined') {\n throw 'Must supply coordinate frame to render the group';\n }\n for (let k = 0; k < this.children.length; k++) {\n const ch = this.children[k];\n // pre-multiply the requested coordindate with this child's CF\n mat4.multiply(this.tempMat, frame, ch.frame);\n // If the child is also a GroupObject\n // do a recursive call on that child\n // otherwise call the renderer function directly\n if (ch.object instanceof ObjectGroup)\n ch.object.render(renderer, this.tempMat);\n else renderer(ch.object, this.tempMat);\n }\n }", "_initializeComponent() {\n //Heade\n this.elements.header = document.createElement(\"div\");\n this.elements.title = document.createElement(\"span\");\n this.elements.range = document.createElement(\"span\");\n\n this.elements.header.className = \"chart-header\";\n this.elements.title.className = \"chart-title\";\n this.elements.range.className = \"chart-range\";\n\n this.elements.header.appendChild(this.elements.title);\n this.elements.header.appendChild(this.elements.range);\n\n //Tooltip\n this.elements.tooltip = document.createElement(\"div\");\n this.elements.date = document.createElement(\"span\");\n this.elements.values = document.createElement(\"div\");\n\n this.elements.tooltip.className = \"chart-tooltip\";\n this.elements.date.className = \"chart-tooltip-date\";\n this.elements.values.className = \"chart-tooltip-values\";\n\n this.elements.tooltip.appendChild(this.elements.date);\n this.elements.tooltip.appendChild(this.elements.values);\n\n //Render\n this.elements.render = document.createElement(\"div\");\n this.elements.chart = document.createElement(\"canvas\");\n this.elements.layout = document.createElement(\"canvas\");\n\n this.elements.render.className = \"chart-render\";\n this.elements.chart.className = \"chart-render-chart\";\n this.elements.layout.className = \"chart-render-layout\";\n\n this.elements.render.appendChild(this.elements.chart);\n this.elements.render.appendChild(this.elements.layout);\n\n //Preview\n this.elements.control = document.createElement(\"div\");\n this.elements.preview = document.createElement(\"canvas\");\n this.elements.select = document.createElement(\"div\");\n this.elements.draggerLeft = document.createElement(\"div\");\n this.elements.draggerRight = document.createElement(\"div\");\n this.elements.coverLeft = document.createElement(\"div\");\n this.elements.coverRight = document.createElement(\"div\");\n\n this.elements.control.className = \"chart-control\";\n this.elements.preview.className = \"chart-preview\";\n this.elements.select.className = \"chart-select\";\n this.elements.draggerLeft.className = \"chart-dragger chart-dragger-left\";\n this.elements.draggerRight.className = \"chart-dragger chart-dragger-right\";\n this.elements.coverLeft.className = \"chart-cover chart-cover-left\";\n this.elements.coverRight.className = \"chart-cover chart-cover-right\";\n\n this.elements.control.appendChild(this.elements.preview);\n this.elements.control.appendChild(this.elements.coverLeft);\n this.elements.control.appendChild(this.elements.select);\n this.elements.select.appendChild(this.elements.draggerLeft);\n this.elements.select.appendChild(this.elements.draggerRight);\n this.elements.control.appendChild(this.elements.coverRight);\n\n //Graph buttons container\n this.elements.graphs = document.createElement(\"div\");\n\n this.elements.graphs.className = \"chart-graphs\";\n\n //Main container\n this.elements.container.className += \" chart-container\";\n\n this.elements.container.appendChild(this.elements.header);\n this.elements.container.appendChild(this.elements.tooltip);\n this.elements.container.appendChild(this.elements.render);\n this.elements.container.appendChild(this.elements.control);\n this.elements.container.appendChild(this.elements.graphs);\n }", "function BasicLineGroup( layer, scene, neuralGroup, color, minOpacity ) {\n\n\tthis.layer = layer;\n\tthis.scene = scene;\n\tthis.neuralGroup = neuralGroup;\n\tthis.color = color;\n\tthis.minOpacity = minOpacity;\n\n\t// actual relative lines element for layer\n\n\tthis.lineGroup = undefined;\n\n\tthis.init();\n\n}", "render() {\n return (\n <View style={styles.container} >\n <StatusBar barStyle='default' />\n <Surface width={width} height={(height - (Platform.OS === 'ios' ? 64 : 76))/2}style={styles.surface} >\n <Group x={100} y={120}>\n <Text font={`20px \"Helvetica Neue\", \"Helvetica\", Arial`} stroke=\"purple\" y={20}>\n STROKED TEXT\n </Text>\n <Text font={`20px \"Helvetica Neue\", \"Helvetica\", Arial`} stroke=\"blue\" y={60}>\n 这三行继承了Group的属性\n </Text>\n <Text font={`20px \"Helvetica Neue\", \"Helvetica\", Arial`} stroke=\"green\" y={100}>\n 小米智能家庭👪\n </Text>\n </Group>\n </Surface>\n </View>\n );\n }", "constructor() {\n super();\n\n this.groups = new Map();\n }", "onStoreGroup({\n groupers\n }) {\n const {\n grid\n } = this,\n {\n element\n } = grid,\n curGroupHeaders = element && DomHelper.children(element, '.b-grid-header.b-group');\n\n if (element) {\n for (const header of curGroupHeaders) {\n DomHelper.removeClasses(header, ['b-group', 'b-asc', 'b-desc']);\n }\n\n if (groupers) {\n for (const groupInfo of groupers) {\n const header = grid.getHeaderElementByField(groupInfo.field);\n\n if (header) {\n DomHelper.addClasses(header, ['b-group', groupInfo.ascending ? 'b-asc' : 'b-desc']);\n }\n }\n }\n }\n }", "renderCell(renderData) {\n const me = this;\n\n // no need to run the code below if not grouping\n if (!me.store.isGrouped) return;\n\n let { cellElement, rowElement, column } = renderData,\n grid = me.grid,\n meta = renderData.record.meta,\n firstColumn = grid.columns.visibleColumns[0],\n subGrid = grid.getSubGridFromColumn(column);\n\n if (meta.hasOwnProperty('groupRowFor')) {\n // Let column clear the cell, in case it needs to do some cleanup\n column.clearCell(cellElement);\n\n // this is a group row, add css classes\n\n // IE11 doesnt support this\n //rowElement.classList.toggle('b-grid-group-collapsed', meta.collapsed === undefined ? false : meta.collapsed);\n if (meta.collapsed) {\n rowElement.classList.add('b-grid-group-collapsed');\n } else {\n rowElement.classList.remove('b-grid-group-collapsed');\n }\n\n rowElement.classList.add('b-group-row');\n\n if (\n column.region === grid.regions[0] &&\n ((firstColumn.type === 'rownumber' && column === subGrid.columns.visibleColumns[1]) ||\n (firstColumn.type !== 'rownumber' && column === subGrid.columns.visibleColumns[0]))\n ) {\n cellElement.classList.add('b-group-title');\n }\n\n me.buildGroupHeader(renderData);\n } else {\n // not a group row, remove css classes\n // TODO: use dom query to remove before render instead?\n if (cellElement === rowElement.firstElementChild) {\n // IE11 doesnt support this\n //rowElement.classList.remove('b-group-row', 'b-grid-group-collapsed');\n rowElement.classList.remove('b-group-row');\n rowElement.classList.remove('b-grid-group-collapsed');\n cellElement.classList.remove('b-group-title');\n }\n }\n }", "function render() {\n var createNodes = __webpack_require__(877);\n var createClusters = __webpack_require__(880);\n var createEdgeLabels = __webpack_require__(881);\n var createEdgePaths = __webpack_require__(882);\n var positionNodes = __webpack_require__(883);\n var positionEdgeLabels = __webpack_require__(884);\n var positionClusters = __webpack_require__(885);\n var shapes = __webpack_require__(886);\n var arrows = __webpack_require__(887);\n\n var fn = function(svg, g) {\n preProcessGraph(g);\n\n var outputGroup = createOrSelectGroup(svg, \"output\");\n var clustersGroup = createOrSelectGroup(outputGroup, \"clusters\");\n var edgePathsGroup = createOrSelectGroup(outputGroup, \"edgePaths\");\n var edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, \"edgeLabels\"), g);\n var nodes = createNodes(createOrSelectGroup(outputGroup, \"nodes\"), g, shapes);\n\n layout(g);\n\n positionNodes(nodes, g);\n positionEdgeLabels(edgeLabels, g);\n createEdgePaths(edgePathsGroup, g, arrows);\n\n var clusters = createClusters(clustersGroup, g);\n positionClusters(clusters, g);\n\n postProcessGraph(g);\n };\n\n fn.createNodes = function(value) {\n if (!arguments.length) return createNodes;\n createNodes = value;\n return fn;\n };\n\n fn.createClusters = function(value) {\n if (!arguments.length) return createClusters;\n createClusters = value;\n return fn;\n };\n\n fn.createEdgeLabels = function(value) {\n if (!arguments.length) return createEdgeLabels;\n createEdgeLabels = value;\n return fn;\n };\n\n fn.createEdgePaths = function(value) {\n if (!arguments.length) return createEdgePaths;\n createEdgePaths = value;\n return fn;\n };\n\n fn.shapes = function(value) {\n if (!arguments.length) return shapes;\n shapes = value;\n return fn;\n };\n\n fn.arrows = function(value) {\n if (!arguments.length) return arrows;\n arrows = value;\n return fn;\n };\n\n return fn;\n}", "componentWillMount() {\n\n this.idToMarker = {};\n\n // Create a group for the markers.\n this.group = L.featureGroup();\n this.group.addTo(this.props.map);\n\n // HIGHLIGHT\n this.group.on('mouseover', e => {\n events.highlightCollection(e.layer.options.feature.id);\n });\n\n // UNHIGHLIGHT\n this.group.on('mouseout', e => {\n events.unhighlightCollection(e.layer.options.feature.id);\n });\n\n // SELECT\n this.group.on('click', e => {\n let localItems = this.tree.search(this.toRbushTreeItem(e.layer));\n let localMarkers = localItems.map((item) => this.idToMarker[item.id]);\n this.props.selectCollection(e.layer.options.feature, localMarkers);\n });\n\n window.markers = this;\n\n }", "function groupLoader(groupName){\n\n\tthis.createPromise = this.createPromise.bind(this);\n\n\tthis.groupData = this.getElement(groupName, dataModels.group, 'name');\n\tthis.groupCount = dataModels.group.length;\n\tthis.modelsData = this.getElements(groupName, dataModels.models, 'group');\n\tthis.modelsCount = this.modelsData.length;\n\n\tthis.promises = this.getPromises();\n\n\n}", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n size = props.size,\n tag = props.tag;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(circular, 'circular'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(tag, 'tag'), 'labels', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"b\" /* getUnhandledProps */])(LabelGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"c\" /* getElementType */])(LabelGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "static getModelName() {\n return \"AccountGroup\";\n }", "getMarkerLayerGroup() {\n return this._markerLayerGroup;\n }" ]
[ "0.58008933", "0.57160455", "0.56957245", "0.543457", "0.5425413", "0.5348135", "0.53019774", "0.52256423", "0.5212535", "0.5190508", "0.5159354", "0.51460224", "0.5126315", "0.503613", "0.5036009", "0.5035937", "0.5032178", "0.5028976", "0.50117284", "0.49989685", "0.49824584", "0.49718234", "0.49446213", "0.49422735", "0.49307305", "0.49236706", "0.49189022", "0.4911442", "0.49067405", "0.48933628", "0.4888016", "0.48695505", "0.4856815", "0.48558256", "0.48529145", "0.4851264", "0.48500586", "0.4849054", "0.48459268", "0.4833511", "0.48332506", "0.48306975", "0.4824032", "0.48158246", "0.48020414", "0.4801289", "0.47965044", "0.47958744", "0.47945", "0.47913954", "0.47877043", "0.47842237", "0.47810763", "0.47791258", "0.4774884", "0.47725773", "0.47725773", "0.4769653", "0.47635984", "0.47600284", "0.47564247", "0.4753123", "0.47530252", "0.47525555", "0.47489893", "0.47460082", "0.47432217", "0.47416592", "0.47413045", "0.47411895", "0.47411686", "0.4735425", "0.4735425", "0.472922", "0.47252852", "0.47212523", "0.47106102", "0.47066873", "0.47029385", "0.46985048", "0.46983773", "0.46944606", "0.46941605", "0.46928385", "0.46904826", "0.4690381", "0.46885982", "0.46850246", "0.46804243", "0.4679861", "0.4677031", "0.46723002", "0.4663768", "0.466027", "0.46592468", "0.46567148", "0.46544534", "0.46537715", "0.4653567", "0.4651299", "0.46503317" ]
0.0
-1
globals __VUE_SSR_CONTEXT__ IMPORTANT: Do NOT use ES2015 features in this file (except for modules). This module is a runtime utility for cleaner component module output and will be included in the final webpack user bundle.
function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "extend(config, ctx) {\n // if (process.server && process.browser) {\n if (ctx.isDev && ctx.isClient) {\n config.devtool = \"source-map\";\n // if (isDev && process.isClient) {\n config.plugins.push(\n new StylelintPlugin({\n files: [\"**/*.vue\", \"**/*.scss\"],\n })\n ),\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n formatter: require(\"eslint-friendly-formatter\"),\n },\n });\n if (ctx.isDev) {\n config.mode = \"development\";\n }\n }\n for (const rule of config.module.rules) {\n if (rule.use) {\n for (const use of rule.use) {\n if (use.loader === \"sass-loader\") {\n use.options = use.options || {};\n use.options.includePaths = [\n \"node_modules/foundation-sites/scss\",\n \"node_modules/motion-ui/src\",\n ];\n }\n }\n }\n }\n // vue-svg-inline-loader\n const vueRule = config.module.rules.find((rule) =>\n rule.test.test(\".vue\")\n );\n vueRule.use = [\n {\n loader: vueRule.loader,\n options: vueRule.options,\n },\n {\n loader: \"vue-svg-inline-loader\",\n },\n ];\n delete vueRule.loader;\n delete vueRule.options;\n }", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}" ]
[ "0.5848589", "0.5729015", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493", "0.5725493" ]
0.0
-1
Determine if we're running in a standard browser environment This allows axios to run in a web worker, and reactnative. Both environments support XMLHttpRequest, but not fully standard globals. web workers: typeof window > undefined typeof document > undefined reactnative: navigator.product > 'ReactNative'
function isStandardBrowserEnv() { if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { return false; } return ( typeof window !== 'undefined' && typeof document !== 'undefined' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isStandardBrowserEnv() {\n if (\n typeof navigator !== 'undefined' &&\n (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')\n ) {\n return false;\n }\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n }", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n }", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined');\n\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}", "function isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}" ]
[ "0.81448644", "0.81339467", "0.81299907", "0.8129108", "0.811999", "0.811999", "0.81184554", "0.81019855", "0.81019855", "0.81019855", "0.81019855", "0.81019855", "0.81019855", "0.81019855", "0.81019855", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695", "0.80985695" ]
0.0
-1
Parameter are the same as `addEventListener`. Notice that if a listener is registered twice, one with capture and one without, remove each one separately. Removal of a capturing listener does not affect a noncapturing version of the same listener, and vice versa.
function removeEventListener(el, name, handler, opt) { if (isDomLevel2) { el.removeEventListener(name, handler, opt); } else { el.detachEvent('on' + name, handler); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xRemoveEventListener(e,eT,eL,cap)\r\n{\r\n if(!(e=xGetElementById(e)))return;\r\n eT=eT.toLowerCase();\r\n if(e.removeEventListener)e.removeEventListener(eT,eL,cap||false);\r\n else if(e.detachEvent)e.detachEvent('on'+eT,eL);\r\n else e['on'+eT]=null;\r\n}", "function xRemoveEventListener(e,eT,eL,cap)\n{\n if(!(e=xGetElementById(e)))return;\n eT=eT.toLowerCase();\n if(e.removeEventListener)e.removeEventListener(eT,eL,cap||false);\n else if(e.detachEvent)e.detachEvent('on'+eT,eL);\n else e['on'+eT]=null;\n}", "function RemoveEventListener(elem, evt, func, capture){\r\n capture = capture || false;\r\n if(elem.removeEventListener) elem.removeEventListener( evt, func, capture);\r\n else elem.detachEvent('on'+evt, func);\r\n}", "function removeEventListeners(){\n _.forEach(unlistenCallbacks, function(unlisten){\n unlisten();\n });\n unlistenCallbacks = [];\n }", "function xRemoveEventListener2(e,eT,eL,cap)\r\n{\r\n if(!(e=xGetElementById(e))) return;\r\n eT=eT.toLowerCase();\r\n if(e==window) {\r\n if(eT=='resize' && e.xREL) {e.xREL=null; return;}\r\n if(eT=='scroll' && e.xSEL) {e.xSEL=null; return;}\r\n }\r\n if(e.removeEventListener) e.removeEventListener(eT,eL,cap||false);\r\n else if(e.detachEvent) e.detachEvent('on'+eT,eL);\r\n else e['on'+eT]=null;\r\n}", "function removeEvent(target, name, callback, capture) {\n\t\tif (target.removeEventListener) {\n\t\t\ttarget.removeEventListener(name, callback, capture || false);\n\t\t} else if (target.detachEvent) {\n\t\t\ttarget.detachEvent('on' + name, callback);\n\t\t}\n\t}", "function removeEvent(target, name, callback, capture) {\n\t\tif (target.removeEventListener) {\n\t\t\ttarget.removeEventListener(name, callback, capture || false);\n\t\t} else if (target.detachEvent) {\n\t\t\ttarget.detachEvent('on' + name, callback);\n\t\t}\n\t}", "function removeEvent(target, name, callback, capture) {\n\t\tif (target.removeEventListener) {\n\t\t\ttarget.removeEventListener(name, callback, capture || false);\n\t\t} else if (target.detachEvent) {\n\t\t\ttarget.detachEvent('on' + name, callback);\n\t\t}\n\t}", "function removeEvent(target, name, callback, capture) {\n\t\tif (target.removeEventListener) {\n\t\t\ttarget.removeEventListener(name, callback, capture || false);\n\t\t} else if (target.detachEvent) {\n\t\t\ttarget.detachEvent('on' + name, callback);\n\t\t}\n\t}", "removeListener(listener) {\n const index = activeListeners.findIndex(l => l === listener);\n if (index !== -1) {\n activeListeners.splice(index, 1);\n }\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 }", "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 }", "function removeListener(w, event, cb) {\n if (w.detachEvent) w.detachEvent('on' + event, cb);else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "function removeEventListener(handle) {\n GEvent.removeListener(handle);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function pRemoveEvent(target,type,listner,useCapature) {\n if(target.detachEvent) \n target.detachEvent(type[0], listner); \n else \n target.removeEventListener([1], listner, useCapature);\n}", "unregisterSpanEventListener(listener) {\n const index = this.eventListenersLocal.indexOf(listener, 0);\n if (index > -1) {\n this.eventListeners.splice(index, 1);\n }\n }", "removeListener(event: string, listener: Function) {\n var idx;\n\n if (typeof this.__events[event] === 'object') {\n idx = indexOf(this.__events[event], listener);\n\n if (idx > -1) {\n this.__events[event].splice(idx, 1);\n }\n }\n }", "removeEventListener(event, callback, useCapture) {\n\t\tthis.$pwMain.unsubscribe({event: event, fn: callback, useCapture: useCapture});\n\t}", "removeEventListener(event, callback, useCapture) {\n\t\tthis.$pwMain.unsubscribe({event: event, fn: callback, useCapture: useCapture});\n\t}", "_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 }", "function content_listenEvent(type, listener, capture) {\n capture = !!capture;\n\n addEventListener(type, listener, capture);\n\n content_listenShutdown(() => {\n removeEventListener(type, listener, capture);\n });\n }", "function useEventListener(eventTarget, event, listener, capture) {\n if (capture === void 0) {\n capture = false;\n }\n\n var handler = useEventCallback(listener);\n react.useEffect(function () {\n var target = typeof eventTarget === 'function' ? eventTarget() : eventTarget;\n target.addEventListener(event, handler, capture);\n return function () {\n return target.removeEventListener(event, handler, capture);\n };\n }, [eventTarget]);\n}", "function useEventListener(eventTarget, event, listener, capture) {\n if (capture === void 0) {\n capture = false;\n }\n\n var handler = (0,_useEventCallback__WEBPACK_IMPORTED_MODULE_1__.default)(listener);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n var target = typeof eventTarget === 'function' ? eventTarget() : eventTarget;\n target.addEventListener(event, handler, capture);\n return function () {\n return target.removeEventListener(event, handler, capture);\n };\n }, [eventTarget]);\n}", "function useEventListener(eventTarget, event, listener, capture) {\n if (capture === void 0) {\n capture = false;\n }\n\n var handler = (0,_useEventCallback__WEBPACK_IMPORTED_MODULE_1__.default)(listener);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {\n var target = typeof eventTarget === 'function' ? eventTarget() : eventTarget;\n target.addEventListener(event, handler, capture);\n return function () {\n return target.removeEventListener(event, handler, capture);\n };\n }, [eventTarget]);\n}", "function removeListeners(useCapturing) {\r\r\n // get all div in list\r\r\n var divList = document.getElementsByTagName('div');\r\r\n // set event to each div\r\r\n for(var i = 0, len = divList.length; i < len; i++) {\r\r\n var element = divList[i];\r\r\n eventUtility.removeEvent(element, \"click\", markDiv, useCapturing);\r\r\n }\r\r\n}", "function removeEvent(obj, evType, fn, useCapture) {\n if (obj.removeEventListener){\n obj.removeEventListener(evType, fn, useCapture);\n return true;\n } else if (obj.detachEvent){\n var r = obj.detachEvent(\"on\"+evType, fn);\n return r;\n } else {\n alert(\"Handler could not be removed\");\n }\n}", "static addEventListener(node, name, callback, capture = false) {\n node.addEventListener(name, callback, capture);\n return () => node.removeEventListener(name, callback, capture);\n }", "_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 }", "function removeListener(evtName, listener) {\n if (!listenersMap.hasOwnProperty(evtName)) {\n return;\n }\n\n var listeners = listenersMap[evtName];\n var index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1, undefined);\n }\n }", "function uueventdetach(node, // @param Node:\r\n eventType, // @param String: event type\r\n evaluator, // @param Function: evaluator\r\n capture) { // @param Boolean(= false):\r\n eventType = uueventattach._FIX[eventType] || eventType;\r\n\r\n if (node.removeEventListener) {\r\n node.removeEventListener(eventType, evaluator, !!(capture || 0));\r\n } else {\r\n node.detachEvent(\"on\" + eventType, evaluator);\r\n }\r\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 }", "_removeEventListeners() {\n this.currentEventListeners.forEach(listener => {\n this.domElement.removeEventListener(listener.event, listener.callBack);\n });\n this.currentEventListeners = null;\n }", "function xl_DetachEvent(obj, evType, fn, useCapture)\n{\n\tif (!useCapture) var useCapture = true; \n\tif (obj.removeEventListener){\n\t\tobj.removeEventListener(evType, fn, useCapture);\n\t\treturn true;\n\t} else if (obj.detachEvent){\n\t\tvar r = obj.detachEvent(\"on\"+evType, fn);\n\t\treturn r;\n\t} else {\n\t\treturn false;\n\t}\n}", "removeListeners() {}", "removeListeners() {}", "removeListeners() {}", "function unsubscribe(listener) {\r\n var index = subscribers.indexOf(listener);\r\n if (index > -1) {\r\n subscribers.splice(index, 1);\r\n }\r\n }", "function deregisterEventListner(event, handler) {\n if (!_.isString(event)) {\n throw new Error(E_EVENT_NAME);\n }\n\n if (!_.isFunction(handler)) {\n throw new Error(E_EVENT_HANDLER);\n }\n\n var found = $listeners[event] ? $listeners[event].indexOf(handler) : -1;\n\n if (found+1) {\n delete($listeners[event]);\n $listeners[event].splice(found, 1);\n }\n\n return _this_;\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 removeClick(){\n removeEventListener('click',removeClick, false);\n topRight.removeEventListener('click',printXOrO);\n midLeft.removeEventListener('click',printXOrO);\n midMid.removeEventListener('click',printXOrO);\n midRight.removeEventListener('click',printXOrO);\n lowLeft.removeEventListener('click',printXOrO);\n lowMid.removeEventListener('click',printXOrO);\n lowRight.removeEventListener('click',printXOrO);\n addEventListener('click', printXOrO);\n}", "function unsubscribe(listener) {\n\t\tlet out = [];\n\t\tfor (let i=0; i<listeners.length; i++) {\n\t\t\tif (listeners[i]===listener) {\n\t\t\t\tlistener = null;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tout.push(listeners[i]);\n\t\t\t}\n\t\t}\n\t\tlisteners = out;\n\t}", "static removeEventListener(type, handler) {\n if(Linking.unlisten) {\n Linking.unlisten();\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}", "function content_listenEventOnce(type, listener, capture) {\n capture = !!capture;\n\n let onReceive = (event) => {\n removeEventListener(type, onReceive, capture);\n\n content_fixupListener(listener)(event);\n };\n\n addEventListener(type, onReceive, capture);\n }", "_removeEventListeners() {\n this.el.removeEventListener('click', this._onClickBound);\n this.el.removeEventListener('keydown', this._onKeydownBound);\n }", "stopObserving(_elem, _name, _function, _useCapture) {\n if (this.isUndefinedOrNull(_name)) {\n return;\n }\n if (this.isNumber(_elem)) {\n _elem = ELEM.get(_elem);\n }\n if (this.isUndefinedOrNull(_elem)) {\n // console.log('Warning Event.stopObserving of event name: \"' + _name + '\" called with an undefined elem!');\n return;\n }\n _useCapture = _useCapture || false;\n if (_elem.removeEventListener) {\n _elem.removeEventListener(_name, _function, _useCapture);\n }\n else {\n console.warn('element', _elem, 'doesn\\'t have removeEventListener!');\n }\n let i = 0;\n while (i < Event.observers.length) {\n const eo = Event.observers[i];\n if (eo && eo[0] === _elem && eo[1] === _name && eo[2] === _function && eo[3] === _useCapture) {\n Event.observers[i] = null;\n Event.observers.splice(i, 1);\n }\n else {\n i += 1;\n }\n }\n }", "function listenEvent(target, type, listener, capture) {\n if (!target || !type || !listener) {\n throw Error('Missing required parameter.');\n }\n\n capture = !!capture;\n\n target.addEventListener(type, listener, capture);\n\n listenShutdown(() => {\n target.removeEventListener(type, listener, capture);\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 }", "removeListeners()\n {\n this.cancel.removeEventListener('click', this.destroy);\n }", "_removeEventListeners() {\n\n if (this._isNative) {\n this.selectEl.removeEventListener('change', this._onInputBound);\n }\n else {\n this.el.removeEventListener('change', this._onInputBound, true);\n }\n }", "function removeListeners() {\n debug(\"removeListeners\");\n cards().forEach(function(card) {\n card.removeEventListener('click', cardMagic)\n })\n }", "function removeEvent(elm, evType, fn, userCapture)\n{\n if(elm)\n {\n if (elm.removeEventListener) { \n elm.removeEventListener(evType, fn, userCapture); \n return true; \n } else if (elm.detachEvent) { \n var r = elm.detachEvent('on' + evType, fn); \n return r; \n } else {\n elm['on' + evType] = function() {return true;};\n }\n }\n}", "function removeListener (name, fn) {\n debug('removeListener: %s', name);\n if ('data' == name) {\n debug('remapping as \"processedData\" listener', fn);\n name = 'processedData';\n }\n return this.realRemoveListener(name, fn);\n}", "unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }", "function removeListener(selector, event)\n\t{\n\t\t_svg.selectAll(selector).on(event, null);\n\n\t\t// remove listener from the map\n\t\tif (_listeners[selector] &&\n\t\t _listeners[selector][event])\n\t\t{\n\t\t\tdelete _listeners[selector][event];\n\t\t}\n\t}", "removeListener(event, listener) {\n this.ee.removeListener(event, listener);\n }", "function removeMouseListeners(downEvent, upEvent, moveEvent)\n {\n canvas.removeEventListener('mousedown', downHandler, false);\n canvas.removeEventListener('mouseup', upHandler, false);\n canvas.removeEventListener('mousemove', moveHandler, false);\n }", "removeEventListener(\n // tslint:disable-next-line:variable-name\n _type, listener) {\n if (!listenersMap.has(this)) {\n throw new TypeError(\"Expected `this` to be an instance of AbortSignal.\");\n }\n const listeners = listenersMap.get(this);\n const index = listeners.indexOf(listener);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n }", "removeEventListener(\n // tslint:disable-next-line:variable-name\n _type, listener) {\n if (!listenersMap.has(this)) {\n throw new TypeError(\"Expected `this` to be an instance of AbortSignal.\");\n }\n const listeners = listenersMap.get(this);\n const index = listeners.indexOf(listener);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n }", "removeEventListener(\n // tslint:disable-next-line:variable-name\n _type, listener) {\n if (!listenersMap.has(this)) {\n throw new TypeError(\"Expected `this` to be an instance of AbortSignal.\");\n }\n const listeners = listenersMap.get(this);\n const index = listeners.indexOf(listener);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n }", "removeEvent(eventListener) {\n delete this.func[eventListener];\n this.removeEventFromBlob(this.html, eventListener)\n }", "function removeListener(node, type) {\n\n \tif (!node) {\n \t\treturn null; // TODO! Should we throw?\n \t}\n\n \tvar nodeID = infernoNodeID(node, true);\n\n \tif (nodeID) {\n \t\tvar listeners = listenersStorage[nodeID];\n\n \t\tif (listeners && listeners[type]) {\n \t\t\tif (listeners[type] && listeners[type].destroy) {\n \t\t\t\tlisteners[type].destroy();\n \t\t\t}\n \t\t\tlisteners[type] = null;\n\n \t\t\tvar registry = EventRegistry[type];\n\n \t\t\tif (registry) {\n \t\t\t\tif (registry._bubbles) {\n \t\t\t\t\t--registry._counter;\n \t\t\t\t\t// TODO Run tests and check if this works, or code should be removed\n \t\t\t\t\t//\t\t\t\t} else if (registry._focusBlur) {\n \t\t\t\t\t//\t\t\t\t\tnode.removeEventListener(type, eventListener[focusEvents[type]]);\n \t\t\t\t} else {\n \t\t\t\t\t\tnode.removeEventListener(type, eventListener[type]);\n \t\t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n }", "function addEventListener(dom, type, listener, options) {\n //@todo proper type check for options: EventListenerOptions | boolean (TS for some reason gives error on passive parameter)\n //console.log(type, dom);\n dom.addEventListener(type, listener, options || false);\n return new _Disposer__WEBPACK_IMPORTED_MODULE_1__[\"Disposer\"](function () {\n dom.removeEventListener(type, listener, options || false);\n });\n}", "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 }", "function listenEventOnce(target, type, listener, capture) {\n if (!target || !type || !listener) {\n throw Error('Missing required parameter.');\n }\n\n capture = !!capture;\n\n let onReceive = (event) => {\n target.removeEventListener(type, onReceive, capture);\n\n fixupListener(listener)(event);\n };\n\n target.addEventListener(type, onReceive, capture);\n }", "removeListener() {\n document.getElementById('banner-picture').removeEventListener('mousedown', this.mouseDownHandler);\n document.removeEventListener('mouseup', this.mouseUpHandler);\n document.getElementById('banner-picture').removeEventListener('mouseenter', this.mouseEnterHandler);\n document.getElementById('banner-picture').removeEventListener('mousemove', this.mouseMoveHandler);\n }", "removeListener(event, listener, emitter = this._defaultEmitter()) {\n emitter.removeListener(event, listener);\n }", "addListener(listener) {\n if (!activeListeners.includes(listener)) {\n activeListeners.push(listener);\n }\n }", "function ignr(o, t, f)\r\n{\r\n if (o.removeEventListener){\r\n // Because MSIE only has a bubbling phase, capture will always be false.\r\n o.removeEventListener(t, f, false);\r\n return true;\r\n } else if (o.detachEvent){\r\n return o.detachEvent(\"on\" + t, f);\r\n }\r\n return false;\r\n}", "unsubscribe(listener){\n let index = this.listeners.indexOf(listener);\n if( index >= 0 )\n this.listeners.splice(index, 1);\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}", "function removeListeners() {\r\n gameOverModal.btn.removeEventListener(\"click\", backToMenu);\r\n }", "onBeforeDetach(msg) {\n document.removeEventListener('keydown', this, USE_CAPTURE);\n document.removeEventListener('mousedown', this, USE_CAPTURE);\n document.removeEventListener('scroll', this, USE_CAPTURE);\n }", "function removeHTMLValueChangedListener(listener) {\n if(!listener) { return; }\n var found = false;\n var i;\n for (i = 0; i < HTMLValueChangedListeners.length; i++) {\n if (listener === HTMLValueChangedListeners[i]) {\n found = true;\n break;\n }\n }\n if (found) {\n HTMLValueChangedListeners.splice(i, 1);\n }\n}", "function removeEvent(object, eventName, functionName, capture){\n\t\t//following true if browser == EI\n\tif(object.detachEvent) {\n\t\tobject.detachEvent(\"on\" + eventName, functionName);\n\t} //end if EI\n\t//else is another browser\n\telse if(object.removeEventListener) {\n\t\tobject.removeEventListener(eventName, functionName, capture);\n\t} //end else other browser, not EI\n} //end", "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 removeListeners() {\n window.removeEventListener('message', _onParentMessage);\n}", "stopListening (optionalElement) {\n if (optionalElement) {\n Object.keys(eventTypeToHandler).forEach(eventType => {\n optionalElement.removeEventListener(eventType, this)\n })\n } else {\n stopped = true\n }\n }", "_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 }", "function removeListeners() {\n\t\t$(document).off(EVENT_NAME_KEYPRESS);\n\t\t$(document).off(EVENT_NAME_KEYUP);\n\t}", "addListener(listener) {\r\n if (IDataListener_1.isDataListener(listener) && this.listeners.indexOf(listener) === -1) {\r\n this.listeners.push(listener);\r\n listener.registerRemover(() => {\r\n const index = this.listeners.indexOf(listener);\r\n if (index !== -1)\r\n this.listeners.splice(index, 1);\r\n });\r\n }\r\n }", "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 clearListeners(event) {\n if(event) {\n delete listeners[event];\n } else {\n listeners = {};\n }\n }", "removeListener(type, listener) {\n let removedListener;\n\n const events = this._events;\n if (events === undefined) return this;\n\n const list = events[type];\n if (list === undefined) return this;\n\n for (let i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener) {\n removedListener = list[i];\n list.splice(i, 1);\n this.emit(\"removedListener\", type, removedListener);\n break;\n }\n }\n\n return this;\n }", "function removeDownListener() {\n if(listener.down) {\n document.removeEventListener('mousedown', mouseDown, false);\n listener.down = false;\n }\n }", "function removeListeners(lView) {\n var tCleanup = lView[TVIEW].cleanup;\n if (tCleanup !== null) {\n var lCleanup = lView[CLEANUP];\n for (var i = 0; i < tCleanup.length - 1; i += 2) {\n if (typeof tCleanup[i] === 'string') {\n // This is a native DOM listener\n var idxOrTargetGetter = tCleanup[i + 1];\n var target = typeof idxOrTargetGetter === 'function' ?\n idxOrTargetGetter(lView) :\n unwrapRNode(lView[idxOrTargetGetter]);\n var listener = lCleanup[tCleanup[i + 2]];\n var useCaptureOrSubIdx = tCleanup[i + 3];\n if (typeof useCaptureOrSubIdx === 'boolean') {\n // native DOM listener registered with Renderer3\n target.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx);\n }\n else {\n if (useCaptureOrSubIdx >= 0) {\n // unregister\n lCleanup[useCaptureOrSubIdx]();\n }\n else {\n // Subscription\n lCleanup[-useCaptureOrSubIdx].unsubscribe();\n }\n }\n i += 2;\n }\n else {\n // This is a cleanup function that is grouped with the index of its context\n var context = lCleanup[tCleanup[i + 1]];\n tCleanup[i].call(context);\n }\n }\n lView[CLEANUP] = null;\n }\n}", "remove() {\n window.removeEventListener('vrdisplaypresentchange', this.__onVRDisplayPresentChange);\n if (screenfull.enabled) {\n document.removeEventListener(screenfull.raw.fullscreenchanged, this.__onChangeFullscreen);\n }\n\n this.removeAllListeners();\n }", "omitEventsClick(){\r\n this.color.cyan.removeEventListener('click',this.detectColor)\r\n this.color.violet.removeEventListener('click',this.detectColor)\r\n this.color.orange.removeEventListener('click',this.detectColor)\r\n this.color.green.removeEventListener('click',this.detectColor)\r\n}" ]
[ "0.73523843", "0.7347782", "0.73320246", "0.71575457", "0.70834035", "0.70741934", "0.70741934", "0.70741934", "0.70741934", "0.69655424", "0.6936234", "0.69298404", "0.69137335", "0.69062173", "0.69062173", "0.69062173", "0.69062173", "0.69062173", "0.68763345", "0.6863793", "0.6863793", "0.6863793", "0.6863793", "0.6863793", "0.6863793", "0.68340313", "0.68311054", "0.68159205", "0.67406976", "0.67406976", "0.6737484", "0.6734545", "0.6689945", "0.66402143", "0.66402143", "0.6606812", "0.65890783", "0.6579927", "0.65613234", "0.6554873", "0.6549433", "0.6541576", "0.65410495", "0.6515507", "0.651452", "0.651452", "0.651452", "0.6509759", "0.649494", "0.6494561", "0.6487889", "0.6484928", "0.6469312", "0.64461195", "0.64453256", "0.64402825", "0.6429082", "0.64204645", "0.63981664", "0.63893694", "0.63799393", "0.6371446", "0.6365725", "0.6361261", "0.63550615", "0.6348518", "0.6344362", "0.63393724", "0.6334981", "0.6334981", "0.6334981", "0.633271", "0.6323996", "0.63150597", "0.6301258", "0.62805355", "0.62684506", "0.62654716", "0.6257428", "0.6250402", "0.62395006", "0.62313807", "0.6226764", "0.62088877", "0.62051696", "0.61964595", "0.6190353", "0.6186078", "0.6185993", "0.6181598", "0.6169299", "0.6167565", "0.6157383", "0.61566406", "0.6154888", "0.61503386", "0.6137202", "0.61366457", "0.6131946" ]
0.6346375
67
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function IndicatorAxis(dim, scale, radiusExtent) { Axis.call(this, dim, scale, radiusExtent); /** * Axis type * - 'category' * - 'value' * - 'time' * - 'log' * @type {string} */ this.type = 'value'; this.angle = 0; /** * Indicator name * @type {string} */ this.name = ''; /** * @type {module:echarts/model/Model} */ this.model; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function getViewRect(seriesModel, api) { return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), { width: api.getWidth(), height: api.getHeight() }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "function getImplementation( cb ){\n\n }", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53492224", "0.48935446", "0.48514137", "0.48082927", "0.47720826", "0.4744996", "0.47347993", "0.47019523", "0.46926585", "0.46926585", "0.46730793", "0.46452278", "0.46379203", "0.46256977", "0.4618543", "0.45818752", "0.45806864", "0.45742333", "0.4568166", "0.45616665", "0.45558366", "0.4549164", "0.45481402", "0.45447382", "0.4537214", "0.4522665", "0.451785", "0.4497493", "0.44942656", "0.4484697", "0.4472648", "0.44683102", "0.4465637", "0.44581723", "0.44557354", "0.4454013", "0.44524705", "0.44436827", "0.44380364", "0.4427005", "0.44242096", "0.44237852", "0.44070554", "0.44050547", "0.44050547", "0.44050547", "0.4404598", "0.4393088", "0.43767613", "0.43684104", "0.43635124", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43511948", "0.43502447", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43443355", "0.43417493", "0.43380377", "0.43350744", "0.43350744", "0.4332956", "0.43327877" ]
0.0
-1
Mixin common methods to axis model, Inlcude methods `getFormattedLabels() => Array.` `getCategories() => Array.` `getMin(origin: boolean) => number` `getMax(origin: boolean) => number` `getNeedCrossZero() => boolean` `setRange(start: number, end: number)` `resetRange()`
function mixinAxisModelCommonMethods(Model) { zrUtil.mixin(Model, axisModelCommonMixin); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Axis(min, max) {\n this.Min = min;\n this.Max = max;\n }", "function mixinAxisModelCommonMethods(Model) {\n\t mixin(Model, AxisModelCommonMixin);\n\t }", "function _default() {\n\n\tfunction axisX(selection, x) {\n\t\tselection.attr(\"transform\", function (d) {\n\t\t\treturn \"translate(\" + Math.ceil(x(d) + tickOffset) + \", 0)\";\n\t\t});\n\t}\n\n\tfunction axisY(selection, y) {\n\t\tselection.attr(\"transform\", function (d) {\n\t\t\treturn \"translate(0,\" + Math.ceil(y(d)) + \")\";\n\t\t});\n\t}\n\n\tfunction scaleExtent(domain) {\n\t\tvar start = domain[0],\n\t\t stop = domain[domain.length - 1];\n\n\n\t\treturn start < stop ? [start, stop] : [stop, start];\n\t}\n\n\tfunction generateTicks(scale) {\n\t\tvar ticks = [];\n\n\t\tif (scale.ticks) return scale.ticks.apply(scale, tickArguments ? (0, _util.toArray)(tickArguments) : []).map(function (v) {\n\t\t\t\treturn (\n\t\t\t\t\t// round the tick value if is number\n\t\t\t\t\t/(string|number)/.test(typeof v === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(v)) && !isNaN(v) ? Math.round(v * 10) / 10 : v\n\t\t\t\t);\n\t\t\t});\n\n\t\tfor (var domain = scale.domain(), i = Math.ceil(domain[0]); i < domain[1]; i++) ticks.push(i);\n\n\t\treturn ticks.length > 0 && ticks[0] > 0 && ticks.unshift(ticks[0] - (ticks[1] - ticks[0])), ticks;\n\t}\n\n\tfunction copyScale() {\n\t\tvar newScale = scale.copy();\n\n\t\tif (params.isCategory || !newScale.domain().length) {\n\t\t\tvar domain = scale.domain();\n\n\t\t\tnewScale.domain([domain[0], domain[1] - 1]);\n\t\t}\n\n\t\treturn newScale;\n\t}\n\n\tfunction textFormatted(v) {\n\t\t// to round float numbers from 'binary floating point'\n\t\t// https://en.wikipedia.org/wiki/Double-precision_floating-point_format\n\t\t// https://stackoverflow.com/questions/17849101/laymans-explanation-for-why-javascript-has-weird-floating-math-ieee-754-stand\n\t\tvar value = /\\d+\\.\\d+0{5,}\\d$/.test(v) ? +(v + \"\").replace(/0+\\d$/, \"\") : v,\n\t\t formatted = tickFormat ? tickFormat(value) : value;\n\n\n\t\treturn (0, _util.isDefined)(formatted) ? formatted : \"\";\n\t}\n\n\tfunction transitionise(selection) {\n\t\treturn params.withoutTransition ? selection.interrupt() : selection.transition(transition);\n\t}\n\n\tfunction axis(g) {\n\t\tg.each(function () {\n\n\t\t\t// this should be called only when category axis\n\t\t\tfunction splitTickText(d, maxWidthValue) {\n\n\t\t\t\tfunction split(splitted, text) {\n\t\t\t\t\tspaceIndex = undefined;\n\n\t\t\t\t\tfor (var i = 1; i < text.length; i++)\n\n\t\t\t\t\t// if text width gets over tick width, split by space index or current index\n\t\t\t\t\tif (text.charAt(i) === \" \" && (spaceIndex = i), subtext = text.substr(0, i + 1), textWidth = sizeFor1Char.w * subtext.length, maxWidth < textWidth) return split(splitted.concat(text.substr(0, spaceIndex || i)), text.slice(spaceIndex ? spaceIndex + 1 : i));\n\n\t\t\t\t\treturn splitted.concat(text);\n\t\t\t\t}\n\n\t\t\t\tvar tickText = textFormatted(d),\n\t\t\t\t maxWidth = maxWidthValue,\n\t\t\t\t subtext = void 0,\n\t\t\t\t spaceIndex = void 0,\n\t\t\t\t textWidth = void 0;\n\t\t\t\treturn Object.prototype.toString.call(tickText) === \"[object Array]\" ? tickText : ((!maxWidth || maxWidth <= 0) && (maxWidth = isVertical ? 95 : params.isCategory ? Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12 : 110), split([], tickText + \"\"));\n\t\t\t}\n\n\t\t\tfunction tspanDy(d, i) {\n\t\t\t\tvar dy = sizeFor1Char.h;\n\n\t\t\t\treturn i === 0 && (dy = orient === \"left\" || orient === \"right\" ? -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3) : \".71em\"), dy;\n\t\t\t}\n\n\t\t\tfunction tickSize(d) {\n\t\t\t\tvar tickPosition = scale(d) + (tickCentered ? 0 : tickOffset);\n\n\t\t\t\treturn range[0] < tickPosition && tickPosition < range[1] ? 6 : 0;\n\t\t\t}\n\n\t\t\tvar g = (0, _d3Selection.select)(this);\n\n\t\t\taxis.g = g;\n\n\n\t\t\tvar scale0 = this.__chart__ || scale,\n\t\t\t scale1 = copyScale();\n\t\t\tthis.__chart__ = scale1;\n\n\n\t\t\t// count of tick data in array\n\t\t\tvar ticks = tickValues || generateTicks(scale1),\n\t\t\t tick = g.selectAll(\".tick\").data(ticks, scale1),\n\t\t\t tickEnter = tick.enter().insert(\"g\", \".domain\").attr(\"class\", \"tick\").style(\"opacity\", \"1\"),\n\t\t\t tickExit = tick.exit().remove();\n\n\t\t\t// update selection\n\n\n\t\t\t// enter selection\n\n\n\t\t\t// MEMO: No exit transition. The reason is this transition affects max tick width calculation because old tick will be included in the ticks.\n\t\t\ttick = tickEnter.merge(tick);\n\n\n\t\t\tvar tickUpdate = transitionise(tick).style(\"opacity\", \"1\"),\n\t\t\t tickTransform = void 0,\n\t\t\t tickX = void 0,\n\t\t\t tickY = void 0,\n\t\t\t range = scale.rangeExtent ? scale.rangeExtent() : scaleExtent((params.orgXScale || scale).range()),\n\t\t\t path = g.selectAll(\".domain\").data([0]),\n\t\t\t pathUpdate = path.enter().append(\"path\").attr(\"class\", \"domain\").merge(transitionise(path));\n\n\t\t\t// update selection - data join\n\n\n\t\t\t// enter + update selection\n\t\t\ttickEnter.append(\"line\"), tickEnter.append(\"text\");\n\n\n\t\t\tvar lineEnter = tickEnter.select(\"line\"),\n\t\t\t lineUpdate = tickUpdate.select(\"line\"),\n\t\t\t textEnter = tickEnter.select(\"text\"),\n\t\t\t textUpdate = tickUpdate.select(\"text\");\n\t\t\tparams.isCategory ? (tickOffset = Math.ceil((scale1(1) - scale1(0)) / 2), tickX = tickCentered ? 0 : tickOffset, tickY = tickCentered ? tickOffset : 0) : (tickX = 0, tickOffset = tickX);\n\n\n\t\t\tvar tspan = void 0,\n\t\t\t sizeFor1Char = _getSizeFor1Char(g.select(\".tick\")),\n\t\t\t counts = [],\n\t\t\t tickLength = Math.max(6, 0) + 3,\n\t\t\t isVertical = orient === \"left\" || orient === \"right\",\n\t\t\t text = tick.select(\"text\");tspan = text.selectAll(\"tspan\").data(function (d, index) {\n\t\t\t\tvar split = params.tickMultiline ? splitTickText(d, params.tickWidth) : (0, _util.isArray)(textFormatted(d)) ? textFormatted(d).concat() : [textFormatted(d)];\n\n\t\t\t\treturn counts[index] = split.length, split.map(function (splitted) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\tsplitted: splitted\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}), tspan.exit().remove(), tspan = tspan.enter().append(\"tspan\").merge(tspan).text(function (d) {\n\t\t\t\treturn d.splitted;\n\t\t\t});\n\n\n\t\t\tvar rotate = params.tickTextRotate;\n\n\t\t\tif (orient === \"bottom\" ? (tickTransform = axisX, lineEnter.attr(\"y2\", 6), textEnter.attr(\"y\", 9), lineUpdate.attr(\"x1\", tickX).attr(\"x2\", tickX).attr(\"y2\", tickSize), textUpdate.attr(\"x\", 0).attr(\"y\", function (r) {\n\t\t\t\treturn r ? 11.5 - 2.5 * (r / 15) * (r > 0 ? 1 : -1) : 9;\n\t\t\t}(rotate)).style(\"text-anchor\", function (r) {\n\t\t\t\treturn r ? r > 0 ? \"start\" : \"end\" : \"middle\";\n\t\t\t}(rotate)).attr(\"transform\", function (r) {\n\t\t\t\treturn r ? \"rotate(\" + r + \")\" : \"\";\n\t\t\t}(rotate)), tspan.attr(\"x\", 0).attr(\"dy\", tspanDy).attr(\"dx\", function (r) {\n\t\t\t\treturn r ? 8 * Math.sin(Math.PI * (r / 180)) : 0;\n\t\t\t}(rotate)), pathUpdate.attr(\"d\", \"M\" + range[0] + \",\" + outerTickSize + \"V0H\" + range[1] + \"V\" + outerTickSize)) : orient === \"top\" ? (tickTransform = axisX, lineEnter.attr(\"y2\", -6), textEnter.attr(\"y\", -9), lineUpdate.attr(\"x2\", 0).attr(\"y2\", -6), textUpdate.attr(\"x\", 0).attr(\"y\", -9), text.style(\"text-anchor\", \"middle\"), tspan.attr(\"x\", 0).attr(\"dy\", \"0em\"), pathUpdate.attr(\"d\", \"M\" + range[0] + \",\" + -outerTickSize + \"V0H\" + range[1] + \"V\" + -outerTickSize)) : orient === \"left\" ? (tickTransform = axisY, lineEnter.attr(\"x2\", -6), textEnter.attr(\"x\", -9), lineUpdate.attr(\"x2\", -6).attr(\"y1\", tickY).attr(\"y2\", tickY), textUpdate.attr(\"x\", -9).attr(\"y\", tickOffset), text.style(\"text-anchor\", \"end\"), tspan.attr(\"x\", -9).attr(\"dy\", tspanDy), pathUpdate.attr(\"d\", \"M\" + -outerTickSize + \",\" + range[0] + \"H0V\" + range[1] + \"H\" + -outerTickSize)) : orient === \"right\" ? (tickTransform = axisY, lineEnter.attr(\"x2\", 6), textEnter.attr(\"x\", 9), lineUpdate.attr(\"x2\", 6).attr(\"y2\", 0), textUpdate.attr(\"x\", 9).attr(\"y\", 0), text.style(\"text-anchor\", \"start\"), tspan.attr(\"x\", 9).attr(\"dy\", tspanDy), pathUpdate.attr(\"d\", \"M\" + outerTickSize + \",\" + range[0] + \"H0V\" + range[1] + \"H\" + outerTickSize)) : void 0, params.tickTitle && textUpdate.append && textUpdate.append(\"title\").each(function (index) {\n\t\t\t\t(0, _d3Selection.select)(this).text(params.tickTitle[index]);\n\t\t\t}), scale1.bandwidth) {\n\t\t\t\tvar x = scale1,\n\t\t\t\t dx = x.bandwidth() / 2;\n\t\t\t\tscale0 = function (d) {\n\t\t\t\t\treturn x(d) + dx;\n\t\t\t\t}, scale1 = scale0;\n\t\t\t} else scale0.bandwidth ? scale0 = scale1 : tickExit.call(tickTransform, scale1);\n\n\t\t\ttickEnter.call(tickTransform, scale0), tickUpdate.call(tickTransform, scale1);\n\t\t});\n\t}\n\n\tvar params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t scale = (0, _d3Scale.scaleLinear)(),\n\t orient = \"bottom\",\n\t outerTickSize = params.withOuterTick ? 6 : 0,\n\t tickValues = null,\n\t tickFormat = void 0,\n\t tickArguments = void 0,\n\t tickOffset = 0,\n\t tickCulling = !0,\n\t tickCentered = void 0,\n\t transition = void 0,\n\t _getSizeFor1Char = function getSizeFor1Char(tick) {\n\t\t// default size for one character\n\t\tvar size = {\n\t\t\th: 11.5,\n\t\t\tw: 5.5\n\t\t};\n\n\t\treturn tick.empty() || tick.select(\"text\").text(\"0\").call(function (el) {\n\t\t\tvar box = el.node().getBBox(),\n\t\t\t h = box.height,\n\t\t\t w = box.width;\n\t\t\th && w && (size.h = h, size.w = w), el.text(\"\");\n\t\t}), _getSizeFor1Char = function getSizeFor1Char() {\n\t\t\treturn size;\n\t\t}, size;\n\t};\n\n\treturn axis.scale = function (x) {\n\t\treturn arguments.length ? (scale = x, axis) : scale;\n\t}, axis.orient = function (x) {\n\t\treturn arguments.length ? (orient = x in {\n\t\t\ttop: 1,\n\t\t\tright: 1,\n\t\t\tbottom: 1,\n\t\t\tleft: 1\n\t\t} ? x + \"\" : \"bottom\", axis) : orient;\n\t}, axis.tickFormat = function (format) {\n\t\treturn arguments.length ? (tickFormat = format, axis) : tickFormat;\n\t}, axis.tickCentered = function (isCentered) {\n\t\treturn arguments.length ? (tickCentered = isCentered, axis) : tickCentered;\n\t}, axis.tickOffset = function () {\n\t\treturn tickOffset;\n\t}, axis.tickInterval = function (size) {\n\t\tvar interval = void 0;\n\n\t\tif (params.isCategory) interval = tickOffset * 2;else {\n\t\t\tvar length = axis.g.select(\"path.domain\").node().getTotalLength() - outerTickSize * 2;\n\n\t\t\tinterval = length / (size || axis.g.selectAll(\"line\").size());\n\t\t}\n\n\t\treturn interval === Infinity ? 0 : interval;\n\t}, axis.ticks = function () {\n\t\tfor (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\n\t\treturn args.length ? (tickArguments = (0, _util.toArray)(args), axis) : tickArguments;\n\t}, axis.tickCulling = function (culling) {\n\t\treturn arguments.length ? (tickCulling = culling, axis) : tickCulling;\n\t}, axis.tickValues = function (x) {\n\t\tif ((0, _util.isFunction)(x)) tickValues = function () {\n\t\t\t\treturn x(scale.domain());\n\t\t\t};else {\n\t\t\tif (!arguments.length) return tickValues;\n\n\t\t\ttickValues = x;\n\t\t}\n\n\t\treturn this;\n\t}, axis.setTransition = function (t) {\n\t\treturn transition = t, this;\n\t}, axis;\n}", "function Axis(min, max, majorUnit, minorUnit,title){\r\n\tthis.displayMajor=null;\r\n\tthis.displayMinor=null;\r\n\r\n\t//Called by descendents\r\n\tthis.init = function(min, max, majorUnit, minorUnit,title)\r\n\t{\r\n\t\tthis.min=min;\r\n\t\tthis.max=max;\r\n\t\tthis.minorUnit=minorUnit;\r\n\t\tthis.majorUnit=majorUnit;\r\n\t\tthis.title=title;\r\n\t}\r\n\r\n\t//Display options for each axis unit, possible values: guides, marks, none\r\n\tthis.setDisplayOptions = function(major, minor)\r\n\t{\r\n\t\tthis.displayMajor = major;\r\n\t\tthis.displayMinor = minor;\r\n\t}\r\n}", "function axis$1 () {\n\n var decorate = noop,\n orient = 'bottom',\n tickFormat = null,\n outerTickSize = 6,\n innerTickSize = 6,\n tickPadding = 3,\n svgDomainLine = d3.svg.line(),\n ticks = _ticks();\n\n var dataJoin$$ = dataJoin().selector('g.tick').element('g').key(identity).attr('class', 'tick');\n\n var domainPathDataJoin = dataJoin().selector('path.domain').element('path').attr('class', 'domain');\n\n // returns a function that creates a translation based on\n // the bound data\n function containerTranslate(s, trans) {\n return function (d) {\n return trans(s(d), 0);\n };\n }\n\n function translate(x, y) {\n if (isVertical()) {\n return 'translate(' + y + ', ' + x + ')';\n } else {\n return 'translate(' + x + ', ' + y + ')';\n }\n }\n\n function pathTranspose(arr) {\n if (isVertical()) {\n return arr.map(function (d) {\n return [d[1], d[0]];\n });\n } else {\n return arr;\n }\n }\n\n function isVertical() {\n return orient === 'left' || orient === 'right';\n }\n\n function tryApply(fn, defaultVal) {\n var scale = ticks.scale();\n return scale[fn] ? scale[fn].apply(scale, ticks.ticks()) : defaultVal;\n }\n\n var axis = function axis(selection) {\n\n selection.each(function (data, index) {\n\n var scale = ticks.scale();\n\n // Stash a snapshot of the new scale, and retrieve the old snapshot.\n var scaleOld = this.__chart__ || scale;\n this.__chart__ = scale.copy();\n\n var ticksArray = ticks();\n var tickFormatter = tickFormat == null ? tryApply('tickFormat', identity) : tickFormat;\n var sign = orient === 'bottom' || orient === 'right' ? 1 : -1;\n var container = d3.select(this);\n\n // add the domain line\n var range$$ = range(scale);\n var domainPathData = pathTranspose([[range$$[0], sign * outerTickSize], [range$$[0], 0], [range$$[1], 0], [range$$[1], sign * outerTickSize]]);\n\n var domainLine = domainPathDataJoin(container, [data]);\n domainLine.attr('d', svgDomainLine(domainPathData));\n\n // datajoin and construct the ticks / label\n dataJoin$$.attr({\n // set the initial tick position based on the previous scale\n // in order to get the correct enter transition - however, for ordinal\n // scales the tick will not exist on the old scale, so use the current position\n 'transform': containerTranslate(isOrdinal(scale) ? scale : scaleOld, translate)\n });\n\n var g = dataJoin$$(container, ticksArray);\n\n // enter\n g.enter().append('path');\n\n var labelOffset = sign * (innerTickSize + tickPadding);\n g.enter().append('text').attr('transform', translate(0, labelOffset));\n\n // update\n g.attr('class', 'tick orient-' + orient);\n\n g.attr('transform', containerTranslate(scale, translate));\n\n g.select('path').attr('d', function (d) {\n return svgDomainLine(pathTranspose([[0, 0], [0, sign * innerTickSize]]));\n });\n\n g.select('text').attr('transform', translate(0, labelOffset)).attr('dy', function () {\n var offset = '0em';\n if (isVertical()) {\n offset = '0.32em';\n } else if (orient === 'bottom') {\n offset = '0.71em';\n }\n return offset;\n }).text(tickFormatter);\n\n // exit - for non ordinal scales, exit by animating the tick to its new location\n if (!isOrdinal(scale)) {\n g.exit().attr('transform', containerTranslate(scale, translate));\n }\n\n decorate(g, data, index);\n });\n };\n\n axis.tickFormat = function (x) {\n if (!arguments.length) {\n return tickFormat;\n }\n tickFormat = x;\n return axis;\n };\n\n axis.tickSize = function (x) {\n var n = arguments.length;\n if (!n) {\n return innerTickSize;\n }\n innerTickSize = Number(x);\n outerTickSize = Number(arguments[n - 1]);\n return axis;\n };\n\n axis.innerTickSize = function (x) {\n if (!arguments.length) {\n return innerTickSize;\n }\n innerTickSize = Number(x);\n return axis;\n };\n\n axis.outerTickSize = function (x) {\n if (!arguments.length) {\n return outerTickSize;\n }\n outerTickSize = Number(x);\n return axis;\n };\n\n axis.tickPadding = function (x) {\n if (!arguments.length) {\n return tickPadding;\n }\n tickPadding = x;\n return axis;\n };\n\n axis.orient = function (x) {\n if (!arguments.length) {\n return orient;\n }\n orient = x;\n return axis;\n };\n\n axis.decorate = function (x) {\n if (!arguments.length) {\n return decorate;\n }\n decorate = x;\n return axis;\n };\n\n rebindAll(axis, ticks);\n\n return axis;\n }", "function axis () {\n\n var axis = axis$1(),\n baseline = d3.functor(0),\n decorate = noop,\n xScale = d3.time.scale(),\n yScale = d3.scale.linear();\n\n var dataJoin$$ = dataJoin().selector('g.axis-adapter').element('g').attr({ 'class': 'axis axis-adapter' });\n\n var axisAdapter = function axisAdapter(selection) {\n\n selection.each(function (data, index) {\n\n var g = dataJoin$$(this, [data]);\n\n var translation;\n switch (axisAdapter.orient()) {\n case 'top':\n case 'bottom':\n translation = 'translate(0,' + yScale(baseline(data)) + ')';\n axis.scale(xScale);\n break;\n\n case 'left':\n case 'right':\n translation = 'translate(' + xScale(baseline(data)) + ',0)';\n axis.scale(yScale);\n break;\n\n default:\n throw new Error('Invalid orientation');\n }\n\n g.enter().attr('transform', translation);\n g.attr('transform', translation);\n\n g.call(axis);\n\n decorate(g, data, index);\n });\n };\n\n axisAdapter.baseline = function (x) {\n if (!arguments.length) {\n return baseline;\n }\n baseline = d3.functor(x);\n return axisAdapter;\n };\n axisAdapter.decorate = function (x) {\n if (!arguments.length) {\n return decorate;\n }\n decorate = x;\n return axisAdapter;\n };\n axisAdapter.xScale = function (x) {\n if (!arguments.length) {\n return xScale;\n }\n xScale = x;\n return axisAdapter;\n };\n axisAdapter.yScale = function (x) {\n if (!arguments.length) {\n return yScale;\n }\n yScale = x;\n return axisAdapter;\n };\n\n return d3.rebind(axisAdapter, axis, 'orient', 'ticks', 'tickValues', 'tickSize', 'innerTickSize', 'outerTickSize', 'tickPadding', 'tickFormat');\n }", "get Axis() {\n throw new Error('axis must be implemented in derived classes');\n }", "function componentCircularAxis () {\n\n /* Default Properties */\n var width = 300;\n var height = 300;\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n var radius = void 0;\n var radialScale = void 0;\n var ringScale = void 0;\n\n /**\n * Constructor\n *\n * @constructor\n * @alias circularAxis\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n if (typeof radius === \"undefined\") {\n radius = Math.min(width, height) / 2;\n }\n\n // Create axis group\n var axisSelect = selection.selectAll(\".axis\").data([0]);\n\n var axis = axisSelect.enter().append(\"g\").classed(\"axis\", true).on(\"click\", function (d) {\n dispatch.call(\"customClick\", this, d);\n }).merge(axisSelect);\n\n // Outer circle\n var outerCircle = axis.selectAll(\".outerCircle\").data([radius]).enter().append(\"circle\").classed(\"outerCircle\", true).attr(\"r\", function (d) {\n return d;\n }).style(\"fill\", \"none\").attr(\"stroke-width\", 2).attr(\"stroke\", \"#ddd\");\n\n // Tick Data Generator\n var tickData = function tickData() {\n var tickArray = void 0,\n tickPadding = void 0;\n if (typeof ringScale.ticks === \"function\") {\n // scaleLinear\n tickArray = ringScale.ticks();\n tickPadding = 0;\n } else {\n // scaleBand\n tickArray = ringScale.domain();\n tickPadding = ringScale.bandwidth() / 2;\n }\n\n return tickArray.map(function (d) {\n return {\n value: d,\n radius: ringScale(d),\n padding: tickPadding\n };\n });\n };\n\n var tickCirclesGroupSelect = axis.selectAll(\".tickCircles\").data(function () {\n return [tickData()];\n });\n\n var tickCirclesGroup = tickCirclesGroupSelect.enter().append(\"g\").classed(\"tickCircles\", true).merge(tickCirclesGroupSelect);\n\n var tickCircles = tickCirclesGroup.selectAll(\"circle\").data(function (d) {\n return d;\n });\n\n tickCircles.enter().append(\"circle\").style(\"fill\", \"none\").attr(\"stroke-width\", 1).attr(\"stroke\", \"#ddd\").merge(tickCircles).transition().attr(\"r\", function (d) {\n return d.radius + d.padding;\n });\n\n tickCircles.exit().remove();\n\n // Spoke Data Generator\n var spokeData = function spokeData() {\n var spokeArray = [];\n var spokeCount = 0;\n if (typeof radialScale.ticks === \"function\") {\n // scaleLinear\n var min = d3.min(radialScale.domain());\n var max = d3.max(radialScale.domain());\n spokeCount = radialScale.ticks().length;\n var spokeIncrement = (max - min) / spokeCount;\n for (var i = 0; i <= spokeCount; i++) {\n spokeArray[i] = (spokeIncrement * i).toFixed(0);\n }\n } else {\n // scaleBand\n spokeArray = radialScale.domain();\n spokeCount = spokeArray.length;\n spokeArray.push(\"\");\n }\n\n var spokeScale = d3.scaleLinear().domain([0, spokeCount]).range(radialScale.range());\n\n return spokeArray.map(function (d, i) {\n return {\n value: d,\n rotate: spokeScale(i)\n };\n });\n };\n\n var spokesGroupSelect = axis.selectAll(\".spokes\").data(function () {\n return [spokeData()];\n });\n\n var spokesGroup = spokesGroupSelect.enter().append(\"g\").classed(\"spokes\", true).merge(spokesGroupSelect);\n\n var spokes = spokesGroup.selectAll(\"line\").data(function (d) {\n return d;\n });\n\n spokes.enter().append(\"line\").attr(\"id\", function (d) {\n return d.value;\n }).attr(\"y2\", -radius).merge(spokes).attr(\"transform\", function (d) {\n return \"rotate(\" + d.rotate + \")\";\n });\n\n spokes.exit().remove();\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Radius Getter / Setter\n *\n * @param {number} _v - Radius in px.\n * @returns {*}\n */\n my.radius = function (_v) {\n if (!arguments.length) return radius;\n radius = _v;\n return this;\n };\n\n /**\n * Radial Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.radialScale = function (_v) {\n if (!arguments.length) return radialScale;\n radialScale = _v;\n return my;\n };\n\n /**\n * Ring Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.ringScale = function (_v) {\n if (!arguments.length) return ringScale;\n ringScale = _v;\n return my;\n };\n\n return my;\n }", "get Axis() {\n let sampleData = this.chart.data[0];\n let size = sampleData.length;\n\n return d3.svg\n .axis()\n .scale(this.chart.xScale)\n .orient('bottom')\n .tickFormat(getDate().long)\n .tickValues(getBestTickValues(sampleData));\n }", "function AxisFormat()\n{\n\t/**\n\t * The type of axis defines its scale.\n\t * <ul>\n\t * <li> \"linear\" - ...\n\t * <li> \"log\" - ...\n\t * <li> \"ordinal\" - The values along the axis are determined by a\n\t * discrete itemized list, calculated from the graphed data.\n\t * <li> \"time\" - the values are a series of dates/times\n\t * <li> \"double positive\" - axis that always counts up from zero,\n\t * regardless of the sign of the data\n\t * </ul>\n\t * @type {string}\n\t */\n\tthis.type = \"linear\";\n\n\t/**\n\t * The number of \"ticks\" to display along the axis including those\n\t * at the ends of the axis. Should be a positive integer or zero and\n\t * will be coerced to a valid value in an undefined way if not.\n\t * Or if the type of axis is \"ordinal\" then ticks may be an array\n\t * to be displayed evenly distributed along the axis.\n\t * @type {number|Array.<*>}\n\t */\n\tthis.ticks = 5;\n\n\t/**\n\t * The minimum and maximum data values expected for the axis in an\n\t * array with the minimum as element 0 and the maximum as element 1.\n\t * If undefined, will default to [0, 1], or the [min, max] of the ticks\n\t * array if it is an array.\n\t * @type {Array.<number>|undefined}\n\t * TODO: find out why current behavior defaults a vertical axis to [0,1] and a horizontal axis to [1e-10,1] -mjl\n\t */\n\tthis.extent = [0, 1];\n\n\t/**\n\t * There are 2 sets of orientation values, one for a horizontal (x) axis\n\t * and one for a vertical (y) axis.\n\t * <ul>\n\t * <li> Horizontal (x) axis values\n\t * <ul>\n\t * <li> \"top\" - The axis should be displayed at the top of the display area\n\t * <li> \"bottom\" - The axis should be displayed at the bottom of the display area\n\t * </ul>\n\t * <li> Vertical (y) axis values\n\t * <ul>\n\t * <li> \"left\" - The axis should be displayed at the left of the display area\n\t * <li> \"right\" - The axis should be displayed at the right of the display area\n\t * </ul>\n\t * </ul>\n\t * @type {string}\n\t */\n\tthis.orientation = \"right\";\n\n\t/**\n\t * The label to display along the axis. It must be valid to be converted to\n\t * html as the inner html of a span element. This allow the use of text\n\t * markup and character entities in the label. Optional.\n\t * @type {string|undefined}\n\t */\n\tthis.label = \"Labels can have extended chars (&mu;m)\";\n}", "function updateAxis(){\n\t\tchangeAxisX();\n\t\tchangeAxisY();\n\t\tupdateMaxMinForAxis();\n\n\t\t/*Init helpers*/\n\t\tvar width = getWidth();\n\t\tvar height = getHeight();\n\t\t//horisontal xAxis\n\t\txAxisLine\n\t\t\t.attr(\"x1\", 0)\n\t\t\t.attr(\"y1\", height/2)\n\t\t\t.attr(\"x2\", width)\n\t\t\t.attr(\"y2\", height/2)\n\t\t\t.attr(\"class\", \"axisLine\")\n\t\t\t.attr(\"stroke-width\", 2)\n\t\t\t.attr(\"stroke\", \"black\");\n\t\txAxisLabelRight\n\t\t\t.attr(\"x\", width)\n\t\t\t.attr(\"y\", height/2)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"rotate(90 \"+width+\" \"+height/2+\") translate(0, 35)\")\n\t\t\t.text(xAxisValue);\n\t\txAxisLabelLeft\n\t\t\t.attr(\"x\", 0)\n\t\t\t.attr(\"y\", height/2)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"rotate(270 \"+0+\" \"+height/2+\") translate(0, 35)\")\n\t\t\t.text(axisValueOpposites[axisValues.indexOf(xAxisValue)]);\n\t\t//vertical yAxis\n\t\tyAxisLine\n\t\t\t.attr(\"x1\", width/2)\n\t\t\t.attr(\"y1\", 0)\n\t\t\t.attr(\"x2\", width/2)\n\t\t\t.attr(\"y2\", height)\n\t\t\t.attr(\"class\", \"axisLine\")\n\t\t\t.attr(\"stroke-width\", 2)\n\t\t\t.attr(\"stroke\", \"black\");\n\t\tyAxisLabelTop\n\t\t\t.attr(\"x\", width/2)\n\t\t\t.attr(\"y\", 30)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"translate(0, 5)\")\n\t\t\t.text(yAxisValue);\n\t\tyAxisLabelBottom\n\t\t\t.attr(\"x\", width/2)\n\t\t\t.attr(\"y\", height)\n\t\t\t.attr(\"transform\", \"translate(0, -5)\")\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.text(axisValueOpposites[axisValues.indexOf(yAxisValue)]);\n\t}", "function FunctionNumberLineAxis(options) {\n let axis,\n axisDefinition,\n axisLocation,\n axisType,\n coordinates,\n parent,\n tickCount;\n\n axis = this;\n\n init(options);\n\n return axis;\n\n /* INITIALIZER */\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n axis.group = addGroup();\n axisDefinition = defineAxis();\n\n applyAxisToGroup();\n }\n\n\n /* PRIVATE METHODS */\n function _required(options) {\n\n parent = options.parent;\n axisLocation = options.axisLocation;\n axisType = switchAxisType();\n coordinates = switchAxisCoordinates();\n\n }\n\n function _defaults(options) {\n\n tickCount = options.tickCount ? options.tickCount : 1;\n\n }\n\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":parent.layers.axes\n });\n\n return group;\n }\n\n function applyAxisToGroup() {\n\n axis.group\n .call(axisDefinition)\n .attr(\"transform\",\"translate(\"+coordinates.x+\",\"+coordinates.y+\")\")\n .attr(\"font-size\",\"14pt\");\n\n }\n\n function defineAxis() {\n let axisDefinition;\n\n\n axisDefinition = axisType(parent.scale)\n .ticks(tickCount);\n\n return axisDefinition;\n }\n\n function switchAxisCoordinates() {\n switch(axisLocation) {\n case \"top\":\n return {\n \"x\":parent.scale.range()[0],\n \"y\":parent.inputY\n };\n case \"bottom\":\n return {\n \"x\":parent.scale.range()[0],\n \"y\":parent.outputY\n };\n }\n }\n\n function switchAxisType() {\n switch(axisLocation) {\n case \"top\":\n return d3.axisTop;\n case \"bottom\":\n return d3.axisBottom;\n }\n }\n\n\n\n\n}", "function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n Object(util[\"k\" /* each */])(AXIS_TYPES, function (v, axisType) {\n var defaultOption = Object(util[\"I\" /* merge */])(Object(util[\"I\" /* merge */])({}, axisDefault[axisType], true), extraDefaultOption, true);\n\n var AxisModel =\n /** @class */\n function (_super) {\n Object(tslib_tslib_es6[\"b\" /* __extends */])(AxisModel, _super);\n\n function AxisModel() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var _this = _super.apply(this, args) || this;\n\n _this.type = axisName + 'Axis.' + axisType;\n return _this;\n }\n\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = Object(util_layout[\"d\" /* fetchLayoutMode */])(this);\n var inputPositionParams = layoutMode ? Object(util_layout[\"f\" /* getLayoutParams */])(option) : {};\n var themeModel = ecModel.getTheme();\n Object(util[\"I\" /* merge */])(option, themeModel.get(axisType + 'Axis'));\n Object(util[\"I\" /* merge */])(option, this.getDefaultOption());\n option.type = getAxisType(option);\n\n if (layoutMode) {\n Object(util_layout[\"h\" /* mergeLayoutParam */])(option, inputPositionParams, layoutMode);\n }\n };\n\n AxisModel.prototype.optionUpdated = function () {\n var thisOption = this.option;\n\n if (thisOption.type === 'category') {\n this.__ordinalMeta = data_OrdinalMeta.createByAxisModel(this);\n }\n };\n /**\n * Should not be called before all of 'getInitailData' finished.\n * Because categories are collected during initializing data.\n */\n\n\n AxisModel.prototype.getCategories = function (rawData) {\n var option = this.option; // FIXME\n // warning if called before all of 'getInitailData' finished.\n\n if (option.type === 'category') {\n if (rawData) {\n return option.data;\n }\n\n return this.__ordinalMeta.categories;\n }\n };\n\n AxisModel.prototype.getOrdinalMeta = function () {\n return this.__ordinalMeta;\n };\n\n AxisModel.type = axisName + 'Axis.' + axisType;\n AxisModel.defaultOption = defaultOption;\n return AxisModel;\n }(BaseAxisModelClass);\n\n registers.registerComponentModel(AxisModel);\n });\n registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n}", "addGaugeCustomTicks() {\n const numericProcessor = this,\n that = numericProcessor.context,\n distance = that._distance,\n majorTickWidth = that._measurements.radius - distance.majorTickDistance;\n let drawTick, drawLabel;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawTick = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n }\n else {\n drawTick = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n drawLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n drawLabel = function () { };\n }\n\n function createTickAndLabel(i) {\n const currentLabel = that.customTicks[i],\n value = numericProcessor.createDescriptor(currentLabel),\n angle = numericProcessor.getAngleByValue(value, true),\n middle = i > 0 && i < that.customTicks.length - 1;\n\n drawTick(angle);\n drawLabel(angle, currentLabel, middle);\n }\n\n for (let i = that.customTicks.length - 1; i >= 0; i--) {\n createTickAndLabel(i);\n }\n }", "_setTicksAndInterval() {\n const that = this;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n //Set the New Format here\n let minLabel = that._formatLabel(that.min),\n maxLabel = that._formatLabel(that.max);\n\n //gets the range with the new min/max\n that._getRange();\n\n //creates a new tickIntervalHandler instance\n that._tickIntervalHandler = new JQX.Utilities.TickIntervalHandler(that, minLabel, maxLabel, 'jqx-label', that._settings.size, that.scaleType === 'integer', that.logarithmicScale);\n\n //re-arranges the layout\n that._layout();\n\n if (!that.customInterval) {\n // calculates the tickInterval\n that._calculateTickInterval();\n\n if (that._dateInterval) {\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n else {\n // Add the ticks and labels\n that._numericProcessor.addTicksAndLabels();\n }\n }\n else {\n if (that.mode === 'date') {\n that._calculateTickInterval()\n }\n\n // custom ticks\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n }", "function calculateRange(axis, axisOptions){\n\t\t\tvar min = axisOptions.min != null ? axisOptions.min : axis.datamin;\n\t\t\tvar max = axisOptions.max != null ? axisOptions.max : axis.datamax;\t\n\t\t\tif(max - min == 0.0){\n\t\t\t\tvar widen = (max == 0.0) ? 1.0 : 0.01;\n\t\t\t\tmin -= widen;\n\t\t\t\tmax += widen;\n\t\t\t}\t\t\t\n\t\t\taxis.tickSize = getTickSize(axisOptions.noTicks, min, max, axisOptions.tickDecimals);\n\t\t\t\t\n\t\t\t/**\n\t\t\t * Autoscaling.\n\t\t\t */\n\t\t\tvar margin;\n\t\t\tif(axisOptions.min == null){\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Add a margin.\n\t\t\t\t */\n\t\t\t\tmargin = axisOptions.autoscaleMargin;\n\t\t\t\tif(margin != 0){\n\t\t\t\t\tmin -= axis.tickSize * margin;\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Make sure we don't go below zero if all values are positive.\n\t\t\t\t\t */\n\t\t\t\t\tif(min < 0 && axis.datamin >= 0) min = 0;\t\t\t\t\n\t\t\t\t\tmin = axis.tickSize * Math.floor(min / axis.tickSize);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(axisOptions.max == null){\n\t\t\t\tmargin = axisOptions.autoscaleMargin;\n\t\t\t\tif(margin != 0){\n\t\t\t\t\tmax += axis.tickSize * margin;\n\t\t\t\t\tif(max > 0 && axis.datamax <= 0) max = 0;\t\t\t\t\n\t\t\t\t\tmax = axis.tickSize * Math.ceil(max / axis.tickSize);\n\t\t\t\t}\n\t\t\t}\n\t\t\taxis.min = min;\n\t\t\taxis.max = max;\n\t\t}", "addTicksAndLabels() {\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = Math.round(that._range / parseFloat((ticksFrequency.toString()))),\n ticksDistance = trackLength / tickscount,\n min = parseFloat(that._drawMin),\n max = parseFloat(that._drawMax);\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n\n //handling specific case\n if (that.logarithmicScale && min < 0 && min !== -1) {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n }\n else {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency) + parseFloat(ticksFrequency));\n }\n\n distanceModifier = second - first;\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n distanceModifier = first - second;\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier / ticksFrequency * ticksDistance;\n\n if (second.toString() !== that._drawMax.toString() && distanceFromFirstToSecond < trackLength) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = firstLabelSize < distanceFromFirstToSecond;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n ticks += this.addMinorTicks(normalLayout);\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n }", "renderAxis() {\n const axis = d3.svg.axis()\n .scale(this.props.scale)\n .orient(this.props.orientation)\n .tickFormat(this.props.tickFormat)\n .innerTickSize(this.props.innerTickSize)\n .outerTickSize(this.props.outerTickSize)\n .tickPadding(this.props.tickPadding);\n\n d3.select(this.node).call(axis);\n }", "function axisProvider(){\n\t/*\n\t * setAxisContainer(svg);\n\t * setXScale(makeLinearScale([0,width],[0,d3.max(data, function(d) { return d.x; })]));\n\t * setYScale(makeLinearScale([height,0],[0,d3.max(data, function(d) { return d.y; })]));\n\t * draw()\n\t * */\n\tvar axisProviderImpl = {\n\t\t\theight \t: 0,\n\t\t\twidth\t: 0,\n\t\t\tsvg\t\t: null,\n\t\t\txScale\t: null,\n\t\t\tyScale\t: null,\n\t\t\txAxis\t: null,\n\t\t\txGrid\t: null,\n\t\t\tyAxis\t: null,\n\t\t\tyGrid\t: null,\n\t\t\tdrawXGrid: true,\n\t\t\tdrawYGrid: true,\n\t\t\tdrawGrid: true,\n\t\t\txScaleOrient : \"bottom\",\n\t\t\tyScaleOrient : \"left\",\n\t\t\txTitle:\"\",\n\t\t\tyTitle:\"\",\n\t\t\ttitle:\"\",\n\t\t\tticks\t: 10,\n\t\t\tgridTicks : 10,\n\t\t\ttickFormat:\",r\",\n\t\t\tsetAxisContainer: function(svg){\n\t\t\t\tif(!isDefined(svg) || isNull(svg)){\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\tthis.height = svg.attr(\"height\");\n\t\t\t\tthis.width = svg.attr(\"width\");\n\t\t\t\tthis.svg\t= svg;\n\t\t\t},\n\t\t\tmakeLinearScale : function(range,domain){\n\t\t\t\treturn d3.scale.linear().range(range).domain(domain).nice();\n\t\t\t},\n\t\t\tsetXScale\t: function(xScale){\n\t\t\t\tthis.xScale = xScale;\n\t\t\t\tthis.xAxis = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.xGrid = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).tickSize(-this.height, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tsetYScale\t:function(yScale){\n\t\t\t\tthis.yScale = yScale;\n\t\t\t\tthis.yAxis = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.yGrid = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).tickSize(-this.width, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tdraw\t: function(){\n\t\t\t\tconsole.log(\"Drawing Axis.\");\n\t\t\t\tthis.clear();\n\t\t\t\tif(this.drawGrid && this.drawYGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").call(this.yGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").call(this.yAxis);\n\t\t\t\t//Y axis title\n\t\t\t\tthis.svg.append(\"g\")\n\t\t\t\t.attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t\t .text(this.yTitle)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",-((this.height/2)))\n\t\t\t .attr(\"y\",-30);\n\t\t\t\t\n\t\t\t\tif(this.drawGrid && this.drawXGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xAxis);\n\t\t\t\t//X axis title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"transform\", \"translate(0,\" + this.height + \")\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .text(this.xTitle)\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",30);\n\t\t\t //chart Title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"chartTitle\")\n\t\t\t .text(this.title)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",0);\n\t\t\t},\n\t\t\tclear : function(){\n\t\t\t\tthis.svg.selectAll(\".grid\").remove();\n\t\t\t\tthis.svg.selectAll(\".axis\").remove();\n\t\t\t\tthis.svg.selectAll(\".axisLabel\").remove();\n\t\t\t}\n\t};\n\t\n\tthis.$get = function(){\n\t\treturn axisProviderImpl;\n\t};\n}", "constructor(options) {\n let that = this;\n that.options = {\n data: null,\n margin: 40,\n height: 500,\n width: 960,\n containerselect: null,\n chartheader: '',\n xaxis: 'number',\n xrange: [0, 100],\n xdirection: 'asc',\n lastseq: 0,\n yaxislabel: '',\n ytickincrement: 100,\n statstable: null,\n };\n that.options = Object.assign(that.options, options);\n\n // first empty containers of any elements we may have placed prior to this\n d3.selectAll(`${that.options.containerselect} .chart-element`).remove();\n if (that.options.statstable) {\n d3.selectAll(`#${that.options.statstable.containerid} .chart-element`).remove();\n }\n\n // default show all labels\n that.showlabels = [];\n\n that.xascending = that.options.xdirection == 'asc';\n if (that.options.xaxis == 'number') {\n that.xscale = d3.scaleLinear;\n // note since https://github.com/d3/d3-array/commit/22cdb3f2b1b98593a08907d17c12756404411b1d d must be scalar, not object\n // see https://github.com/d3/d3-array/issues/249\n that.bisectX = d3.bisector(function (d, x) {\n if (that.xascending) {\n return d - x;\n } else {\n return x - d;\n }\n }).left;\n\n // incr is 1 when ascending, -1 when descending\n that.lowx = that.options.xrange[0];\n that.highx = that.options.xrange[1];\n that.incr = (that.xascending) ? 1 : -1;\n that.xrange = _.range(that.lowx, that.highx + that.incr, that.incr);\n that.tickformat = function(dx) { return dx };\n that.parsex = function(x) { return x; }\n that.atlastseq = function(lastseq, thisx) {\n return (lastseq > 0 && ((that.xascending && thisx >= lastseq) || (!that.xascending && thisx <= lastseq)))\n }\n\n that.focustext = function(d) {return d.x + \" \" + d.value}\n that.formatxfortable = function(d) {return d}\n\n } else if (that.options.xaxis == 'date') {\n // see https://bl.ocks.org/gordlea/27370d1eea8464b04538e6d8ced39e89\n that.xscale = d3.scaleTime;\n // TODO: take xdirection option into account\n that.bisectX = d3.bisector(function(d) { return d; }).left;\n let parseDate = d3.timeParse(\"%m-%d\");\n that.lowx = parseDate(that.options.xrange[0]);\n that.highx = parseDate(that.options.xrange[1]);\n that.xrange = [];\n for (let thisdate=new Date(that.lowx); thisdate<=that.highx; thisdate = new Date(thisdate.setDate(thisdate.getDate()+1))) {\n that.xrange.push(thisdate);\n }\n\n // see https://bl.ocks.org/d3noob/0e276dc70bb9184727ee47d6dd06e915\n that.tickformat = d3.timeFormat(\"%m/%d\");\n\n that.parsex = function(x) {\n // translate date - maybe remove year first\n let datesplit = x.split('-');\n // check if year is present\n // TODO: needs to be special processing if previous year\n if (datesplit.length == 3) {\n x = datesplit.slice(1).join('-');\n }\n return parseDate(x);\n }\n\n that.atlastseq = function(lastseq, thisx) {\n return (lastseq != '' && moment(thisx).format('MM-DD') >= lastseq)\n }\n\n let formatDate = d3.timeFormat(\"%m/%d\");\n that.focustext = function(d) {return formatDate(d.x) + \" \" + d.value}\n that.formatxfortable = function(d) {return `${formatDate(d)}`}\n\n } else {\n throw 'ERROR: unknown xaxis option value: ' + that.options.xaxis;\n }\n\n // convert margin if necessary\n if (typeof that.options.margin == 'number') {\n that.options.margin = {\n top: that.options.margin,\n right: that.options.margin,\n bottom: that.options.margin,\n left: that.options.margin\n };\n }\n }", "function FunctionPlotterAxis(options) {\n let axis,\n axisType,\n fontSize,\n fontWeight,\n position,\n tickCount,\n where;\n\n axis = this;\n\n init(options);\n\n return axis;\n\n function init(options) {\n _required(options);\n _defaults(options);\n\n position = definePosition();\n\n axis.group = addGroup();\n axis.axisDefinition = defineAxis();\n\n applyAxisToGroup();\n\n }\n\n function _defaults(options) {\n\n fontSize = options.fontSize ? options.fontSize : \"14pt\";\n fontWeight = options.fontWeight ? options.fontWeight : \"normal\";\n tickCount = options.tickCount ? options.tickCount : 1;\n\n }\n\n function _required(options) {\n\n\n axis.scales = options.scales;\n axisType = options.axisType;\n where = options.where;\n\n }\n\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\n \"where\":where\n });\n\n return group;\n\n }\n\n function applyAxisToGroup() {\n\n axis.group\n .call(axis.axisDefinition.ticks(tickCount))\n .attr(\"transform\",\"translate(\"+position.x+\",\"+position.y+\")\")\n .attr(\"font-size\",fontSize)\n .attr(\"font-weight\",fontWeight);\n\n }\n\n\n function defineAxis() {\n let axisDefinition;\n\n\n switch(axisType) {\n case \"left\":\n axisDefinition = d3.axisLeft(axis.scales.y);\n break;\n case \"bottom\":\n axisDefinition = d3.axisBottom(axis.scales.x);\n break;\n }\n\n return axisDefinition;\n }\n\n function definePosition() {\n let position;\n\n switch(axisType) {\n case \"left\":\n position = {\n \"x\":axis.scales.x(0),\n \"y\":0\n };\n break;\n case \"bottom\":\n position = {\n \"x\":0,\n \"y\":axis.scales.y(0)\n };\n break;\n }\n\n return position;\n }\n\n\n}", "function axis() {\n obj.extend(_.config, _.defaults);\n _.d3axis = d3.svg.axis();\n axis.rebind(\n _.d3axis,\n 'scale',\n 'orient',\n 'ticks',\n 'tickValues',\n 'tickSubdivide',\n 'tickSize',\n 'tickPadding',\n 'tickFormat');\n return axis;\n }", "labelTextAxis(xAxis, yAxis){\n this.xAxis = xAxis;\n this.yAxis = yAxis;\n }", "get axis() {\n return {\n index: this.$index,\n columns: this.$columns\n };\n }", "function domain_extender(self, axis, ordinal) {\n var scalename = axis + 'scale',\n zero = axis + '0',\n zero_val = axis + '0_value';\n if (ordinal) return function () {\n var scale_prop = self[scalename],\n scale = scale_prop(),\n domain = self.data().map(self[axis]());\n if (scale_prop._has_domain) {\n var old_domain = scale.domain(),\n add_values = domain.filter(function (val) {\n return old_domain.indexOf(val) < 0;\n });\n scale.domain(old_domain.concat(add_values));\n } else {\n scale.domain(domain);\n scale_prop._has_domain = true;\n }\n return scale;\n };else return function () {\n var scale_prop = self[scalename],\n scale = scale_prop(),\n domain = d3.extent(self.data(), self[axis]());\n\n // Incorporate the zero value\n var z = self[zero]();\n if (typeof z != 'undefined') {\n if (domain[0] > z) domain[0] = z;\n if (domain[1] < z) domain[1] = z;\n } else {\n z = domain[0];\n }\n self[zero_val] = z;\n\n // Extend the domain\n if (scale_prop._has_domain) scale.domain(d3.extent([].concat(_toConsumableArray(scale.domain()), _toConsumableArray(domain))));else {\n scale.domain(domain);\n scale_prop._has_domain = true;\n }\n return scale;\n };\n}", "_initDerivedProperties() {\n let drawLabelWidth = (this.drawXAxis ? LABELWIDTH : 0);\n let drawLabelHeight = (this.drawYAxis ? LABELHEIGHT : 0);\n\n //the area, in canvas coords, of the main region (that is, the area\n //bounded in graph coords by this.range)\n this.main = {\n left: this.gutter.left,\n right: this.width - this.gutter.right - AXIS_ARROW_LENGTH - drawLabelWidth,\n top: this.gutter.top + AXIS_ARROW_LENGTH + drawLabelHeight,\n bottom: this.height - this.gutter.bottom\n }\n this.main.width = this.main.right - this.main.left;\n this.main.height = this.main.bottom - this.main.top;\n\n //the center positions relative to the graph range\n let relativeCentreX = (0 - this.range.x.min) / this.range.x.size;\n let relativeCentreY = (0 - this.range.y.min) / this.range.y.size;\n //the center of the graph in canvas coords\n this.center = {\n x: this.main.left + relativeCentreX * this.main.width,\n y: this.main.bottom - relativeCentreY * this.main.height\n }\n\n //the size in pixels of a step of 1 in either axis\n this.unitSize = {\n x: this.main.width / this.range.x.size,\n y: this.main.height / this.range.y.size\n }\n\n //if steps weren't defined, calculate them now\n this.stepX = this.stepX || this._getStepSize('x');\n this.stepY = this.stepY || this._getStepSize('y');\n\n //the size of each gutter in graph coords\n let gutterLeft = this.gutter.left / this.unitSize.x;\n let gutterRight = this.gutter.right / this.unitSize.x;\n let gutterTop = this.gutter.top / this.unitSize.y;\n let gutterBottom = this.gutter.bottom / this.unitSize.y;\n\n let arrowWidth = AXIS_ARROW_LENGTH / this.unitSize.x;\n let arrowHeight = AXIS_ARROW_LENGTH / this.unitSize.y;\n\n //the area that needs to be plotted (main and gutters) in graph coords\n this.drawRegion = {\n left: this.range.x.min - gutterLeft,\n right: this.range.x.max + gutterRight,\n top: this.range.y.max + gutterTop,\n bottom: this.range.y.min - gutterBottom\n }\n this.drawRegion.width = this.drawRegion.right - this.drawRegion.left;\n this.drawRegion.height = this.drawRegion.top - this.drawRegion.bottom;\n\n //one unit of graph units, in canvas coords (pixels)\n this.scale = {\n x: (this.width - drawLabelWidth - AXIS_ARROW_LENGTH) / this.drawRegion.width,\n y: -(this.height - drawLabelHeight - AXIS_ARROW_LENGTH) / this.drawRegion.height\n }\n }", "function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n\t each(AXIS_TYPES, function (v, axisType) {\n\t var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\n\t\n\t var AxisModel =\n\t /** @class */\n\t function (_super) {\n\t __extends(AxisModel, _super);\n\t\n\t function AxisModel() {\n\t var args = [];\n\t\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t args[_i] = arguments[_i];\n\t }\n\t\n\t var _this = _super.apply(this, args) || this;\n\t\n\t _this.type = axisName + 'Axis.' + axisType;\n\t return _this;\n\t }\n\t\n\t AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n\t var layoutMode = fetchLayoutMode(this);\n\t var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n\t var themeModel = ecModel.getTheme();\n\t merge(option, themeModel.get(axisType + 'Axis'));\n\t merge(option, this.getDefaultOption());\n\t option.type = getAxisType(option);\n\t\n\t if (layoutMode) {\n\t mergeLayoutParam(option, inputPositionParams, layoutMode);\n\t }\n\t };\n\t\n\t AxisModel.prototype.optionUpdated = function () {\n\t var thisOption = this.option;\n\t\n\t if (thisOption.type === 'category') {\n\t this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\n\t }\n\t };\n\t /**\n\t * Should not be called before all of 'getInitailData' finished.\n\t * Because categories are collected during initializing data.\n\t */\n\t\n\t\n\t AxisModel.prototype.getCategories = function (rawData) {\n\t var option = this.option; // FIXME\n\t // warning if called before all of 'getInitailData' finished.\n\t\n\t if (option.type === 'category') {\n\t if (rawData) {\n\t return option.data;\n\t }\n\t\n\t return this.__ordinalMeta.categories;\n\t }\n\t };\n\t\n\t AxisModel.prototype.getOrdinalMeta = function () {\n\t return this.__ordinalMeta;\n\t };\n\t\n\t AxisModel.type = axisName + 'Axis.' + axisType;\n\t AxisModel.defaultOption = defaultOption;\n\t return AxisModel;\n\t }(BaseAxisModelClass);\n\t\n\t registers.registerComponentModel(AxisModel);\n\t });\n\t registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n\t }", "function ticksAndAnnotations() {\n var activeAxIds = [];\n var i;\n function pushActiveAxIds(axList) {\n for (i = 0; i < axList.length; i++) {\n if (!axList[i].fixedrange) activeAxIds.push(axList[i]._id);\n }\n }\n function pushActiveAxIdsSynced(axList, axisType) {\n for (i = 0; i < axList.length; i++) {\n var axListI = axList[i];\n var axListIType = axListI[axisType];\n if (!axListI.fixedrange && axListIType.tickmode === 'sync') activeAxIds.push(axListIType._id);\n }\n }\n if (editX) {\n pushActiveAxIds(xaxes);\n pushActiveAxIds(links.xaxes);\n pushActiveAxIds(matches.xaxes);\n pushActiveAxIdsSynced(plotinfo.overlays, 'xaxis');\n }\n if (editY) {\n pushActiveAxIds(yaxes);\n pushActiveAxIds(links.yaxes);\n pushActiveAxIds(matches.yaxes);\n pushActiveAxIdsSynced(plotinfo.overlays, 'yaxis');\n }\n updates = {};\n for (i = 0; i < activeAxIds.length; i++) {\n var axId = activeAxIds[i];\n var ax = getFromId(gd, axId);\n Axes.drawOne(gd, ax, {\n skipTitle: true\n });\n updates[ax._name + '.range[0]'] = ax.range[0];\n updates[ax._name + '.range[1]'] = ax.range[1];\n }\n Axes.redrawComponents(gd, activeAxIds);\n }", "createScales(){\n let dv = this;\n\n // set scales\n dv.x = d3.scaleTime().range([0, dv.width]);\n dv.y = d3.scaleLinear().range([dv.height, 0]);\n\n // Update scales\n dv.x.domain(d3.extent(dv.data[0].values, d => {\n return (d.date); }));// this needs to be dynamic dv.date!!\n \n // for the y domain to track negative numbers \n const minValue = d3.min(dv.data, d => {\n return d3.min(d.values, d => { return d[dv.value]; });\n });\n\n // Set Y axis scales 0 if positive number else use minValue\n dv.y.domain([ minValue >=0 ? 0 : minValue,\n d3.max(dv.data, d => { \n return d3.max(d.values, d => { return d[dv.value]; });\n })\n ]);\n\n dv.xLabel.text(dv.titleX);\n dv.yLabel.text(dv.titleY);\n\n dv.drawGridLines();\n // dv.tickNumber = 0 ; //= dv.data[0].values.length;\n\n // Update axes\n dv.tickNumber !== \"undefined\" ? dv.xAxisCall.scale(dv.x).ticks(dv.tickNumber) : dv.xAxisCall.scale(dv.x);\n\n // // Update axes - what about ticks for smaller devices??\n // dv.xAxisCall.scale(dv.x).ticks(d3.timeYear.filter((d) => {\n // return d = parseYear(\"2016\");\n // }));\n // dv.xAxisCall.scale(dv.x).ticks(dv.tickNumber).tickFormat( (d,i) => {\n // return i < dv.tickNumber ? dv.data[0].values[i].label : \"\";\n // });\n \n // .tickFormat(dv.formatQuarter);\n dv.xAxis.transition(dv.t()).call(dv.xAxisCall);\n \n //ticks(dv.tickNumberY)\n dv.yScaleFormat !== \"undefined\" ? dv.yAxisCall.scale(dv.y).tickFormat(dv.yScaleFormat ) : dv.yAxisCall.scale(dv.y);\n dv.yAxis.transition(dv.t()).call(dv.yAxisCall);\n\n // Update x-axis label based on selector\n // dv.xLabel.text(dv.variable);\n\n // Update y-axis label based on selector\n // var selectorKey = dv.keys.findIndex( d => { return d === dv.variable; });\n // var newYLabel =[selectorKey];\n // dv.yLabel.text(newYLabel);\n\n dv.update();\n }", "numericalMapping(axis) {\n const solver = this.solver;\n const state = this.plotSegment.state;\n const props = this.plotSegment.object.properties;\n const attrs = state.attributes;\n const dataIndices = state.dataRowIndices;\n const table = this.getTableContext();\n switch (axis) {\n case \"x\":\n {\n const data = props.xData;\n if (data.type == \"numerical\") {\n const [x1, x2] = solver.attrs(attrs, [this.x1Name, this.x2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (1 - t) * props.marginX1 - t * props.marginX2, [[1 - t, x1], [t, x2]], [[1, solver.attr(markState.attributes, \"x\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [x1, x2, gapX] = solver.attrs(attrs, [\n this.x1Name,\n this.x2Name,\n \"gapX\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapX(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginX1 -\n (i + 0.5) * props.marginX2, [\n [i + 0.5, x2],\n [data.categories.length - i - 0.5, x1],\n [-data.categories.length / 2 + i + 0.5, gapX]\n ], [\n [\n data.categories.length,\n solver.attr(markState.attributes, \"x\")\n ]\n ]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, x, x1);\n }\n break;\n case \"y\": {\n const data = props.yData;\n if (data.type == \"numerical\") {\n const [y1, y2] = solver.attrs(attrs, [this.y1Name, this.y2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (t - 1) * props.marginY2 + t * props.marginY1, [[1 - t, y1], [t, y2]], [[1, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [y1, y2, gapY] = solver.attrs(attrs, [\n this.y1Name,\n this.y2Name,\n \"gapY\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapY(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginY1 -\n (i + 0.5) * props.marginY2, [\n [i + 0.5, y2],\n [data.categories.length - i - 0.5, y1],\n [-data.categories.length / 2 + i + 0.5, gapY]\n ], [[data.categories.length, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, y, y2);\n }\n }\n }", "addTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = this.round(new JQX.Utilities.BigNumber(that._range).divide(ticksFrequency)),\n ticksDistance = trackLength / tickscount,\n min = new JQX.Utilities.BigNumber(that._drawMin),\n max = new JQX.Utilities.BigNumber(that._drawMax);\n\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n second = ticksFrequency.add(first.subtract(first.mod(ticksFrequency)));\n distanceModifier = second.subtract(first);\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = first.subtract(first.mod(ticksFrequency));\n distanceModifier = first.subtract(second);\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier.divide(ticksFrequency).multiply(ticksDistance);\n\n if (second.compare(that.max) !== 0 && distanceFromFirstToSecond.compare(trackLength) < 0) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = distanceFromFirstToSecond.compare(firstLabelSize) > 0;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n if (that.mode !== 'date') {\n ticks += this.addMinorTicks(normalLayout);\n }\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "niceScale (yMin, yMax, ticks = 10) {\n if ((yMin === Number.MIN_VALUE && yMax === 0) || (!Utils.isNumber(yMin) && !Utils.isNumber(yMax))) {\n // when all values are 0\n yMin = 0\n yMax = 1\n ticks = 1\n let justRange = this.justRange(yMin, yMax, ticks)\n return justRange\n }\n\n // Calculate Min amd Max graphical labels and graph\n // increments. The number of ticks defaults to\n // 10 which is the SUGGESTED value. Any tick value\n // entered is used as a suggested value which is\n // adjusted to be a 'pretty' value.\n //\n // Output will be an array of the Y axis values that\n // encompass the Y values.\n let result = []\n // If yMin and yMax are identical, then\n // adjust the yMin and yMax values to actually\n // make a graph. Also avoids division by zero errors.\n if (yMin === yMax) {\n yMin = yMin - 10 // some small value\n yMax = yMax + 10 // some small value\n }\n // Determine Range\n let range = yMax - yMin\n let tiks = ticks + 1\n // Adjust ticks if needed\n if (tiks < 2) {\n tiks = 2\n } else if (tiks > 2) {\n tiks -= 2\n }\n\n // Get raw step value\n let tempStep = range / tiks\n // Calculate pretty step value\n\n let mag = Math.floor(this.log10(tempStep))\n let magPow = Math.pow(10, mag)\n let magMsd = parseInt(tempStep / magPow)\n let stepSize = magMsd * magPow\n\n // build Y label array.\n // Lower and upper bounds calculations\n let lb = stepSize * Math.floor(yMin / stepSize)\n let ub = stepSize * Math.ceil((yMax / stepSize))\n // Build array\n let val = lb\n while (1) {\n result.push(val)\n val += stepSize\n if (val > ub) { break }\n }\n\n // TODO: need to remove this condition below which makes this function tightly coupled with w.\n if (this.w.config.yaxis[0].max === undefined &&\n this.w.config.yaxis[0].min === undefined) {\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n } else {\n result = []\n let v = yMin\n result.push(v)\n let valuesDivider = Math.abs(yMax - yMin) / ticks\n for (let i = 0; i <= ticks - 1; i++) {\n v = v + valuesDivider\n result.push(v)\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n }\n }", "function Axis(name) {\n $.jqplot.ElemContainer.call(this);\n // Group: Properties\n //\n // Axes options are specified within an axes object at the top level of the \n // plot options like so:\n // > {\n // > axes: {\n // > xaxis: {min: 5},\n // > yaxis: {min: 2, max: 8, numberTicks:4},\n // > x2axis: {pad: 1.5},\n // > y2axis: {ticks:[22, 44, 66, 88]}\n // > }\n // > }\n // There are 2 x axes, 'xaxis' and 'x2axis', and \n // 9 yaxes, 'yaxis', 'y2axis'. 'y3axis', ... Any or all of which may be specified.\n this.name = name;\n this._series = [];\n // prop: show\n // Wether to display the axis on the graph.\n this.show = false;\n // prop: tickRenderer\n // A class of a rendering engine for creating the ticks labels displayed on the plot, \n // See <$.jqplot.AxisTickRenderer>.\n this.tickRenderer = $.jqplot.AxisTickRenderer;\n // prop: tickOptions\n // Options that will be passed to the tickRenderer, see <$.jqplot.AxisTickRenderer> options.\n this.tickOptions = {};\n // prop: labelRenderer\n // A class of a rendering engine for creating an axis label.\n this.labelRenderer = $.jqplot.AxisLabelRenderer;\n // prop: labelOptions\n // Options passed to the label renderer.\n this.labelOptions = {};\n // prop: label\n // Label for the axis\n this.label = null;\n // prop: showLabel\n // true to show the axis label.\n this.showLabel = true;\n // prop: min\n // minimum value of the axis (in data units, not pixels).\n this.min = null;\n // prop: max\n // maximum value of the axis (in data units, not pixels).\n this.max = null;\n // prop: autoscale\n // DEPRECATED\n // the default scaling algorithm produces superior results.\n this.autoscale = false;\n // prop: pad\n // Padding to extend the range above and below the data bounds.\n // The data range is multiplied by this factor to determine minimum and maximum axis bounds.\n // A value of 0 will be interpreted to mean no padding, and pad will be set to 1.0.\n this.pad = 1.2;\n // prop: padMax\n // Padding to extend the range above data bounds.\n // The top of the data range is multiplied by this factor to determine maximum axis bounds.\n // A value of 0 will be interpreted to mean no padding, and padMax will be set to 1.0.\n this.padMax = null;\n // prop: padMin\n // Padding to extend the range below data bounds.\n // The bottom of the data range is multiplied by this factor to determine minimum axis bounds.\n // A value of 0 will be interpreted to mean no padding, and padMin will be set to 1.0.\n this.padMin = null;\n // prop: ticks\n // 1D [val, val, ...] or 2D [[val, label], [val, label], ...] array of ticks for the axis.\n // If no label is specified, the value is formatted into an appropriate label.\n this.ticks = [];\n // prop: numberTicks\n // Desired number of ticks. Default is to compute automatically.\n this.numberTicks;\n // prop: tickInterval\n // number of units between ticks. Mutually exclusive with numberTicks.\n this.tickInterval;\n // prop: renderer\n // A class of a rendering engine that handles tick generation, \n // scaling input data to pixel grid units and drawing the axis element.\n this.renderer = $.jqplot.LinearAxisRenderer;\n // prop: rendererOptions\n // renderer specific options. See <$.jqplot.LinearAxisRenderer> for options.\n this.rendererOptions = {};\n // prop: showTicks\n // Wether to show the ticks (both marks and labels) or not.\n // Will not override showMark and showLabel options if specified on the ticks themselves.\n this.showTicks = true;\n // prop: showTickMarks\n // Wether to show the tick marks (line crossing grid) or not.\n // Overridden by showTicks and showMark option of tick itself.\n this.showTickMarks = true;\n // prop: showMinorTicks\n // Wether or not to show minor ticks. This is renderer dependent.\n this.showMinorTicks = true;\n // prop: drawMajorGridlines\n // True to draw gridlines for major axis ticks.\n this.drawMajorGridlines = true;\n // prop: drawMinorGridlines\n // True to draw gridlines for minor ticks.\n this.drawMinorGridlines = false;\n // prop: drawMajorTickMarks\n // True to draw tick marks for major axis ticks.\n this.drawMajorTickMarks = true;\n // prop: drawMinorTickMarks\n // True to draw tick marks for minor ticks. This is renderer dependent.\n this.drawMinorTickMarks = true;\n // prop: useSeriesColor\n // Use the color of the first series associated with this axis for the\n // tick marks and line bordering this axis.\n this.useSeriesColor = false;\n // prop: borderWidth\n // width of line stroked at the border of the axis. Defaults\n // to the width of the grid boarder.\n this.borderWidth = null;\n // prop: borderColor\n // color of the border adjacent to the axis. Defaults to grid border color.\n this.borderColor = null;\n // prop: scaleToHiddenSeries\n // True to include hidden series when computing axes bounds and scaling.\n this.scaleToHiddenSeries = false;\n // minimum and maximum values on the axis.\n this._dataBounds = {min:null, max:null};\n // statistics (min, max, mean) as well as actual data intervals for each series attached to axis.\n // holds collection of {intervals:[], min:, max:, mean: } objects for each series on axis.\n this._intervalStats = [];\n // pixel position from the top left of the min value and max value on the axis.\n this._offsets = {min:null, max:null};\n this._ticks=[];\n this._label = null;\n // prop: syncTicks\n // true to try and synchronize tick spacing across multiple axes so that ticks and\n // grid lines line up. This has an impact on autoscaling algorithm, however.\n // In general, autoscaling an individual axis will work better if it does not\n // have to sync ticks.\n this.syncTicks = null;\n // prop: tickSpacing\n // Approximate pixel spacing between ticks on graph. Used during autoscaling.\n // This number will be an upper bound, actual spacing will be less.\n this.tickSpacing = 75;\n // Properties to hold the original values for min, max, ticks, tickInterval and numberTicks\n // so they can be restored if altered by plugins.\n this._min = null;\n this._max = null;\n this._tickInterval = null;\n this._numberTicks = null;\n this.__ticks = null;\n // hold original user options.\n this._options = {};\n }", "function getYaxisOptions(){\n scale = new Array();\n\n if(generate_param_1){\n y1_scale = {\n type: \"linear\",\n\n display: show_scale_1,\n position: \"left\",\n id: \"y-axis-1\",\n scaleLabel: {\n display: true,\n labelString: label_1,\n },\n };\n\n if(same_scale) {\n y1_scale[\"ticks\"] = {\n min: min_scale_value,\n max: max_scale_value\n }\n }\n\n scale.push(y1_scale);\n }\n\n\n if(generate_param_2){\n y2_scale = {\n type: \"linear\",\n display: show_scale_2,\n position: \"right\",\n id: \"y-axis-2\",\n scaleLabel: {\n display: true,\n labelString: label_2,\n },\n gridLines: {\n drawOnChartArea: false,\n }\n };\n\n if(same_scale) {\n y2_scale[\"ticks\"] = {\n min: min_scale_value,\n max: max_scale_value\n }\n }\n\n scale.push(y2_scale);\n }\n\n if(generate_param_3){\n y3_scale = {\n type: \"linear\",\n display: show_scale_3,\n position: \"right\",\n id: \"y-axis-3\",\n scaleLabel: {\n display: true,\n labelString: label_3\n },\n gridLines: {\n drawOnChartArea: false,\n }\n };\n scale.push(y3_scale);\n }\n\n\n\n return scale;\n}", "addGaugeTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n numericProcessor = this,\n maxLabelHeight = Math.max(that._tickIntervalHandler.labelsSize.minLabelSize, that._tickIntervalHandler.labelsSize.maxLabelSize),\n majorStep = that._majorTicksInterval,\n minorStep = that._minorTicksInterval,\n majorTickValues = {},\n distance = that._distance,\n radius = that._measurements.radius,\n majorTickWidth = radius - distance.majorTickDistance,\n minorTickWidth = radius - distance.minorTickDistance,\n bigDrawMin = new JQX.Utilities.BigNumber(that._drawMin),\n bigDrawMax = new JQX.Utilities.BigNumber(that._drawMax);\n let drawMajor, drawMinor, addLabel, currentAngle, angleAtMin, angleAtMax;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawMajor = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n\n drawMinor = function (value) {\n that._drawTick(numericProcessor.getAngleByValue(value, true), minorTickWidth, 'minor');\n };\n }\n else {\n drawMajor = function () { };\n drawMinor = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n addLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n addLabel = function () { };\n }\n\n if (!that.inverted) {\n angleAtMin = that.endAngle;\n angleAtMax = that.startAngle;\n }\n else {\n angleAtMin = that.startAngle;\n angleAtMax = that.endAngle;\n }\n\n // first major tick and label\n currentAngle = numericProcessor.getAngleByValue(bigDrawMin, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMin.toString()] = true;\n addLabel(currentAngle, that.min, false);\n\n let second = bigDrawMin.subtract(bigDrawMin.mod(majorStep)),\n firstMinTick;\n\n if (bigDrawMin.compare(0) !== -1) {\n second = second.add(majorStep);\n }\n\n // determines the value at the first minor tick\n for (let i = new JQX.Utilities.BigNumber(second); i.compare(bigDrawMin) !== -1; i = i.subtract(minorStep)) {\n firstMinTick = i;\n }\n\n // second major tick and label\n currentAngle = numericProcessor.getAngleByValue(second, false);\n drawMajor(currentAngle);\n majorTickValues[second.toString()] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMin, numericProcessor.getAngleByValue(second, false, true)) / 360) > maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(second), second.compare(bigDrawMax) === -1);\n }\n\n let i;\n // middle major ticks and labels\n for (i = second.add(majorStep); i.compare(bigDrawMax.subtract(majorStep)) === -1; i = i.add(majorStep)) {\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i.toString()] = true;\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (majorTickValues[i.toString()] === undefined && i.compare(bigDrawMax) !== 1) {\n // second-to-last major tick and label\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i.toString()] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, numericProcessor.getAngleByValue(i, false, true)) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (that._normalizedStartAngle !== that.endAngle) {\n // last major tick and label\n currentAngle = numericProcessor.getAngleByValue(bigDrawMax, false);\n drawMajor(currentAngle);\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, angleAtMin) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, that.max, false);\n }\n }\n }\n\n if (that.mode === 'date') {\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n return;\n }\n\n // minor ticks\n if (!that.logarithmicScale) {\n for (let j = firstMinTick; j.compare(bigDrawMax) === -1; j = j.add(minorStep)) {\n if (majorTickValues[j.toString()]) {\n continue; // does not plot minor ticks over major ones\n }\n drawMinor(j);\n }\n }\n else {\n this.drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor);\n }\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "function SVGGraphAxis(graph, title, min, max, major, minor, type) {\r\n\tthis._graph = graph; // The owning graph\r\n\tthis._title = title || ''; // Title of this axis\r\n\tthis._titleFormat = {}; // Formatting settings for the title\r\n\tthis._titleOffset = 0; // The offset for positioning the title\r\n\tthis._labels = null; // List of labels for this axis - one per possible value across all series\r\n\tthis._labelFormat = {}; // Formatting settings for the labels\r\n\tthis._lineFormat = {stroke: 'black', strokeWidth: 1}; // Formatting settings for the axis lines\r\n\tthis._ticks = {major: major || 10, minor: minor || 0, size: 10, position: 'out'}; // Tick mark options\r\n\tthis._scale = {min: min || 0, max: max || 100, type: type || 'linear' }; // Axis scale settings\r\n\tthis._crossAt = 0; // Where this axis crosses the other one\r\n }", "_updateIndicators() {\n const _this = this;\n this.duration = this.model.time.delayAnimations;\n this.yScale = this.model.marker.axis_y.getScale();\n this.xScale = this.model.marker.axis_x.getScale();\n this.yAxis.tickFormat(_this.model.marker.axis_y.getTickFormatter());\n this.xAxis.tickFormat(_this.model.marker.axis_x.getTickFormatter());\n this.xAxisLeft.tickFormat(_this.model.marker.axis_x.getTickFormatter());\n\n const sideDim = this.SIDEDIM;\n const stackDim = this.STACKDIM;\n\n const stacks = this.model.marker.getKeys(stackDim);\n let stackKeys = [];\n stackKeys = stacks.map(m => m[stackDim]);\n this.stackKeys = stackKeys;\n\n const sideItems = this.model.marker.label_side.getItems();\n //var sideKeys = Object.keys(sideItems);\n let sideKeys = [];\n if (!utils.isEmpty(sideItems)) {\n const sideFiltered = !!this.model.marker.side.getEntity().show[sideDim];\n const sides = this.model.marker.getKeys(sideDim)\n .filter(f => !sideFiltered || this.model.marker.side.getEntity().isShown(f));\n sideKeys = sides.map(m => m[sideDim]);\n\n if (sideKeys.length > 2) sideKeys.length = 2;\n if (sideKeys.length > 1) {\n const sortFunc = this.ui.chart.flipSides ? d3.ascending : d3.descending;\n sideKeys.sort(sortFunc);\n }\n }\n if (!sideKeys.length) sideKeys.push(\"undefined\");\n this.sideKeys = sideKeys;\n\n this.twoSided = this.sideKeys.length > 1;\n this.titleRight.classed(\"vzb-hidden\", !this.twoSided);\n if (this.twoSided) {\n this.xScaleLeft = this.xScale.copy();\n this.title.text(sideItems[this.sideKeys[1]]);\n this.titleRight.text(sideItems[this.sideKeys[0]]);\n } else {\n const title = this.sideKeys.length && sideItems[this.sideKeys[0]] ? sideItems[this.sideKeys[0]] : \"\";\n this.title.text(title);\n }\n\n this.cScale = this.model.marker.color.getScale();\n }", "function SVGPlotAxis(plot, title, min, max, major, minor) {\r\n\tthis._plot = plot; // The owning plot\r\n\tthis._title = title || ''; // The plot's title\r\n\tthis._titleFormat = { textAnchor: 'middle' }; // Formatting settings for the title\r\n\tthis._titleOffset = 0; // The offset for positioning the title\r\n\tthis._labelFormat = { }; // Formatting settings for the labels\r\n\tthis._lineFormat = {stroke: 'black', strokeWidth: 1}; // Formatting settings for the axis lines\r\n\tthis._ticks = {major: major || 10, minor: minor || 0, size: 10, position: 'both'}; // Tick mark options\r\n\tthis._scale = {min: min || 0, max: max || 100}; // Axis scale settings\r\n\tthis._crossAt = 0; // Where this axis crosses the other one. */\r\n }", "createAxes () {\n }", "drawAxis() {\n let svgSelect = d3.select(\"#vis-8-svg\");\n svgSelect.append(\"g\")\n .attr(\"class\", \"year-axis\")\n .attr(\"transform\", `translate(0,${this.vizHeight - 50})`)\n .call(this.xAxis);\n svgSelect.append(\"text\")\n .attr(\"class\", \"axis-label\")\n .attr(\"transform\", `translate(${this.vizWidth / 2},${this.vizHeight - 20})`)\n .text(\"Years\")\n\n let axisTotalAcres = d3.axisLeft(this.scaleTotalAcres);\n svgSelect.append(\"g\")\n .attr(\"class\", \"y-axis\")\n .attr(\"transform\", `translate(${this.vizMinWidth},0)`)\n .call(axisTotalAcres);\n svgSelect.append(\"text\")\n .attr(\"class\", \"axis-label\")\n .attr(\"transform\", `translate(20,${this.vizHeight / 2 + 50}) rotate(-90)`)\n .text(\"Total Acres Burned\")\n\n\n let axisNumFires = d3.axisRight(this.scaleNumFires);\n svgSelect.append(\"g\")\n .attr(\"class\", \"y-axis\")\n .attr(\"transform\", `translate(${this.vizWidth - this.vizMaxWidth},0)`)\n .call(axisNumFires);\n svgSelect.append(\"text\")\n .attr(\"class\", \"axis-label\")\n .attr(\"transform\", `translate(${this.vizWidth - 20},${this.vizHeight / 2 - 50}) rotate(90)`)\n .text(\"Number of Fires\")\n }", "function ExplorableNumberlineAxis(options) {\n let axis,\n axisDefinition,\n axisType,\n color,\n coordinates,\n fontFamily,\n fontSize,\n fontWeight,\n scale,\n tickOffset,\n tickSize,\n where;\n\n axis = this;\n\n init(options);\n\n return axis;\n\n function init(options) {\n\n _required(options);\n _defaults(options);\n\n axisDefinition = defineAxis();\n axis.group = addGroup();\n\n }\n\n function _defaults(options) {\n\n axisType = options.axisType ? options.axisType : d3.axisBottom;\n color = options.color ? options.color : \"black\";\n coordinates = options.coordinates ? options.coordinates : {\"x\":0,\"y\":0};\n fontSize = options.fontSize ? options.fontSize : \"14pt\";\n fontWeight = options.fontWeight ? options.fontWeight : \"normal\";\n fontFamily = options.fontFamily ? options.fontFamily : \"\";\n tickOffset = options.tickOffset ? options.tickOffset : 0;\n tickSize = options.tickSize ? options.tickSize : 5;\n\n }\n\n function _required(options) {\n scale = options.scale;\n where = options.where;\n }\n\n function addGroup() {\n let group;\n\n group = where.append(\"g\")\n .call(axisDefinition)\n .attr(\"transform\",\"translate(\"+coordinates.x+\",\"+coordinates.y+\")\");\n\n group.selectAll(\"text\")\n .attr(\"font-family\",fontFamily)\n .attr(\"font-weight\",fontWeight)\n .attr(\"font-size\",fontSize)\n .attr(\"dy\",tickOffset);\n\n return group;\n }\n\n function defineAxis() {\n let axisDefinition;\n\n axisDefinition = axisType()\n .scale(scale)\n .tickSize(tickSize);\n\n return axisDefinition;\n }\n\n}", "function getXscaleOptions(){\n x_options = {\n type: x_type,\n position: 'bottom',\n scaleLabel: {\n display: true,\n labelString: x_label\n },\n };\n\n if(x_time){\n x_options[\"time\"] = getTimeOptions(x_type);\n }else{\n x_options[\"ticks\"] = {\n beginAtZero: true\n }\n }\n\n if(same_scale){\n x_options[\"ticks\"] = {\n min: min_scale_value,\n max: max_scale_value\n }\n }\n\n return x_options;\n}", "function ApacheChartModel(seriesLabels, groupLabels, yValues, xValues, seriesColors)\n{\n // An array representing series labels\n this._seriesLabels = seriesLabels;\n // An array representing Group labels\n this._groupLabels = groupLabels;\n // A 2D array representing values for Y axis\n this._yValues = yValues;\n // A 2D array representing values for X axis.\n // The x axis values are used only for scatter plots/XYline \n this._xValues = xValues;\n // The array of strings with colors. Used for display of the series\n this._seriesColors = seriesColors;\n \n // the maximum value used to display the y-axis. \n // Default is 120% of maximum of the yValues\n //this._maxYValue = undefined;\n \n // the minimum value used to display the y-axis. Default is 80% of minimum of values\n //this._minYValue = undefined;\n\n // the maximum value used to display the X-axis. \n // Default is 120% of maximum of the xValues\n //this._maxXValue = undefined;\n \n // the minimum value used to display the y-axis. Default is 80% of minimum of values \n //this._minXValue = undefined;\n \n // The title for the graph\n //this._title = undefined;\n \n // The sub-title for the graph\n //this._subTitle = undefined;\n \n // The foot node for the graph\n //this._footNote = undefined;\n}", "addAxes () {\n }", "function AxisFieldRenderer(parent){this.parent=parent;}", "get axes() {\n if (this._axes === null) {\n let coll = new IgrAxisCollection();\n let inner = coll._innerColl;\n inner.addListener((sender, e) => {\n switch (e.action) {\n case NotifyCollectionChangedAction.Add:\n this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));\n break;\n case NotifyCollectionChangedAction.Remove:\n this._axesAdapter.removeManualItemAt(e.oldStartingIndex);\n break;\n case NotifyCollectionChangedAction.Replace:\n this._axesAdapter.removeManualItemAt(e.oldStartingIndex);\n this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));\n break;\n case NotifyCollectionChangedAction.Reset:\n this._axesAdapter.clearManualItems();\n break;\n }\n });\n this._axes = coll;\n }\n return this._axes;\n }", "function Axis( name, title ){\n this.name = name;\n this.title = title;\n\n this.fNdivisions;\n this.fAxisColor;\n this.fLabelColor;\n this.fLabelFont;\n this.fLabelOffset;\n this.fLabelOffset;\n this.fLabelSize;\n this.fTitleOffset;\n this.d3Axis = d3.svg.axis();\n\n }", "addGaugeTicksAndLabels() {\n const that = this.context,\n numericProcessor = this,\n maxLabelHeight = Math.max(that._tickIntervalHandler.labelsSize.minLabelSize, that._tickIntervalHandler.labelsSize.maxLabelSize),\n majorStep = that._majorTicksInterval,\n minorStep = that._minorTicksInterval,\n majorTickValues = {},\n distance = that._distance,\n radius = that._measurements.radius,\n majorTickWidth = radius - distance.majorTickDistance,\n minorTickWidth = radius - distance.minorTickDistance;\n let drawMajor, drawMinor, addLabel, currentAngle, angleAtMin, angleAtMax;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawMajor = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n\n drawMinor = function (value) {\n that._drawTick(numericProcessor.getAngleByValue(value, true), minorTickWidth, 'minor');\n };\n }\n else {\n drawMajor = function () { };\n drawMinor = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n addLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n addLabel = function () { };\n }\n\n if (!that.inverted) {\n angleAtMin = that.endAngle;\n angleAtMax = that.startAngle;\n }\n else {\n angleAtMin = that.startAngle;\n angleAtMax = that.endAngle;\n }\n\n // first major tick and label\n currentAngle = numericProcessor.getAngleByValue(that._drawMin, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMin] = true;\n addLabel(currentAngle, that.min, false);\n\n let second = that._drawMin - numericProcessor.getPreciseModulo(that._drawMin, majorStep),\n firstMinTick;\n\n if (that._drawMin >= 0) {\n second += majorStep;\n }\n\n // determines the value at the first minor tick\n for (let i = second; i >= that._drawMin; i = i - minorStep) {\n firstMinTick = i;\n }\n\n // second major tick and label\n currentAngle = numericProcessor.getAngleByValue(second, false);\n drawMajor(currentAngle);\n majorTickValues[second] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMin, numericProcessor.getAngleByValue(second, false, true)) / 360) > maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(second), second < that._drawMax);\n }\n\n let i;\n // middle major ticks and labels\n for (i = second + majorStep; i < that._drawMax - majorStep; i += majorStep) {\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i] = true;\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (majorTickValues[i] === undefined && i <= that._drawMax) {\n // second-to-last major tick and label\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, numericProcessor.getAngleByValue(i, false, true)) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (that._normalizedStartAngle !== that.endAngle) {\n // last major tick and label\n currentAngle = numericProcessor.getAngleByValue(that._drawMax, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMax] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, angleAtMin) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, that.max, false);\n }\n }\n }\n\n // minor ticks\n if (!that.logarithmicScale) {\n for (let j = firstMinTick; j < that._drawMax; j += minorStep) {\n if (majorTickValues[j]) {\n continue; // does not plot minor ticks over major ones\n }\n drawMinor(j);\n }\n }\n else {\n this.drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor);\n }\n }", "createAxis()\n {\n // já que vamos atualizar os dados do gráficos o eixo deve sempre atualizar esse xAxis, yAxis a cada update!\n // já que esses são \"intervalos\" escalados de acordo com os dados ! (dados(extent(min,max)) -> pixels(min,max))\n \n/* \n let xAxis = d3.axisBottom(this.xScale).ticks(15);\n let yAxis = d3.axisLeft(this.yScale).ticks(15); // eixos com 15 marcas\n\n this.margins\n .append(\"g\") // criar grupo que vai conter os elementos que fazem parte do eixo (que na verdade são os dados são valores da margem!)\n .attr(\"transform\",`translate(0,${this.config.height})`) // transladar na altura da área de desenho (os eixos usam os valores (dados) da escala mas eles não se submetem a ela! (nesse caso))\n .call(xAxis); // a função xAxis vai ser chamada e o argumento dela vai ser o grupo g que foi criado!\n\n this.margins\n .append(\"g\")\n .call(yAxis); \n*/\n // vamos por enquanto só criar os grupos dos eixos x e y \n\n let xAxis = d3.axisBottom(this.xScale).ticks(this.ticks);\n\n let yAxis = d3.axisLeft(this.yScale).ticks(this.ticks)\n\n this.margins\n .append(\"g\") \n .attr('class','ei-x')\n .attr(\"transform\",`translate(0,${this.config.height})`)\n .call(xAxis); \n \n this.margins\n .append(\"g\")\n .attr('class','ei-y')\n .call(yAxis); \n \n\n }", "function buildAxis() {\n xAxis = d3Axis.axisBottom(xScale)\n .ticks(xTicks, numberFormat)\n .tickSizeInner([-chartHeight]);\n\n yAxis = d3Axis.axisLeft(yScale);\n }", "function BasicLinechartComponent(renderer) {\n this.renderer = renderer;\n /**\n * Input width of the component\n * Default value : 900\n */\n this.width = 900;\n /**\n * Input height of the compenent\n * Default value : 200\n */\n this.height = 200;\n /**\n * Input data array that the component display\n * Default value : []\n */\n this.data = [];\n /**\n * Input domain of the Axis Y\n * Works only for continuous values\n * Default value : [0,0]\n */\n this.domain = [0, 0];\n /**\n * Input speed of zoom between 0 and 1\n * Default value : 0.2\n */\n this.speedZoom = 0.2;\n /**\n * Input range of timestamp\n * Default value : [0,0]\n */\n this.range = [0, 0];\n /**\n * Output rangeChange that emit range\n */\n this.rangeChange = new i0.EventEmitter();\n /**\n * Input currentTime\n * Default value : 0\n */\n this.currentTime = 0;\n /**\n * Output currentTimeChange that emit currentTime\n */\n this.currentTimeChange = new i0.EventEmitter();\n /**\n * Title of the component\n */\n this.title = 'Timeline : ';\n /**\n * Margin of the component\n */\n this.margin = { top: 20, right: 20, bottom: 20, left: 50 }; //marge interne au svg \n /**\n * dataZoom is a copy of data with the range specify\n */\n this.dataZoom = [];\n /**\n * idZoom is the number of wheel notch\n */\n this.idZoom = 0;\n /**\n * It's the smallest timestamp of data\n */\n this.minTime = 0;\n /**\n * It's the biggest timestamp of data\n */\n this.maxTime = 0;\n /**\n * It's the difference between the smallest and the biggest\n */\n this.lengthTime = 0;\n /**\n * Width of the svg\n */\n this.svgWidth = 0;\n /**\n * Height of the svg\n */\n this.svgHeight = 0;\n /**\n * Scale of the X axis\n */\n this.scaleX = d3__namespace.scaleTime();\n /**\n * Scale of the Y axis\n */\n this.scaleY = d3__namespace.scaleLinear();\n /**\n * Array of area definition\n */\n this.area = [];\n /**\n * Array of line definition\n */\n this.line = [];\n /**\n * data length before the new change\n */\n this.lastDatalength = 0;\n /**\n * Mode of the tooltip\n */\n this.modeToolTips = \"normal\";\n /**\n * true if the currentTimeline is selected\n */\n this.currentTimeSelected = false;\n /**\n * true if the scrollbar is selected\n */\n this.scrollbarSelected = false;\n /**\n * Last position of the mouse\n */\n this.lastPos = 0;\n /**\n * true if the CTRL Key of keyBoard is push\n */\n this.zoomSelected = false;\n }", "draw_axis(){\n //Y-axis and horizontal grid\n let axis_left = d3.axisLeft(this.y)\n .ticks(this.TICKS)\n .tickFormat(d => d)\n\n this.svg.append('g')\n .attr('transform', `translate(${this.X0}, 0)`)\n .style('font', '14px times')\n .attr('class', 'axis_y')\n .call(axis_left)\n\n let h_grid = d3.axisLeft(this.y)\n .tickSize(-this.W + this.X0)\n .tickFormat('')\n .ticks(this.TICKS)\n\n\n\n this.svg.append('g')\n .attr('transform', `translate(${this.X0}, 0)`)\n .attr('class', 'h_grid')\n .call(h_grid)\n\n\n //X-axis and vertical grid\n this.axis_bottom = d3.axisBottom(this.x)\n .ticks(10)\n .tickFormat(d => 2018 - d)\n\n this.axis_x = this.svg.append('g')\n .style('font', '14px times')\n .attr('transform', `translate(0, ${this.AXIS_HEIGHT})`)\n .attr('class', 'axis_x')\n .call(this.axis_bottom)\n\n\n\n }", "preDraw() {\n super.preDraw();\n // Prior to drawing we are adjusting config based elements here\n this.base.classed(\"chart-theme-\" + this.config(\"theme\"), true);\n\n this.scale.x.range([0, (this.config(\"width\") - this.config(\"margin-right\") - this.config(\"margin-left\"))]);\n this.scale.y.range([(this.config(\"height\") - this.config(\"margin-top\") - this.config(\"margin-bottom\")), 0]);\n\n this.containers.axis.x.attr(\"width\", this.config(\"width\")).attr(\"height\", this.config(\"margin-\" + this.config(\"orient-x\")));\n\n this.axis.x.orient(this.config(\"orient-x\")).ticks(this.config(\"ticks-x\"));\n this.axis.y.orient(this.config(\"orient-y\")).ticks(this.config(\"ticks-y\"));\n }", "get axis() {\n\t\treturn this.__axis;\n\t}", "function setScatterAxisData(data, axis, _vars) {\r\n //declare vars\r\n var axisData = [],\r\n chartData = data.chartData,\r\n scatterLabel = data.dataTable[axis],\r\n min = scatterLabel ? chartData[0][scatterLabel] : 0,\r\n max = scatterLabel ? chartData[0][scatterLabel] : 0,\r\n dataType;\r\n \r\n for (var j = 0; j < data.dataTableKeys.length; j++) {\r\n if (data.dataTableKeys[j].vizType === axis) {\r\n dataType = data.dataTableKeys[j].type;\r\n break;\r\n }\r\n }\r\n //loop over data to find max and min\r\n //also determines the y axis total if the data is stacked\r\n for (var i = 1; i < chartData.length; i++) {\r\n if (chartData[i].hasOwnProperty(scatterLabel)) {\r\n var num = chartData[i][scatterLabel];\r\n if (!isNaN(num)) {\r\n num = parseFloat(num);\r\n if (num > max) {\r\n max = num;\r\n } else if (num < min) {\r\n min = num;\r\n }\r\n }\r\n }\r\n }\r\n if (axis !== 'z') {\r\n min *= 0.9;\r\n max *= 1.1;\r\n }\r\n\r\n if (_vars.yMin && !isNaN(_vars.yMin) && axis === 'y') {\r\n min = _vars.yMin;\r\n }\r\n if (_vars.yMax && !isNaN(_vars.yMax) && axis === 'y') {\r\n max = _vars.yMax;\r\n }\r\n if (_vars.xMin && !isNaN(_vars.xMin) && axis === 'x') {\r\n min = _vars.xMin;\r\n }\r\n if (_vars.xMax && !isNaN(_vars.xMax) && axis === 'x') {\r\n max = _vars.xMax;\r\n }\r\n\r\n axisData.push(min);\r\n axisData.push(max);\r\n return {\r\n 'label': scatterLabel,\r\n 'values': axisData,\r\n 'dataType': 'NUMBER',\r\n 'min': min,\r\n 'max': max\r\n };\r\n}", "function setAxis(axis, axisModel) {\n\t axis.type = axisModel.get('type');\n\t axis.scale = createScaleByModel(axisModel);\n\t axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\n\t axis.inverse = axisModel.get('inverse');\n\t\n\t if (isAngleAxisModel(axisModel)) {\n\t axis.inverse = axis.inverse !== axisModel.get('clockwise');\n\t var startAngle = axisModel.get('startAngle');\n\t axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\n\t } // Inject axis instance\n\t\n\t\n\t axisModel.axis = axis;\n\t axis.model = axisModel;\n\t }", "function XTimeAxis(min, max, majorUnit, minorUnit,title){\r\n\tthis.init(min, max, majorUnit, minorUnit,title);\r\n}", "drawAxes() {\n this.context.fillStyle = DEFAULT_PLOT_PARAMETERS.color;\n\n if(this.drawYAxis) {\n assert(this.range.x.min <= 0 && this.range.y.max >= 0,\n 'Cannot draw the y axis as it is out of range.')\n\n let labelWidth = this.context.measureText('y').width;\n\n //has to be fudged to look right\n let labelPosY = 0;\n let labelPosX = this.center.x - (labelWidth / 2);\n this.context.fillText('y', labelPosX, labelPosY);\n\n this._drawLine(this.center.x, LABELHEIGHT + AXIS_ARROW_LENGTH, this.center.x,\n this.height, 2);\n\n this.context.beginPath();\n this.context.lineWidth = 1;\n this.context.moveTo(this.center.x, LABELHEIGHT);\n this.context.lineTo(this.center.x + 5, LABELHEIGHT + AXIS_ARROW_LENGTH);\n this.context.lineTo(this.center.x - 5, LABELHEIGHT + AXIS_ARROW_LENGTH);\n this.context.fill();\n\n if(this.drawYUnits) {\n let stepSize = this.stepY;\n let i = stepSize.times(Math.ceil(this.drawRegion.bottom / stepSize.approx));\n for(; i.lessThan(this.drawRegion.top); i = i.plus(stepSize)) {\n if(!(i.equal(0))) {\n let yPos = this.center.y - i.approx * this.unitSize.y;\n\n this._drawLine(this.center.x, yPos, this.center.x + 6, yPos, 2);\n i.draw(this.context, {top: yPos, right: this.center.x});\n\n if(this.drawGrid) {\n this._drawLine(0, yPos, this.width - LABELWIDTH, yPos, 1,\n [5, 5]);\n }\n }\n }\n }\n }\n\n if(this.drawXAxis) {\n assert(this.range.y.min <= 0 && this.range.y.max >= 0,\n 'Cannot draw the x axis as it is out of range.')\n\n let labelWidth = this.context.measureText('x').width;\n\n //has to be fudged to look right\n let labelPosY = this.center.y - FONTSIZE / 2;\n let labelPosX = this.width - (LABELWIDTH / 2) - (labelWidth / 2);\n this.context.fillText('x', labelPosX, labelPosY);\n\n this._drawLine(0, this.center.y, this.width - LABELWIDTH - AXIS_ARROW_LENGTH, this.center.y, 2);\n\n this.context.beginPath();\n this.context.lineWidth = 1;\n this.context.moveTo(this.width - LABELWIDTH, this.center.y);\n this.context.lineTo(this.width - LABELWIDTH - AXIS_ARROW_LENGTH, this.center.y + 5);\n this.context.lineTo(this.width - LABELWIDTH - AXIS_ARROW_LENGTH, this.center.y - 5);\n this.context.fill();\n\n if(this.drawXUnits) {\n let stepSize = this.stepX;\n let xMin = this.range.x.min\n let i = stepSize.times(Math.ceil(this.drawRegion.left / stepSize.approx));\n for(; i.lessThan(this.drawRegion.right); i = i.plus(stepSize)) {\n if(!(i.equal(0))) {\n let xPos = this.center.x + i.approx * this.unitSize.x;\n\n //are any of the labels fractions? if step is an integer,\n //or an integral multiple of pi, then no.\n if(stepSize.approx === parseInt(stepSize.approx)) {\n var areFractions = false;\n } else {\n let stepSizeDivPi = stepSize.divide(new Rational(\"pi\"));\n\n if(stepSizeDivPi.approx === parseInt(stepSizeDivPi.approx)) {\n var areFractions = false;\n } else {\n var areFractions = true;\n }\n }\n\n this._drawLine(xPos, this.center.y, xPos, this.center.y - 6, 2);\n\n let labelYPos = this.center.y + MARKING_PADDING_TOP;\n if(i.greaterThan(0)) {\n i.draw(this.context, {top: labelYPos, left: xPos}, areFractions);\n } else if(i.lessThan(0)) {\n i.draw(this.context, {top: labelYPos, right: xPos}, areFractions);\n }\n\n if(this.drawGrid) {\n this._drawLine(xPos, LABELHEIGHT, xPos, this.height, 1,\n [5, 5]);\n }\n }\n }\n }\n }\n\n //draw origin\n if(this.drawOrigin) {\n let origin = new Rational(0);\n origin.draw(this.context, {top: this.center.y, right: this.center.x});\n }\n }", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function axisBox() {\n return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };\n}", "function calculateBase(groupItem){var extent;var baseAxis=groupItem.axis;var seriesModels=groupItem.seriesModels;var seriesCount=seriesModels.length;var boxWidthList=groupItem.boxWidthList = [];var boxOffsetList=groupItem.boxOffsetList = [];var boundList=[];var bandWidth;if(baseAxis.type === 'category'){bandWidth = baseAxis.getBandWidth();}else {var maxDataCount=0;each(seriesModels,function(seriesModel){maxDataCount = Math.max(maxDataCount,seriesModel.getData().count());});extent = baseAxis.getExtent(),Math.abs(extent[1] - extent[0]) / maxDataCount;}each(seriesModels,function(seriesModel){var boxWidthBound=seriesModel.get('boxWidth');if(!zrUtil.isArray(boxWidthBound)){boxWidthBound = [boxWidthBound,boxWidthBound];}boundList.push([parsePercent(boxWidthBound[0],bandWidth) || 0,parsePercent(boxWidthBound[1],bandWidth) || 0]);});var availableWidth=bandWidth * 0.8 - 2;var boxGap=availableWidth / seriesCount * 0.3;var boxWidth=(availableWidth - boxGap * (seriesCount - 1)) / seriesCount;var base=boxWidth / 2 - availableWidth / 2;each(seriesModels,function(seriesModel,idx){boxOffsetList.push(base);base += boxGap + boxWidth;boxWidthList.push(Math.min(Math.max(boxWidth,boundList[idx][0]),boundList[idx][1]));});}", "function calculateTicks(axis, axisOptions){\n\t\t\taxis.ticks = [];\t\n\t\t\tif(axisOptions.ticks){\n\t\t\t\tvar ticks = axisOptions.ticks;\n\t\n\t\t\t\tif(Object.isFunction(ticks)){\n\t\t\t\t\tticks = ticks({ min: axis.min, max: axis.max });\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Clean up the user-supplied ticks, copy them over.\n\t\t\t\t */\n\t\t\t\tfor(var i = 0, v, label; i < ticks.length; ++i){\n\t\t\t\t\tvar t = ticks[i];\n\t\t\t\t\tif(typeof(t) == 'object'){\n\t\t\t\t\t\tv = t[0];\n\t\t\t\t\t\tlabel = (t.length > 1) ? t[1] : axisOptions.tickFormatter(v);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tv = t;\n\t\t\t\t\t\tlabel = axisOptions.tickFormatter(v);\n\t\t\t\t\t}\n\t\t\t\t\taxis.ticks[i] = { v: v, label: label };\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t/**\n\t\t\t\t * Round to nearest multiple of tick size.\n\t\t\t\t */\n\t\t\t\tvar start = axis.tickSize * Math.ceil(axis.min / axis.tickSize);\n\t\t\t\t/**\n\t\t\t\t * Then spew out all possible ticks.\n\t\t\t\t */\n\t\t\t\tfor(i = 0; start + i * axis.tickSize <= axis.max; ++i){\n\t\t\t\t\tv = start + i * axis.tickSize;\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Round (this is always needed to fix numerical instability).\n\t\t\t\t\t */\n\t\t\t\t\tvar decimals = axisOptions.tickDecimals;\n\t\t\t\t\tif(decimals == null) decimals = 1 - Math.floor(Math.log(axis.tickSize) / Math.LN10);\n\t\t\t\t\tif(decimals < 0) decimals = 0;\n\t\t\t\t\t\n\t\t\t\t\tv = v.toFixed(decimals);\n\t\t\t\t\taxis.ticks.push({ v: v, label: axisOptions.tickFormatter(v) });\n\t\t\t\t}\n\t\t\t}\n\t\t}", "resetRange() {\n this._initAxisTags(true);\n this.draw();\n }", "function AbstractChartPainter() {\n\n}", "function AxisHelper () {\n this.radius = 1;\n this.high = 10;\n var N = 10; \n this.c1 = new Cilinder(N, N, this.radius, this.high);\n this.c2 = new Cilinder(N, N, this.radius, this.high);\n this.c3 = new Cilinder(N, N, this.radius, this.high);\n this.c1.setColor(1,0,0); // x = R\n this.c2.setColor(0,1,0); // y = G\n this.c3.setColor(0,0,1); // z = B\n\n}", "rescale(min, max) {\n if(min === 0){\n min = min + \"\";\n }\n if(max === 0){\n max = max + \"\";\n }\n this.x.domain([min || 30, max || 80]);\n\n this.xAxisElement\n .transition().duration(1500).ease(easeSinInOut) // https://github.com/mbostock/d3/wiki/Transitions#wiki-d3_ease\n .call(this.xAxis);\n\n for (let k in this.data) {\n // Add the valueline path.\n this.lineSvg.select(\".MECU\"+k)\n .transition().duration(1500).ease(easeSinInOut)\n .attr(\"d\", this.valueline(this.data[k].r));\n }\n }", "function setAxis(axis, axisModel) {\n axis.type = axisModel.get('type');\n axis.scale = createScaleByModel(axisModel);\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\n axis.inverse = axisModel.get('inverse');\n\n if (isAngleAxisModel(axisModel)) {\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\n var startAngle = axisModel.get('startAngle');\n axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\n } // Inject axis instance\n\n\n axisModel.axis = axis;\n axis.model = axisModel;\n}", "function appendAxes() {\n graphImg\n .append(\"g\")\n .call(xAxis)\n .attr(\"class\", \"xAxis\")\n .attr(\n \"transform\",\n \"translate(0,\" + (displayHeight - margin - labelArea) + \")\"\n );\n graphImg\n .append(\"g\")\n .call(yAxis)\n .attr(\"class\", \"yAxis\")\n .attr(\"transform\", \"translate(\" + (margin + labelArea) + \", 0)\");\n }", "function getYaxisOptions(opts, unit, min, max){\r\n\topts.axes.yaxis = {\r\n min: min,\r\n max: max,\r\n numberTicks: 5,\r\n autoscale: true,\r\n label: unit,\r\n tickOptions: {\r\n          angle: 0\r\n },\r\n tickInterval: null\r\n };\r\n opts.seriesDefaults.shadow = true;\r\n opts.seriesDefaults.pointLabels = {show: true};\r\n opts.seriesDefaults.markerOptions.color = 'darkblue';\r\n opts.highlighter.sizeAdjust = 4; \r\n\r\n return opts;\r\n}", "function componentCandleSticks () {\n\n /* Default Properties */\n var width = 400;\n var height = 400;\n var colors = [\"green\", \"red\"];\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n var xScale = void 0;\n var yScale = void 0;\n var colorScale = d3.scaleOrdinal().range(colors).domain([true, false]);\n var candleWidth = 3;\n var classed = \"candleSticks\";\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n // TODO: Use dataTransform() to calculate date domains?\n var maxDate = d3.max(data.values, function (d) {\n return d.date;\n });\n var minDate = d3.min(data.values, function (d) {\n return d.date;\n });\n\n var ONE_DAY_IN_MILLISECONDS = 86400000;\n var dateDomain = [new Date(minDate - ONE_DAY_IN_MILLISECONDS), new Date(maxDate + ONE_DAY_IN_MILLISECONDS)];\n\n // TODO: Use dataTransform() to calculate candle min/max?\n var yDomain = [d3.min(data.values, function (d) {\n return d.low;\n }), d3.max(data.values, function (d) {\n return d.high;\n })];\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain([true, false]).range(colors);\n }\n\n if (typeof xScale === \"undefined\") {\n xScale = d3.scaleTime().domain(dateDomain).range([0, width]);\n }\n\n if (typeof yScale === \"undefined\") {\n yScale = d3.scaleLinear().domain(yDomain).range([height, 0]).nice();\n }\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias candleSticks\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n init(selection.data()[0]);\n selection.each(function () {\n\n // Is Up Day\n var isUpDay = function isUpDay(d) {\n return d.close > d.open;\n };\n\n // Line Function\n var line = d3.line().x(function (d) {\n return d.x;\n }).y(function (d) {\n return d.y;\n });\n\n // High Low Lines\n var highLowLines = function highLowLines(bars) {\n var paths = bars.selectAll(\".high-low-line\").data(function (d) {\n return [d];\n });\n\n paths.enter().append(\"path\").classed(\"high-low-line\", true).attr(\"d\", function (d) {\n return line([{ x: xScale(d.date), y: yScale(d.high) }, { x: xScale(d.date), y: yScale(d.low) }]);\n });\n };\n\n // Open Close Bars\n var openCloseBars = function openCloseBars(bars) {\n var rect = bars.selectAll(\".open-close-bar\").data(function (d) {\n return [d];\n });\n\n rect.enter().append(\"rect\").classed(\"open-close-bar\", true).attr(\"x\", function (d) {\n return xScale(d.date) - candleWidth;\n }).attr(\"y\", function (d) {\n return isUpDay(d) ? yScale(d.close) : yScale(d.open);\n }).attr(\"width\", candleWidth * 2).attr(\"height\", function (d) {\n return isUpDay(d) ? yScale(d.open) - yScale(d.close) : yScale(d.close) - yScale(d.open);\n });\n };\n\n // Update series group\n var seriesGroup = d3.select(this);\n seriesGroup.classed(classed, true).attr(\"id\", function (d) {\n return d.key;\n }).on(\"mouseover\", function (d) {\n dispatch.call(\"customSeriesMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customSeriesClick\", this, d);\n });\n\n // Add candles to series\n var candlesSelect = seriesGroup.selectAll(\".candle\").data(function (d) {\n return d.values;\n });\n\n var candles = candlesSelect.enter().append(\"g\").classed(\"candle\", true).attr(\"fill\", function (d) {\n return colorScale(isUpDay(d));\n }).attr(\"stroke\", function (d) {\n return colorScale(isUpDay(d));\n }).on(\"mouseover\", function (d) {\n dispatch.call(\"customValueMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customValueClick\", this, d);\n }).merge(candlesSelect);\n\n highLowLines(candles);\n openCloseBars(candles);\n // openCloseTicks(candles);\n\n candles.exit().remove();\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return my;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return my;\n };\n\n /**\n * X Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.xScale = function (_v) {\n if (!arguments.length) return xScale;\n xScale = _v;\n return my;\n };\n\n /**\n * Y Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.yScale = function (_v) {\n if (!arguments.length) return yScale;\n yScale = _v;\n return my;\n };\n\n /**\n * Candle Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.candleWidth = function (_v) {\n if (!arguments.length) return candleWidth;\n candleWidth = _v;\n return my;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "function getXaxisCustomRangeReport(dateFrom,dateTo){\n\n var db = getDatabase();\n var rs = \"\";\n\n //console.log(\"Global Report loading X chart data for custom report, from: \"+dateFrom+\" to: \"+dateTo);\n\n db.transaction(function(tx) {\n\n /* note:the 'in' clusole is necessary to don't load the category with NO expense in the range. Otherwise X and Y dataset have different size */\n rs = tx.executeSql(\"select cat_name,id from category where id in (select e.id_category from expense e where date(e.date) <= date('\"+dateTo+\"') and date(e.date) >= date('\"+dateFrom+\"') group by id_category)\");\n\n }\n );\n\n /* build the X values array */\n var categoryNames = [];\n for(var i =0;i < rs.rows.length;i++) {\n categoryNames.push(rs.rows.item(i).cat_name);\n //console.log('Category name: '+rs.rows.item(i).cat_name);\n }\n\n return categoryNames;\n }", "function cartesianAxisHelper_layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (util[\"O\" /* retrieve */](opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}", "function axis() {\n stroke(100);\n strokeWeight(1);\n push();\n\n // define positions\n var xaxis = height*4/5\n var yaxis = width/2\n\n // draw x axis\n translate(0,xaxis);\n line(0,0,width,0);\n pop();\n push();\n\n // draw y axis\n translate(width/2,0);\n line(0,0,0,height);\n pop();\n push();\n\n // get user input for range\n range = rangeSlider.value();\n\n // shorten displayed digits and add '$'\n if(range >= 1000 & range <= 1000000){\n range_half = \"$\" + range / 2000 + \"K\";\n range = \"$\" + range / 1000 + \"K\";\n }\n\n if(range >= 1000000){\n range_half = \"$\" + range / 2000000 + \"M\";\n range = \"$\" + range / 1000000 + \"M\";\n }\n\n // x-axis labels\n text(\"-\" + range, 0 , xaxis + 10)\n text(\"-\" + range_half, width/4, xaxis + 10)\n text(range_half, 3*width/4 - 30, xaxis + 10)\n text(range, width - 30, height*4/5 + 10)\n\n\n // y-axis labels\n text(1, yaxis - 15, 10)\n text(0.5, yaxis - 20, xaxis/2)\n text(0.25, yaxis - 25, xaxis*3/4)\n text(0.75, yaxis - 25, xaxis/4)\n\n // origin\n text(0, yaxis - 3, xaxis + 10)\n\n }", "function LineChartApi(p_element, p_settings, p_data) {\n\tthis.base = SeriesChartApi;\n\tthis.base(p_element, p_settings, p_data);\n\tvar me = this;\n\n\t// Helper function for DrawChart()\n\tfunction DrawPoint(p_series) {\n\t\tvar TotalData = me.GetFilteredData(p_series);\n\t\tif (TotalData[0] == undefined || TotalData[0] == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// ### Variables ###\n\t\tvar categories = TotalData[0];\n\t\tvar data = TotalData[1]\n\t\tvar isVariableXAxis = TotalData[2];\n\t\tvar isDate = TotalData[3];\n\n\t\tvar colorNumber = p_series - 1;\n\t\t// Derived values\n\t\tvar incrementX = me.g_chartArea.maxX / (data.length - 1);\n\t\tvar valueX = isDate ? categories[0].valueOf() : categories[0];\n\t\tvar nextY = 1 - ((data[0] - me.minY) / (me.maxY - me.minY));\n\n\t\tvar pointBorder = me.g_chartArea.pointBorder == null\n\t\t\t|| me.g_chartArea.pointBorder[colorNumber] == null\n\t\t\t? me.g_chartArea.color[colorNumber] : me.g_chartArea.pointBorder[colorNumber];\n\n\t\tfor (var i = 0; i < (data.length - 1) ; i++) {\n\t\t\t// Get X\n\t\t\tvar x1;\n\t\t\tvar x2;\n\n\t\t\tif (isVariableXAxis) {\n\t\t\t\tvar nextX = (valueX - me.minX) / (me.maxX - me.minX);\n\t\t\t\tvar x1 = (nextX * me.g_chartArea.maxX) + me.g_chartArea.minX;\n\n\t\t\t\tvalueX = isDate ? categories[i + 1].valueOf() : categories[i + 1];\n\n\t\t\t\tvar nextX = (valueX - me.minX) / (me.maxX - me.minX);\n\t\t\t\tvar x2 = (nextX * me.g_chartArea.maxX) + me.g_chartArea.minX;\n\t\t\t} else {\n\t\t\t\tx1 = me.g_chartArea.minX + (i * incrementX);\n\t\t\t\tx2 = me.g_chartArea.minX + ((i + 1) * incrementX);\n\t\t\t}\n\t\t\t// Get Y\n\t\t\tvar y1 = (nextY * me.g_chartArea.maxY) + me.g_chartArea.minY;\n\t\t\tnextY = 1 - ((data[i + 1] - me.minY) / (me.maxY - me.minY));\n\n\t\t\tvar y2 = (nextY * me.g_chartArea.maxY) + me.g_chartArea.minY;\n\t\t\t// Check if a point is missing\n\t\t\tif (isNaN(y1) || isNaN(y2)) {\n\n\t\t\t\tif (!isNaN(y1)) {\n\t\t\t\t\t// if this point exists, draw it out\n\t\t\t\t\tvar category = isDate ? me.FormatDate(categories[i], me.g_xAxis.dateFormat) : categories[i];\n\n\t\t\t\t\tvar Circle = me.Circle(me.g_chartArea.reference, x1, y1, 0.75, me.g_chartArea.color[colorNumber], pointBorder);\n\n\t\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\t\"mouseover\",\n\t\t\t\t\t\tme.HoverText,\n\t\t\t\t\t\tdata[i] + ', ' + category);\n\n\t\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\t\"mouseout\",\n\t\t\t\t\t\tme.EndHoverText);\n\t\t\t\t}\n\n\t\t\t\tif (!isNaN(y2)) {\n\t\t\t\t\t// if this point exists, draw it out\n\t\t\t\t\tvar category = isDate ? me.FormatDate(categories[i + 1], me.g_xAxis.dateFormat) : categories[i + 1];\n\n\t\t\t\t\tvar Circle = me.Circle(me.g_chartArea.reference, x2, y2, 0.75, me.g_chartArea.color[colorNumber], pointBorder);\n\n\t\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\t\"mouseover\",\n\t\t\t\t\t\tme.HoverText,\n\t\t\t\t\t\tdata[i + 1] + ', ' + category);\n\n\t\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\t\"mouseout\",\n\t\t\t\t\t\tme.EndHoverText);\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Draw the line\n\t\t\tme.Line(me.g_chartArea.reference, x1, y1, x2, y2, me.g_chartArea.color[colorNumber]);\n\n\t\t\t// Draw the point\n\t\t\tvar category = isDate ? me.FormatDate(categories[i], me.g_xAxis.dateFormat) : categories[i];\n\n\t\t\tvar Circle = me.Circle(me.g_chartArea.reference, x1, y1, 0.75, me.g_chartArea.color[colorNumber], pointBorder);\n\n\t\t\tme.Event(Circle,\n\t\t\t\t\"mouseover\",\n\t\t\t\tme.HoverText,\n\t\t\t\tdata[i] + ', ' + category);\n\n\t\t\tme.Event(Circle,\n\t\t\t\t\"mouseout\",\n\t\t\t\tme.EndHoverText);\n\n\t\t\tif (i == (data.length - 2)) {\n\t\t\t\t// this is the last point\n\t\t\t\tvar category = isDate ? me.FormatDate(categories[i + 1], me.g_xAxis.dateFormat) : categories[i + 1];\n\n\t\t\t\tvar Circle = me.Circle(me.g_chartArea.reference, x2, y2, 0.75, me.g_chartArea.color[colorNumber], pointBorder);\n\n\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\"mouseover\",\n\t\t\t\t\tme.HoverText,\n\t\t\t\t\tdata[i + 1] + ', ' + category);\n\n\t\t\t\tme.Event(Circle,\n\t\t\t\t\t\"mouseout\",\n\t\t\t\t\tme.EndHoverText);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t};\n\n\n\t// #### User Interfaces ####\n\n\n\tthis.DrawChart = function () {\n\t\tif (me.drawSeries == -1) {\n\t\t\tfor (var i = 1; i < this.g_data.length; i++) {\n\t\t\t\tDrawPoint(i);\n\t\t\t}\n\t\t}\n\t\telse DrawPoint(me.drawSeries);\n\t};\n}", "function drawYAxis() {\n // draw tick marks and labels\n var domain = y1Domain,\n styles = vis.__styles,\n ticks = vis.getYTicks(scales.y, c.h, extendRange, useLogScale);\n\n if (!extendRange && ticks[ticks.length-1] != domain[1]) ticks.push(domain[1]);\n\n if ($('body').hasClass('fullscreen')) {\n theme.horizontalGrid['stroke-width'] = 2;\n }\n\n _.each(ticks, function(val, t) {\n var y = scales.y(val), x = c.lpad;\n if (val >= domain[0] && val <= domain[1] || extendRange) {\n // c.paper.text(x, y, val).attr(styles.labels).attr({ 'text-anchor': 'end' });\n\n // axis label\n vis.label(x+2, y-10, formatter.y1(val, t == ticks.length-1), { align: 'left', cl: 'axis' });\n // axis ticks\n if (theme.yTicks) {\n vis.path([['M', c.lpad-25, y], ['L', c.lpad-20,y]], 'tick');\n }\n // grid line\n if (theme.horizontalGrid) {\n vis.path([['M', c.lpad, y], ['L', c.w - c.rpad,y]], 'grid')\n .attr(theme.horizontalGrid);\n }\n }\n });\n\n // draw axis line\n if (domain[0] <= 0 && domain[1] >= 0) {\n y = scales.y(0);\n vis.path([['M', c.lpad, y], ['L', c.w - c.rpad,y]], 'axis')\n .attr(theme.xAxis);\n }\n }", "function rawChart() {\r\n\tvar chart_title = \"VLMO\";\r\n\t$('#container').highcharts(\r\n\t\t\t{\r\n\t\t\t\tchart : {\r\n\t\t\t\t\tzoomType : 'xy'\r\n\t\t\t\t},\r\n\t\t\t\ttitle : {\r\n\t\t\t\t\ttext : chart_title\r\n\t\t\t\t},\r\n\t\t\t\tsubtitle : {\r\n\t\t\t\t\ttext : 'From ' + selectStartDate.format('yyyy-mm-dd')\r\n\t\t\t\t\t\t\t+ ' To ' + selectEndDate.format('yyyy-mm-dd')\r\n\t\t\t\t},\r\n\t\t\t\tcredits : {\r\n\t\t\t\t\thref : 'http://www.vervemobile.com',\r\n\t\t\t\t\ttext : 'vervemobile.com'\r\n\t\t\t\t},\r\n\t\t\t\txAxis : [ {\r\n\t\t\t\t\tcategories : categories,\r\n\t\t\t\t\t// tickmarkPlacement: 'on',\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\tenabled : false\r\n\t\t\t\t\t},\r\n\t\t\t\t\t// gridLineWidth: 1,\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\trotation : -45,\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\tvar value = this.value;\r\n\t\t\t\t\t\t\tvar now = new Date(value);\r\n\t\t\t\t\t\t\treturn now.format(\"mmm dd\");\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\tyAxis : [ { // Primary\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\treturn accounting.formatNumber(this.value);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#01A9DB '\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\ttext : 'Clicks',\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#01A9DB'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\topposite : true\r\n\r\n\t\t\t\t}, { // Tertiary\r\n\t\t\t\t\tlabels : {\r\n\t\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\t\treturn accounting.formatNumber(this.value);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#DBA901'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttitle : {\r\n\t\t\t\t\t\ttext : 'Impressions',\r\n\t\t\t\t\t\tstyle : {\r\n\t\t\t\t\t\t\tcolor : '#DBA901'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} ],\r\n\t\t\t\ttooltip : {\r\n\t\t\t\t\tshared : true,\r\n\t\t\t\t\tformatter : function() {\r\n\t\t\t\t\t\tvar date_Value = new Date(this.x);\r\n\t\t\t\t\t\tvar s = '<b>' + date_Value.format('mmm d, yyyy')\r\n\t\t\t\t\t\t\t\t+ '</b>';\r\n\t\t\t\t\t\t$.each(this.points, function(i, point) {\r\n\t\t\t\t\t\t\tif (point.series.name == 'Impressions') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #DBA901;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else if (point.series.name == 'Clicks') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #01A9DB;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else if (point.series.name == 'Cta any') {\r\n\t\t\t\t\t\t\t\ts += '<br/><font style=\"color: #80FF00;\">'\r\n\t\t\t\t\t\t\t\t\t\t+ point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatNumber(point.y)\r\n\t\t\t\t\t\t\t\t\t\t+ '</font>';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\ts += '<br/>' + point.series.name + ': '\r\n\t\t\t\t\t\t\t\t\t\t+ accounting.formatMoney(point.y);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn s;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tlegend : {\r\n\t\t\t\t\t// layout: 'vertical',\r\n\t\t\t\t\t// align: 'left',\r\n\t\t\t\t\t// x: 100,\r\n\t\t\t\t\t// verticalAlign: 'top',\r\n\t\t\t\t\t// y: 0,\r\n\t\t\t\t\t// floating: true,\r\n\t\t\t\t\tbackgroundColor : '#FFFFFF'\r\n\t\t\t\t},\r\n\t\t\t\tseries : [ {\r\n\t\t\t\t\tname : 'Clicks',\r\n\t\t\t\t\tcolor : '#01A9DB',\r\n\t\t\t\t\ttype : 'areaspline',\r\n\t\t\t\t\tyAxis : 1,\r\n\t\t\t\t\tdata : secondData\r\n\t\t\t\t}, {\r\n\t\t\t\t\tname : 'Impressions',\r\n\t\t\t\t\tcolor : '#DBA901',\r\n\t\t\t\t\ttype : 'column',\t\t\t\t\t\r\n\t\t\t\t\tdata : firstData\r\n\t\t\t\t} ]\r\n\t\t\t});\r\n\tchart = $('#container').highcharts();\r\n}", "function formatAxis() {\n var zeroTick, zeroTickLabel;\n // remove boldness from default axis path\n _.root.selectAll('path')\n .attr({\n 'fill': 'none'\n });\n\n // update fonts\n _.root.selectAll('text')\n .attr({\n 'stroke': 'none',\n 'fill': _.config.color\n });\n\n //Apply padding to the first tick on Y axis\n if (_.config.axisType === 'y') {\n zeroTick = _.root.select('g');\n\n if (zeroTick.node()) {\n zeroTickLabel = zeroTick.text() +\n (_.config.unit ? ' ' + _.config.unit : '');\n zeroTick.select('text').text(zeroTickLabel);\n setZeroTickTranslate(zeroTick);\n }\n }\n\n // apply text background for greater readability.\n _.root.selectAll('.gl-axis text').each(function() {\n\n var textBg = this.cloneNode(true);\n d3.select(textBg).attr({\n stroke: _.config.textBgColor,\n 'stroke-width': _.config.textBgSize\n });\n this.parentNode.insertBefore(textBg, this);\n });\n\n // remove axis line\n _.root.selectAll('.domain')\n .attr({\n 'stroke': 'none'\n });\n }", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "draw_axes () {\n let canvas = this.layers.get(CONST.CHART_LAYER_AXES);\n\n // Draw axes\n let ctx = canvas.getContext('2d');\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n ctx.strokeStyle = CONST.WHITE;\n ctx.lineWidth = 3;\n\n ctx.beginPath();\n ctx.moveTo(0, canvas.height-this.chart_padding_x_axis);\n ctx.lineTo(canvas.width - this.chart_padding_y_axis, canvas.height-this.chart_padding_x_axis);\n ctx.lineTo(canvas.width - this.chart_padding_y_axis, 0);\n ctx.stroke();\n\n this.draw_axes_labels();\n }", "_validateMinMax(validatedProperty, initialValidation, oldValue) {\n const that = this;\n\n let validateMin = validatedProperty === 'min' || validatedProperty === 'both',\n validateMax = validatedProperty === 'max' || validatedProperty === 'both';\n\n if (typeof (initialValidation) === undefined) {\n initialValidation = false;\n }\n\n if (validatedProperty === 'both') {\n validator('min', oldValue);\n validator('max', oldValue);\n }\n else {\n validator(validatedProperty, oldValue);\n }\n\n function validator(param, oldValue) {\n that._numericProcessor.validateMinMax(param === 'min' || initialValidation, param === 'max' || initialValidation);\n const value = that['_' + param + 'Object'];\n let validateCondition = param === 'min' ? that._numericProcessor.compare(that.max, value, true) <= 0 :\n that._numericProcessor.compare(that.min, value, true) > 0;\n\n if (validateCondition) {\n if (oldValue) {\n that._numberRenderer = new JQX.Utilities.NumberRenderer(oldValue);\n param === 'min' ? validateMin = false : validateMax = false;\n that[param] = oldValue;\n that['_' + param + 'Object'] = oldValue;\n }\n else {\n that.error(that.localize('invalidMinOrMax', { elementType: that.nodeName.toLowerCase(), property: param }));\n }\n }\n else {\n that._numberRenderer = new JQX.Utilities.NumberRenderer(value);\n that[param] = that['_' + param + 'Object'];\n }\n }\n\n if (that.logarithmicScale) {\n that._validateOnLogarithmicScale(validateMin, validateMax, oldValue);\n }\n else {\n that._drawMin = that.min;\n that._drawMax = that.max;\n }\n\n that.min = that.min.toString();\n that.max = that.max.toString();\n\n that._minObject = that._numericProcessor.createDescriptor(that.min);\n that._maxObject = that._numericProcessor.createDescriptor(that.max);\n\n if (that.mode === 'date') {\n that._minDate = JQX.Utilities.DateTime.fromFullTimeStamp(that.min);\n that._maxDate = JQX.Utilities.DateTime.fromFullTimeStamp(that.max);\n }\n\n //Validates the Interval\n that._numericProcessor.validateInterval(that.interval);\n\n if (that.customInterval) {\n that._numericProcessor.validateCustomTicks();\n }\n }", "niceScale(yMin, yMax, diff, index = 0, ticks = 10) {\n const w = this.w\n const NO_MIN_MAX_PROVIDED =\n (this.w.config.yaxis[index].max === undefined &&\n this.w.config.yaxis[index].min === undefined) ||\n this.w.config.yaxis[index].forceNiceScale\n if (\n (yMin === Number.MIN_VALUE && yMax === 0) ||\n (!Utils.isNumber(yMin) && !Utils.isNumber(yMax)) ||\n (yMin === Number.MIN_VALUE && yMax === -Number.MAX_VALUE)\n ) {\n // when all values are 0\n yMin = 0\n yMax = ticks\n let linearScale = this.linearScale(yMin, yMax, ticks)\n return linearScale\n }\n\n if (yMin > yMax) {\n // if somehow due to some wrong config, user sent max less than min,\n // adjust the min/max again\n console.warn('yaxis.min cannot be greater than yaxis.max')\n yMax = yMin + 0.1\n } else if (yMin === yMax) {\n // If yMin and yMax are identical, then\n // adjust the yMin and yMax values to actually\n // make a graph. Also avoids division by zero errors.\n yMin = yMin === 0 ? 0 : yMin - 0.5 // some small value\n yMax = yMax === 0 ? 2 : yMax + 0.5 // some small value\n }\n\n // Calculate Min amd Max graphical labels and graph\n // increments. The number of ticks defaults to\n // 10 which is the SUGGESTED value. Any tick value\n // entered is used as a suggested value which is\n // adjusted to be a 'pretty' value.\n //\n // Output will be an array of the Y axis values that\n // encompass the Y values.\n let result = []\n\n // Determine Range\n let range = Math.abs(yMax - yMin)\n\n if (\n range < 1 &&\n NO_MIN_MAX_PROVIDED &&\n (w.config.chart.type === 'candlestick' ||\n w.config.series[index].type === 'candlestick' ||\n w.globals.isRangeData)\n ) {\n /* fix https://github.com/apexcharts/apexcharts.js/issues/430 */\n yMax = yMax * 1.01\n }\n\n let tiks = ticks + 1\n // Adjust ticks if needed\n if (tiks < 2) {\n tiks = 2\n } else if (tiks > 2) {\n tiks -= 2\n }\n\n // Get raw step value\n let tempStep = range / tiks\n // Calculate pretty step value\n\n let mag = Math.floor(Utils.log10(tempStep))\n let magPow = Math.pow(10, mag)\n let magMsd = parseInt(tempStep / magPow)\n let stepSize = magMsd * magPow\n\n // build Y label array.\n // Lower and upper bounds calculations\n let lb = stepSize * Math.floor(yMin / stepSize)\n let ub = stepSize * Math.ceil(yMax / stepSize)\n // Build array\n let val = lb\n\n if (NO_MIN_MAX_PROVIDED && diff > 6) {\n while (1) {\n result.push(val)\n val += stepSize\n if (val > ub) {\n break\n }\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n } else {\n result = []\n let v = yMin\n result.push(v)\n let valuesDivider = Math.abs(yMax - yMin) / ticks\n for (let i = 0; i <= ticks; i++) {\n v = v + valuesDivider\n result.push(v)\n }\n\n if (result[result.length - 2] >= yMax) {\n result.pop()\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n }\n }", "constructor(config) {\n // Constants\n this.MIN_Y_AXIS_RANGE = 1;\n this.ZOOM_Y_PERCENTAGE = 0.1; // Zoom 10% of Y axis\n this.MOVE_Y_PERCENTAGE = 0.2; // Move 20% of Y axis\n this.UPDATE_Y_USE_ALL_DATA = true; // update y axis using all the data or just the incoming\n this.Y_PADDING = 0.05; // 5% of air up and down when updating the axis\n\n // Assure that the config object is correct\n if(!this._validateConstructorParams(config)) return;\n\n this.data = null;\n this.isReady = false;\n\n this.legendContainer = config.legendContainer;\n this.secondsIndicator = config.secondsIndicator;\n this.yMin = config.yMin;\n this.yMax = config.yMax;\n this.yMinHome = config.yMin;\n this.yMaxHome = config.yMax;\n\n this._initEmptyTimeChart(config.container, config.width, config.height, config.xTicks, config.yTicks);\n this._initAxisDeltas(config.dxZoom);\n this._initEmptyLegend();\n this._initEmptyTitle();\n this._addEventsXAxis(config.xZoomBtn[0], config.xZoomBtn[1]);\n this._addEventsYAxis(config.yZoomBtn, config.yMoveBtn, config.yHomeBtn);\n this._updateXAxis(config.secondsInScreen);\n\n this.htmlIds = {\n yAutoUpdate: config.yAutoUpdate,\n };\n\n // Select recalculateYAxisFunction\n this.recalculateYAxisFunction = (this.UPDATE_Y_USE_ALL_DATA) ?\n this._recalculateYAxisFull : this._recalculateYAxisIncoming;\n // NOTE: assigning functions like this is dangerous without bind,\n // although in this case should work\n }", "function axis_attribute_change(self){\n if($(self).hasClass('x-gene-attribute-select')){\n x_attribute_change(self);\n } else if($(self).hasClass('y-gene-attribute-select')){\n y_attribute_change(self);\n }\n }", "function axisBeforePadding() {\n var _this = this;\n var axisLength = this.len,\n chart = this.chart,\n isXAxis = this.isXAxis,\n dataKey = isXAxis ? 'xData' : 'yData',\n min = this.min,\n range = this.max - min;\n var pxMin = 0,\n pxMax = axisLength,\n transA = axisLength / range,\n hasActiveSeries;\n // Handle padding on the second pass, or on redraw\n this.series.forEach(function (series) {\n if (series.bubblePadding &&\n (series.visible || !chart.options.chart.ignoreHiddenSeries)) {\n // Correction for #1673\n _this.allowZoomOutside = true;\n hasActiveSeries = true;\n var data = series[dataKey];\n if (isXAxis) {\n (series.onPoint || series).getRadii(0, 0, series);\n if (series.onPoint) {\n series.radii = series.onPoint.radii;\n }\n }\n if (range > 0) {\n var i = data.length;\n while (i--) {\n if (isNumber(data[i]) &&\n _this.dataMin <= data[i] &&\n data[i] <= _this.max) {\n var radius = series.radii && series.radii[i] || 0;\n pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);\n pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);\n }\n }\n }\n }\n });\n // Apply the padding to the min and max properties\n if (hasActiveSeries && range > 0 && !this.logarithmic) {\n pxMax -= axisLength;\n transA *= (axisLength +\n Math.max(0, pxMin) - // #8901\n Math.min(pxMax, axisLength)) / axisLength;\n [\n ['min', 'userMin', pxMin],\n ['max', 'userMax', pxMax]\n ].forEach(function (keys) {\n if (typeof pick(_this.options[keys[0]], _this[keys[1]]) === 'undefined') {\n _this[keys[0]] += keys[2] / transA;\n }\n });\n }\n }", "function calculateScales(keepAxis) {\n //get min and max values\n maxTaskLength = d3.max(diagram.data, function (d) { return d[currentSerie.sourceField].toString().length; });\n tasks = e.getUniqueValues(diagram.data, currentSerie.sourceField);\n groups = e.getUniqueValues(diagram.data, currentSerie.groupField);\n\n //set domain info\n timeDomainStart = d3.min(diagram.data, function (d) { return new Date(d[startDateField]); });\n timeDomainEnd = d3.max(diagram.data, function (d) { return new Date(d[endDateField]); });\n dateDiff = timeDomainEnd.diff(timeDomainStart);\n\n //set axis formatting via date diff\n if (dateDiff > 365) {\n //set axis formatting\n axisFormatting = d3.utcFormat('%e-%b-%Y');\n } else {\n if (dateDiff < 1) {\n //set axis formatting\n axisFormatting = d3.utcFormat('%X');\n } else {\n //set axis formatting\n axisFormatting = d3.utcFormat('%b-%e');\n }\n }\n\n //calculate margins\n autoMargin = ((diagram.yAxis.labelFontSize / 2) * (maxTaskLength + 1)) + diagram.yAxis.labelFontSize;\n margin.left = diagram.margin.left + autoMargin;\n margin.right = diagram.margin.right;\n margin.top = diagram.margin.top;\n margin.bottom = diagram.margin.bottom;\n\n //set dimension\n width = diagram.plot.width - diagram.plot.left - diagram.plot.right - margin.left - margin.right;\n height = diagram.plot.height - diagram.plot.top - diagram.plot.bottom - margin.top - margin.bottom;\n\n //caclulate tick count\n maxAxisLength = axisFormatting(timeDomainEnd).length;\n singleAxisWidth = (((diagram.xAxis.labelFontSize / 2) * (maxAxisLength)) + diagram.xAxis.labelFontSize);\n autoTickCount = Math.floor(width / singleAxisWidth);\n\n //create scales\n xScale = d3.scaleUtc().domain([timeDomainStart, timeDomainEnd]).range([0, width]).clamp(true);\n yScale = d3.scaleBand().domain(tasks).range([height - margin.top - margin.bottom, 0]).padding(0.1);\n\n //create axes\n xAxis = d3.axisBottom().scale(xScale).ticks(autoTickCount / 2).tickFormat(axisFormatting);\n yAxis = d3.axisLeft().scale(yScale).tickSize(0);\n\n if (currentSerie.labelFontSize === 'auto')\n currentSerie.labelFontSize = 11;\n }", "getXScale(width) {\n let domainValues = _.map(this.props.data, (d) => d[this.props.x]);\n let sortedVals = _.sortBy(domainValues, [(d) => {\n let rank = this.props.xRank[d];\n return (rank) ? rank : 8;\n \n }]);\n\n return scaleBand()\n .padding(this.props.padding)\n .domain(sortedVals)\n .range([this.props.margins.left, width - this.props.margins.left]);\n }", "function objectBuildAxisX(colorGrid, colorTick) {\n var axisX = {\n gridColor : colorGrid,\n tickColor : colorTick,\n labelFormatter : function(e) {\n return e.value;\n },\n margin : 20,\n interlacedColor : \"#E1FCFF\"\n };\n return axisX;\n}" ]
[ "0.6456995", "0.64222115", "0.64139944", "0.6311109", "0.62709725", "0.62081957", "0.60227144", "0.59888047", "0.5952998", "0.592759", "0.59203583", "0.58894354", "0.5867283", "0.5856101", "0.580715", "0.5805064", "0.5797678", "0.57902026", "0.57778424", "0.5771716", "0.57472956", "0.57457954", "0.57226694", "0.5714124", "0.57015246", "0.5694004", "0.56926525", "0.5658473", "0.56522", "0.5642823", "0.56213397", "0.5605622", "0.560466", "0.56007284", "0.559681", "0.5577563", "0.5545552", "0.5542944", "0.5541432", "0.5527665", "0.5498711", "0.54937637", "0.5484266", "0.54807955", "0.54771096", "0.546965", "0.5467219", "0.5421156", "0.54195446", "0.539098", "0.5390805", "0.5390703", "0.5383924", "0.5381139", "0.5374413", "0.53736824", "0.53713065", "0.5345948", "0.534148", "0.534148", "0.534148", "0.534148", "0.5340589", "0.53264946", "0.53232414", "0.53121686", "0.5310726", "0.5266824", "0.5260838", "0.52492744", "0.5247334", "0.52464", "0.52411896", "0.52331465", "0.5223024", "0.52144563", "0.52127993", "0.520862", "0.52067715", "0.51901865", "0.51901865", "0.51901865", "0.51901865", "0.51786715", "0.5176384", "0.516708", "0.51642376", "0.5153927", "0.5153683", "0.515244", "0.51443934", "0.5141978" ]
0.6458842
8
Creates a new instance of ResizeObserverController.
function ResizeObserverController() { /** * Indicates whether DOM listeners have been added. * * @private {boolean} */ this.connected_ = false; /** * Tells that controller has subscribed for Mutation Events. * * @private {boolean} */ this.mutationEventsAdded_ = false; /** * Keeps reference to the instance of MutationObserver. * * @private {MutationObserver} */ this.mutationsObserver_ = null; /** * A list of connected observers. * * @private {Array<ResizeObserverSPI>} */ this.observers_ = []; this.onTransitionEnd_ = this.onTransitionEnd_.bind(this); this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\r\n\t /**\r\n\t * Indicates whether DOM listeners have been added.\r\n\t *\r\n\t * @private {boolean}\r\n\t */\r\n\t this.connected_ = false;\r\n\t /**\r\n\t * Tells that controller has subscribed for Mutation Events.\r\n\t *\r\n\t * @private {boolean}\r\n\t */\r\n\t this.mutationEventsAdded_ = false;\r\n\t /**\r\n\t * Keeps reference to the instance of MutationObserver.\r\n\t *\r\n\t * @private {MutationObserver}\r\n\t */\r\n\t this.mutationsObserver_ = null;\r\n\t /**\r\n\t * A list of connected observers.\r\n\t *\r\n\t * @private {Array<ResizeObserverSPI>}\r\n\t */\r\n\t this.observers_ = [];\r\n\t this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n\t this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n\t }", "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle$1(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle$1(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }", "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\n /**\n * Indicates whether DOM listeners have been added.\n *\n * @private {boolean}\n */\n this.connected_ = false;\n /**\n * Tells that controller has subscribed for Mutation Events.\n *\n * @private {boolean}\n */\n\n this.mutationEventsAdded_ = false;\n /**\n * Keeps reference to the instance of MutationObserver.\n *\n * @private {MutationObserver}\n */\n\n this.mutationsObserver_ = null;\n /**\n * A list of connected observers.\n *\n * @private {Array<ResizeObserverSPI>}\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\n this.connected_ = false;\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\n\n this.mutationEventsAdded_ = false;\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\n\n this.mutationsObserver_ = null;\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\n this.connected_ = false;\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\n\n this.mutationEventsAdded_ = false;\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\n\n this.mutationsObserver_ = null;\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }", "function ResizeObserverController() {\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\n this.connected_ = false;\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\n\n this.mutationEventsAdded_ = false;\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\n\n this.mutationsObserver_ = null;\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array<ResizeObserverSPI>}\r\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = $C4qV$var$throttle(this.refresh.bind(this), $C4qV$var$REFRESH_DELAY);\n }", "static _createObserver() {\n\t\tlet ObserverConstructor;\n\n\t\t// TODO: One day, the `ResizeObserver` API will be supported in all modern web browsers.\n\t\t// When it happens, this module will no longer make sense and should be removed and\n\t\t// the native implementation should be used across the project to save bytes.\n\t\t// Check out https://caniuse.com/#feat=resizeobserver.\n\t\tif ( typeof _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].window.ResizeObserver === 'function' ) {\n\t\t\tObserverConstructor = _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].window.ResizeObserver;\n\t\t} else {\n\t\t\tObserverConstructor = ResizeObserverPolyfill;\n\t\t}\n\n\t\tResizeObserver._observerInstance = new ObserverConstructor( entries => {\n\t\t\tfor ( const entry of entries ) {\n\t\t\t\tconst callbacks = ResizeObserver._getElementCallbacks( entry.target );\n\n\t\t\t\tif ( callbacks ) {\n\t\t\t\t\tfor ( const callback of callbacks ) {\n\t\t\t\t\t\tcallback( entry );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}", "resizeObservers() {\n\t\t// create an observer instance\n\t\tthis.observer = new ResizeObserver((e) => {\n\t\t\trequestAnimationFrame(this.resizeCheck.bind(this));\n\t\t});\n\n\t\t// pass in the target node\n\t\tthis.observer.observe(this.document.documentElement);\n\t}", "function resizeDetector() {\n if (!instance) {\n instance = (0, _elementResizeDetector2.default)({\n strategy: 'scroll'\n });\n }\n\n return instance;\n}", "_setupResize () {\n this._resizeEvent = this.resize ? this.resize : this.resizeCanvas\n this._events['resize'] = {event: this._resizeEvent, context: window}\n }", "resize() {\n this._create();\n }", "get onResize$() {\n return this.resizeObservable$;\n }", "checkSize() {\n if (this._resizeHandler) {\n this._resizeHandler();\n }\n\n return this;\n }", "constructor() {\n this.viewportWidth = window.innerWidth\n this.viewportHeight = window.innerHeight\n\n this.init()\n this.handleResize()\n }", "setResize(_state) {\n this.events.resize = _state;\n this.setEvents();\n return this;\n }", "function init() {\n vm.onResizeFunction();\n $scope.$apply();\n }", "onResize_() {\n dispatcher.getInstance().dispatchEvent(new GoogEvent(EventType.RESIZE));\n }", "$_initResizeEvent() {\n window.addEventListener('resize', this.$_resizeHandler)\n }", "function instantiateController() {\n return new PaneController(\n mockScope,\n mockAgentService,\n mockWindow,\n mockLocation,\n mockAttrs\n );\n }", "_initResizeListener() {\n window.addEventListener('resize', () => this._onResize())\n }", "function useResizeObserver(target, callback) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var _options$window = options.window,\n window = _options$window === void 0 ? _configurable__WEBPACK_IMPORTED_MODULE_1__.defaultWindow : _options$window,\n observerOptions = __rest(options, [\"window\"]);\n var observer;\n var isSupported = (0,_useSupported__WEBPACK_IMPORTED_MODULE_2__.useSupported)(function () {\n return window && 'ResizeObserver' in window;\n });\n var cleanup = function cleanup() {\n if (observer) {\n observer.disconnect();\n observer = undefined;\n }\n };\n var stopWatch = (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(function () {\n return (0,_unrefElement__WEBPACK_IMPORTED_MODULE_3__.unrefElement)(target);\n }, function (el) {\n cleanup();\n if (isSupported.value && window && el) {\n observer = new ResizeObserver(callback);\n observer.observe(el, observerOptions);\n }\n }, {\n immediate: true,\n flush: 'post'\n });\n var stop = function stop() {\n cleanup();\n stopWatch();\n };\n (0,_tryOnScopeDispose__WEBPACK_IMPORTED_MODULE_4__.tryOnScopeDispose)(stop);\n return {\n isSupported: isSupported,\n stop: stop\n };\n}", "resize(e) {\n ELEM.flush();\n this._listeners.byEvent.resize.forEach(_viewId => {\n const _ctrl = this._views[_viewId];\n if (this.isntNullOrUndefined(_ctrl) && this.isFunction(_ctrl.resize)) {\n _ctrl.resize();\n }\n });\n }", "resize(e) {\n ELEM.flush();\n this._listeners.byEvent.resize.forEach(_viewId => {\n const _ctrl = this._views[_viewId];\n if (this.isntNullOrUndefined(_ctrl) && this.isFunction(_ctrl.resize)) {\n _ctrl.resize();\n }\n });\n }", "WatchResize(element) {\n if(element && !this.resizeObserver) {\n this.resizeObserver = new ResizeObserver((entries) => {\n const container = entries[0];\n\n this.setState({\n width: container.contentRect.width\n });\n });\n\n this.resizeObserver.observe(element);\n }\n }", "$_elementQueryMixin_init() {\n this.$data.$_elementQueryMixin_resizeObserver = new ResizeObserver(\n ([entry]) => {\n const { height, width } = entry.contentRect;\n\n if (this.$data.$_elementQueryMixin_size) {\n this.$data.$_elementQueryMixin_size.height = height;\n this.$data.$_elementQueryMixin_size.width = width;\n }\n }\n ).observe(this.$el);\n }", "resize(windowRect) {}", "function resize() {}", "resize() {\n if (this._isShutDown) return;\n this._canvas.width = window.innerWidth;\n this._canvas.height = window.innerHeight;\n this.redraw();\n }", "static get listeners() {\n return {\n 'resize': '_resizeHandler'\n };\n }", "_resize() {\n const ratio = window.devicePixelRatio || 1;\n const width = window.innerWidth;\n const height = window.innerHeight;\n\n if (this.options.dpi) {\n this.width = width * ratio;\n this.height = height * ratio;\n } else {\n this.width = width;\n this.height = height;\n }\n\n this._canvas.width = this.width;\n this._canvas.height = this.height;\n\n this._canvas.style.width = width + 'px';\n this._canvas.style.height = height + 'px';\n }", "setupResize() {\n window.addEventListener('resize', this.resize.bind(this)); \n }", "get resize() {\n\t\treturn this.nativeElement ? this.nativeElement.resize : undefined;\n\t}", "resize(windowRect) {\n }", "_resizeHandler() {\n const that = this;\n\n if (!that._isVisible()) {\n that._renderingSuspended = true;\n return;\n }\n else if (that._renderingSuspended) {\n that._createElement();\n return;\n }\n\n if (that._renderingSuspended) {\n return;\n }\n\n if (that._orientationChanged !== true) {\n that._setTicksAndInterval();\n that._moveThumbBasedOnValue(that._drawValue);\n }\n\n //Needed for getOptimalSize method\n if (that._trackChanged) {\n that._measurements.trackLength = that.$.track[this._settings.clientSize];\n that._setTicksAndInterval();\n that._moveThumbBasedOnValue(that._drawValue);\n }\n\n that._setTrackSize();\n delete that._orientationChanged;\n delete that._trackChanged;\n }", "_resize() {\n this._onChangeViewport({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }", "onBeforeResize() {\n }", "function makeResponsive() {\n $(window)\n .resize(() => {\n resizer();\n })\n .trigger('resize');\n }", "function on_resize(c, t) {\n onresize = function() {\n clearTimeout(t);\n t = setTimeout(c, 10)\n };\n return c\n}", "_resizeHandler() {\n this.refit();\n }", "mutationObservers() {\n\t\t// create an observer instance\n\t\tthis.observer = new MutationObserver((mutations) => {\n\t\t\tthis.resizeCheck();\n\t\t});\n\n\t\t// configuration of the observer:\n\t\tlet config = { attributes: true, childList: true, characterData: true, subtree: true };\n\n\t\t// pass in the target node, as well as the observer options\n\t\tthis.observer.observe(this.document, config);\n\t}", "function resizeCallback() {\n var i = 0,\n j = observers.length;\n\n setDirection();\n setBreakpoint();\n setOrientation();\n for (i; i < j; i++) {\n observers[i]['func'].apply(null, [responsiveParams]);\n }\n\n running = false;\n }", "function activateResizing() {\n var debouncedOnResize = (function(scope, target, options) {\n\n return function() {\n if (options.isRemoved) return;\n\n var updates = calculateMenuPositions(scope, target, options);\n var container = updates.container;\n var dropDown = updates.dropDown;\n\n container.element.css(animator.toCss(container.styles));\n dropDown.element.css(animator.toCss(dropDown.styles));\n };\n\n })(scope, element, opts);\n\n var window = angular.element($window);\n window.on('resize', debouncedOnResize);\n window.on('orientationchange', debouncedOnResize);\n\n // Publish deactivation closure...\n return function deactivateResizing() {\n\n // Disable resizing handlers\n window.off('resize', debouncedOnResize);\n window.off('orientationchange', debouncedOnResize);\n }\n }", "function activateResizing() {\n var debouncedOnResize = (function(scope, target, options) {\n\n return function() {\n if (options.isRemoved) return;\n\n var updates = calculateMenuPositions(scope, target, options);\n var container = updates.container;\n var dropDown = updates.dropDown;\n\n container.element.css(animator.toCss(container.styles));\n dropDown.element.css(animator.toCss(dropDown.styles));\n };\n\n })(scope, element, opts);\n\n var window = angular.element($window);\n window.on('resize', debouncedOnResize);\n window.on('orientationchange', debouncedOnResize);\n\n // Publish deactivation closure...\n return function deactivateResizing() {\n\n // Disable resizing handlers\n window.off('resize', debouncedOnResize);\n window.off('orientationchange', debouncedOnResize);\n };\n }", "function activateResizing() {\n var debouncedOnResize = (function(scope, target, options) {\n\n return function() {\n if (options.isRemoved) return;\n\n var updates = calculateMenuPositions(scope, target, options);\n var container = updates.container;\n var dropDown = updates.dropDown;\n\n container.element.css(animator.toCss(container.styles));\n dropDown.element.css(animator.toCss(dropDown.styles));\n };\n\n })(scope, element, opts);\n\n var window = angular.element($window);\n window.on('resize', debouncedOnResize);\n window.on('orientationchange', debouncedOnResize);\n\n // Publish deactivation closure...\n return function deactivateResizing() {\n\n // Disable resizing handlers\n window.off('resize', debouncedOnResize);\n window.off('orientationchange', debouncedOnResize);\n };\n }", "function activateResizing() {\n var debouncedOnResize = (function(scope, target, options) {\n\n return function() {\n if (options.isRemoved) return;\n\n var updates = calculateMenuPositions(scope, target, options);\n var container = updates.container;\n var dropDown = updates.dropDown;\n\n container.element.css(animator.toCss(container.styles));\n dropDown.element.css(animator.toCss(dropDown.styles));\n };\n\n })(scope, element, opts);\n\n var window = angular.element($window);\n window.on('resize', debouncedOnResize);\n window.on('orientationchange', debouncedOnResize);\n\n // Publish deactivation closure...\n return function deactivateResizing() {\n\n // Disable resizing handlers\n window.off('resize', debouncedOnResize);\n window.off('orientationchange', debouncedOnResize);\n };\n }", "function BpmnAutoResize(injector) {\n injector.invoke(diagram_js_lib_features_auto_resize_AutoResize__WEBPACK_IMPORTED_MODULE_0__[\"default\"], this);\n}", "addResizeHandler () {\r\n window.addEventListener('resize', () =>\r\n this.view.resize(this.player.getCamera())\r\n )\r\n }", "function onResize(event) {\n\tview.size = event.size; // currently seems to only work with the nightly-buidl\n}", "function resized() {\r\n\tclearInterval(renderer);\r\n\tmain();\r\n}", "function init() {\n window.addEventListener('resize', windowSizeChanged);\n }", "_resizeHandler() {\n const that = this;\n\n that.$.container.style.width = that.$.container.style.height = Math.min(that.offsetWidth, that.offsetHeight) + 'px';\n }", "listen() {\n EventManager.on('resize', this.onResize)\n }", "resizeInitiate() {\n this.resizeEnd();\n // wrap a resize start event handler\n this.resizeStartHandler = (e) => {\n this.resizeStart(e);\n };\n // wrap a resize(resizing) event handler\n this.resizeHandler = (e) => {\n this.resize(e);\n };\n\n // parse the direction parameter given by users\n this.directions = resizable.parseDirection(this.options.directions);\n\n // parse the resize threshold parameter given by users\n this.resizeThreshold = resizable.parseThreshold(this.options.threshold);\n\n // create resizable div elements\n this.createResizableDivElements();\n\n // initialize the size limit\n this.sizeLimit = {\n minWidth: this.options.minWidth !== undefined ? this.options.minWidth : 0,\n maxWidth:\n this.options.maxWidth !== undefined\n ? this.options.maxWidth\n : Number.POSITIVE_INFINITY,\n minHeight: this.options.minHeight !== undefined ? this.options.minHeight : 0,\n maxHeight:\n this.options.maxHeight !== undefined\n ? this.options.maxHeight\n : Number.POSITIVE_INFINITY,\n };\n }", "_setWindowResize() {\n if (this.resizeEvent) return\n this.resizeEvent = true\n window.onresize = () => {\n this.resizeCallbacks.forEach(cb => cb())\n }\n }", "async SetResizeFunction() {\n window.addEventListener('resize', () => {\n this.innerWidth=window.innerWidth, this.innerHeight=window.innerHeight;\n this.onWindowResize(this.camera, this.renderer, this.postprocessing)\n });\n }", "onResize() {\n if ( !this.mRunning )\n return;\n\n if ( this.mViewportMode === SPE_RUNTIME_VIEWMODE_FULLSCREEN ||\n this.mViewportMode === SPE_RUNTIME_VIEWMODE_FULL_WIDTH ) {\n this.mViewportWidth = window.innerWidth;\n }\n if ( this.mViewportMode === SPE_RUNTIME_VIEWMODE_FULLSCREEN ||\n this.mViewportMode === SPE_RUNTIME_VIEWMODE_FULL_HEIGHT ) {\n this.mViewportHeight = window.innerHeight;\n }\n\n if ( this.mMainCamera ) {\n if ( this.mMainCamera.type === 'PerspectiveCamera' ) {\n this.mMainCamera.aspect = this.mViewportWidth / this.mViewportHeight;\n }\n else if ( this.mMainCamera.type === 'OrthographicCamera' ) {\n this.mMainCamera.left = -this.mViewportWidth / 2;\n this.mMainCamera.right = this.mViewportWidth / 2;\n this.mMainCamera.top = this.mViewportHeight / 2;\n this.mMainCamera.bottom = -this.mViewportHeight / 2;\n }\n this.mMainCamera.updateProjectionMatrix();\n }\n if ( this.mRenderer ) {\n this.mRenderer.setSize( this.mViewportWidth, this.mViewportHeight );\n }\n }", "onResize(evt) {\n var event = document.createEvent('Event');\n event.initEvent('resize', true, true);\n this.refs.container.dispatchEvent(event)\n }", "function activateResizing() {\n var debouncedOnResize = (function(scope, target, options) {\n\n return function() {\n if (options.isRemoved) return;\n\n var updates = calculateMenuPositions(scope, target, options);\n var container = updates.container;\n var dropDown = updates.dropDown;\n\n container.element.css(animator.toCss(container.styles));\n dropDown.element.css(animator.toCss(dropDown.styles));\n };\n\n })(scope, element, opts);\n\n var window = angular.element($window);\n window.on('resize', debouncedOnResize);\n window.on('orientationchange', debouncedOnResize);\n\n // Publish deactivation closure...\n return function deactivateResizing() {\n\n // Disable resizing handlers\n window.off('resize', debouncedOnResize);\n window.off('orientationchange', debouncedOnResize);\n };\n }", "resize() {\n this.renderer.setSize( this.container.offsetWidth, this.container.offsetHeight );\n this.composer.setSize( this.container.offsetWidth, this.container.offsetHeight );\n this.camera.aspect = this.container.offsetWidth / this.container.offsetHeight;\n this.camera.updateProjectionMatrix();\n this.requestRender();\n }" ]
[ "0.78830975", "0.78830975", "0.78728455", "0.786317", "0.7860705", "0.7860705", "0.7860705", "0.7860705", "0.7860705", "0.7860705", "0.7860705", "0.7860705", "0.7860705", "0.7860705", "0.7860705", "0.7860705", "0.7860705", "0.78508484", "0.78344685", "0.78318673", "0.7805686", "0.7805686", "0.7805686", "0.7805686", "0.7805686", "0.7805686", "0.7805686", "0.7716292", "0.7716292", "0.77068925", "0.67269075", "0.6006434", "0.55350775", "0.5534486", "0.5451043", "0.5312887", "0.5266537", "0.5252148", "0.5249402", "0.5203262", "0.5093599", "0.5066578", "0.5031584", "0.5031025", "0.5006398", "0.4961638", "0.4961638", "0.49227285", "0.4917493", "0.49111313", "0.48913786", "0.48888445", "0.48663405", "0.48653626", "0.48539862", "0.48377502", "0.48334682", "0.48214975", "0.48191446", "0.48066112", "0.47928315", "0.47897434", "0.4773658", "0.4764081", "0.47635245", "0.47554192", "0.47506213", "0.47506213", "0.47506213", "0.47443518", "0.47436038", "0.47185054", "0.47163704", "0.47104567", "0.47049484", "0.46971998", "0.46950117", "0.4679567", "0.46760142", "0.46698493", "0.4665557", "0.46568716", "0.46450356" ]
0.78771085
18
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Parallel coordinate system creater.
function create(ecModel, api) { var coordSysList = []; ecModel.eachComponent('parallel', function (parallelModel, idx) { var coordSys = new Parallel(parallelModel, ecModel, api); coordSys.name = 'parallel_' + idx; coordSys.resize(parallelModel, api); parallelModel.coordinateSystem = coordSys; coordSys.model = parallelModel; coordSysList.push(coordSys); }); // Inject the coordinateSystems into seriesModel ecModel.eachSeries(function (seriesModel) { if (seriesModel.get('coordinateSystem') === 'parallel') { var parallelModel = ecModel.queryComponents({ mainType: 'parallel', index: seriesModel.get('parallelIndex'), id: seriesModel.get('parallelId') })[0]; seriesModel.coordinateSystem = parallelModel.coordinateSystem; } }); return coordSysList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\n // array of: r_maj,r_min,lat1,lat2,c_lon,c_lat,false_east,false_north\n //double c_lat; /* center latitude */\n //double c_lon; /* center longitude */\n //double lat1; /* first standard parallel */\n //double lat2; /* second standard parallel */\n //double r_maj; /* major axis */\n //double r_min; /* minor axis */\n //double false_east; /* x offset in meters */\n //double false_north; /* y offset in meters */\n\n if (!this.lat2) {\n this.lat2 = this.lat1;\n } //if lat2 is not defined\n if (!this.k0) {\n this.k0 = 1;\n }\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < __WEBPACK_IMPORTED_MODULE_5__constants_values__[\"a\" /* EPSLN */]) {\n return;\n }\n\n var temp = this.b / this.a;\n this.e = Math.sqrt(1 - temp * temp);\n\n var sin1 = Math.sin(this.lat1);\n var cos1 = Math.cos(this.lat1);\n var ms1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e, sin1, cos1);\n var ts1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_tsfnz__[\"a\" /* default */])(this.e, this.lat1, sin1);\n\n var sin2 = Math.sin(this.lat2);\n var cos2 = Math.cos(this.lat2);\n var ms2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e, sin2, cos2);\n var ts2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_tsfnz__[\"a\" /* default */])(this.e, this.lat2, sin2);\n\n var ts0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_tsfnz__[\"a\" /* default */])(this.e, this.lat0, Math.sin(this.lat0));\n\n if (Math.abs(this.lat1 - this.lat2) > __WEBPACK_IMPORTED_MODULE_5__constants_values__[\"a\" /* EPSLN */]) {\n this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);\n }\n else {\n this.ns = sin1;\n }\n if (isNaN(this.ns)) {\n this.ns = sin1;\n }\n this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));\n this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);\n if (!this.title) {\n this.title = \"Lambert Conformal Conic\";\n }\n}", "function createParallelCoordSys(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new parallel_Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = seriesModel.getReferringComponents('parallel', util_model[\"b\" /* SINGLE_REFERRING */]).models[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}", "create(cp0, cp1, cp2, cp3) {\n\n const cp = this.cp;\n\n cp[0] = new PVector();\n cp[0].x = cp0.x;\n cp[0].y = cp0.y;\n\n\n cp[1] = new PVector();\n cp[1].x = cp1.x;\n cp[1].y = cp1.y;\n\n cp[2] = new PVector();\n cp[2].x = cp2.x;\n cp[2].y = cp2.y;\n\n cp[3] = new PVector();\n cp[3].x = cp3.x;\n cp[3].y = cp3.y;\n\n\n }", "function init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < __WEBPACK_IMPORTED_MODULE_9__constants_values__[\"a\" /* EPSLN */]) {\n return;\n }\n this.lat2 = this.lat2 || this.lat1;\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e = Math.sqrt(this.es);\n this.e0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_e0fn__[\"a\" /* default */])(this.es);\n this.e1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_e1fn__[\"a\" /* default */])(this.es);\n this.e2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_e2fn__[\"a\" /* default */])(this.es);\n this.e3 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_e3fn__[\"a\" /* default */])(this.es);\n\n this.sinphi = Math.sin(this.lat1);\n this.cosphi = Math.cos(this.lat1);\n\n this.ms1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_msfnz__[\"a\" /* default */])(this.e, this.sinphi, this.cosphi);\n this.ml1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, this.lat1);\n\n if (Math.abs(this.lat1 - this.lat2) < __WEBPACK_IMPORTED_MODULE_9__constants_values__[\"a\" /* EPSLN */]) {\n this.ns = this.sinphi;\n }\n else {\n this.sinphi = Math.sin(this.lat2);\n this.cosphi = Math.cos(this.lat2);\n this.ms2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_msfnz__[\"a\" /* default */])(this.e, this.sinphi, this.cosphi);\n this.ml2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, this.lat2);\n this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);\n }\n this.g = this.ml1 + this.ms1 / this.ns;\n this.ml0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, this.lat0);\n this.rh = this.a * (this.g - this.ml0);\n}", "computeCoords() {\n this.distanceFromEarthCenter = bv3.length(this.position)\n this.distanceFromEarthSurface = this.distanceFromEarthCenter - 6378\n\n this.lat = radians2degrees(Math.asin(-this.position[1] / this.distanceFromEarthCenter))\n\n\n const posAtEquator = [this.position[0], 0, this.position[2]]\n\n\n const distanceFromEarthCenterAtEquator = bv3.length(posAtEquator)\n const l90 = radians2degrees(Math.asin(-this.position[0] / distanceFromEarthCenterAtEquator))\n\n\n if (this.position[0] > 0 != this.position[2] > 0) {\n if (this.position[0] > 0) {\n //CCconsole.log(\"c1\")\n this.lon = l90;\n } else {\n //CCconsole.log(\"c2\")\n this.lon = 180 - l90;\n }\n } else {\n if (this.position[0] > 0) {\n //CCconsole.log(\"c3\")\n this.lon = -180 - l90;\n } else {\n //CCconsole.log(\"c4\")\n this.lon = l90;\n }\n }\n\n \n }", "function init() {\n if (this.es === undefined || this.es <= 0) {\n throw new Error('incorrect elliptical usage');\n }\n\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n this.cgb = [];\n this.cbg = [];\n this.utg = [];\n this.gtu = [];\n\n var f = this.es / (1 + Math.sqrt(1 - this.es));\n var n = f / (2 - f);\n var np = n;\n\n this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 ))))));\n this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));\n\n np = np * n;\n this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));\n this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));\n\n np = np * n;\n this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));\n this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));\n\n np = np * n;\n this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));\n this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175)));\n\n np = np * n;\n this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));\n this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));\n\n np = np * n;\n this.cgb[5] = np * (601676 / 22275);\n this.cbg[5] = np * (444337 / 155925);\n\n np = Math.pow(n, 2);\n this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));\n\n this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));\n this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));\n\n this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));\n this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));\n\n np = np * n;\n this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 ))));\n this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));\n\n np = np * n;\n this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));\n this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));\n\n np = np * n;\n this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));\n this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));\n\n np = np * n;\n this.utg[5] = np * (-20648693 / 638668800);\n this.gtu[5] = np * (212378941 / 319334400);\n\n var Z = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_gatg__[\"a\" /* default */])(this.cbg, this.lat0);\n this.Zb = -this.Qn * (Z + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_clens__[\"a\" /* default */])(this.gtu, 2 * Z));\n}", "function init() {\n if (this.es === undefined || this.es <= 0) {\n throw new Error('incorrect elliptical usage');\n }\n\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n this.cgb = [];\n this.cbg = [];\n this.utg = [];\n this.gtu = [];\n\n var f = this.es / (1 + Math.sqrt(1 - this.es));\n var n = f / (2 - f);\n var np = n;\n\n this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 ))))));\n this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));\n\n np = np * n;\n this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));\n this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));\n\n np = np * n;\n this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));\n this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));\n\n np = np * n;\n this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));\n this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175)));\n\n np = np * n;\n this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));\n this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));\n\n np = np * n;\n this.cgb[5] = np * (601676 / 22275);\n this.cbg[5] = np * (444337 / 155925);\n\n np = Math.pow(n, 2);\n this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));\n\n this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));\n this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));\n\n this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));\n this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));\n\n np = np * n;\n this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 ))));\n this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));\n\n np = np * n;\n this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));\n this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));\n\n np = np * n;\n this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));\n this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));\n\n np = np * n;\n this.utg[5] = np * (-20648693 / 638668800);\n this.gtu[5] = np * (212378941 / 319334400);\n\n var Z = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.cbg, this.lat0);\n this.Zb = -this.Qn * (Z + Object(_common_clens__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.gtu, 2 * Z));\n}", "function calculate_coordinates () {\n\t }", "function createParallelogram(points){\n var parlgrm = new createjs.Shape();\n parlgrm.graphics.beginStroke(\"blue\");\n parlgrm.graphics.moveTo(points[0], points[1]).lineTo(points[4], points[5]).lineTo(points[2], points[3]).lineTo(points[6], points[7]).lineTo(points[0], points[1]);\n parlgrm.name=\"parallelogram\";\n var centroidx = (points[0]+points[2]+points[4]+points[6])/4;\n centroid.push(centroidx);\n var centroidy = (points[1]+points[3]+points[5]+points[7])/4; //Center of mass =(centroidx,centroidy)\n centroid.push(centroidy);\n stage.addChild(parlgrm);\n}", "function init$3() {\n if (this.es === undefined || this.es <= 0) {\n throw new Error('incorrect elliptical usage');\n }\n\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n this.cgb = [];\n this.cbg = [];\n this.utg = [];\n this.gtu = [];\n\n var f = this.es / (1 + Math.sqrt(1 - this.es));\n var n = f / (2 - f);\n var np = n;\n\n this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 ))))));\n this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));\n\n np = np * n;\n this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));\n this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));\n\n np = np * n;\n this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));\n this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));\n\n np = np * n;\n this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));\n this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175)));\n\n np = np * n;\n this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));\n this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));\n\n np = np * n;\n this.cgb[5] = np * (601676 / 22275);\n this.cbg[5] = np * (444337 / 155925);\n\n np = Math.pow(n, 2);\n this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));\n\n this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));\n this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));\n\n this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));\n this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));\n\n np = np * n;\n this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 ))));\n this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));\n\n np = np * n;\n this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));\n this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));\n\n np = np * n;\n this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));\n this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));\n\n np = np * n;\n this.utg[5] = np * (-20648693 / 638668800);\n this.gtu[5] = np * (212378941 / 319334400);\n\n var Z = gatg(this.cbg, this.lat0);\n this.Zb = -this.Qn * (Z + clens(this.gtu, 2 * Z));\n}", "function getParticleSystem(){\n //geomerty to render points for particles\n var particleGeo = new t.Geometry();\n var particleMaterial = new t.PointsMaterial({\n color: 0xffffff, \n size: 1,\n map: new t.TextureLoader().load('./assets/particle.jpg'),\n transparent: true,\n blending: t.AdditiveBlending,\n depthWrite: false\n \n });\n \n for(let i =0; i< 2500; i++){\n let point = new t.Vector3(\n (Math.random() -.5) * 100, \n (Math.random() -.5) * 100, \n (Math.random() -.5) * 100\n );\n particleGeo.vertices.push(point);\n }\n \n return new t.Points(particleGeo, particleMaterial);\n}", "function YGps_get_coordSystem()\n {\n var res; // enumGPSCOORDINATESYSTEM;\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_COORDSYSTEM_INVALID;\n }\n }\n res = this._coordSystem;\n return res;\n }", "function setCoordinates() {\n var grid_size = optimizeToGrid(nodes.length);\n //Create 2D array\n var coord_array = [];\n for (i = 0; i < nodes.length; i++) {\n coord_array[i] = [];\n var x_coord = (i % grid_size[0]);\n var y_coord = (Math.floor(i / grid_size[0])); \n coord_array[i][0] = x_coord;\n coord_array[i][1] = y_coord;\n }\n return coord_array;\n}", "initializeCoords() {\n // deltas between nodes\n let row_delta = 2 * this.m;\n let column_delta = 2;\n\n // top-left node has coordinates x=-0.45*(m-1)*distance_between_nodes,\n // y=0. Positions of the other nodes are based on this node\n for (let i = 0; i < this.n; ++i) { \n for (let j = 0; j < this.m; ++j) { \n this.coord[i * row_delta + j * column_delta] = (-0.45 * (this.m - 1) + j) * this.distance_between_nodes;\n this.coord[i * row_delta + j * column_delta + 1] = 1 - i * this.distance_between_nodes;\n this.old_coord[i * row_delta + j * column_delta] = this.coord[i * row_delta + j * column_delta];\n this.old_coord[i * row_delta + j * column_delta + 1] = this.coord[i * row_delta + j * column_delta + 1];\n }\n }\n }", "function YGps_get_coordSystem_async(callback,context)\n {\n var res; // enumGPSCOORDINATESYSTEM;\n var loadcb; // func;\n loadcb = function(ctx,obj,res) {\n if (res != YAPI_SUCCESS) {\n callback(context, obj, Y_COORDSYSTEM_INVALID);\n } else {\n callback(context, obj, obj._coordSystem);\n }\n };\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n this.load_async(YAPI.defaultCacheValidity,loadcb,null);\n } else {\n loadcb(null, this, YAPI_SUCCESS);\n }\n }", "update_positions() {\n let positions = this.vertex_positions;\n for (var i = 0; i < this.vertices.length; i++) {\n positions[i * 3] = this.vertices[i].x;\n positions[i * 3 + 1] = this.vertices[i].y;\n positions[i * 3 + 2] = this.vertices[i].z;\n }\n this.geometry.attributes.position.needsUpdate = true;\n }", "projectPosition(xyz) {\n const [X, Y] = this.projectFlat(xyz);\n const Z = (xyz[2] || 0) * this.unitsPerMeter;\n return [X, Y, Z];\n }", "function coordinateSystem(unit) {\n return {\n dx: new Point(unit / 3, -unit / 3),\n dy: new Point(unit, 0),\n dz: new Point(0, unit)\n };\n}", "calculateVertices() {\n if (this._transformID === this.transform._worldID) {\n return;\n }\n this._transformID = this.transform._worldID;\n var wt = this.transform.worldTransform;\n // reveal(wt)\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var data = this.geometry.points; // batch.vertexDataOriginal;\n var vertexData = this.vertexData;\n var count = 0;\n for (var i = 0; i < data.length; i += 2) {\n var x = data[i];\n var y = data[i + 1];\n vertexData[count++] = (a * x) + (c * y) + tx;\n vertexData[count++] = (d * y) + (b * x) + ty;\n }\n }", "function isParallel(v1, v2) {\n return v1.x * v2.y === v1.y * v2.x;\n}", "function generatePositions() {\n rows = [];\n columns = [];\n if (gridOption.enableRow) {\n //use coordinate.y to generate rows\n if (coordinate.y && coordinate.y.model.rotate == 90) {\n coordinate.y.forEach(function(i,length){\n rows.push(coordinate.y.model.beginY-length)\n });\n gridOption._x = coordinate.x.model.beginX;\n } else if (coordinate.x && coordinate.x.model.rotate == 90) {\n coordinate.x.forEach(function (i, length) {\n rows.push(coordinate.x.model.beginY - length)\n });\n\n gridOption._x = coordinate.y.model.beginX;\n }\n gridOption.width = coordinate.size().width || 0;\n gridOption.rows = rows;\n }\n if (gridOption.enableColumn) {\n if (coordinate.y && coordinate.y.model.rotate == 0) {\n coordinate.y.forEach(function(i,length){\n columns.push(coordinate.y.model.beginX+length)\n });\n gridOption._y = coordinate.x.model.beginY;\n } else if (coordinate.x && coordinate.x.model.rotate == 0) {\n coordinate.x.forEach(function (i, length) {\n columns.push(coordinate.x.model.beginX + length)\n });\n gridOption._y = coordinate.y.model.beginY;\n }\n gridOption.height = coordinate.size().height || 0;\n gridOption.columns = columns;\n }\n\n }", "function forward(p) {\n var xy = {x: 0, y: 0};\n var lat, lon;\n var theta, phi;\n var t, mu;\n /* nu; */\n var area = {value: 0};\n\n // move lon according to projection's lon\n p.x -= this.long0;\n\n /* Convert the geodetic latitude to a geocentric latitude.\n * This corresponds to the shift from the ellipsoid to the sphere\n * described in [LK12]. */\n if (this.es !== 0) {//if (P->es != 0) {\n lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));\n } else {\n lat = p.y;\n }\n\n /* Convert the input lat, lon into theta, phi as used by QSC.\n * This depends on the cube face and the area on it.\n * For the top and bottom face, we can compute theta and phi\n * directly from phi, lam. For the other faces, we must use\n * unit sphere cartesian coordinates as an intermediate step. */\n lon = p.x; //lon = lp.lam;\n if (this.face === FACE_ENUM.TOP) {\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - lat;\n if (lon >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (lon > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] || lon <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_1;\n theta = (lon > 0.0 ? lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (lon > -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) && lon <= -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_2;\n theta = lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = lon;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + lat;\n if (lon >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = -lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (lon < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon >= -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_1;\n theta = -lon;\n } else if (lon < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon >= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_2;\n theta = -lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = (lon > 0.0 ? -lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : -lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n }\n } else {\n var q, r, s;\n var sinlat, coslat;\n var sinlon, coslon;\n\n if (this.face === FACE_ENUM.RIGHT) {\n lon = qsc_shift_lon_origin(lon, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n } else if (this.face === FACE_ENUM.BACK) {\n lon = qsc_shift_lon_origin(lon, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (this.face === FACE_ENUM.LEFT) {\n lon = qsc_shift_lon_origin(lon, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n sinlat = Math.sin(lat);\n coslat = Math.cos(lat);\n sinlon = Math.sin(lon);\n coslon = Math.cos(lon);\n q = coslat * coslon;\n r = coslat * sinlon;\n s = sinlat;\n\n if (this.face === FACE_ENUM.FRONT) {\n phi = Math.acos(q);\n theta = qsc_fwd_equat_face_theta(phi, s, r, area);\n } else if (this.face === FACE_ENUM.RIGHT) {\n phi = Math.acos(r);\n theta = qsc_fwd_equat_face_theta(phi, s, -q, area);\n } else if (this.face === FACE_ENUM.BACK) {\n phi = Math.acos(-q);\n theta = qsc_fwd_equat_face_theta(phi, s, -r, area);\n } else if (this.face === FACE_ENUM.LEFT) {\n phi = Math.acos(-r);\n theta = qsc_fwd_equat_face_theta(phi, s, q, area);\n } else {\n /* Impossible */\n phi = theta = 0;\n area.value = AREA_ENUM.AREA_0;\n }\n }\n\n /* Compute mu and nu for the area of definition.\n * For mu, see Eq. (3-21) in [OL76], but note the typos:\n * compare with Eq. (3-14). For nu, see Eq. (3-38). */\n mu = Math.atan((12 / _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) * (theta + Math.acos(Math.sin(theta) * Math.cos(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]));\n t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));\n\n /* Apply the result to the real area. */\n if (area.value === AREA_ENUM.AREA_1) {\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_2) {\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"];\n } else if (area.value === AREA_ENUM.AREA_3) {\n mu += 1.5 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"];\n }\n\n /* Now compute x, y from mu and nu */\n xy.x = t * Math.cos(mu);\n xy.y = t * Math.sin(mu);\n xy.x = xy.x * this.a + this.x0;\n xy.y = xy.y * this.a + this.y0;\n\n p.x = xy.x;\n p.y = xy.y;\n return p;\n}", "function max3dsWorkerCreatorFunction()\n{\nself.onmessage = function(event) {\n if( !self.loader_ ) {\n //console.log('Worker.onmessage.this=' + this);\n self.loader_ = new self.Max3dsLoader(/**@type{Worker}*/(this));\n }\n if(self.loader_) {\n self.loader_.onmessage(event.data);\n }\n};\n\nself.vec = {};\n\nself.vec.quaternion = {};\n\nself.vec.quaternion.setFromAxixAngle = function(quat, x,y,z,w) {\n var L = x*x+y*y+z*z;\n L = L == 0.0 ? 1 : Math.sin(w*0.5)/Math.sqrt(L);\n quat[0] = x*L; quat[1] = y*L; quat[2] = z*L; quat[3] = Math.cos(w*0.5);\n}\n\nself.vec.Mat4 = {};\n\nself.vec.Mat4.create = function(){\n return [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1];\n};\n// Translates the given matrix by x,y,z. Equvialent to:\n// ol.vec.Mat4.multMat(\n// mat,\n// ol.vec.Mat4.makeTranslate(ol.vec.Mat4.create(), x, y, z),\n// mat);\nself.vec.Mat4.translate = function(mat,x,y,z){\n mat[12] = mat[0] * x + mat[4] * y + mat[ 8] * z + mat[12];\n mat[13] = mat[1] * x + mat[5] * y + mat[ 9] * z + mat[13];\n mat[14] = mat[2] * x + mat[6] * y + mat[10] * z + mat[14];\n mat[15] = mat[3] * x + mat[7] * y + mat[11] * z + mat[15];\n return mat;\n};\n\nself.vec.Mat4.flipX = function(mat){\n mat[0] *= -1; mat[4] *= -1; mat[8] *= -1; mat[12] *= -1;\n return mat;\n};\n\nself.vec.Mat4.invert = function(mat, resultMat){\n var m00 = mat[ 0], m10 = mat[ 1], m20 = mat[ 2], m30 = mat[ 3];\n var m01 = mat[ 4], m11 = mat[ 5], m21 = mat[ 6], m31 = mat[ 7];\n var m02 = mat[ 8], m12 = mat[ 9], m22 = mat[10], m32 = mat[11];\n var m03 = mat[12], m13 = mat[13], m23 = mat[14], m33 = mat[15];\n\n var a0 = m00 * m11 - m10 * m01;\n var a1 = m00 * m21 - m20 * m01;\n var a2 = m00 * m31 - m30 * m01;\n var a3 = m10 * m21 - m20 * m11;\n var a4 = m10 * m31 - m30 * m11;\n var a5 = m20 * m31 - m30 * m21;\n var b0 = m02 * m13 - m12 * m03;\n var b1 = m02 * m23 - m22 * m03;\n var b2 = m02 * m33 - m32 * m03;\n var b3 = m12 * m23 - m22 * m13;\n var b4 = m12 * m33 - m32 * m13;\n var b5 = m22 * m33 - m32 * m23;\n\n var det = a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0;\n if (det == 0) {\n return false;\n }\n\n var idet = 1.0 / det;\n resultMat[ 0] = ( m11 * b5 - m21 * b4 + m31 * b3) * idet;\n resultMat[ 1] = (-m10 * b5 + m20 * b4 - m30 * b3) * idet;\n resultMat[ 2] = ( m13 * a5 - m23 * a4 + m33 * a3) * idet;\n resultMat[ 3] = (-m12 * a5 + m22 * a4 - m32 * a3) * idet;\n resultMat[ 4] = (-m01 * b5 + m21 * b2 - m31 * b1) * idet;\n resultMat[ 5] = ( m00 * b5 - m20 * b2 + m30 * b1) * idet;\n resultMat[ 6] = (-m03 * a5 + m23 * a2 - m33 * a1) * idet;\n resultMat[ 7] = ( m02 * a5 - m22 * a2 + m32 * a1) * idet;\n resultMat[ 8] = ( m01 * b4 - m11 * b2 + m31 * b0) * idet;\n resultMat[ 9] = (-m00 * b4 + m10 * b2 - m30 * b0) * idet;\n resultMat[10] = ( m03 * a4 - m13 * a2 + m33 * a0) * idet;\n resultMat[11] = (-m02 * a4 + m12 * a2 - m32 * a0) * idet;\n resultMat[12] = (-m01 * b3 + m11 * b1 - m21 * b0) * idet;\n resultMat[13] = ( m00 * b3 - m10 * b1 + m20 * b0) * idet;\n resultMat[14] = (-m03 * a3 + m13 * a1 - m23 * a0) * idet;\n resultMat[15] = ( m02 * a3 - m12 * a1 + m22 * a0) * idet;\n //\n resultMat.det = det;\n return true;\n};\n\nself.vec.Mat4.multVec3 = function(mat, v) {\n var x=v[0], y=v[1], z=v[2];\n v[0] = mat[0]*x + mat[4]*y + mat[ 8]*z + mat[12];\n v[1] = mat[1]*x + mat[5]*y + mat[ 9]*z + mat[13];\n v[2] = mat[2]*x + mat[6]*y + mat[10]*z + mat[14];\n return v;\n};\n// mat0:left, mat1:right\nself.vec.Mat4.multMat = function(mat0, mat1, resultMat) {\n var a00 = mat0[ 0], a10 = mat0[ 1], a20 = mat0[ 2], a30 = mat0[ 3];\n var a01 = mat0[ 4], a11 = mat0[ 5], a21 = mat0[ 6], a31 = mat0[ 7];\n var a02 = mat0[ 8], a12 = mat0[ 9], a22 = mat0[10], a32 = mat0[11];\n var a03 = mat0[12], a13 = mat0[13], a23 = mat0[14], a33 = mat0[15];\n\n var b00 = mat1[ 0], b10 = mat1[ 1], b20 = mat1[ 2], b30 = mat1[ 3];\n var b01 = mat1[ 4], b11 = mat1[ 5], b21 = mat1[ 6], b31 = mat1[ 7];\n var b02 = mat1[ 8], b12 = mat1[ 9], b22 = mat1[10], b32 = mat1[11];\n var b03 = mat1[12], b13 = mat1[13], b23 = mat1[14], b33 = mat1[15];\n\n resultMat[ 0] = a00 * b00 + a01 * b10 + a02 * b20 + a03 * b30;\n resultMat[ 1] = a10 * b00 + a11 * b10 + a12 * b20 + a13 * b30;\n resultMat[ 2] = a20 * b00 + a21 * b10 + a22 * b20 + a23 * b30;\n resultMat[ 3] = a30 * b00 + a31 * b10 + a32 * b20 + a33 * b30;\n\n resultMat[ 4] = a00 * b01 + a01 * b11 + a02 * b21 + a03 * b31;\n resultMat[ 5] = a10 * b01 + a11 * b11 + a12 * b21 + a13 * b31;\n resultMat[ 6] = a20 * b01 + a21 * b11 + a22 * b21 + a23 * b31;\n resultMat[ 7] = a30 * b01 + a31 * b11 + a32 * b21 + a33 * b31;\n\n resultMat[ 8] = a00 * b02 + a01 * b12 + a02 * b22 + a03 * b32;\n resultMat[ 9] = a10 * b02 + a11 * b12 + a12 * b22 + a13 * b32;\n resultMat[10] = a20 * b02 + a21 * b12 + a22 * b22 + a23 * b32;\n resultMat[11] = a30 * b02 + a31 * b12 + a32 * b22 + a33 * b32;\n\n resultMat[12] = a00 * b03 + a01 * b13 + a02 * b23 + a03 * b33;\n resultMat[13] = a10 * b03 + a11 * b13 + a12 * b23 + a13 * b33;\n resultMat[14] = a20 * b03 + a21 * b13 + a22 * b23 + a23 * b33;\n resultMat[15] = a30 * b03 + a31 * b13 + a32 * b23 + a33 * b33;\n return resultMat;\n};\n\nself.vec.Mat4.fromRotationTranslationScale = function(result, q, v, s){\n // https://github.com/toji/gl-matrix/blob/master/src/gl-matrix/mat4.js\n var x = q[0], y = q[1], z = q[2], w = q[3]\n ,x2 = x + x, y2 = y + y, z2 = z + z\n ,xx = x * x2,xy = x * y2,xz = x * z2\n ,yy = y * y2,yz = y * z2,zz = z * z2\n ,wx = w * x2,wy = w * y2,wz = w * z2;\n result[ 0] = (1 - (yy + zz)) * s[0];\n result[ 1] = (xy + wz) * s[0];\n result[ 2] = (xz - wy) * s[0];\n result[ 3] = 0;\n result[ 4] = (xy - wz) * s[1];\n result[ 5] = (1 - (xx + zz)) * s[1];\n result[ 6] = (yz + wx) * s[1];\n result[ 7] = 0;\n result[ 8] = (xz + wy) * s[2];\n result[ 9] = (yz - wx) * s[2];\n result[10] = (1 - (xx + yy)) * s[2];\n result[11] = 0;\n result[12] = v[0];\n result[13] = v[1];\n result[14] = v[2];\n result[15] = 1;\n return result;\n};\n\n/**\n * Binary Stream Helper class\n * @constructor\n * @param {Uint8Array} buffer UInt8Array buffer.\n * @param {number} bufferOffset Start index of buffer.\n */\nself.BinaryStream = function(buffer, bufferOffset) {\n this.buffer_ = buffer;\n this.bufferOffset_ = bufferOffset;\n this.Position = bufferOffset+0;\n this.bufferLength_ = buffer.length;\n this.data = null;\n this.fa = new Float32Array(1);\n this.fb = new Uint8Array(this.fa.buffer);\n};\n\nself.BinaryStream.prototype.seek = function(chunkSize, seekOrigin) {\n // SeekOrigin.Current\n if( seekOrigin === 0 ) {\n this.Position += chunkSize;\n }\n // SeekOrigin.Begin\n else if( seekOrigin === -1 ) {\n this.Position = this.bufferOffset_ + chunkSize;\n }\n // SeekOrigin.End\n else if( seekOrigin === 1 ) {\n this.Position = this.bufferLength_ - chunkSize;\n }\n};\n\nself.BinaryStream.prototype.readByte = function() {\n // throw new Error('BinaryStream (byteOffset + size) value is out of bounds');\n this.data = this.buffer_[this.Position];\n this.Position++;\n return this.data;\n};\n\nself.BinaryStream.prototype.readUInt16 = function() {\n this.data = this.buffer_[this.Position] | (this.buffer_[this.Position+1]<<8);\n this.Position+=2;\n return this.data;\n};\n\nself.BinaryStream.prototype.readUInt32 = function() {\n this.data = this.buffer_[this.Position] \n | (this.buffer_[this.Position+1]<<8) \n | (this.buffer_[this.Position+2]<<16) \n | (this.buffer_[this.Position+3]<<24);\n this.Position+=4;\n return this.data;\n};\n\nself.BinaryStream.prototype.readFloat = function() {\n this.fb[0] = this.buffer_[this.Position ]; \n this.fb[1] = this.buffer_[this.Position+1]; \n this.fb[2] = this.buffer_[this.Position+2]; \n this.fb[3] = this.buffer_[this.Position+3];\n this.data = this.fa[0];\n this.Position+=4;\n return this.data;\n};\n\nself.BinaryStream.prototype.readString = function() {\n this.data = {name:'',key:''};\n var code;\n while(this.buffer_[this.Position] !== 0) {\n code = this.buffer_[this.Position++];\n this.data.name += String.fromCharCode(code);\n this.data.key += ('00' + Number(code).toString(16).toUpperCase()).substr(-2);\n }\n // eat zero char\n this.Position++;\n return this.data;\n};\n\nself.BinaryStream.prototype.getFloat32Array = function(count) {\n this.data = new Float32Array(count);\n (new Uint8Array(this.data.buffer)).set(new Uint8Array(this.buffer_.buffer, this.Position, count*4));\n this.Position += count*4;\n return this.data;\n};\n\nself.BinaryStream.prototype.getUint16Array = function(count) {\n this.data = new Uint16Array(count);\n (new Uint8Array(this.data.buffer)).set(new Uint8Array(this.buffer_.buffer, this.Position, count*2));\n this.Position += count*2;\n return this.data;\n};\n\n/**\n * Max3dsLoader class\n * @constructor\n * @param {Worker} worker Worker.\n */\nself.Max3dsLoader = function(worker) {\n /**\n * @private\n * @type {Worker}\n */\n this.worker_ = worker;\n //\n this.tmpFloat32Array = new Float32Array(65536);\n this.tmpUint16Array = new Uint16Array (65536*3);\n};\n\n/**\n * Override Worker.onmessage\n * @param {Object} eventData Event.Data.\n */\nself.Max3dsLoader.prototype.onmessage = function(eventData) {\n // Note! sorted by calling frequency\n var command = eventData['command'];\n //console.log('poiWorker.onmessage.command='+command);\n \n //\n // Load Asset File\n //\n if( command === 'load' ) {\n this.load(eventData);\n return;\n }\n};\n\nself.Max3dsLoader.prototype.readModelChunk = function(aNextPointer) {\n //\n // 1. Read Editor3d, KeyFrames Chunks\n //\n // MAIN3DS (0x4D4D)\n // |\n // +--VERSION (0x0002)\n // +--EDIT3DS (0x3D3D)\n // +--KEYF3DS (0xB000)\n //\n var currModel = {meshes:{}, materials:{}, nodes:[]};\n this.asset.models.push(currModel);\n //debugger;\n var chunkId, chunkSize, chunkNext;\n while( this.bstream.Position < aNextPointer ) {\n chunkId = this.bstream.readUInt16();\n chunkSize = this.bstream.readUInt32()-6;\n chunkNext = chunkSize + this.bstream.Position;\n // EDIT3DS\n if( chunkId === 0x3D3D ) {\n this.readEditor3dsChunk(currModel, chunkNext);\n }\n // KEYF3DS\n else if( chunkId == 0xB000 )\n {\n this.readKeyframeChunk(currModel, chunkNext);\n }\n else {\n this.bstream.seek(chunkSize, 0);\n }\n }\n};\n\nself.Max3dsLoader.prototype.readKeyframeChunk = function(aCurrModel, aNextPointer) {\n //\n // 1. Read Keyframe Chunk\n //\n // +--KEYF3DS (0xB000)\n // |\n // +--KEYF_UNKNWN01 (0xB00A)\n // +--............. (0x7001) ( viewport, same as editor )\n // +--KEYF_FRAMES (0xB008) LIB3DS_KFSEQ\n // +--KEYF_CURTIME (0xB009) LIB3DS_CURTIME\n // +--KEYF_OBJNODES (0xB002) LIB3DS_OBJECT_NODE_TAG\n // |\n // +--KEYF_OBJHIERARCH (0xB010) LIB3DS_NODE_HDR\n // +--KEYF_OBJDUMMYNAME (0xB011) LIB3DS_INSTANCE_NAME\n // +--KEYF_OBJUNKNWN01 (0xB013) LIB3DS_PIVOT\n // +--KEYF_OBJUNKNWN02 (0xB014) LIB3DS_BOUNDBOX\n // +--KEYF_OBJUNKNWN03 (0xB015) LIB3DS_MORPH_SMOOTH\n // +--KEYF_OBJPIVOT (0xB020) LIB3DS_POS_TRACK_TAG\n // +--KEYF_OBJUNKNWN04 (0xB021) LIB3DS_ROT_TRACK_TAG\n // +--KEYF_OBJUNKNWN05 (0xB022) LIB3DS_SCL_TRACK_TAG\n //\n var chunkId, chunkSize, chunkNext;\n while( this.bstream.Position < aNextPointer ) {\n chunkId = this.bstream.readUInt16();\n chunkSize = this.bstream.readUInt32()-6;\n chunkNext = chunkSize + this.bstream.Position;\n // KEYF_OBJNODES LIB3DS_OBJECT_NODE_TAG\n if( chunkId == 0xB002 )\n {\n this.readNodeChunk(aCurrModel, chunkNext, chunkId);\n }\n // Skip\n // LIB3DS_AMBIENT_NODE_TAG (0xB001)\n // LIB3DS_CAMERA_NODE_TAG (0xB003)\n // LIB3DS_TARGET_NODE_TAG (0xB004)\n // LIB3DS_LIGHT_NODE_TAG (0xB005)\n // LIB3DS_L_TARGET_NODE_TAG (0xB006)\n // LIB3DS_SPOTLIGHT_NODE_TAG (0xB007)\n else {\n this.bstream.seek(chunkSize, 0);\n }\n }\n};\n\nself.Max3dsLoader.prototype.readNodeChunk = function(aCurrModel, aNextPointer, aNodeType) {\n //\n // 2. Keyframe Node\n // http://merlin.fit.vutbr.cz/upload/IvProjects/2006/3ds2iv/3ds2iv.pdf\n //\n // | +--KEYF_OBJNODES (0xB002)\n // | | |\n // | | +--CHK_NODE_ID (0xB030)\n // | | +--CHK_NODE_HDR (0xB010)\n // | | +--CHK_PIVOT (0xB013)\n // | | +--CHK_INSTANCE_NAME (0xB011)\n // | | +--CHK_MORPH_SMOOTH (0xB020)\n // | | +--CHK_POS_TRACK_TAG (0xB015)\n // | | +--CHK_COL_TRACK_TAG (0xB025)\n // | | +--CHK_ROT_TRACK_TAG (0xB021)\n // | | +--CHK_SCL_TRACK_TAG (0xB022)\n // | | +--CHK_MORPH_TRACK_TAG (0xB026)\n // | | +--CHK_FOV_TRACK_TAG (0xB023)\n // | | +--CHK_ROLL_TRACK_TAG (0xB024)\n // | | +--CHK_HOT_TRACK_TAG (0xB027)\n // | | +--CHK_FALL_TRACK_TAG (0xB028)\n // | | +--CHK_HIDE_TRACK_TAG (0xB029)\n // | |\n //\n // FIXME! Upvector(Yaxis vs Zaxis) transRot:[0,0,1,1] vs [0,0,1,1]\n var currNode = {nodeId:-1, parent:null, transPos:[0,0,0], transRot:[0,0,1,1], transScl:[1,1,1]};\n aCurrModel.nodes.push(currNode);\n \n //\n var chunkId, chunkSize; // chunkNext\n \n var q=[0,0,0,0], trackKeys,tcbFlags, k, p; // kk\n while( this.bstream.Position < aNextPointer ) {\n chunkId = this.bstream.readUInt16();\n chunkSize = this.bstream.readUInt32()-6;\n \n //chunkNext = chunkSize + this.bstream.Position;\n \n // CHK_NODE_ID\n if( chunkId == 0xB030 )\n {\n currNode.nodeId = this.bstream.readUInt16();\n }\n // CHK_NODE_HDR\n else if( chunkId == 0xB010 )\n {\n currNode.keyName = this.bstream.readString();\n currNode.flags = this.bstream.readUInt32();\n currNode.parentId= this.bstream.readUInt16();\n }\n // CHK_INSTANCE_NAME\n else if( chunkId == 0xB011 && aNodeType == 0xB002 )\n {\n currNode.instanceName = this.bstream.readString();\n }\n // CHK_PIVOT\n else if( chunkId == 0xB013 )\n {\n currNode.pivot = [0,0,0];\n currNode.pivot[0] = this.bstream.readFloat();\n currNode.pivot[1] = this.bstream.readFloat();\n currNode.pivot[2] = this.bstream.readFloat();\n }\n // CHK_POS_TRACK_TAG\n else if( chunkId == 0xB020 && aNodeType != 0xB001 && aNodeType != 0xB006 ) {\n this.bstream.readUInt16(); // track.flags\n this.bstream.readUInt32(); // track.dummy1\n this.bstream.readUInt32(); // track.dummy1\n trackKeys = this.bstream.readUInt32();\n for(k=0; k<trackKeys; k++)\n {\n this.bstream.readUInt32(); // track.tcb.frame\n tcbFlags = this.bstream.readUInt16();\n if( (tcbFlags & 0x0001) != 0 ) this.bstream.readFloat(); // track.tcb.Tension\n if( (tcbFlags & 0x0002) != 0 ) this.bstream.readFloat(); // track.tcb.Continuty\n if( (tcbFlags & 0x0004) != 0 ) this.bstream.readFloat(); // track.tcb.Bias\n if( (tcbFlags & 0x0008) != 0 ) this.bstream.readFloat(); // track.tcb.EaseTo\n if( (tcbFlags & 0x0010) != 0 ) this.bstream.readFloat(); // track.tcb.EaseFrom\n currNode.transPos[0] = this.bstream.readFloat();\n currNode.transPos[1] = this.bstream.readFloat();\n currNode.transPos[2] = this.bstream.readFloat();\n }\n }\n // CHK_ROT_TRACK_TAG\n else if( chunkId == 0xB021 && aNodeType == 0xB002 ) {\n this.bstream.readUInt16(); // track.flags\n this.bstream.readUInt32(); // track.dummy1\n this.bstream.readUInt32(); // track.dummy1\n trackKeys = this.bstream.readUInt32();\n for(k=0; k<trackKeys; k++)\n {\n this.bstream.readUInt32(); // track.tcb.frame\n tcbFlags = this.bstream.readUInt16();\n if( (tcbFlags & 0x0001) != 0 ) this.bstream.readFloat(); // track.tcb.Tension\n if( (tcbFlags & 0x0002) != 0 ) this.bstream.readFloat(); // track.tcb.Continuty\n if( (tcbFlags & 0x0004) != 0 ) this.bstream.readFloat(); // track.tcb.Bias\n if( (tcbFlags & 0x0008) != 0 ) this.bstream.readFloat(); // track.tcb.EaseTo\n if( (tcbFlags & 0x0010) != 0 ) this.bstream.readFloat(); // track.tcb.EaseFrom\n q[3] = this.bstream.readFloat(); // rotation angle\n q[0] = this.bstream.readFloat(); // rotation axix.x\n q[1] = this.bstream.readFloat(); // rotation axix.y\n q[2] = this.bstream.readFloat(); // rotation axix.z\n if( q[0]==0.0 && q[1]==0.0 && q[2]==0.0 ) q[1] = 1;\n // NOTE! flip angle(q[3]) (I do not know why. it can be related to UP vector)\n self.vec.quaternion.setFromAxixAngle(currNode.transRot, q[0],q[1],q[2],-q[3]);\n }\n }\n // CHK_SCL_TRACK_TAG\n else if( chunkId == 0xB022 && aNodeType != 0xB001 && aNodeType != 0xB006 ) {\n this.bstream.readUInt16(); // track.flags\n this.bstream.readUInt32(); // track.dummy1\n this.bstream.readUInt32(); // track.dummy1\n trackKeys = this.bstream.readUInt32();\n for(k=0; k<trackKeys; k++)\n {\n this.bstream.readUInt32(); // track.tcb.frame\n tcbFlags = this.bstream.readUInt16();\n if( (tcbFlags & 0x0001) != 0 ) this.bstream.readFloat(); // track.tcb.Tension\n if( (tcbFlags & 0x0002) != 0 ) this.bstream.readFloat(); // track.tcb.Continuty\n if( (tcbFlags & 0x0004) != 0 ) this.bstream.readFloat(); // track.tcb.Bias\n if( (tcbFlags & 0x0008) != 0 ) this.bstream.readFloat(); // track.tcb.EaseTo\n if( (tcbFlags & 0x0010) != 0 ) this.bstream.readFloat(); // track.tcb.EaseFrom\n currNode.transScl[0] = this.bstream.readFloat();\n currNode.transScl[1] = this.bstream.readFloat();\n currNode.transScl[2] = this.bstream.readFloat();\n }\n }\n else {\n this.bstream.seek(chunkSize, 0);\n }\n }\n //\n // Set Node Matrix from rotation/translation/scale\n //\n currNode.nodeMatrix = self.vec.Mat4.create();\n self.vec.Mat4.fromRotationTranslationScale(currNode.nodeMatrix\n , currNode.transRot, currNode.transPos, currNode.transScl);\n if( currNode.pivot ) {\n self.vec.Mat4.translate(currNode.nodeMatrix,-currNode.pivot[0],-currNode.pivot[1],-currNode.pivot[2]); \n }\n // Reference Parent\n currNode.parent = null;\n if( currNode.parentId != 0xFFFF ) {\n for(k=aCurrModel.nodes.length-2; k>=0; k-- ) {\n p = aCurrModel.nodes[k];\n if(p.nodeId==currNode.parentId) {\n currNode.parent = p;\n self.vec.Mat4.multMat(p.nodeMatrix, currNode.nodeMatrix, currNode.nodeMatrix);\n break;\n }\n }\n // FIXME!\n if(currNode.parent==null && this.DEBUG) {\n console.log('3ds node.parent is null at '+currNode.keyName.name);\n }\n }\n // Reference Mesh\n currNode.refMesh = aCurrModel.meshes[currNode.keyName.key];\n if(currNode.refMesh) {\n currNode.refMesh.refCount++;\n }\n // split nodes of multi material mesh\n if( !!currNode.refMesh && !!currNode.refMesh.splits ) {\n currNode.isSplit = true;\n var splitNode, splitMesh;\n for(k=0, p=currNode.refMesh.splits.length; k<p; k++) {\n splitMesh = currNode.refMesh.splits[k];\n splitMesh.refCount++;\n splitNode = {refMesh : splitMesh\n ,nodeId : aCurrModel.nodes.length\n ,parent : currNode\n ,nodeMatrix: currNode.nodeMatrix.slice()\n };\n aCurrModel.nodes.push(splitNode);\n }\n }\n};\n\nself.Max3dsLoader.prototype.readEditor3dsChunk = function(aCurrModel, aNextPointer) {\n //\n // 2. Read Objects, Materials Chunks\n // \n // +--EDIT3DS (0x3D3D)\n // | |\n // | +--EDIT_OBJECT (0x4000)\n // | +--EDIT_MATERIAL (0xAFFF)\n // | +--EDIT_BACKGR (0x1200) \n // | +--EDIT_AMBIENT (0x2100)\n // | +--EDIT_CONFIG1 (0x0100)\n // | +--EDIT_CONFIG2 (0x3E3D) \n // | +--EDIT_VIEW_P1 (0x7012), EDIT_VIEW_P2(0x7011), EDIT_VIEW_P3 (0x7020)\n // | +--EDIT_VIEW1 (0x7001) \n // | +--EDIT_UNKNW01 (0x1100), EDIT_UNKNW02(0x1201), EDIT_UNKNW03(0x1300) ~ 14(0xAFFF)\n // |\n //\n var chunkId, chunkSize, chunkNext;\n while( this.bstream.Position < aNextPointer ) {\n chunkId = this.bstream.readUInt16();\n chunkSize = this.bstream.readUInt32()-6;\n chunkNext = chunkSize + this.bstream.Position;\n // EDIT_OBJECT\n if( chunkId === 0x4000 ) {\n this.readObjectChunk(aCurrModel, chunkNext);\n }\n // EDIT_MATERIAL\n else if( chunkId == 0xAFFF )\n {\n this.readMaterialChunk(aCurrModel, chunkNext);\n }\n else {\n this.bstream.seek(chunkSize, 0);\n }\n }\n};\n\nself.Max3dsLoader.prototype.readObjectChunk = function(aCurrModel, aNextPointer) {\n //\n // 3. TriMeshes, Lights, Cameras Chunks\n //\n // | +--EDIT_OBJECT (0x4000)\n // | | |\n // | | +--OBJ_TRIMESH (0x4100) \n // | | +--OBJ_LIGHT (0x4600)\n // | | +--OBJ_CAMERA (0x4700)\n // | | +--OBJ_UNKNWN01 (0x4710)\n // | | +--OBJ_UNKNWN02 (0x4720)\n // | |\n //\n var currMesh = {id:Object.keys(aCurrModel.meshes).length, index:0\n ,model:aCurrModel, refCount:0, countFace:0, countVertex:0, countTexuv:0\n ,faceMaterials:[]};\n // Read Name of object\n currMesh.keyName = this.bstream.readString();\n //\n var chunkId, chunkSize, chunkNext;\n while( this.bstream.Position < aNextPointer ) {\n chunkId = this.bstream.readUInt16();\n chunkSize = this.bstream.readUInt32()-6;\n chunkNext = chunkSize + this.bstream.Position;\n // OBJ_TRIMESH (NOTE! Object vs Mesh = 1:1)\n if( chunkId == 0x4100 )\n {\n aCurrModel.meshes[currMesh.keyName.key] = currMesh;\n this.readMeshChunk(currMesh, chunkNext);\n }\n else {\n this.bstream.seek(chunkSize, 0);\n }\n }\n};\n\nself.Max3dsLoader.prototype.readMaterialChunk = function(aCurrModel, aNextPointer) {\n //\n // 3. Material's Name, Color(Diffuse, Specular, Ambient, Illum, Alpha\n // , Shading, TwoSide, Shiness, Texture, Bumpmap, ...\n //\n // | +--EDIT_MATERIAL (0xAFFF)\n // | | |\n // | | +--MAT_NAME (0xA000)\n // | | +--MAT_TWO_SIDE (0xA081)\n // | | +--MAT_AMBIENT (0xA010)\n // | | +--MAT_DIFFUSE (0xA020)\n // | | +--MAT_SPECULAR (0xA030)\n // | | +--MAT_SHINESS (0xA040)\n // | | +--MAT_SHINES_PCT (0xA041)\n // | | +--MAT_SHADING (0xA100)\n // | | +--MAT_SELF_ILLUM (0xA080) // Emissive color (self illumination)\n // | | +--MAT_SELF_ILPCT (0xA084)\n // | | +--MAT_TRANSPARENCY (0xA050)\n // | | +--MAT_TEXTURE (0xA200) // Diffuse texture channel 0 \n // | | +--MAT_OPACMAP (0xA210) // Contains opacity information for each texel\n // | | +--MAT_REFLMAP (0xA220)\n // | | +--MAT_SELFIMAP (0xA33D) // Self Illumination map (emissive colors)\n // | | +--MAT_BUMPMAP (0xA230)\n // | | +--MAT_SPECMAP (0xA204)\n // | | +--MAT_MAT_SHINMAP (0xA33C)\n // | |\n //\n var currMat = {model:aCurrModel, refCount:0, repeat:false};\n //\n var chunkId, chunkSize, chunkNext;\n while( this.bstream.Position < aNextPointer ) {\n chunkId = this.bstream.readUInt16();\n chunkSize = this.bstream.readUInt32()-6;\n chunkNext = chunkSize + this.bstream.Position;\n // MAT_NAME (0xA000)\n if( chunkId === 0xA000 ) {\n currMat.keyName = this.bstream.readString();\n // NOTE! overriding the existing material could be occurred\n aCurrModel.materials[currMat.keyName.key] = currMat;\n }\n // MAT_AMBIENT (0xA010)\n else if( chunkId == 0xA010 )\n {\n currMat.ambientColor = [0,0,0];\n this.readColorChunk( currMat.ambientColor );\n }\n // MAT_DIFFUSE (0xA020)\n else if( chunkId == 0xA020 )\n {\n currMat.diffuseColor = [0,0,0];\n this.readColorChunk( currMat.diffuseColor );\n }\n // MAT_SPECULAR (0xA030)\n else if( chunkId == 0xA030 )\n {\n currMat.specularColor = [0,0,0];\n this.readColorChunk( currMat.specularColor );\n }\n // MAT_SHADING (0xA100)\n else if( chunkId == 0xA100 )\n {\n currMat.shading = this.bstream.readUInt16();\n }\n // MAT_SHINESS (0xA040)\n else if( chunkId == 0xA040 )\n {\n currMat.shiness = this.readPercentageChunk();\n }\n // MAT_TEXTURE (0xA200)\n else if( chunkId == 0xA200 )\n {\n currMat.diffuseTexture = {keyName:undefined};\n this.readTextureChunk(currMat.diffuseTexture, chunkNext);\n }\n else {\n this.bstream.seek(chunkSize, 0);\n }\n }\n};\n\nself.Max3dsLoader.prototype.readTextureChunk = function(aCurrTexure, aNextPointer) {\n //\n // 4. Texure Attributes\n //\n // | | +--MAT_TEXTURE (0xA200) // Diffuse texture channel 0 \n // | | +--MAT_OPACMAP (0xA210) // Contains opacity information for each texel\n // | | +--MAT_REFLMAP (0xA220)\n // | | +--MAT_SELFIMAP (0xA33D) // Self Illumination map (emissive colors)\n // | | +--MAT_BUMPMAP (0xA230)\n // | | +--MAT_SPECMAP (0xA204)\n // | | +--MAT_MAT_SHINMAP (0xA33C)\n // | | | |\n // | | | +--MAT_MAPFILE (0xA300)\n // | | | +--MAT_MAP_USCALE (0xA354)\n // | | | +--MAT_MAP_VSCALE (0xA356)\n // | | | +--MAT_MAP_UOFFSET (0xA358)\n // | | | +--MAT_MAP_VOFFSET (0xA35A)\n // | | | +--MAT_MAP_ANG (0xA35C)\n // | | | +--MAT_MAP_TILING (0xA351)\n //\n var chunkId, chunkSize;\n //\n while( this.bstream.Position < aNextPointer ) {\n chunkId = this.bstream.readUInt16();\n chunkSize = this.bstream.readUInt32()-6;\n // MAT_MAPFILE(0xA300)\n if( chunkId == 0xA300 ) {\n aCurrTexure.keyName = this.bstream.readString();\n // \n }\n // Blend Factor(PERCENTF) \n else if( chunkId == 0x0030 ) {\n aCurrTexure.blend = this.bstream.readUInt16(); // Int16\n }\n // Blend Factor(PERCENTW) \n else if( chunkId == 0x0031 ) {\n aCurrTexure.blend = this.bstream.readByte() / 255;\n }\n // MAT_MAP_USCALE (0xA354)\n else if( chunkId == 0xA354 ) {\n aCurrTexure.scaleU = this.bstream.readFloat();\n }\n // MAT_MAP_VSCALE (0xA356)\n else if( chunkId == 0xA356 ) {\n aCurrTexure.scaleV = this.bstream.readFloat();\n }\n // MAT_MAP_UOFFSET (0xA358)\n else if( chunkId == 0xA358 ) {\n aCurrTexure.offsetU = this.bstream.readFloat();\n }\n // MAT_MAP_VOFFSET (0xA35A)\n else if( chunkId == 0xA35A ) {\n aCurrTexure.offsetV = this.bstream.readFloat();\n }\n // MAT_MAP_ANG (0xA35C)\n else if( chunkId == 0xA35C ) {\n // Texture coordinate rotation, CCW in DEGREES\n aCurrTexure.angleRot = this.bstream.readFloat();\n }\n // MAT_MAP_TILING (0xA351)\n else if( chunkId == 0xA351 ) {\n aCurrTexure.Tiling = this.bstream.readUInt16();\n // if (flag & 0x2u) MapMode_Mirror\n // if (flag & 0x10u) MapMode_Decal\n // others MapMode_Warp\n }\n else {\n this.bstream.seek(chunkSize, 0);\n }\n }\n};\n\nself.Max3dsLoader.prototype.readColorChunk = function(oColor) {\n var chunkId = this.bstream.readUInt16();\n var chunkSize = this.bstream.readUInt32()-6;\n // RGBF LINRGBF\n if( chunkId == 0x0010 || chunkId == 0x0013 )\n {\n oColor[0] = this.bstream.readFloat();\n oColor[1] = this.bstream.readFloat();\n oColor[2] = this.bstream.readFloat();\n }\n // RGBB LINRGBB\n else if( chunkId == 0x0011 || chunkId == 0x0012 )\n {\n oColor[0] = this.bstream.readByte() / 255;\n oColor[1] = this.bstream.readByte() / 255;\n oColor[2] = this.bstream.readByte() / 255;\n this.bstream.seek(chunkSize-3, 0);\n }\n // PERCENTF\n else if( chunkId == 0x0030 )\n {\n oColor[0] = oColor[1] = oColor[2] = this.bstream.readFloat();\n }\n // PERCENTW\n else if( chunkId == 0x0031 )\n {\n oColor[0] = oColor[1] = oColor[2] = this.bstream.readByte() / 255;\n }\n // Skip Unhandled Chunks\n else\n {\n this.bstream.seek(chunkSize, 0);\n }\n};\n\nself.Max3dsLoader.prototype.readPercentageChunk = function() {\n var chunkId = this.bstream.readUInt16();\n var chunkSize = this.bstream.readUInt32()-6;\n // PERCENTF\n if( chunkId == 0x0030 )\n {\n if( chunkSize == 2 )\n return this.bstream.readUInt16();// Int16?\n else if( chunkSize == 4 )\n return this.bstream.readFloat();\n else {\n this.bstream.seek(chunkSize, 0);\n return -1;\n }\n }\n // PERCENTW\n else if( chunkId == 0x0031 )\n {\n if( chunkSize==2 )\n return this.bstream.readUInt16() / 0xFFFF; // Int16\n else if( chunkSize==4 )\n return this.bstream.readFloat();\n else {\n this.bstream.seek(chunkSize, 0);\n return -1;\n }\n }\n // Skip Unhandled Chunks\n else\n {\n this.bstream.seek(chunkSize, 0);\n return -1; // FIXME return NaN\n }\n};\n\nself.Max3dsLoader.prototype.readFaceChunk = function(aCurrMesh, aNextPointer) {\n //\n // 5. SmoothingGroups and MaterialAssignments\n //\n // | | | +--TRI_FACEL1 (0x4120)\n // | | | | |\n // | | | | +--TRI_SMOOTH (0x4150) \n // | | | | +--TRI_MATERIAL (0x4130)\n //\n //\n var chunkId, chunkSize;\n //var cntFace, i, num, f; //m\n while( this.bstream.Position < aNextPointer ) {\n chunkId = this.bstream.readUInt16();\n chunkSize = this.bstream.readUInt32()-6;\n // TRI_MATERIAL\n if( chunkId == 0x4130 ) {\n var nameMat = this.bstream.readString();\n var currMaterial = aCurrMesh.model.materials[nameMat.key];\n if(!!currMaterial) {\n currMaterial.refCount++;\n aCurrMesh.material = currMaterial;\n }\n //\n var cntFace = this.bstream.readUInt16();\n if(cntFace) {\n var faces = this.bstream.getUint16Array(cntFace);\n aCurrMesh.faceMaterials.push({material:currMaterial, faces:faces});\n }\n }\n // TRI_SMOOTH\n /*else if( chunkId == 0x4150 ) {\n // This is the list of smoothing groups - a bitfield for every face. \n // Up to 32 smoothing groups assigned to a single face.\n aCurrMesh.smoothGroups = [];\n num = (chunkSize/4)|0;\n cntFace = aCurrMesh.countFace;\n for( i=0; i < cntFace && i<num; i++ ) {\n aCurrMesh.smoothGroups.push(this.bstream.readUInt32());\n }\n }*/\n else {\n this.bstream.seek(chunkSize, 0);\n }\n }\n};\n\nself.Max3dsLoader.prototype.readMeshChunk = function(aCurrMesh, aNextPointer) {\n //\n // 4. Faces, VertexList, MapCoords\n //\n // | | +--OBJ_TRIMESH (0x4100) \n // | | | |\n // | | | +--TRI_VERTEXL (0x4110)\n // | | | +--TRI_VERTEXOPTIONS (0x4111) LIB3DS_POINT_FLAG_ARRAY\n // | | | +--TRI_MAPPINGCOORS (0x4140)\n // | | | +--TRI_MAPPINGSTANDARD (0x4170)\n // | | | +--TRI_FACEL1 (0x4120)\n // | | | | |\n // | | | | +--TRI_SMOOTH (0x4150)\n // | | | | +--TRI_MATERIAL (0x4130)\n // | | | |\n // | | | +--TRI_LOCALMATRIX (0x4160)\n // | | | +--TRI_VISIBLE(COLOR) (0x4165)\n // | | |\n //\n // \n var chunkId, chunkSize, chunkNext;\n var bufferVertex, bufferIndice, dataArray, i, x, bi; //v f\n var dataVertex, dataTexuv, dataIndice,vertexIndex; \n //\n while( this.bstream.Position < aNextPointer ) {\n chunkId = this.bstream.readUInt16();\n chunkSize = this.bstream.readUInt32()-6;\n chunkNext = chunkSize + this.bstream.Position;\n // TRI_VERTEXL\n // This is the list of all vertices in the current mesh\n if( chunkId == 0x4110 ) {\n aCurrMesh.countVertex = this.bstream.readUInt16();\n //\n if( aCurrMesh.countVertex ) {\n dataVertex = this.bstream.getFloat32Array(aCurrMesh.countVertex*3); \n }\n }\n // TRI_LOCALMATRIX (0x4160)\n // This is the RLEATIVE transformation matrix of the current mesh. Vertices are\n // pretransformed by this matrix wonder.\n // Skip Unhandled Chunks\n else if( chunkId == 0x4160 ) {\n aCurrMesh.localMatrix = self.vec.Mat4.create();\n aCurrMesh.localInv = self.vec.Mat4.create();\n // a1 a2 a3 a4 0 4 8 12\n // b1 b2 b3 b4 1 5 9 13\n // c1 c2 c3 c4 2 6 10 14\n // d1 d2 d3 d4 3 7 11 15\n aCurrMesh.localMatrix[0 ] = this.bstream.readFloat(); // a1\n aCurrMesh.localMatrix[1 ] = this.bstream.readFloat(); // b1\n aCurrMesh.localMatrix[2 ] = this.bstream.readFloat(); // c1\n aCurrMesh.localMatrix[3 ] = 0;\n aCurrMesh.localMatrix[4 ] = this.bstream.readFloat(); // a2\n aCurrMesh.localMatrix[5 ] = this.bstream.readFloat(); // b2\n aCurrMesh.localMatrix[6 ] = this.bstream.readFloat(); // c2\n aCurrMesh.localMatrix[7 ] = 0;\n aCurrMesh.localMatrix[8 ] = this.bstream.readFloat(); // a3\n aCurrMesh.localMatrix[9 ] = this.bstream.readFloat(); // b3\n aCurrMesh.localMatrix[10] = this.bstream.readFloat(); // c3\n aCurrMesh.localMatrix[11] = 0;\n aCurrMesh.localMatrix[12] = this.bstream.readFloat(); // a4\n aCurrMesh.localMatrix[13] = this.bstream.readFloat(); // b4\n aCurrMesh.localMatrix[14] = this.bstream.readFloat(); // c4\n aCurrMesh.localMatrix[15] = 1;\n // invert local matrix for pivoting & transforming hierarchy\n self.vec.Mat4.invert(aCurrMesh.localMatrix, aCurrMesh.localInv);\n // Handle negative transformation matrix determinant -> invert vertex x\n if( aCurrMesh.localInv.det < 0.0 ) {\n self.vec.Mat4.flipX(aCurrMesh.localInv);\n }\n }\n // TRI_MAPPINGCOORS(0x4140) LIB3DS_TEX_VERTS\n // This is the list of all UV coords in the current mesh\n else if( chunkId == 0x4140 ) {\n aCurrMesh.countTexuv = this.bstream.readUInt16();\n if( aCurrMesh.countTexuv ) {\n dataTexuv = this.bstream.getFloat32Array(aCurrMesh.countTexuv*2);\n }\n }\n // TRI_FACELIST (0x4120) LIB3DS_FACE_ARRAY\n // This is the list of all faces in the current mesh\n else if( chunkId == 0x4120 ) {\n aCurrMesh.countFace = this.bstream.readUInt16();\n if( aCurrMesh.countFace ) {\n dataIndice = this.bstream.getUint16Array(aCurrMesh.countFace*4);\n }\n // for(i=0;i < aCurrMesh.countFace; i++) {\n // f = {smoothGroup:0}; // new Face()\n // aCurrMesh.faces.push(f);\n // }\n // Larger 3DS files could have multiple FACE chunks here\n // stream->GetRemainingSizeToLimit() > 6(sizeof(Chunk))\n if( this.bstream.Position < chunkNext ) {\n this.readFaceChunk(aCurrMesh, chunkNext);\n }\n }\n else {\n this.bstream.seek(chunkSize, 0);\n }\n }\n //\n // populate mesh vertex\n //\n if( aCurrMesh.countVertex==0 || aCurrMesh.countFace==0 ) {\n // remove empty mesh\n delete aCurrMesh.model.meshes[aCurrMesh.keyName.key];\n }\n else {\n if( !aCurrMesh.localMatrix ) {\n aCurrMesh.localMatrix = self.vec.Mat4.create();\n }\n //\n bufferVertex = null;\n bufferIndice = null;\n //\n for(bi=this.asset.buffers.length-1; bi>=0; bi-=2 ) {\n bufferVertex = this.asset.buffers[bi-1];\n bufferIndice = this.asset.buffers[bi-0];\n if( bufferVertex.dataArray.length >= bufferVertex.capacity+aCurrMesh.countVertex*8 ) {\n break;\n }\n // else\n bufferVertex = null;\n bufferIndice = null;\n }\n // add new vertex buffer if not found\n if( !bufferVertex ) {\n bufferVertex = { type:1,index:this.asset.buffers.length, offset:0, capacity:0\n , dataArray:new Float32Array(65536<<3) };\n this.asset.buffers.push(bufferVertex);\n //\n bufferIndice = { type:2,index:this.asset.buffers.length, offset:0, capacity:0\n , dataArray:new Uint16Array(aCurrMesh.countFace*3*3) };\n this.asset.buffers.push(bufferIndice);\n }\n // populate vertex\n aCurrMesh.vertexBuffer = bufferVertex;\n aCurrMesh.vertexOffset = bufferVertex.offset;\n bufferVertex.capacity += (aCurrMesh.countVertex*8);\n bufferVertex.offset = bufferVertex.capacity;\n dataArray = bufferVertex.dataArray;\n //\n for(i=0;i < aCurrMesh.countVertex; i++) {\n x = aCurrMesh.vertexOffset+(i<<3);\n dataArray[x+0] = dataVertex[i*3+0];\n dataArray[x+1] = dataVertex[i*3+1];\n dataArray[x+2] = dataVertex[i*3+2];\n }\n for(i=0;i < aCurrMesh.countTexuv; i++) {\n x = aCurrMesh.vertexOffset+(i<<3);\n dataArray[x+6] = dataTexuv[(i<<1)+0];\n dataArray[x+7] = dataTexuv[(i<<1)+1];\n }\n // populate face index\n //\n aCurrMesh.indiceBuffer = bufferIndice;\n aCurrMesh.indiceOffset = bufferIndice.offset;\n bufferIndice.capacity += aCurrMesh.countFace*3;\n bufferIndice.offset = bufferIndice.capacity;\n dataArray = bufferIndice.dataArray;\n // make sure capacity of bufferIndice\n if( aCurrMesh.indiceOffset+aCurrMesh.countFace*3 > bufferIndice.dataArray.length ) {\n dataArray = new Uint16Array(bufferIndice.dataArray.length + aCurrMesh.countFace*3*3);\n dataArray.set(bufferIndice.dataArray);\n bufferIndice.dataArray = dataArray;\n }\n // prune face vertex index\n if( aCurrMesh.faceMaterials.length < 2 ) {\n vertexIndex = aCurrMesh.vertexOffset>>3;\n for(i=0;i < aCurrMesh.countFace; i++) {\n x = aCurrMesh.indiceOffset+(i*3);\n dataArray[x+0] = vertexIndex + dataIndice[(i<<2)+0];\n dataArray[x+1] = vertexIndex + dataIndice[(i<<2)+1];\n dataArray[x+2] = vertexIndex + dataIndice[(i<<2)+2];\n }\n }\n //\n // Split meshes by materials\n //\n if( aCurrMesh.faceMaterials.length > 1 ) {\n var mi,ml, fi,fl,ii;\n var faceMatl, splitMesh, faces;\n var model=aCurrMesh.model;\n var indiceOffset = aCurrMesh.indiceOffset;\n dataArray = aCurrMesh.indiceBuffer.dataArray;\n vertexIndex = aCurrMesh.vertexOffset>>3;\n //\n aCurrMesh.splits = [];\n // \n for(mi=0, ml=aCurrMesh.faceMaterials.length; mi<ml; mi++) {\n faceMatl =aCurrMesh.faceMaterials[mi];\n faces =faceMatl.faces; \n splitMesh = {id:Object.keys(model.meshes).length\n ,keyName: {name:aCurrMesh.keyName.name\n ,key :aCurrMesh.keyName.key+'#'+mi}\n ,index:0, model:model, refCount:0\n ,material : faceMatl.material\n ,vertexBuffer: aCurrMesh.vertexBuffer\n ,vertexOffset: aCurrMesh.vertexOffset\n ,indiceBuffer: aCurrMesh.indiceBuffer\n ,indiceOffset: indiceOffset\n ,countFace : faces.length\n ,countVertex : 0\n };\n // append new split mesh into model\n aCurrMesh.splits.push(splitMesh);\n model.meshes[splitMesh.keyName.key] = splitMesh;\n // rearrange face index\n //debugger;\n for(ii=0,fl=faces.length; ii<fl; ii++) {\n fi =faces[ii];\n x = indiceOffset+(ii*3);\n dataArray[x+0] = vertexIndex + dataIndice[(fi<<2)+0];\n dataArray[x+1] = vertexIndex + dataIndice[(fi<<2)+1];\n dataArray[x+2] = vertexIndex + dataIndice[(fi<<2)+2];\n }\n indiceOffset += 3*splitMesh.countFace;\n }\n //console.log('aCurrMesh.faceMaterials.length'+aCurrMesh.faceMaterials.length + ', splits.length='+aCurrMesh.splits.length);\n aCurrMesh.faceMaterials.length = 0;\n }\n }\n};\n\nself.Max3dsLoader.prototype.handleMeshNullMaterial = function() {\n var mi, ml; //ni, nl, vi, vl\n var model, mesh; // face, tc\n var nullMaterial;\n // 0. init\n var material, matName;\n var baseUrl = this.baseUrl_\n + (this.baseUrl_ .charAt(this.baseUrl_.length-1)!='/' && this.modelUrl_.charAt(0)!='/'?'/':'')\n + (this.modelUrl_.lastIndexOf('/')!=-1\n ? this.modelUrl_.substring(0,this.modelUrl_.lastIndexOf('/')):'');\n baseUrl += (baseUrl.charAt(baseUrl.length-1)!='/'?'/':'');\n //\n // 1. handle errors of meshes\n //\n for(mi=0, ml=this.asset.models.length; mi<ml; mi++) {\n model =this.asset.models[mi];\n nullMaterial= null;\n for(mesh in model.meshes) {\n mesh = model.meshes[mesh];\n // remove empty mesh\n if( mesh.countFace==0 ) {\n delete model.meshes[mesh.keyName.key];\n continue;\n }\n // check null material of mesh\n if(!mesh.material) {\n if(!nullMaterial) {\n nullMaterial = {model:model, refCount:1, repeat:false, diffuseColor:[0.5,0.5,0.5]};\n model.materials['$$$DEFAULT'] = nullMaterial;\n }\n mesh.material = nullMaterial;\n }\n }\n // remove unused material by counting material.refCount\n for( matName in model.materials ) {\n material = model.materials[matName];\n if(material.diffuseTexture && material.diffuseTexture.keyName) {\n material.diffuseTexture.imageBinary = baseUrl + material.diffuseTexture.keyName.name;\n //console.log('output texture Url='+material.diffuseTexture.imageBinary);\n }\n if(!material.refCount) {\n delete model.materials[matName];\n }\n }\n }\n};\n\nself.Max3dsLoader.prototype.handleUnloadedMeshes = function() {\n // post-processing\n //\n var mi,ml;\n var model, mesh, node;\n // pivot\n for(mi=0, ml=this.asset.models.length; mi<ml; mi++) {\n model =this.asset.models[mi];\n for(mesh in model.meshes) {\n mesh = model.meshes[mesh];\n if(!mesh.refCount) {\n node ={ refMesh : mesh\n , nodeId : model.nodes.length\n , parentId : 0xFFFF\n , nodeMatrix: mesh.localMatrix\n };\n model.nodes.push(node);\n mesh.refCount = 1;\n }\n }\n }\n};\n\nself.Max3dsLoader.prototype.computeMeshNormals = function() {\n // post-processing\n // compute normals with SmoothingGroups\n var mi, ml, fi, fl, vi, vl; // f2\n var model, mesh, norm, i0, i1, i2, vx; //face, v\n var v0=[0,0,0], v1=[0,0,0], v2=[0,0,0];\n var d1=[0,0,0], d2=[0,0,0], nn=[0,0,0];\n var vertexArray, indexArray;\n // Go down from scene to face\n for(mi=0, ml=this.asset.models.length; mi<ml; mi++) {\n model =this.asset.models[mi];\n for(mesh in model.meshes) {\n mesh = model.meshes[mesh];\n // filter split mesh\n if( mesh.countVertex === 0 )\n continue;\n vertexArray = mesh.vertexBuffer.dataArray;\n indexArray = mesh.indiceBuffer.dataArray;\n // summation\n for(fi=0, fl=mesh.countFace; fi<fl; fi++) {\n i0 = indexArray[mesh.indiceOffset + fi*3 + 0]<<3;\n i1 = indexArray[mesh.indiceOffset + fi*3 + 1]<<3;\n i2 = indexArray[mesh.indiceOffset + fi*3 + 2]<<3;\n //\n v0[0] = vertexArray[i0+0]; v0[1] = vertexArray[i0+1]; v0[2] = vertexArray[i0+2];\n v1[0] = vertexArray[i1+0]; v1[1] = vertexArray[i1+1]; v1[2] = vertexArray[i1+2];\n v2[0] = vertexArray[i2+0]; v2[1] = vertexArray[i2+1]; v2[2] = vertexArray[i2+2];\n // side vector\n d1[0]=v1[0]-v0[0]; d1[1]=v1[1]-v0[1]; d1[2]=v1[2]-v0[2];\n d2[0]=v2[0]-v0[0]; d2[1]=v2[1]-v0[1]; d2[2]=v2[2]-v0[2];\n // normal = cross(d1, d2)\n nn[0]=d1[1]*d2[2]-d1[2]*d2[1];\n nn[1]=d1[2]*d2[0]-d1[0]*d2[2];\n nn[2]=d1[0]*d2[1]-d1[1]*d2[0];\n // normalize (NOTE! I think computing normal is not needed at this loop.)\n norm = nn[0]*nn[0]+nn[1]*nn[1]+nn[2]*nn[2];\n if(norm!==0.0) {\n norm = 1/Math.sqrt(norm);\n nn[0]*= norm; nn[1]*= norm; nn[2]*= norm;\n }\n // normal sumation\n vertexArray[i0+3]+=nn[0]; vertexArray[i0+4]+=nn[1]; vertexArray[i0+5]+=nn[2];\n vertexArray[i1+3]+=nn[0]; vertexArray[i1+4]+=nn[1]; vertexArray[i1+5]+=nn[2];\n vertexArray[i2+3]+=nn[0]; vertexArray[i2+4]+=nn[1]; vertexArray[i2+5]+=nn[2];\n }\n // normalizing\n for(vi=0, vl=mesh.countVertex; vi<vl; vi++) {\n vx = mesh.vertexOffset+(vi<<3);\n nn[0] = vertexArray[vx+3];\n nn[1] = vertexArray[vx+4];\n nn[2] = vertexArray[vx+5];\n norm = nn[0]*nn[0]+nn[1]*nn[1]+nn[2]*nn[2];\n if(norm!==0.0) {\n norm = 1/Math.sqrt(norm);\n vertexArray[vx+3] = nn[0]*norm;\n vertexArray[vx+4] = nn[1]*norm;\n vertexArray[vx+5] = nn[2]*norm;\n }\n }\n // localize Mesh Vertice\n if( mesh.localInv ) {\n for(vi=0, vl=mesh.countVertex; vi<vl; vi++) {\n vx = mesh.vertexOffset+(vi<<3);\n v0[0] = vertexArray[vx+0];\n v0[1] = vertexArray[vx+1];\n v0[2] = vertexArray[vx+2];\n //\n self.vec.Mat4.multVec3(mesh.localInv, v0);\n //\n vertexArray[vx+0] = v0[0];\n vertexArray[vx+1] = v0[1];\n vertexArray[vx+2] = v0[2];\n }\n }\n }\n }\n};\n\nself.Max3dsLoader.prototype.computeAssetBbox = function() {\n // post-processing\n this.asset.bbox = [Infinity,Infinity,Infinity, -Infinity, -Infinity, -Infinity];\n //\n var mi,ml, ni,nl, vi, vl,vx;\n var model, mesh, node, nodeMatrix, v=[0,0,0];\n var xcen, ycen, zcen;\n var vertexArray; // vertexOffset;\n // compute bbox for all mesh\n for(mi=0, ml=this.asset.models.length; mi<ml; mi++) {\n model =this.asset.models[mi];\n for(ni=0, nl=model.nodes.length; ni<nl; ni++) {\n node =model.nodes[ni];\n mesh =node.refMesh;\n if( node.nodeMatrix && mesh !== undefined && mesh.vertexBuffer ) {\n nodeMatrix = node.nodeMatrix;\n vertexArray = mesh.vertexBuffer.dataArray;\n //vertexOffset = mesh.vertexOffset;\n // transform vertex by node matrix\n for(vi=0, vl=mesh.countVertex; vi<vl; vi++) {\n vx = mesh.vertexOffset+(vi<<3);\n v[0] = vertexArray[vx+0];\n v[1] = vertexArray[vx+1];\n v[2] = vertexArray[vx+2];\n //\n self.vec.Mat4.multVec3(nodeMatrix, v);\n //\n this.asset.bbox[0] = Math.min(this.asset.bbox[0], v[0]);\n this.asset.bbox[1] = Math.min(this.asset.bbox[1], v[1]);\n this.asset.bbox[2] = Math.min(this.asset.bbox[2], v[2]);\n this.asset.bbox[3] = Math.max(this.asset.bbox[3], v[0]);\n this.asset.bbox[4] = Math.max(this.asset.bbox[4], v[1]);\n this.asset.bbox[5] = Math.max(this.asset.bbox[5], v[2]);\n }\n }\n }\n }\n // normalizing bbox\n xcen = 0.5*( this.asset.bbox[0] + this.asset.bbox[3] );\n ycen = 0.5*( this.asset.bbox[1] + this.asset.bbox[4] );\n zcen = this.asset.bbox[2];\n //\n this.asset.bbox[0] -= xcen; this.asset.bbox[3] -= xcen;\n this.asset.bbox[1] -= ycen; this.asset.bbox[4] -= ycen;\n this.asset.bbox[2] -= zcen; this.asset.bbox[5] -= zcen;\n // translate nodeMatrix by basePoint<-xcen,-ycen,-zcen>\n for(mi=0, ml=this.asset.models.length; mi<ml; mi++) {\n model =this.asset.models[mi];\n for(ni=0, nl=model.nodes.length; ni<nl; ni++) {\n node =model.nodes[ni];\n if( node.refMesh !== undefined && node.nodeMatrix ) {\n node.nodeMatrix[12] -= xcen;\n node.nodeMatrix[13] -= ycen;\n node.nodeMatrix[14] -= zcen;\n }\n }\n }\n};\n\nself.Max3dsLoader.prototype.buildRenderObject = function() {\n // post-processing\n // build renderable object that used by ol.model3d.Max3ds\n var renderData = new Object();\n var rBuffers = [], rMeshes=[], rMaterials=[], rNodes=[];\n renderData['bbox' ] = this.asset.bbox;\n renderData['buffers' ] = rBuffers;\n renderData['meshes' ] = rMeshes;\n renderData['materials'] = rMaterials;\n renderData['nodes' ] = rNodes;\n //debugger;\n var mi,ml,ni,nl,bi,bl;\n var model,material, matObj, node,nodeObj, mesh, meshObj,vbuffer;\n //\n // 1.0 create Bufferview\n for(bi=0, bl=this.asset.buffers.length; bi<bl; bi++) {\n vbuffer = this.asset.buffers[bi];\n matObj = new Object();\n matObj['type' ] = vbuffer.type;\n matObj['capacity' ] = vbuffer.capacity;\n matObj['dataArray'] = vbuffer.dataArray;\n rBuffers.push(matObj);\n }\n //\n for(mi=0, ml=this.asset.models.length; mi<ml; mi++) {\n model =this.asset.models[mi];\n // 1.1 write materials\n for( material in model.materials ) {\n material = model.materials[material];\n material.index = rMaterials.length;\n //\n matObj = new Object();\n rMaterials.push(matObj);\n matObj['repeat' ] = material.repeat;\n matObj['ambientColor' ] = material.ambientColor;\n matObj['specularColor' ] = material.specularColor;\n matObj['shiness' ] = material.shiness;\n matObj['diffuseColor' ] = material.diffuseColor;\n matObj['diffuseImage' ] = material.diffuseTexture === undefined?undefined\n :material.diffuseTexture.imageBinary;\n }\n // 1.2 write meshes\n for(mesh in model.meshes) {\n mesh = model.meshes[mesh];\n if(!!mesh.splits) continue; // Ignore Source Mesh of splitter\n mesh.index = rMeshes.length;\n //\n meshObj = new Object();\n rMeshes.push(meshObj);\n meshObj['vbIndex' ] = mesh.vertexBuffer.index;\n meshObj['xbIndex' ] = mesh.indiceBuffer.index;\n meshObj['faceOffset'] = mesh.indiceOffset*2; // 2:uint16\n meshObj['faceCount' ] = mesh.countFace*3;\n meshObj['material' ] =!mesh.material?null:mesh.material.index; //FIXME!\n }\n // 1.3 nodes\n for(ni=0, nl=model.nodes.length; ni<nl; ni++) {\n node =model.nodes[ni];\n if( node.refMesh && node.nodeMatrix && !node.refMesh.splits ) {\n nodeObj = new Object();\n rNodes.push(nodeObj);\n nodeObj['mesh' ] = node.refMesh.index;\n nodeObj['transform'] = node.nodeMatrix;\n }\n }\n }\n return renderData;\n};\n\nself.Max3dsLoader.prototype.onAssetLoaded = function() {\n //\n // 2. postprocessing\n // 2.1 handle Mesh Null Material\n this.handleMeshNullMaterial();\n // 2.2 Handle Unloaded Meshes\n this.handleUnloadedMeshes();\n // 2.3 compute face normals\n this.computeMeshNormals();\n // 2.4 copmpute bounding box of asset\n this.computeAssetBbox();\n //\n // 3 build service format\n var response = new Object();\n response['response'] = 'done';\n response['data' ] = this.buildRenderObject();\n // GC\n this.asset = undefined;\n // Send Response To App\n this.worker_.postMessage(response);\n //\n // Here, We are ended!\n //\n}\n\nself.Max3dsLoader.prototype.onAssetDownloaded = function(buffer) {\n //\n // 1. build asset from binary stream\n //\n // Asset\n // - bbox\n // - models\n // - nodes\n // - meshes \n // - materials \n //\n this.bstream = new self.BinaryStream(buffer, 0);\n //\n // Asset Class Specification\n // models : 3ds model(global singleton)\n //\n this.asset = { models:[], buffers:[] };\n //\n var chunkId, chunkSize, chunkNext;\n //\n while( this.bstream.Position < this.bstream.bufferLength_ ) {\n chunkId = this.bstream.readUInt16();\n chunkSize = this.bstream.readUInt32()-6; // 6:2(id)+4(len)\n chunkNext = chunkSize + this.bstream.Position;\n //\n if( chunkId === 0x4D4D ) {\n this.readModelChunk(chunkNext);\n }\n else {\n this.bstream.seek(chunkSize, 0); // 0:SeekOrigin.Current\n }\n }\n // GC\n this.bstream = undefined;\n //\n // 2. postprocessing\n //\n this.onAssetLoaded();\n};\n\n/**\n * Load Discreet 3DS\n * @param {Object} eventData Event Data\n */\nself.Max3dsLoader.prototype.load = function(eventData) {\n //\n // Here, we are starting!\n //\n // Read Loading Parameters\n //\n var options = eventData['options'];\n this.DEBUG = options['debug' ];\n this.baseUrl_ = options['baseUrl' ];\n this.modelUrl_ = options['modelUrl' ];\n this.crossOrigin_ = options['crossOrigin'];\n //\n // Download Asset File\n //\n var loader = this;\n var modelUrl = this.baseUrl_ \n + (this.baseUrl_.charAt(this.baseUrl_.length-1)!='/' && this.modelUrl_.charAt(0)!='/'?'/':'') \n + this.modelUrl_;\n //\n var xhr = new XMLHttpRequest();\n xhr.open('GET', modelUrl, false);\n xhr.responseType = 'arraybuffer';\n xhr.onerror = function() {\n self.postMessage({response:'error', asset:modelUrl, status:'get failed:'+xhr.statusText});\n };\n xhr.onload = function(e) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n loader.onAssetDownloaded(new Uint8Array(/**@type{ArrayBufferView}*/(xhr.response)));\n }\n };\n xhr.send();\n}\n}", "calculatePositions() {\n this.x1 = this.from.getCenterX()\n this.y1 = this.from.getCenterY()\n this.x2 = this.to.getCenterX()\n this.y2 = this.to.getCenterY()\n }", "calculateVertices() {\n var geometry = this.geometry;\n var vertices = geometry.buffers[0].data;\n if (geometry.vertexDirtyId === this.vertexDirty && this._transformID === this.transform._worldID) {\n return;\n }\n this._transformID = this.transform._worldID;\n if (this.vertexData.length !== vertices.length) {\n this.vertexData = new Float32Array(vertices.length);\n }\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n for (var i = 0; i < vertexData.length / 2; i++) {\n var x = vertices[(i * 2)];\n var y = vertices[(i * 2) + 1];\n vertexData[(i * 2)] = (a * x) + (c * y) + tx;\n vertexData[(i * 2) + 1] = (b * x) + (d * y) + ty;\n }\n if (this._roundPixels) {\n for (var i$1 = 0; i$1 < vertexData.length; i$1++) {\n vertexData[i$1] = Math.round(vertexData[i$1]);\n }\n }\n this.vertexDirty = geometry.vertexDirtyId;\n }", "function createCoordinateLines(vpts, xScale, yScale, zScale, xExent, yExent, zExent){\n var lineGeo = new THREE.Geometry();\n lineGeo.vertices.push(\n v(xScale(vpts.xMin), yScale(vpts.yCen), zScale(vpts.zCen)), v(xScale(vpts.xMax), yScale(vpts.yCen), zScale(vpts.zCen)),\n v(xScale(vpts.xCen), yScale(vpts.yMin), zScale(vpts.zCen)), v(xScale(vpts.xCen), yScale(vpts.yMax), zScale(vpts.zCen)),\n v(xScale(vpts.xCen), yScale(vpts.yCen), zScale(vpts.zMax)), v(xScale(vpts.xCen), yScale(vpts.yCen), zScale(vpts.zMin)),\n\n v(xScale(vpts.xMin), yScale(vpts.yMax), zScale(vpts.zMin)), v(xScale(vpts.xMax), yScale(vpts.yMax), zScale(vpts.zMin)),\n v(xScale(vpts.xMin), yScale(vpts.yMin), zScale(vpts.zMin)), v(xScale(vpts.xMax), yScale(vpts.yMin), zScale(vpts.zMin)),\n v(xScale(vpts.xMin), yScale(vpts.yMax), zScale(vpts.zMax)), v(xScale(vpts.xMax), yScale(vpts.yMax), zScale(vpts.zMax)),\n v(xScale(vpts.xMin), yScale(vpts.yMin), zScale(vpts.zMax)), v(xScale(vpts.xMax), yScale(vpts.yMin), zScale(vpts.zMax)),\n\n v(xScale(vpts.xMin), yScale(vpts.yCen), zScale(vpts.zMax)), v(xScale(vpts.xMax), yScale(vpts.yCen), zScale(vpts.zMax)),\n v(xScale(vpts.xMin), yScale(vpts.yCen), zScale(vpts.zMin)), v(xScale(vpts.xMax), yScale(vpts.yCen), zScale(vpts.zMin)),\n v(xScale(vpts.xMin), yScale(vpts.yMax), zScale(vpts.zCen)), v(xScale(vpts.xMax), yScale(vpts.yMax), zScale(vpts.zCen)),\n v(xScale(vpts.xMin), yScale(vpts.yMin), zScale(vpts.zCen)), v(xScale(vpts.xMax), yScale(vpts.yMin), zScale(vpts.zCen)),\n\n v(xScale(vpts.xMax), yScale(vpts.yMin), zScale(vpts.zMin)), v(xScale(vpts.xMax), yScale(vpts.yMax), zScale(vpts.zMin)),\n v(xScale(vpts.xMin), yScale(vpts.yMin), zScale(vpts.zMin)), v(xScale(vpts.xMin), yScale(vpts.yMax), zScale(vpts.zMin)),\n v(xScale(vpts.xMax), yScale(vpts.yMin), zScale(vpts.zMax)), v(xScale(vpts.xMax), yScale(vpts.yMax), zScale(vpts.zMax)),\n v(xScale(vpts.xMin), yScale(vpts.yMin), zScale(vpts.zMax)), v(xScale(vpts.xMin), yScale(vpts.yMax), zScale(vpts.zMax)),\n\n v(xScale(vpts.xCen), yScale(vpts.yMin), zScale(vpts.zMax)), v(xScale(vpts.xCen), yScale(vpts.yMax), zScale(vpts.zMax)),\n v(xScale(vpts.xCen), yScale(vpts.yMin), zScale(vpts.zMin)), v(xScale(vpts.xCen), yScale(vpts.yMax), zScale(vpts.zMin)),\n v(xScale(vpts.xMax), yScale(vpts.yMin), zScale(vpts.zCen)), v(xScale(vpts.xMax), yScale(vpts.yMax), zScale(vpts.zCen)),\n v(xScale(vpts.xMin), yScale(vpts.yMin), zScale(vpts.zCen)), v(xScale(vpts.xMin), yScale(vpts.yMax), zScale(vpts.zCen)),\n\n v(xScale(vpts.xMax), yScale(vpts.yMax), zScale(vpts.zMin)), v(xScale(vpts.xMax), yScale(vpts.yMax), zScale(vpts.zMax)),\n v(xScale(vpts.xMax), yScale(vpts.yMin), zScale(vpts.zMin)), v(xScale(vpts.xMax), yScale(vpts.yMin), zScale(vpts.zMax)),\n v(xScale(vpts.xMin), yScale(vpts.yMax), zScale(vpts.zMin)), v(xScale(vpts.xMin), yScale(vpts.yMax), zScale(vpts.zMax)),\n v(xScale(vpts.xMin), yScale(vpts.yMin), zScale(vpts.zMin)), v(xScale(vpts.xMin), yScale(vpts.yMin), zScale(vpts.zMax)),\n\n v(xScale(vpts.xMin), yScale(vpts.yCen), zScale(vpts.zMin)), v(xScale(vpts.xMin), yScale(vpts.yCen), zScale(vpts.zMax)),\n v(xScale(vpts.xMax), yScale(vpts.yCen), zScale(vpts.zMin)), v(xScale(vpts.xMax), yScale(vpts.yCen), zScale(vpts.zMax)),\n v(xScale(vpts.xCen), yScale(vpts.yMax), zScale(vpts.zMin)), v(xScale(vpts.xCen), yScale(vpts.yMax), zScale(vpts.zMin)),\n v(xScale(vpts.xCen), yScale(vpts.yMin), zScale(vpts.zMin)), v(xScale(vpts.xCen), yScale(vpts.yMin), zScale(vpts.zMax))\n\n );\n var lineMat = new THREE.LineBasicMaterial({\n color: 0x000000,\n lineWidth: 1\n });\n var line = new THREE.Line(lineGeo, lineMat);\n line.type = THREE.Lines;\n scatterPlot.add(line);\n\n var titleX = createText2D('-X');\n titleX.position.x = xScale(vpts.xMin) - 12,\n titleX.position.y = 5;\n scatterPlot.add(titleX);\n\n var valueX = createText2D(format(xExent[0]));\n valueX.position.x = xScale(vpts.xMin) - 12,\n valueX.position.y = -5;\n scatterPlot.add(valueX);\n\n var titleX = createText2D('X');\n titleX.position.x = xScale(vpts.xMax) + 12;\n titleX.position.y = 5;\n scatterPlot.add(titleX);\n\n var valueX = createText2D(format(xExent[1]));\n valueX.position.x = xScale(vpts.xMax) + 12,\n valueX.position.y = -5;\n scatterPlot.add(valueX);\n\n var titleY = createText2D('-Y');\n titleY.position.y = yScale(vpts.yMin) - 5;\n scatterPlot.add(titleY);\n\n var valueY = createText2D(format(yExent[0]));\n valueY.position.y = yScale(vpts.yMin) - 15,\n scatterPlot.add(valueY);\n\n var titleY = createText2D('Y');\n titleY.position.y = yScale(vpts.yMax) + 15;\n scatterPlot.add(titleY);\n\n var valueY = createText2D(format(yExent[1]));\n valueY.position.y = yScale(vpts.yMax) + 5,\n scatterPlot.add(valueY);\n\n var titleZ = createText2D('-Z ' + format(zExent[0]));\n titleZ.position.z = zScale(vpts.zMin) + 2;\n scatterPlot.add(titleZ);\n\n var titleZ = createText2D('Z ' + format(zExent[1]));\n titleZ.position.z = zScale(vpts.zMax) + 2;\n scatterPlot.add(titleZ);\n}", "copyIntoCoordinateSystem(otherSystem) {\n\t\tthrow new Error(\"Function 'copyIntoCoordinateSystem' must be implemented.\");\n\t}", "function init() {\n var con = this.b / this.a;\n this.es = 1 - con * con;\n if(!('x0' in this)){\n this.x0 = 0;\n }\n if(!('y0' in this)){\n this.y0 = 0;\n }\n this.e = Math.sqrt(this.es);\n if (this.lat_ts) {\n if (this.sphere) {\n this.k0 = Math.cos(this.lat_ts);\n }\n else {\n this.k0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n }\n else {\n if (!this.k0) {\n if (this.k) {\n this.k0 = this.k;\n }\n else {\n this.k0 = 1;\n }\n }\n }\n}", "_createTerrain() {\n // Map data creation\n // The map is a flat array of successive 3D coordinates (x, y, z).\n // It's defined by a number of points on its width : mapSubX\n // and a number of points on its height : mapSubZ\n \n var mapSubX = 200; // point number on X axis\n var mapSubZ = 200; // point number on Z axis\n var seed = 0.3; // seed\n var noiseScale = 0.03; // noise frequency\n var elevationScale = 1.0;\n noise.seed(seed);\n var mapData = new Float32Array(mapSubX * mapSubZ * 3); // x3 float values per point : x, y and z\n \n // SPMap with 3 object types\n var SPmapData = [];\n for ( var i = 0; i < this.terrainObjects.length; i++ ) {\n SPmapData.push([]);\n }\n \n for (var l = 0; l < mapSubZ; l++) {\n for (var w = 0; w < mapSubX; w++) {\n var x = (w - mapSubX * 0.5) * 2.0;\n var z = (l - mapSubZ * 0.5) * 2.0;\n var y = noise.simplex2(x * noiseScale, z * noiseScale); // altitude\n y *= (0.5 + y) * y * elevationScale;\n // objects of the map\n let index = l * mapSubX + w;\n // let's populate randomly\n if (Math.random() > 0.998) {\n let xp = x;\n let yp = y;\n let zp = z;\n \n let ry = Math.random() * 3.6;\n //let sx = 0.75 + Math.random()/2;\n let sx = 1;\n let sy = 0.75 + Math.random()/2;\n //let sz = 0.75 + Math.random()/2;\n let sz = 1;\n \n let type = index % this.terrainObjects.length;\n SPmapData[index % this.terrainObjects.length].push(xp, yp, zp, 0, ry, 0, sx, sy, sz);\n }\n \n mapData[3 *(l * mapSubX + w)] = x;\n mapData[3 * (l * mapSubX + w) + 1] = y;\n mapData[3 * (l * mapSubX + w) + 2] = z;\n \n }\n }\n \n this.sps = new BABYLON.SolidParticleSystem(\"sps\", this.world.scene, {useModelMaterial: true});\n for ( var i = 0; i < this.terrainObjects.length; i++ ) {\n this.sps.addShape(this.terrainObjects[i], 100);\n }\n this.sps.buildMesh();\n \n // Dynamic Terrain\n // ===============\n var terrainSub = 100; // 100 terrain subdivisions\n var params = {\n mapData: mapData, // data map declaration : what data to use ?\n mapSubX: mapSubX, // how are these data stored by rows and columns\n mapSubZ: mapSubZ,\n terrainSub: terrainSub, // how many terrain subdivisions wanted\n SPmapData: SPmapData, // Object map\n sps: this.sps\n }\n this.terrain = new BABYLON.DynamicTerrain(\"terrain\", params, this.world.scene);\n this.terrain.mesh.material = this.terrainMaterial;\n // https://www.html5gamedevs.com/topic/35066-babylonjs-dynamic-terrain-collision-fps-issue/\n // the most efficient way to check collisions with a dynamic terrain or any BJS Ground objects\n // (although they aren't the same) keeps to use the methods\n // getHeightAtCoordinates(x, z) and getNormalAtCoordinates(x, z)\n // or getHeithFromMap(x, z) and getNormalFromMap(x, z)\n // depending on the object class\n this.terrain.mesh.checkCollisions = this.checkCollisions;\n \n this.terrain.update(true);\n console.log('Terrain created');\n }", "Paraboloid(){\n\t\tlet parab = Math.pow(this.x,2) + Math.pow(this.y, 2); \n\t\treturn parab; \n\t}", "function computeLocation(t){\n var coordinates = []\n coordinates.push(origin[0]);\n coordinates.push(origin[1]);\n for(var i=0;i<n;i++){\n var radius = screenHeight/(radMult*((i+1)**radExp));\n //var radius = radiusMultiplyer/(p**(i));\n var theta;\n if(t[i]){\n theta = 2*Math.PI*t[i]/p;\n }\n else{\n theta = 0;\n }\n coordinates[0] += radius*Math.cos(-theta);\n coordinates[1] += radius*Math.sin(-theta);\n }\n return coordinates;\n}", "function YGps_set_coordSystem(newval)\n { var rest_val;\n rest_val = String(newval);\n return this._setAttr('coordSystem',rest_val);\n }", "givePosition() {\n let v = createVector(this.x, this.y);\n return v;\n }", "function createCoords(svgid,parameters) {\r\n\tthis.svgid = svgid;\r\n\tthis.id = svgid+'_coords';\r\n\tthis.svg = document.getElementById(svgid);\r\n\tthis.fontSize = parseFloat(getComputedStyle(this.svg).fontSize);\r\n\tlet rem = this.fontSize;\r\n\tlet re = new RegExp(\"rem\");\r\n\t\r\n\t\t// MARGINS\r\n\tlet margin = new Array();\r\n\tlet marginTop,marginRight,marginBottom,marginLeft;\t\r\n\tif( parameters['margin'] != undefined ) { margin = parameters['margin']; }\t\r\n\tmarginTop = re.test(margin[0]) ? parseFloat(margin[0])*rem : parseFloat(margin[0]);\r\n\tmarginRight = re.test(margin[1]) ? parseFloat(margin[1])*rem : parseFloat(margin[1]);\r\n\tmarginBottom = re.test(margin[2]) ? parseFloat(margin[2])*rem : parseFloat(margin[2]);\r\n\tmarginLeft = re.test(margin[3]) ? parseFloat(margin[3])*rem : parseFloat(margin[3]);\r\n\tmargin = [marginTop,marginRight,marginBottom,marginLeft];\r\n\tthis.margin = margin;\r\n\tthis.marginTop = marginTop; this.marginRight = marginRight; this.marginBottom = marginBottom; this.marginLeft = marginLeft;\r\n\t\r\n\t\t// svg area [min-u,max-v,width,height] of the plotBox\t\t\r\n\tthis.plotBox = [marginLeft,marginTop,this.svg.clientWidth-(marginRight+marginLeft),this.svg.clientHeight-(marginTop+marginBottom)];\r\n\t\t// svg coordinate Range\r\n\tthis.uMin = this.plotBox[0];\r\n\tthis.uMax = this.plotBox[0]+this.plotBox[2];\r\n\tthis.vMin = this.plotBox[1];\r\n\tthis.vMax = this.plotBox[1]+this.plotBox[3];\t\r\n \r\n\tthis.defineCoords(parameters);\r\n\t\r\n\t // define two special groups for this coordinate system\r\n var g1 = document.createElementNS('http://www.w3.org/2000/svg', 'g');\r\n var g2 = document.createElementNS('http://www.w3.org/2000/svg', 'g');\r\n\t\r\n /* this.g1.id = this.id+'_g1'; this.g2.id = this.id+'_g2'; */\r\n this.svg.g1 = g1; // default for plots\r\n this.svg.g2 = g2; // default for axes\r\n this.svg.appendChild(g2);\r\n this.svg.appendChild(g1);\r\n\t\r\n\tif( parameters['clip'] == true ) { this.plotObject('clip',{'x1':this.xMin,'x2':this.xMax,'y1':this.yMin,'y2':this.yMax}); }\r\n} // END function createCoords()", "mapCoordsToNode(x, y) {\n\n\t}", "function PolarCoordinates() {\r\n}", "_createMesh() {\n var element = this._element;\n var w = element.calculatedWidth;\n var h = element.calculatedHeight;\n\n var r = this._rect;\n\n // Note that when creating a typed array, it's initialized to zeros.\n // Allocate memory for 4 vertices, 8 floats per vertex, 4 bytes per float.\n var vertexData = new ArrayBuffer(4 * 8 * 4);\n var vertexDataF32 = new Float32Array(vertexData);\n\n // Vertex layout is: PX, PY, PZ, NX, NY, NZ, U, V\n // Since the memory is zeroed, we will only set non-zero elements\n\n // POS: 0, 0, 0\n vertexDataF32[5] = 1; // NZ\n vertexDataF32[6] = r.x; // U\n vertexDataF32[7] = r.y; // V\n\n // POS: w, 0, 0\n vertexDataF32[8] = w; // PX\n vertexDataF32[13] = 1; // NZ\n vertexDataF32[14] = r.x + r.z; // U\n vertexDataF32[15] = r.y; // V\n\n // POS: w, h, 0\n vertexDataF32[16] = w; // PX\n vertexDataF32[17] = h; // PY\n vertexDataF32[21] = 1; // NZ\n vertexDataF32[22] = r.x + r.z; // U\n vertexDataF32[23] = r.y + r.w; // V\n\n // POS: 0, h, 0\n vertexDataF32[25] = h; // PY\n vertexDataF32[29] = 1; // NZ\n vertexDataF32[30] = r.x; // U\n vertexDataF32[31] = r.y + r.w; // V\n\n var vertexDesc = [\n { semantic: SEMANTIC_POSITION, components: 3, type: TYPE_FLOAT32 },\n { semantic: SEMANTIC_NORMAL, components: 3, type: TYPE_FLOAT32 },\n { semantic: SEMANTIC_TEXCOORD0, components: 2, type: TYPE_FLOAT32 }\n ];\n\n var device = this._system.app.graphicsDevice;\n var vertexFormat = new VertexFormat(device, vertexDesc);\n var vertexBuffer = new VertexBuffer(device, vertexFormat, 4, BUFFER_STATIC, vertexData);\n\n var mesh = new Mesh(device);\n mesh.vertexBuffer = vertexBuffer;\n mesh.primitive[0].type = PRIMITIVE_TRIFAN;\n mesh.primitive[0].base = 0;\n mesh.primitive[0].count = 4;\n mesh.primitive[0].indexed = false;\n mesh.aabb.setMinMax(Vec3.ZERO, new Vec3(w, h, 0));\n\n this._updateMesh(mesh);\n\n return mesh;\n }", "function generateCoordinates() {\n\tvar latitude = function(){\n\t\tfor (i = 0; i<=loopCount; i++) {\n\t\tvar lat = numGen(80, -80, 3);\n\t\tmarkerArray[i] = {};\n\t\tmarkerArray[i].latitude = lat;\n\t}};\n\tvar longitude = function(){\n\t\tfor (i = 0; i<=loopCount; i++) {\n\t\tvar long = numGen(-180, 180, 3);\n\t\tmarkerArray[i].longitude = long;\n\t}};\n\t// generate sprite coordinates\n\tlatitude();\n\tlongitude();\n}", "function Cluster () {\n const _polygons = []\n const _processors = []\n const _disposableProcessors = []\n\n this.add = (vectors, color) => {\n _polygons.push(new Polygon(vectors, color))\n }\n\n // Interface for adding processors (not disposable by default)\n this.use = (fn, disposable) => {\n if (disposable) {\n _disposableProcessors.push(fn)\n } else {\n _processors.push(fn)\n }\n }\n\n // Interface for adding transforms (disposable by default)\n this.transform = (fn, disposable) => {\n this.use(processors.transform(fn), disposable || true)\n }\n\n // Apply transforms and processors\n this.apply = () => {\n _disposableProcessors.forEach(fn => fn(_polygons))\n _disposableProcessors.length = 0\n\n _processors.forEach(fn => fn(_polygons))\n }\n\n // These are shortcuts for adding transforms and processors\n this.zsort = observer => {\n this.use(processors.zsort(observer))\n return this\n }\n\n this.center = location => {\n this.use(processors.center(location))\n return this\n }\n\n this.scale = scale => {\n this.transform(transforms.scale(scale))\n return this\n }\n\n this.transpose = offset => {\n this.transform(transforms.transpose(offset))\n return this\n }\n\n this.shading = (source, intensity, observer) => {\n this.use(processors.transform(transforms.shading(source, intensity, observer)))\n return this\n }\n\n this.rotate = rotation => {\n this.transform(transforms.rotate(rotation))\n return this\n }\n\n this.cuboid = (location, size, color) => {\n templates.cuboid(location, size, color)(this.add)\n }\n }", "function PerspectiveTransform( a11, a21, a31, a12, a22, a32, a13, a23, a33)\r\n{\r\n\tthis.a11 = a11;\r\n\tthis.a12 = a12;\r\n\tthis.a13 = a13;\r\n\tthis.a21 = a21;\r\n\tthis.a22 = a22;\r\n\tthis.a23 = a23;\r\n\tthis.a31 = a31;\r\n\tthis.a32 = a32;\r\n\tthis.a33 = a33;\r\n\tthis.transformPoints1=function( points)\r\n\t\t{\r\n\t\t\tvar max = points.length;\r\n\t\t\tvar a11 = this.a11;\r\n\t\t\tvar a12 = this.a12;\r\n\t\t\tvar a13 = this.a13;\r\n\t\t\tvar a21 = this.a21;\r\n\t\t\tvar a22 = this.a22;\r\n\t\t\tvar a23 = this.a23;\r\n\t\t\tvar a31 = this.a31;\r\n\t\t\tvar a32 = this.a32;\r\n\t\t\tvar a33 = this.a33;\r\n\t\t\tfor (var i = 0; i < max; i += 2)\r\n\t\t\t{\r\n\t\t\t\tvar x = points[i];\r\n\t\t\t\tvar y = points[i + 1];\r\n\t\t\t\tvar denominator = a13 * x + a23 * y + a33;\r\n\t\t\t\tpoints[i] = (a11 * x + a21 * y + a31) / denominator;\r\n\t\t\t\tpoints[i + 1] = (a12 * x + a22 * y + a32) / denominator;\r\n\t\t\t}\r\n\t\t}\r\n\tthis. transformPoints2=function(xValues, yValues)\r\n\t\t{\r\n\t\t\tvar n = xValues.length;\r\n\t\t\tfor (var i = 0; i < n; i++)\r\n\t\t\t{\r\n\t\t\t\tvar x = xValues[i];\r\n\t\t\t\tvar y = yValues[i];\r\n\t\t\t\tvar denominator = this.a13 * x + this.a23 * y + this.a33;\r\n\t\t\t\txValues[i] = (this.a11 * x + this.a21 * y + this.a31) / denominator;\r\n\t\t\t\tyValues[i] = (this.a12 * x + this.a22 * y + this.a32) / denominator;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\tthis.buildAdjoint=function()\r\n\t\t{\r\n\t\t\t// Adjoint is the transpose of the cofactor matrix:\r\n\t\t\treturn new PerspectiveTransform(this.a22 * this.a33 - this.a23 * this.a32, this.a23 * this.a31 - this.a21 * this.a33, this.a21 * this.a32 - this.a22 * this.a31, this.a13 * this.a32 - this.a12 * this.a33, this.a11 * this.a33 - this.a13 * this.a31, this.a12 * this.a31 - this.a11 * this.a32, this.a12 * this.a23 - this.a13 * this.a22, this.a13 * this.a21 - this.a11 * this.a23, this.a11 * this.a22 - this.a12 * this.a21);\r\n\t\t}\r\n\tthis.times=function( other)\r\n\t\t{\r\n\t\t\treturn new PerspectiveTransform(this.a11 * other.a11 + this.a21 * other.a12 + this.a31 * other.a13, this.a11 * other.a21 + this.a21 * other.a22 + this.a31 * other.a23, this.a11 * other.a31 + this.a21 * other.a32 + this.a31 * other.a33, this.a12 * other.a11 + this.a22 * other.a12 + this.a32 * other.a13, this.a12 * other.a21 + this.a22 * other.a22 + this.a32 * other.a23, this.a12 * other.a31 + this.a22 * other.a32 + this.a32 * other.a33, this.a13 * other.a11 + this.a23 * other.a12 +this.a33 * other.a13, this.a13 * other.a21 + this.a23 * other.a22 + this.a33 * other.a23, this.a13 * other.a31 + this.a23 * other.a32 + this.a33 * other.a33);\r\n\t\t}\r\n\r\n}", "function ManifoldPoint() {\n\n // Whether this manifold point is persisting or not.\n this.warmStarted = false;\n // The position of this manifold point.\n this.position = new _Vec.Vec3();\n // The position in the first shape's coordinate.\n this.localPoint1 = new _Vec.Vec3();\n // The position in the second shape's coordinate.\n this.localPoint2 = new _Vec.Vec3();\n // The normal vector of this manifold point.\n this.normal = new _Vec.Vec3();\n // The tangent vector of this manifold point.\n this.tangent = new _Vec.Vec3();\n // The binormal vector of this manifold point.\n this.binormal = new _Vec.Vec3();\n // The impulse in normal direction.\n this.normalImpulse = 0;\n // The impulse in tangent direction.\n this.tangentImpulse = 0;\n // The impulse in binormal direction.\n this.binormalImpulse = 0;\n // The denominator in normal direction.\n this.normalDenominator = 0;\n // The denominator in tangent direction.\n this.tangentDenominator = 0;\n // The denominator in binormal direction.\n this.binormalDenominator = 0;\n // The depth of penetration.\n this.penetration = 0;\n}", "update_positions() {\n let positions = this.vertex_positions;\n for (var i = 0; i < this.vertices.length; i++) {\n positions[i * 3] = this.vertices[i].x;\n positions[i * 3 + 1] = this.vertices[i].y;\n positions[i * 3 + 2] = this.vertices[i].z;\n }\n this.attributes.position.needsUpdate = true;\n }", "calculateVertices()\n {\n if (this._transformID === this.transform._worldID && this._textureID === this._texture._updateID)\n {\n return;\n }\n\n this._transformID = this.transform._worldID;\n this._textureID = this._texture._updateID;\n\n // set the vertex data\n\n const texture = this._texture;\n const wt = this.transform.worldTransform;\n const a = wt.a;\n const b = wt.b;\n const c = wt.c;\n const d = wt.d;\n const tx = wt.tx;\n const ty = wt.ty;\n const vertexData = this.vertexData;\n const trim = texture.trim;\n const orig = texture.orig;\n let w0 = 0;\n let w1 = 0;\n let h0 = 0;\n let h1 = 0;\n\n if (trim)\n {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (this.anchor._x * orig.width);\n w0 = w1 + trim.width;\n\n h1 = trim.y - (this.anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else\n {\n w0 = orig.width * (1 - this.anchor._x);\n w1 = orig.width * -this.anchor._x;\n\n h0 = orig.height * (1 - this.anchor._y);\n h1 = orig.height * -this.anchor._y;\n }\n\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n }", "function setGeometry(gl) {\n var positions = new Float32Array([\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung right\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // right of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // right of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0]);\n\n // Center the F around the origin and Flip it around. We do this because\n // we're in 3D now with and +Y is up where as before when we started with 2D\n // we had +Y as down.\n\n // We could do by changing all the values above but I'm lazy.\n // We could also do it with a matrix at draw time but you should\n // never do stuff at draw time if you can do it at init time.\n var matrix = m4.xRotation(Math.PI);\n matrix = m4.translate(matrix, -50, -75, -15);\n\n for (var ii = 0; ii < positions.length; ii += 3) {\n var vector = m4.transformPoint(matrix, [positions[ii + 0], positions[ii + 1], positions[ii + 2], 1]);\n positions[ii + 0] = vector[0];\n positions[ii + 1] = vector[1];\n positions[ii + 2] = vector[2];\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n}", "function translate_coordinates(trans_option,porg) {\n with(Math) { \n var xx,yy,r,ct,st,angle;\n angle = DEG_TO_RADIANS(porg.rotation_angle_degs);\n if( trans_option == XY_TO_LL) {\n /* X,Y to Lat/Lon Coordinate Translation */\n pxpos_mtrs = porg.x; \n pypos_mtrs = porg.y;\n xx = pxpos_mtrs - porg.xoffset_mtrs;\n yy = pypos_mtrs - porg.yoffset_mtrs;\n r = sqrt(xx*xx + yy*yy);\n\n if(r) {\n ct = xx/r;\n st = yy/r;\n xx = r * ( (ct * cos(angle))+ (st * sin(angle)) );\n yy = r * ( (st * cos(angle))- (ct * sin(angle)) );\n }\n\n var plon = porg.olon + xx/METERS_DEGLON(porg.olat);\n var plat = porg.olat + yy/METERS_DEGLAT(porg.olat);\n\n //if plon or plat are above max values, find where it would be\n while(plon < -180){\n plon +=360;\n }\n while (plon > 180){\n plon -= 360;\n }\n while(plat < -90){\n plat +=180;\n }\n while (plat > 90){\n plat -= 180;\n }\n \n var sll={};\n sll={slat:plat, slon:plon};\n\n return(sll);\n\n } else if(trans_option == LL_TO_XY) {\n\n xx = (porg.slon - porg.olon)*METERS_DEGLON(porg.olat);\n yy = (porg.slat - porg.olat)*METERS_DEGLAT(porg.olat);\n\n r = sqrt(xx*xx + yy*yy);\n\n /* alert('LL_TO_XY: xx=' + xx + ' yy=' + yy + ' r=' + r);\n return false;*/\n\n if(r){\n ct = xx/r;\n st = yy/r;\n xx = r * ( (ct * cos(angle)) + (st * sin(angle)) );\n yy = r * ( (st * cos(angle)) - (ct * sin(angle)) );\n }\n\n pxpos_mtrs = xx + porg.xoffset_mtrs;\n pypos_mtrs = yy + porg.yoffset_mtrs;\n\n var sxy={};\n sxy={x:pxpos_mtrs, y:pypos_mtrs};\n\n return(sxy);\n }\n }\n}", "function computeCenters() {\n centers = [];\n var x = 150;\n var y = 75;\n var yd = 50;\n var xd = 100;\n switch (shape) {\n case \"9-TS\":\n centers = [\n [50,25], [150,25], [250,25], [250,75], [250,125], [150,125], [50,125], [50,75], [x,y]\n ];\n break;\n case \"quad\":\n centers = [\n [50,25], [250,25], [250,125], [50,125], [50,25], [150,75] \n ];\n break;\n case \"qent\":\n centers = [\n [x, y-yd], \n [x+(yd*zr('s',2)), y+(yd*zr('c',2))],\n [x+(yd*zr('s',4)), y-(yd*zr('c',1))],\n [x-(yd*zr('s',4)), y-(yd*zr('c',1))],\n [x-(yd*zr('s',2)), y+(yd*zr('c',2))],\n [x, y]\n ];\n break;\n case \"pent\":\n centers = [\n [x, y-yd], \n [x+(xd*zr('s',2)), y+(yd*zr('c',2))],\n [x+(xd*zr('s',4)), y-(yd*zr('c',1))],\n [x-(xd*zr('s',4)), y-(yd*zr('c',1))],\n [x-(xd*zr('s',2)), y+(yd*zr('c',2))],\n [x, y]\n ];\n break;\n }\n}", "calculateVertices() {\n var texture = this._texture;\n if (this._transformID === this.transform._worldID && this._textureID === texture._updateID) {\n return;\n }\n this._transformID = this.transform._worldID;\n this._textureID = texture._updateID;\n // set the vertex data\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n var trim = texture.trim;\n var orig = texture.orig;\n var anchor = this._anchor;\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (anchor._x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w1 = -anchor._x * orig.width;\n w0 = w1 + orig.width;\n h1 = -anchor._y * orig.height;\n h0 = h1 + orig.height;\n }\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n if (this._roundPixels) {\n for (var i = 0; i < 8; i++) {\n vertexData[i] = Math.round(vertexData[i]);\n }\n }\n }", "function init() {\n\n if (Math.abs(this.lat1 + this.lat2) < __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */]) {\n return;\n }\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e3 = Math.sqrt(this.es);\n\n this.sin_po = Math.sin(this.lat1);\n this.cos_po = Math.cos(this.lat1);\n this.t1 = this.sin_po;\n this.con = this.sin_po;\n this.ms1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n this.qs1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat2);\n this.cos_po = Math.cos(this.lat2);\n this.t2 = this.sin_po;\n this.ms2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n this.qs2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat0);\n this.cos_po = Math.cos(this.lat0);\n this.t3 = this.sin_po;\n this.qs0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n\n if (Math.abs(this.lat1 - this.lat2) > __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */]) {\n this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);\n }\n else {\n this.ns0 = this.con;\n }\n this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;\n this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;\n}", "function CreateCoordArray() {\n let xR = 0,\n yR = 19;\n let i = 0,\n j = 0;\n for (let y = 9; y <= 446; y += 23) {\n for (let x = 11; x <= 264; x += 23) {\n coordinateArray[i][j] = new Coordinates(x, y);\n i++;\n }\n j++;\n i = 0;\n }\n}", "function cs_geocentric_to_geodetic (cs, p) {\n\n var X =p.x;\n var Y = p.y;\n var Z = p.z;\n var Longitude;\n var Latitude;\n var Height;\n\n var W; /* distance from Z axis */\n var W2; /* square of distance from Z axis */\n var T0; /* initial estimate of vertical component */\n var T1; /* corrected estimate of vertical component */\n var S0; /* initial estimate of horizontal component */\n var S1; /* corrected estimate of horizontal component */\n var Sin_B0; /* Math.sin(B0), B0 is estimate of Bowring aux variable */\n var Sin3_B0; /* cube of Math.sin(B0) */\n var Cos_B0; /* Math.cos(B0) */\n var Sin_p1; /* Math.sin(phi1), phi1 is estimated latitude */\n var Cos_p1; /* Math.cos(phi1) */\n var Rn; /* Earth radius at location */\n var Sum; /* numerator of Math.cos(phi1) */\n var At_Pole; /* indicates location is in polar region */\n\n X = parseFloat(X); // cast from string to float\n Y = parseFloat(Y);\n Z = parseFloat(Z);\n\n At_Pole = false;\n if (X != 0.0)\n {\n Longitude = Math.atan2(Y,X);\n }\n else\n {\n if (Y > 0)\n {\n Longitude = HALF_PI;\n }\n else if (Y < 0)\n {\n Longitude = -HALF_PI;\n }\n else\n {\n At_Pole = true;\n Longitude = 0.0;\n if (Z > 0.0)\n { /* north pole */\n Latitude = HALF_PI;\n }\n else if (Z < 0.0)\n { /* south pole */\n Latitude = -HALF_PI;\n }\n else\n { /* center of earth */\n Latitude = HALF_PI;\n Height = -cs.b;\n return;\n }\n }\n }\n W2 = X*X + Y*Y;\n W = Math.sqrt(W2);\n T0 = Z * AD_C;\n S0 = Math.sqrt(T0 * T0 + W2);\n Sin_B0 = T0 / S0;\n Cos_B0 = W / S0;\n Sin3_B0 = Sin_B0 * Sin_B0 * Sin_B0;\n T1 = Z + cs.b * cs.ep2 * Sin3_B0;\n Sum = W - cs.a * cs.es * Cos_B0 * Cos_B0 * Cos_B0;\n S1 = Math.sqrt(T1*T1 + Sum * Sum);\n Sin_p1 = T1 / S1;\n Cos_p1 = Sum / S1;\n Rn = cs.a / Math.sqrt(1.0 - cs.es * Sin_p1 * Sin_p1);\n if (Cos_p1 >= COS_67P5)\n {\n Height = W / Cos_p1 - Rn;\n }\n else if (Cos_p1 <= -COS_67P5)\n {\n Height = W / -Cos_p1 - Rn;\n }\n else\n {\n Height = Z / Sin_p1 + Rn * (cs.es - 1.0);\n }\n if (At_Pole == false)\n {\n Latitude = Math.atan(Sin_p1 / Cos_p1);\n }\n\n p.x = Longitude;\n p.y =Latitude;\n p.z = Height;\n return 0;\n}", "function forward(p) {\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lon - this.long0);\n var con;\n var x, y;\n var sin_phi = Math.sin(lat);\n var cos_phi = Math.cos(lat);\n\n if (!this.es) {\n var b = cos_phi * Math.sin(delta_lon);\n\n if ((Math.abs(Math.abs(b) - 1)) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return (93);\n }\n else {\n x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;\n y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));\n b = Math.abs(y);\n\n if (b >= 1) {\n if ((b - 1) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return (93);\n }\n else {\n y = 0;\n }\n }\n else {\n y = Math.acos(y);\n }\n\n if (lat < 0) {\n y = -y;\n }\n\n y = this.a * this.k0 * (y - this.lat0) + this.y0;\n }\n }\n else {\n var al = cos_phi * delta_lon;\n var als = Math.pow(al, 2);\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var tq = Math.abs(cos_phi) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"] ? Math.tan(lat) : 0;\n var t = Math.pow(tq, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n al = al / Math.sqrt(con);\n var ml = Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat, sin_phi, cos_phi, this.en);\n\n x = this.a * (this.k0 * al * (1 +\n als / 6 * (1 - t + c +\n als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c +\n als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) +\n this.x0;\n\n y = this.a * (this.k0 * (ml - this.ml0 +\n sin_phi * delta_lon * al / 2 * (1 +\n als / 12 * (5 - t + 9 * c + 4 * cs +\n als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c +\n als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) +\n this.y0;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n}", "function calculateCoordinatesForTiles(){\n var coordinates = {},\n\t\tc2 = new Cesium.Cartesian2(0, 0)\n \tleftTop = scene.camera.pickEllipsoid(c2)\n c2 = new Cesium.Cartesian2(canvas.width, canvas.height)\n var rightDown = scene.camera.pickEllipsoid(c2)\n\n if (leftTop != null && rightDown != null) {\n coordinates.leftTop = Cesium.Ellipsoid.WGS84.cartesianToCartographic(leftTop)\n coordinates.rightDown = Cesium.Ellipsoid.WGS84.cartesianToCartographic(rightDown)\n console.log(\"min lat/long - \", coordinates.leftTop.latitude, coordinates.leftTop.longitude)\n console.log(\"max lat/long - \", coordinates.rightDown.latitude, coordinates.rightDown.longitude)\n\n\t\treturn coordinates\n } else {\n //The sky is visible in 3D\n return null\n }\n}", "constructor() {\n super(\"position\", \"normal\", \"texture_coord\");\n\n this.arrays.position.push(Vec.of(0, 0, 0));\n for (let i = 0; i < 11; i++) {\n const spin = Mat4.rotation(i * 2 * Math.PI / 10, Vec.of(0, 0, -1));\n\n const radius = i % 2 ? 4 : 7;\n const new_point = spin.times(Vec.of(0, radius, 0, 1)).to3();\n\n this.arrays.position.push(new_point);\n if (i > 0)\n this.indices.push(0, i, i + 1)\n }\n\n this.arrays.normal = this.arrays.position.map(p => Vec.of(0, 0, -1));\n this.arrays.texture_coord = this.arrays.position.map(p => Vec.of((p[0] + 7) / 14, (p[1] + 7) / 14));\n }", "function createNewCoordinate() {\n var randCoordArr = generateXY();\n coordinates = new CurrentPicturePosition(randCoordArr[0], randCoordArr[1]);\n}", "getCoords() {\n return [this.x, this.y, this.z];\n }", "initGrid(){\n \n let vertex;\n let vertices = [];\n let vertex_data;\n let col_len = grid.column_n;\n let row_len = grid.row_n;\n\n // Outer loop to create parent\n // mod gives you column\n // division gives you row\n // calculations are not 0 index\n for ( let i = 0; i < grid.n; i++ ) {\n\n vertex_data = { };\n\n if( grid.begin_i === i ){ // IF AT BEGIN\n vertex_data.name = \"vertex begin-pos pos pos-\" + grid.begin_i + \" item-\" + i;\n vertex_data.id = \"vertex-\" + i;\n vertex_data.distance = 0;\n }else if( grid.target_i === i ){ // IF AT TARGET\n vertex_data.name = \"vertex target-pos item-\" + i;\n vertex_data.distance = INFINITY;\n vertex_data.id = \"vertex-\" + i;\n }\n else{ //IF VANILLA VERTEX\n vertex_data.name = \"vertex item-\" + i ;\n vertex_data.distance = INFINITY;\n vertex_data.id = \"vertex-\" + i;\n }\n\n //ADD WEIGHTS\n if( i % col_len === 0 ) //LEFT\n vertex_data.left = -1;\n else\n vertex_data.left = 1;\n\n if( ( i % col_len ) === ( col_len - 1 ) ) //RIGHT\n vertex_data.right = -1;\n else\n vertex_data.right = 1;\n\n if( Math.floor( i / col_len ) === ( 0 ) ) //UPPER\n vertex_data.top = -1;\n else\n vertex_data.top = 1;\n\n if( Math.floor( i / col_len ) >= ( row_len-1 ) ) //LOWER\n vertex_data.bottom = -1;\n else\n vertex_data.bottom = 1;\n\n vertex = <Vertex \n name={vertex_data.name}\n key={i}\n index={i}\n id={vertex_data.id}\n /> \n\n vertices.push( vertex );\n\n grid.vertex_data.push({\n index: i,\n visited_via: \"\",\n cost: vertex_data.distance,\n left: vertex_data.left,\n right: vertex_data.right,\n top: vertex_data.top,\n bottom: vertex_data.bottom,\n });\n }\n\n //ADD TO STATE-STORE FOR RENDER()\n this.setState( (state,props) => {\n return { vertices: [...vertices] }\n });\n }", "function GridPosition(nx, ny, nz) {\n \"use strict\";\n this.nx = nx;\n this.ny = ny;\n this.nz = nz;\n}", "function test_crosshair_op_cluster_vsphere65() {}", "constructor(num_particles) {\n super(\"position\", \"normal\", \"texture_coord\", \"offset\");\n // Loop 3 times (for each axis), and inside loop twice (for opposing cube sides):\n for (let i = 0; i < num_particles; i++) {\n defs.Square.insert_transformed_copy_into(this, [9], Mat4.identity());\n }\n const offsets = Array(num_particles).fill(0).map(x=>vec3(0,0.1,0).randomized(0.1));\n this.arrays.offset = this.arrays.position.map((x, i)=> offsets[~~(i/4)]);\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n }", "_coord(arr) {\n var a = arr[0], d = arr[1], b = arr[2];\n var sum, pos = [0, 0];\n sum = a + d + b;\n if (sum !== 0) {\n a /= sum;\n d /= sum;\n b /= sum;\n pos[0] = corners[0][0] * a + corners[1][0] * d + corners[2][0] * b;\n pos[1] = corners[0][1] * a + corners[1][1] * d + corners[2][1] * b;\n }\n return pos;\n }", "function PerspectiveTransform( a11, a21, a31, a12, a22, a32, a13, a23, a33)\n{\n\tthis.a11 = a11;\n\tthis.a12 = a12;\n\tthis.a13 = a13;\n\tthis.a21 = a21;\n\tthis.a22 = a22;\n\tthis.a23 = a23;\n\tthis.a31 = a31;\n\tthis.a32 = a32;\n\tthis.a33 = a33;\n\tthis.transformPoints1=function( points)\n\t\t{\n\t\t\tvar max = points.length;\n\t\t\tvar a11 = this.a11;\n\t\t\tvar a12 = this.a12;\n\t\t\tvar a13 = this.a13;\n\t\t\tvar a21 = this.a21;\n\t\t\tvar a22 = this.a22;\n\t\t\tvar a23 = this.a23;\n\t\t\tvar a31 = this.a31;\n\t\t\tvar a32 = this.a32;\n\t\t\tvar a33 = this.a33;\n\t\t\tfor (var i = 0; i < max; i += 2)\n\t\t\t{\n\t\t\t\tvar x = points[i];\n\t\t\t\tvar y = points[i + 1];\n\t\t\t\tvar denominator = a13 * x + a23 * y + a33;\n\t\t\t\tpoints[i] = (a11 * x + a21 * y + a31) / denominator;\n\t\t\t\tpoints[i + 1] = (a12 * x + a22 * y + a32) / denominator;\n\t\t\t}\n\t\t}\n\tthis. transformPoints2=function(xValues, yValues)\n\t\t{\n\t\t\tvar n = xValues.length;\n\t\t\tfor (var i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tvar x = xValues[i];\n\t\t\t\tvar y = yValues[i];\n\t\t\t\tvar denominator = this.a13 * x + this.a23 * y + this.a33;\n\t\t\t\txValues[i] = (this.a11 * x + this.a21 * y + this.a31) / denominator;\n\t\t\t\tyValues[i] = (this.a12 * x + this.a22 * y + this.a32) / denominator;\n\t\t\t}\n\t\t}\n\n\tthis.buildAdjoint=function()\n\t\t{\n\t\t\t// Adjoint is the transpose of the cofactor matrix:\n\t\t\treturn new PerspectiveTransform(this.a22 * this.a33 - this.a23 * this.a32, this.a23 * this.a31 - this.a21 * this.a33, this.a21 * this.a32 - this.a22 * this.a31, this.a13 * this.a32 - this.a12 * this.a33, this.a11 * this.a33 - this.a13 * this.a31, this.a12 * this.a31 - this.a11 * this.a32, this.a12 * this.a23 - this.a13 * this.a22, this.a13 * this.a21 - this.a11 * this.a23, this.a11 * this.a22 - this.a12 * this.a21);\n\t\t}\n\tthis.times=function( other)\n\t\t{\n\t\t\treturn new PerspectiveTransform(this.a11 * other.a11 + this.a21 * other.a12 + this.a31 * other.a13, this.a11 * other.a21 + this.a21 * other.a22 + this.a31 * other.a23, this.a11 * other.a31 + this.a21 * other.a32 + this.a31 * other.a33, this.a12 * other.a11 + this.a22 * other.a12 + this.a32 * other.a13, this.a12 * other.a21 + this.a22 * other.a22 + this.a32 * other.a23, this.a12 * other.a31 + this.a22 * other.a32 + this.a32 * other.a33, this.a13 * other.a11 + this.a23 * other.a12 +this.a33 * other.a13, this.a13 * other.a21 + this.a23 * other.a22 + this.a33 * other.a23, this.a13 * other.a31 + this.a23 * other.a32 + this.a33 * other.a33);\n\t\t}\n\n}", "function ParaGeometry(parameter,scale)\n{\n var x = parameter.x*UnitOf(parameter.lunit)*scale; \n\tvar y = parameter.y*UnitOf(parameter.lunit)*scale; \n\tvar z = parameter.z*UnitOf(parameter.lunit)*scale; \n\tvar alpha = parameter.alpha*UnitOf(parameter.aunit)/UnitOf('deg');\n\tvar theta = parameter.theta*UnitOf(parameter.aunit)/UnitOf('deg');\n\tvar phi = parameter.phi*UnitOf(parameter.aunit)/UnitOf('deg'); \n\n var fDx = x/2;\n var fDy = y/2;\n var fDz = z/2;\n \n alpha=Math.min(alpha,360);\n alpha=Math.PI*alpha/180;\n\n theta=Math.min(theta,360);\n theta=Math.PI*theta/180;\n\n phi=Math.min(phi,180);\n phi=Math.PI*phi/180;\n\n var fTalpha = Math.tan(alpha);\n var fTthetaCphi = Math.tan(theta)*Math.cos(phi);\n var fTthetaSphi = Math.tan(theta)*Math.sin(phi);\n\n \tvar geometry = new THREE.Geometry();\n\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi-fDy*fTalpha-fDx, -fDz*fTthetaSphi-fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi-fDy*fTalpha+fDx, -fDz*fTthetaSphi-fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi+fDy*fTalpha-fDx, -fDz*fTthetaSphi+fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(-fDz*fTthetaCphi+fDy*fTalpha+fDx, -fDz*fTthetaSphi+fDy, -fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi-fDy*fTalpha-fDx, +fDz*fTthetaSphi-fDy, +fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi-fDy*fTalpha+fDx, +fDz*fTthetaSphi-fDy, +fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi+fDy*fTalpha-fDx, +fDz*fTthetaSphi+fDy, +fDz));\n geometry.vertices.push( new THREE.Vector3(+fDz*fTthetaCphi+fDy*fTalpha+fDx, +fDz*fTthetaSphi+fDy, +fDz));\n\n geometry.faces.push( new THREE.Face3(0,2,1) );\n geometry.faces.push( new THREE.Face3(2,3,1) );\n\n geometry.faces.push( new THREE.Face3(4,5,6) );\n geometry.faces.push( new THREE.Face3(5,7,6) );\n\n geometry.faces.push( new THREE.Face3(0,1,4) );\n geometry.faces.push( new THREE.Face3(1,5,4) );\n\n geometry.faces.push( new THREE.Face3(2,6,7) );\n geometry.faces.push( new THREE.Face3(7,3,2) );\n\n geometry.faces.push( new THREE.Face3(0,4,2) );\n geometry.faces.push( new THREE.Face3(4,6,2) );\n\n geometry.faces.push( new THREE.Face3(1,3,7) );\n geometry.faces.push( new THREE.Face3(7,5,1) );\n\n return geometry;\n\n}", "function composeLocalTransformations() {\n for (let i = 0; i < skeleton.nodesCount; i++) {\n if (skeleton.nodes[i].name != \"End Site\") {\n //localTransformations.addTransformation(identityMatrix);\n }\n }\n\n for (let i = 0; i < frames.count; i++) {\n //frames.data[i] = {};\n let tmpTransform = [];\n let endSiteCount = 0;\n for (let j = 0; j < skeleton.nodesCount; j++) {\n if (skeleton.nodes[j].name != 'End Site') {\n if (!skeleton.nodes[j].localTransform) {\n skeleton.nodes[j].localTransform = [];\n }\n let tmpData = transformationMatrix(skeleton.nodes[j].offset.x + motionValues.values[j - endSiteCount].tranX[i],\n skeleton.nodes[j].offset.y + motionValues.values[j - endSiteCount].tranY[i],\n skeleton.nodes[j].offset.z + motionValues.values[j - endSiteCount].tranZ[i],\n motionValues.values[j - endSiteCount].rotX[i],\n motionValues.values[j - endSiteCount].rotY[i],\n motionValues.values[j - endSiteCount].rotZ[i]);\n //tmpTransform.push(tmpData)\n skeleton.nodes[j].localTransform.push(tmpData);\n //localTransformations.addTransformation(tmpTransform);\n\n }\n else\n endSiteCount++;\n }\n //frames.localMatrix.push(tmpTransform);\n }\n composeGlobalTransformations();\n computeXYZ();\n console.log(frames);\n}", "function CreateCoordArray() {\n let xR = 0, yR = 19;\n let i = 0, j = 0;\n for (let y = 9; y <= 446; y += 23) {\n // 12 * 23 = 276 - 12 = 264 Max X value\n for (let x = 11; x <= 264; x += 23) {\n coordinateArray[i][j] = new Coordinates(x, y);\n // console.log(i + \":\" + j + \" = \" + coordinateArray[i][j].x + \":\" + coordinateArray[i][j].y);\n i++;\n }\n j++;\n i = 0;\n }\n}", "function loadGrid() {\n\n // Establishing View Delta\n var maxCorner = vec3.fromValues(0.01,-0.49,0.75); // bbox corner\n var minCorner = vec3.fromValues(0.99,1.49,0.85); // other corner\n var temp = vec3.create();\n viewDelta = vec3.length(vec3.subtract(temp,maxCorner,minCorner)) / 100; // set globalQ\n\n var triangles = [[0,1,2],[2,3,0]];\n var gridColor = [0.4,0.4,0.4];\n \n var y1 = 1.4; // min y\n var y2 = 1.5; // max y\n var lineThick = 0.005;\n\n var rows = 20;\n var cols = 10;\n\n numTriangleSets = rows * cols; // remember how many tri sets\n\n // For Each Set ...\n for (var rowNum = 0; rowNum < rows; rowNum++) {\n\n var x1 = 0.9; // min x\n var x2 = 1.0; // max x\n\n for (var colNum = 0; colNum < cols; colNum++) {\n\n var setNum = (rowNum * cols) + colNum;\n\n // Storing Centers, Translations, Axis \n centerArray[setNum] = vec3.fromValues(0,0,0);\n transArray[setNum] = vec3.fromValues(0,0,0);\n xAxisArray[setNum] = vec3.fromValues(1,0,0);\n yAxisArray[setNum] = vec3.fromValues(0,1,0);\n\n // Color \n colorArray[setNum] = gridColor;\n\n // Tris\n gridTriArray[setNum] = triangles;\n\n var vertices = [[x1 + lineThick, y1 + lineThick, 0.75], [x1 + lineThick, y2 - lineThick, 0.75], \n [x2 - lineThick, y2 - lineThick, 0.75], [x2 - lineThick, y1 + lineThick, 0.75]];\n\n gridVertexArray[setNum] = vertices; \n\n x1 = x1 - 0.1;\n x2 = x2 - 0.1;\n }\n\n y1 = y1 - 0.1;\n y2 = y2 - 0.1;\n }\n\n // Set Helper Variables\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var vtxToAdd; // vtx coords to add to the coord array\n var normToAdd; // vtx normal to add to the coord array\n var triToAdd; // tri indices to add to the index array\n \n // process each triangle set to load webgl vertex and triangle buffers\n for (var whichSet=0; whichSet<numTriangleSets; whichSet++) { // for each tri set\n\n // set up the vertex and normal arrays, define model center and axes\n var glVertices = []; // flat coord list for webgl\n\n var numVerts = gridVertexArray[whichSet].length; // num vertices in tri set\n\n for (whichSetVert=0; whichSetVert<numVerts; whichSetVert++) { // verts in set\n\n vtxToAdd = gridVertexArray[whichSet][whichSetVert]; // get vertex to add\n\n glVertices.push(vtxToAdd[0],vtxToAdd[1],vtxToAdd[2]); // put coords in set coord list\n\n } // end for vertices in set\n\n vec3.scale(centerArray[whichSet],centerArray[whichSet],1/numVerts); // avg ctr sum\n\n // send the vertex coords and normals to webGL\n vertexBuffers[whichSet] = gl.createBuffer(); // init empty webgl set vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(glVertices),gl.STATIC_DRAW); // data in\n \n // set up the triangle index array, adjusting indices across sets\n var glTriangles = []; // flat index list for webgl\n\n triSetSizes[whichSet] = gridTriArray[whichSet].length; // number of tris in this set\n\n for (whichSetTri=0; whichSetTri<triSetSizes[whichSet]; whichSetTri++) {\n triToAdd = gridTriArray[whichSet][whichSetTri]; // get tri to add\n glTriangles.push(triToAdd[0],triToAdd[1],triToAdd[2]); // put indices in set list\n } // end for triangles in set\n\n // send the triangle indices to webGL\n triangleBuffers.push(gl.createBuffer()); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(glTriangles),gl.STATIC_DRAW); // data in\n\n } // end for each triangle set \n\n\n} // end load models", "constructor(){\n this.isLoaded = false;\n this.minXYZ=[0,0,0];\n this.maxXYZ=[0,0,0];\n \n this.numFaces=0;\n this.numVertices=0;\n \n // Allocate vertex array\n this.vBuffer = [];\n // Allocate triangle array\n this.fBuffer = [];\n // Allocate normal array\n this.nBuffer = [];\n // Allocate array for edges so we can draw wireframe\n this.eBuffer = [];\n // Allocate array for texture coordinates\n this.texcoordBuffer = [];\n \n console.log(\"TriMesh: Allocated buffers\");\n \n // Get extension for 4 byte integer indices for drawElements\n var ext = gl.getExtension('OES_element_index_uint');\n if (ext ==null){\n alert(\"OES_element_index_uint is unsupported by your browser and terrain generation cannot proceed.\");\n }\n else{\n console.log(\"OES_element_index_uint is supported!\");\n }\n }", "function PlanePos(){\n\n\nthis.getSegment=function getSegment (planeW, planeH, planeWs, planeHs,coordX, coordY) {\n//<-- cordinate diapazons\n\nthis.DiapX=planeW/2;\nthis.DiapY=planeH/2;\n//<-- \nif((coordX>=-1*this.DiapX && coordX<this.DiapX)&& (coordY>=-1*this.DiapY && coordY<this.DiapY)){\nthis.DiapX=this.DiapX+coordX;\nthis.DiapY=this.DiapY-+coordY;\n\n//<-- segment dimanesions\nthis.SegmentWidth=planeW/planeWs;\nthis.SegmentHeight=planeH/planeHs;\n//<--\nthis.SegX=Math.ceil(this.DiapX/this.SegmentWidth);\nthis.SegY=Math.ceil(this.DiapY/this.SegmentHeight);\n\n//return(this.SegX*planeWs-(planeHs-this.SegY));\nreturn (this.SegY*planeWs-(planeHs-this.SegX));\n}\nreturn(0);\n}//<--\n\nthis.getVertices=function getVertices(planeW, planeH, planeWs, planeHs,coordX, CoordY){\nthis.segment= this.getSegment (planeW, planeH, planeWs, planeHs,coordX, CoordY);\n//<-- first vertice number\nreturn(this.segment+(Math.ceil(this.segment/planeWs)-1)); \t\n\t\n}//<--\n\n\n\n\t\n\t\n\t\n\t\n\t\n}//<-- plane", "constructor(num_particles) {\n super(\"position\", \"normal\", \"texture_coord\", \"offset\");\n // Loop 3 times (for each axis), and inside loop twice (for opposing cube sides):\n for (let i = 0; i < num_particles; i++) {\n defs.Square.insert_transformed_copy_into(this, [9], Mat4.identity());\n }\n const offsets = Array(num_particles).fill(0).map(x=>vec3(1.5,1,0).randomized(1));\n this.arrays.offset = this.arrays.position.map((x, i)=> offsets[~~(i/4)]);\n }", "constructor(x, y, worldSpace = true)\n\t{\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.worldSpace = worldSpace;\n\t}", "constructor(num_particles) {\n super(\"position\", \"normal\", \"texture_coord\", \"offset\");\n // Loop 3 times (for each axis), and inside loop twice (for opposing cube sides):\n for (let i = 0; i < num_particles; i++) {\n defs.Square.insert_transformed_copy_into(this, [9], Mat4.identity());\n }\n const offsets = Array(num_particles).fill(0).map(x=>vec3(0.5,3,0).randomized(2));\n this.arrays.offset = this.arrays.position.map((x, i)=> offsets[~~(i/4)]);\n }", "function LatLongToOSGrid(p) {\n var lat = p.lat * Math.PI / 180; \t\t\t// convert degrees to radians\n var lon = p.lon * Math.PI / 180; \t\t\t// convert degrees to radians\n\n var a = 6377340.189, b = 6356034.447; // Airy 1965 Datum major & minor semi-axes\n var F0 = 1.000035; // NatGrid scale factor on central meridian\n var lat0 = (53.5) * Math.PI / 180\n var lon0 = (-8) * Math.PI / 180; \t\t// Irishh NG true origin\n var N0 = 250000, E0 = 200000; // northing & easting of true origin, metres\n\n\n var e2 = 1 - (b*b)/(a*a); // eccentricity squared\n var n = (a-b)/(a+b), n2 = n*n, n3 = n*n*n;\n\n var cosLat = Math.cos(lat), sinLat = Math.sin(lat);\n var nu = a*F0/Math.sqrt(1-e2*sinLat*sinLat); // transverse radius of curvature\n var rho = a*F0*(1-e2)/Math.pow(1-e2*sinLat*sinLat, 1.5); // meridional radius of curvature\n var eta2 = nu/rho-1;\n\n var Ma = (1 + n + (5/4)*n2 + (5/4)*n3) * (lat-lat0);\n var Mb = (3*n + 3*n*n + (21/8)*n3) * Math.sin(lat-lat0) * Math.cos(lat+lat0);\n var Mc = ((15/8)*n2 + (15/8)*n3) * Math.sin(2*(lat-lat0)) * Math.cos(2*(lat+lat0));\n var Md = (35/24)*n3 * Math.sin(3*(lat-lat0)) * Math.cos(3*(lat+lat0));\n var M = b * F0 * (Ma - Mb + Mc - Md); // meridional arc\n\n var cos3lat = cosLat*cosLat*cosLat;\n var cos5lat = cos3lat*cosLat*cosLat;\n var tan2lat = Math.tan(lat)*Math.tan(lat);\n var tan4lat = tan2lat*tan2lat;\n\n var I = M + N0;\n var II = (nu/2)*sinLat*cosLat;\n var III = (nu/24)*sinLat*cos3lat*(5-tan2lat+9*eta2);\n var IIIA = (nu/720)*sinLat*cos5lat*(61-58*tan2lat+tan4lat);\n var IV = nu*cosLat;\n var V = (nu/6)*cos3lat*(nu/rho-tan2lat);\n var VI = (nu/120) * cos5lat * (5 - 18*tan2lat + tan4lat + 14*eta2 - 58*tan2lat*eta2);\n\n var dLon = lon-lon0;\n var dLon2 = dLon*dLon, dLon3 = dLon2*dLon, dLon4 = dLon3*dLon, dLon5 = dLon4*dLon, dLon6 = dLon5*dLon;\n\n var N = I + II*dLon2 + III*dLon4 + IIIA*dLon6;\n var E = E0 + IV*dLon + V*dLon3 + VI*dLon5;\n\n var digits = 10;\n E = Math.floor((E%10000000)/Math.pow(10,5-digits/2));\n N = Math.floor((N%10000000)/Math.pow(10,5-digits/2));\n var gridRef = E.padLZ(digits/2) + N.padLZ(digits/2);\n return gridRef;\n \n}", "function PointsCloudSystem(name, pointSize, scene, options) {\n /**\n * The PCS array of cloud point objects. Just access each particle as with any classic array.\n * Example : var p = SPS.particles[i];\n */\n this.particles = new Array();\n /**\n * The PCS total number of particles. Read only. Use PCS.counter instead if you need to set your own value.\n */\n this.nbParticles = 0;\n /**\n * This a counter for your own usage. It's not set by any SPS functions.\n */\n this.counter = 0;\n /**\n * This empty object is intended to store some PCS specific or temporary values in order to lower the Garbage Collector activity.\n * Please read :\n */\n this.vars = {};\n this._promises = [];\n this._positions = new Array();\n this._indices = new Array();\n this._normals = new Array();\n this._colors = new Array();\n this._uvs = new Array();\n this._updatable = true;\n this._isVisibilityBoxLocked = false;\n this._alwaysVisible = false;\n this._groups = new Array(); //start indices for each group of particles\n this._groupCounter = 0;\n this._computeParticleColor = true;\n this._computeParticleTexture = true;\n this._computeParticleRotation = true;\n this._computeBoundingBox = false;\n this._isReady = false;\n this.name = name;\n this._size = pointSize;\n this._scene = scene || EngineStore.LastCreatedScene;\n if (options && options.updatable !== undefined) {\n this._updatable = options.updatable;\n }\n else {\n this._updatable = true;\n }\n }", "function solveProjection(coords) {\n var a = [];\n var b = [];\n for (var i = 0; i < 4; i++) {\n var c = coords[i];\n a.push([c.sx, c.sy, 1, 0, 0, 0, -c.sx*c.tx, -c.sy*c.tx]);\n a.push([0, 0, 0, c.sx, c.sy, 1, -c.sx*c.ty, -c.sy*c.ty]);\n b.push(c.tx);\n b.push(c.ty);\n }\n return solveSystem(a, b);\n}", "function forward(p) {\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_adjust_lon__[\"a\" /* default */])(lon - this.long0);\n var con;\n var x, y;\n var sin_phi = Math.sin(lat);\n var cos_phi = Math.cos(lat);\n\n if (!this.es) {\n var b = cos_phi * Math.sin(delta_lon);\n\n if ((Math.abs(Math.abs(b) - 1)) < __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */]) {\n return (93);\n }\n else {\n x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;\n y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));\n b = Math.abs(y);\n\n if (b >= 1) {\n if ((b - 1) > __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */]) {\n return (93);\n }\n else {\n y = 0;\n }\n }\n else {\n y = Math.acos(y);\n }\n\n if (lat < 0) {\n y = -y;\n }\n\n y = this.a * this.k0 * (y - this.lat0) + this.y0;\n }\n }\n else {\n var al = cos_phi * delta_lon;\n var als = Math.pow(al, 2);\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var tq = Math.abs(cos_phi) > __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */] ? Math.tan(lat) : 0;\n var t = Math.pow(tq, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n al = al / Math.sqrt(con);\n var ml = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_pj_mlfn__[\"a\" /* default */])(lat, sin_phi, cos_phi, this.en);\n\n x = this.a * (this.k0 * al * (1 +\n als / 6 * (1 - t + c +\n als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c +\n als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) +\n this.x0;\n\n y = this.a * (this.k0 * (ml - this.ml0 +\n sin_phi * delta_lon * al / 2 * (1 +\n als / 12 * (5 - t + 9 * c + 4 * cs +\n als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c +\n als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) +\n this.y0;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n}", "translate(x, y) {\r\n let tempCubes = [[0, 0], [0, 0], [0, 0], [0, 0]];\r\n this.cubes.forEach(translateCube);\r\n let tempPivotCube = [0, 0];\r\n tempPivotCube[0] = this.pivotCube[0] + x;\r\n tempPivotCube[1] = this.pivotCube[1] + y;\r\n function translateCube(item, index) {\r\n tempCubes[index][0] = item[0] + x;\r\n tempCubes[index][1] = item[1] + y;\r\n }\r\n\r\n return new Tetromino(tempCubes, tempPivotCube, this.material);\r\n }", "function CreatePointInSpace(x, y, z){\n this.xPoint = x;\n this.yPoint = y;\n this.zPoint = z;\n}", "constructor(x, y, timestamp) {\n this.x = x;\n this.y = y;\n this.timestamp = timestamp;\n }", "addVertex(givenX, givenY, xMove, yMove, zoom){ //generally the mouse coords\n\n //apply transformations!\n let xcoor = (givenX - (width/2)) / (width/2);\n let ycoor = ((height - givenY) - (height/2)) / (height/2); //weird since canvas is upside down for mouse\n let hit = false;\n //now you have to apply the transformations for world, not inverse\n xcoor = xcoor/zoom;\n ycoor = ycoor/zoom;\n\n\n xcoor -= xMove; //minus because shifting left is negative, so subtracting a negative value moves to the right\n ycoor -= yMove;\n\n //now just create a vertex with these coords\n this.numVertices++; //get a unique ID\n\n let vert = new Vertex(xcoor, ycoor, this.numVertices);\n this.vertices.addFront(new VertexItem(vert));\n this.vertArray.push(vert);\n\n }", "function addParallelCoordinates(fetch_data_array){\r\n\t\r\nconsole.log(\"ppp\");\r\n\r\nvar margin = {top: 30, right: 10, bottom: 10, left: 10},\r\n width = 960 - margin.left - margin.right,\r\n height = 500 - margin.top - margin.bottom;\r\n\r\nvar x = d3.scale.ordinal().rangePoints([0, width], 1),\r\n y = {},\r\n dragging = {};\r\n\r\nvar line = d3.svg.line(),\r\n axis = d3.svg.axis().orient(\"left\"),\r\n background,\r\n foreground;\r\n\r\nvar svg = d3.select(\"body\").append(\"svg\")\r\n .attr(\"width\", width + margin.left + margin.right)\r\n .attr(\"height\", height + margin.top + margin.bottom)\r\n .append(\"g\")\r\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\r\n\r\n// Extract the list of dimensions and create a scale for each.\r\n x.domain(dimensions = d3.keys(fetch_data_array[0]).filter(function(d) {\r\n return d!=\"cancertype\" && (y[d] = d3.scale.linear()\r\n .domain(d3.extent(fetch_data_array, function(p) { return +p[d]; }))\r\n .range([height, 0]));\r\n }));\r\n\r\n // Add grey background lines for context.\r\n background = svg.append(\"g\")\r\n .attr(\"class\", \"background\")\r\n .selectAll(\"path\")\r\n .data(fetch_data_array)\r\n .enter().append(\"path\")\r\n .attr(\"d\", path);\r\n\r\n // Add blue foreground lines for focus.\r\n foreground = svg.append(\"g\")\r\n .attr(\"class\", \"foreground\")\r\n .selectAll(\"path\")\r\n .data(fetch_data_array)\r\n .enter().append(\"path\")\r\n .attr(\"d\", path);\r\n\r\n // Add a group element for each dimension.\r\n var g = svg.selectAll(\".dimension\")\r\n .data(dimensions)\r\n .enter().append(\"g\")\r\n .attr(\"class\", \"dimension\")\r\n .attr(\"transform\", function(d) { return \"translate(\" + x(d) + \")\"; })\r\n .call(d3.behavior.drag()\r\n .origin(function(d) { return {x: x(d)}; })\r\n .on(\"dragstart\", function(d) {\r\n dragging[d] = x(d);\r\n background.attr(\"visibility\", \"hidden\");\r\n })\r\n .on(\"drag\", function(d) {\r\n dragging[d] = Math.min(width, Math.max(0, d3.event.x));\r\n foreground.attr(\"d\", path);\r\n dimensions.sort(function(a, b) { return position(a) - position(b); });\r\n x.domain(dimensions);\r\n g.attr(\"transform\", function(d) { return \"translate(\" + position(d) + \")\"; })\r\n })\r\n .on(\"dragend\", function(d) {\r\n delete dragging[d];\r\n transition(d3.select(this)).attr(\"transform\", \"translate(\" + x(d) + \")\");\r\n transition(foreground).attr(\"d\", path);\r\n background\r\n .attr(\"d\", path)\r\n .transition()\r\n .delay(500)\r\n .duration(0)\r\n .attr(\"visibility\", null);\r\n }));\r\n\r\n // Add an axis and title.\r\n g.append(\"g\")\r\n .attr(\"class\", \"axis\")\r\n .each(function(d) { d3.select(this).call(axis.scale(y[d])); })\r\n .append(\"text\")\r\n .style(\"text-anchor\", \"middle\")\r\n .attr(\"y\", -9)\r\n .text(function(d) { return d; });\r\n\r\n // Add and store a brush for each axis.\r\n g.append(\"g\")\r\n .attr(\"class\", \"brush\")\r\n .each(function(d) {\r\n d3.select(this).call(y[d].brush = d3.svg.brush().y(y[d]).on(\"brushstart\", brushstart).on(\"brush\", brush));\r\n })\r\n .selectAll(\"rect\")\r\n .attr(\"x\", -8)\r\n .attr(\"width\", 16);\r\n\r\n\r\nfunction position(d) {\r\n var v = dragging[d];\r\n return v == null ? x(d) : v;\r\n}\r\n\r\nfunction transition(g) {\r\n return g.transition().duration(500);\r\n}\r\n\r\n// Returns the path for a given data point.\r\nfunction path(d) {\r\n return line(dimensions.map(function(p) { return [position(p), y[p](d[p])]; }));\r\n}\r\n\r\nfunction brushstart() {\r\n d3.event.sourceEvent.stopPropagation();\r\n}\r\n\r\n// Handles a brush event, toggling the display of foreground lines.\r\nfunction brush() {\r\n var actives = dimensions.filter(function(p) { return !y[p].brush.empty(); }),\r\n extents = actives.map(function(p) { return y[p].brush.extent(); });\r\n foreground.style(\"display\", function(d) {\r\n return actives.every(function(p, i) {\r\n return extents[i][0] <= d[p] && d[p] <= extents[i][1];\r\n }) ? null : \"none\";\r\n });\r\n}\t\r\n}", "function coordonneesPoint(x,y)\n {\n this.x = x;\n this.y = y;\n }", "function init() {\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n if (this.es) {\n this.en = Object(_common_pj_enfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.ml0 = Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);\n }\n}", "static create() {\nreturn this.from_xyzw(0, 0, 0, 1);\n}", "function main(){\n // Same functions used in class for moveTo and lineTo\n function moveToTx(x,y,z,Tx) {\n var loc = [x,y,z];\n var locTx = m4.transformPoint(Tx,loc);\n context.moveTo(locTx[0],locTx[1]);\n }\n function lineToTx(x,y,z,Tx) {\n var loc = [x,y,z];\n var locTx = m4.transformPoint(Tx,loc);\n context.lineTo(locTx[0], locTx[1]);\n }\n function drawAxes(Tx){\n context.beginPath();\n moveToTx(-50, 0, 0, Tx);\n lineToTx(50, 0, 0, Tx);\n context.stroke(); // x-axis\n moveToTx(0, -50, 0, Tx);\n lineToTx(0, 50, 0, Tx);\n context.stroke(); // y-axis\n moveToTx(0, 0, -50, Tx);\n lineToTx(0, 0, 50, Tx);\n context.stroke(); // z-axis\n }\n /**\n Itterates through the 2d array of points (x,y,z), drawing a line\n between each. Points have already been transformed to exist in the world\n coordinate system from the point at which they were added.\n **/\n function drawPicture(Tx, vectArray, toMouse){\n context.beginPath();\n vectArray.forEach(function(point,i){\n if(i === 0){\n moveToTx(point[0],point[1],point[2],Tx);\n }else{\n lineToTx(point[0],point[1],point[2],Tx);\n }\n context.stroke();\n });\n if(toMouse){\n lineToTx(currMousePos[0],currMousePos[1],0,m4.identity());\n }\n context.stroke();\n }\n /**\n Draws a grid on the y=0 plane\n **/\n function drawGrid(Tx){\n context.beginPath();\n var dim = 10;\n var length = 500;\n // Draw from the negative width to pos\n for(var i=-(dim/2); i<=(dim/2); i++){\n iScaled = i * 50;\n moveToTx(iScaled, 0, -length/2, Tx); lineToTx(iScaled, 0, length/2, Tx);\n moveToTx(-length/2, 0, iScaled, Tx); lineToTx(length/2, 0, iScaled, Tx);\n }\n context.stroke();\n }\n // Animation loop\n function draw(){\n // Quick clear for re-draw as well as resize in event of window change\n canvas.width = window.innerWidth; canvas.height = window.innerHeight;\n context.strokeStyle = PRIMARY_TEXT_COLOR;\n\n // Transforms\n var TrotX = m4.rotationX(thetaXSpindle*Math.PI); // Spindle spins independantly of the world.\n var TrotY = m4.rotationY(thetaYSpindle*Math.PI);\n var Ttrans = m4.translation([spindleX,0,spindleZ]);\n Tspindle = m4.multiply(TrotX, TrotY);\n Tspindle = m4.multiply(Tspindle, Ttrans);\n\n var eye = [Math.sin(theta*Math.PI)*radius, camPosY, Math.cos(theta*Math.PI)*radius];\n var target = [0,0,0];\n var up = [0,1,0];\n var TlookAt = m4.lookAt(eye, target, up);\n var Tcamera = m4.inverse(TlookAt);\n Tcamera = m4.multiply(Tcamera, m4.scaling([1,-1,1])); // flip to point Y up\n Tcamera = m4.multiply(Tcamera, m4.translation([canvas.width/2, canvas.height/2, 0]));\n\n context.strokeStyle = 'rgba(255, 255, 255, .15)';\n drawGrid(Tcamera);\n context.strokeStyle = \"lightblue\";\n commits.forEach(function(curr){\n curr.draw(Tcamera);\n });\n // Animation transforms\n thetaYSpindle += rotSpeedY;\n thetaXSpindle += rotSpeedX;\n TspindleMod = m4.multiply(Tspindle, Tcamera);\n // Update the global variable\n mouseToWorld = m4.inverse(TspindleMod);\n\n context.strokeStyle = \"white\";\n drawAxes(TspindleMod);\n context.strokeStyle = \"lightblue\";\n drawPicture(TspindleMod, vectArray, true);\n context.translate(canvas.width/2, canvas.height/2); // Move orgin for UI\n ui.showManual();\n ui.showStats(rotSpeedX, rotSpeedY, spindleX, spindleZ);\n window.requestAnimationFrame(draw);\n }\n draw();\n\n\n // EVENT LISTENERS\n document.onmousemove = function(e){\n currMousePos = [e.pageX, e.pageY, 0];\n }\n document.onmousedown = function(event){\n if(currPos){\n prevPos = currPos\n }\n currPos = [event.clientX, event.clientY, 0];\n currPos = m4.transformPoint(mouseToWorld, currPos);\n vectArray.push(currPos);\n }\n document.addEventListener('keydown', (event) => {\n const keyName = event.key;\n if(keyName === \"c\"){\n // Store drawing\n var drawing = new Drawing(Tspindle, vectArray);\n drawing.rotSpeedY = rotSpeedY;\n drawing.rotSpeedX = rotSpeedX;\n commits.push(drawing);\n // Clear drawing\n vectArray = [];\n currPos = null;\n }\n if(keyName === \"x\"){\n // pop last commit\n commits.pop();\n // Clear drawing\n vectArray = [];\n currPos = null;\n }\n // Controll axis'\n if(keyName === \"ArrowUp\"){\n event.preventDefault();\n rotSpeedX += stepSize;\n }\n if(keyName === \"ArrowDown\"){\n event.preventDefault();\n rotSpeedX -= stepSize;\n }\n if(keyName === \"ArrowLeft\"){\n event.preventDefault();\n rotSpeedY -= stepSize;\n }\n if(keyName === \"ArrowRight\"){\n event.preventDefault();\n rotSpeedY += stepSize;\n }\n if(keyName === \"w\"){\n event.preventDefault();\n camPosY += 1;\n }\n if(keyName === \"s\"){\n event.preventDefault();\n camPosY -= 1;\n }\n if(keyName === \"d\"){\n event.preventDefault();\n theta += .05;\n }\n if(keyName === \"a\"){\n event.preventDefault();\n theta -= .05;\n }\n if(keyName === \"l\"){\n event.preventDefault();\n spindleX += 5;\n }\n if(keyName === \"j\"){\n event.preventDefault();\n spindleX -= 5;\n }\n if(keyName === \"i\"){\n event.preventDefault();\n spindleZ += 5;\n }\n if(keyName === \"k\"){\n event.preventDefault();\n spindleZ -= 5;\n }\n });\n /** Drawing **/\n function Drawing(Tmod, array){\n this.Tmod = Tmod;\n this.array = array;\n // Animation transforms\n this.rotSpeedY;\n this.rotSpeedX;\n // Drawing\n this.draw = function(Tcamera){\n var rot = m4.rotationX(Math.PI*this.rotSpeedX);\n this.Tmod = m4.multiply(rot,this.Tmod);\n rot = m4.rotationY(Math.PI*this.rotSpeedY);\n this.Tmod = m4.multiply(rot, this.Tmod);\n var Tx = m4.multiply(this.Tmod, Tcamera);\n drawPicture(Tx, this.array, false);\n }\n }\n}", "function Grid(pins, x_max, y_max) {\n //this.Density = density;\n this.x_max = x_max;\n this.y_max = y_max;\n var H_Lat = -91;\n var L_Lat = 91;\n var H_Long = -181;\n var L_Long = 181;\n\n pins.forEach(function(pin){\n if (pin.Latitude > H_Lat && pin.Latitude !== null) {\n H_Lat = pin.Latitude;\n console.log(\"New H_Lat: \" + pin.Latitude);\n }\n\n if (pin.Latitude < L_Lat && pin.Latitude !== null){\n L_Lat = pin.Latitude;\n console.log(\"New L_Lat: \" + pin.Latitude);\n }\n\n if (pin.Longitude > H_Long && pin.Longitude !== null){\n H_Long = pin.Longitude;\n console.log(\"New H_Long: \" + pin.Longitude);\n }\n\n if (pin.Longitude < L_Long && pin.Longitude !== null) {\n L_Long = pin.Longitude;\n console.log(\"New L_Long: \" + pin.Longitude);\n }\n\n });\n\n var lat_extend = (H_Lat - L_Lat) * .025;\n var long_extend = (H_Long - L_Long) * .025;\n\n H_Lat = H_Lat + lat_extend;\n L_Lat = L_Lat - lat_extend;\n H_Long = H_Long + long_extend;\n L_Long = L_Long - long_extend;\n\n //console.log(\"HLat: \" + String(H_Lat) + \" \\ LLat: \" + String(L_Lat));\n //console.log(\"HLong: \" + String(H_Long) + \" \\ LLong: \" + String(L_Long));\n\n var chunkCollection = [];\n\n for (var a = 0; a <= this.y_max; a++) {\n chunkCollection.push(new Array(this.x_max));\n }\n\n// solve for distance\n\n var recHeight = (H_Lat - L_Lat) / y_max;\n var recWidth = (H_Long - L_Long) / x_max;\n\n //console.log(\"rec width: \" + recWidth);\n //console.log(\"rec height: \" + recHeight);\n\n// the distance from point 10 and point 4 is\n// Density is how many rectangles will be on screen.\n\n\n for (var y = 0; y < y_max; y++) {\n for (var x = 0; x < x_max; x++) {\n // Creates the boundary, lowest point with lowest corner\n // to create a side of the cube.\n // merge the google maps.\n\n chunkCollection[x][y] = new Chunk(x, y,\n recWidth, recHeight, L_Lat, L_Long);\n }\n }\n\n pins.forEach(function (p) {\n\n var lat_index = (p.Latitude - L_Lat) / recHeight;\n var long_index = (p.Longitude - L_Long) / recWidth;\n\n lat_index = parseInt(lat_index);\n long_index = parseInt(long_index);\n\n try {\n chunkCollection[long_index][lat_index].addPin(p);\n } catch (e) {\n console.log(\"valid: \" + p.isValid());\n\n console.log(\"P| lat:\" + p.Latitude + \" long:\" + p.Longitude);\n console.log(\"P| latI:\" + lat_index + \" longI:\" + long_index);\n console.error(\"Data is not possible! Something fucked up\");\n }\n\n });\n\n this.getChunk = function (x, y) {\n try {\n return chunkCollection[y][x];\n } catch (e) {\n console.warn(\"Out of bounds!\");\n }\n };\n\n this.getChunks = function() {\n var chunks = [];\n\n for (var y = 0; y < this.y_max; y++) {\n for (var x = 0; x < this.x_max; x++) {\n if (!chunkCollection[x][y].isEmpty()){\n chunks.push(chunkCollection[x][y]);\n }\n }\n }\n\n return chunks;\n };\n\n this.draw = function(map){\n chunkCollection.forEach(function(col){\n col.forEach(function(chunk){\n chunk.draw(map);\n });\n });\n };\n\n this.getFarms = function () {\n var farms = [];\n for (var y = 0; y < this.y_max; y++) {\n for (var x = 0; x < this.x_max; x++) {\n var chunk = chunkCollection[x][y];\n if (chunk !== null && !chunk.isEmpty()){\n var chunks = chunk.getSurrounding(this, null);\n var pins = [];\n for (var i = 0; i < chunks.length; i++){\n for (var ii = 0; ii < chunks[i].pins.length; ii++){\n pins.push(chunks[i].pins[ii]);\n }\n }\n var farm = new Farm(pins, false);\n chunks.forEach(function(chunk){\n chunkCollection[chunk.x][chunk.y] = new Chunk();\n });\n if (!(farm.pins.length < 100))\n farms.push(farm);\n }\n }\n }\n return farms;\n };\n\n this.getEdgeChunks = function (){\n var edgeChunks = [];\n var that = this;\n\n chunkCollection.forEach(function(col){\n col.forEach(function(chunk){\n if (chunk.isEdge(that, this.x_max, this.y_max))\n edgeChunks.push(chunk)\n });\n });\n\n return edgeChunks;\n };\n\n this.getLiveChunks = function (){\n var live = [];\n var chunks = this.getChunks();\n for (var i = 0; i < chunks.getChunks().length; i++){\n if (chunks[i].pinCount > 0)\n live.push(chunks[i]);\n }\n return live;\n };\n\n this.getCenter = function(){\n return {lat: L_Lat + ((H_Lat - L_Lat)/2), lng: L_Long + ((H_Long - L_Long)/2)};\n }\n}", "function forward(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y, el;\n var dlon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_adjust_lon__[\"a\" /* default */])(lon - this.long0);\n el = dlon * Math.sin(lat);\n if (this.sphere) {\n if (Math.abs(lat) <= __WEBPACK_IMPORTED_MODULE_7__constants_values__[\"a\" /* EPSLN */]) {\n x = this.a * dlon;\n y = -1 * this.a * this.lat0;\n }\n else {\n x = this.a * Math.sin(el) / Math.tan(lat);\n y = this.a * (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_adjust_lat__[\"a\" /* default */])(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));\n }\n }\n else {\n if (Math.abs(lat) <= __WEBPACK_IMPORTED_MODULE_7__constants_values__[\"a\" /* EPSLN */]) {\n x = this.a * dlon;\n y = -1 * this.ml0;\n }\n else {\n var nl = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__common_gN__[\"a\" /* default */])(this.a, this.e, Math.sin(lat)) / Math.tan(lat);\n x = nl * Math.sin(el);\n y = this.a * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));\n }\n\n }\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n}", "project(xyz) {\n const {viewport} = this.context;\n const worldPosition = getWorldPosition(xyz, {\n viewport,\n modelMatrix: this.props.modelMatrix,\n coordinateOrigin: this.props.coordinateOrigin,\n coordinateSystem: this.props.coordinateSystem\n });\n const [x, y, z] = worldToPixels(worldPosition, viewport.pixelProjectionMatrix);\n return xyz.length === 2 ? [x, y] : [x, y, z];\n }", "constructor(x, y, width, height) {\n this.pos = createVector(x, y);\n this.topLeft = createVector(x, y);\n this.width = width;\n this.height = height;\n }", "function init() {\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n if (this.es) {\n this.en = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_pj_enfn__[\"a\" /* default */])(this.es);\n this.ml0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_pj_mlfn__[\"a\" /* default */])(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);\n }\n}", "constructor(x,y) {\r\n this.x = x\r\n this.y = y\r\n }", "_getWorldCoords() {\n const corners = [\n tempCorner1.set(-1, 1, 0), // plane's top left corner\n tempCorner2.set(1, 1, 0), // plane's top right corner\n tempCorner3.set(1, -1, 0), // plane's bottom right corner\n tempCorner4.set(-1, -1, 0), // plane's bottom left corner\n ];\n\n // corners with model view projection matrix applied\n let mvpCorners = [];\n // eventual clipped corners\n let clippedCorners = [];\n\n // we are going to get our plane's four corners relative to our model view projection matrix\n for(let i = 0; i < corners.length; i++) {\n const mvpCorner = corners[i].applyMat4(this._matrices.modelViewProjection.matrix);\n mvpCorners.push(mvpCorner);\n\n // Z position is > 1 or < -1 means the corner is clipped\n if(Math.abs(mvpCorner.z) > 1) {\n clippedCorners.push(i);\n }\n }\n\n // near plane is clipping, get intersections between plane and near plane\n if(clippedCorners.length) {\n mvpCorners = this._getNearPlaneIntersections(corners, mvpCorners, clippedCorners);\n }\n\n // we need to check for the X and Y min and max values\n // use arbitrary integers that will be overriden anyway\n let minX = Infinity;\n let maxX = -Infinity;\n\n let minY = Infinity;\n let maxY = -Infinity;\n\n for(let i = 0; i < mvpCorners.length; i++) {\n const corner = mvpCorners[i];\n\n if(corner.x < minX) {\n minX = corner.x;\n }\n if(corner.x > maxX) {\n maxX = corner.x;\n }\n\n if(corner.y < minY) {\n minY = corner.y;\n }\n if(corner.y > maxY) {\n maxY = corner.y;\n }\n }\n\n return {\n top: maxY,\n right: maxX,\n bottom: minY,\n left: minX,\n };\n }", "position() {\n // p5.Vector.fromAngle() makes a new 2D vector from an angle\n // millis returns the number of milliseconds since starting the sketch when setup() is called)\n let formula = p5.Vector.fromAngle(millis() / this.millisDivider, this.length);\n translate(formula);\n }", "static getCoords(t, c, p) {\r\n\t\tlet m = MathTools.matMul(t.t, [\r\n\t\t\t[p.x],\r\n\t\t\t[p.y],\r\n\t\t\t[1]\r\n\t\t])\r\n\t\tm[0][0] += (t.x - c.x)\r\n\t\tm[1][0] += (t.y - c.y)\r\n\t\tm = MathTools.matMul(c.t, m)\r\n\t\treturn {\r\n\t\t\tx: m[0][0]+window.innerWidth/2,\r\n\t\t\ty: window.innerHeight - (m[1][0]+window.innerHeight/2)\r\n\t\t}\r\n\t}" ]
[ "0.6406983", "0.6309303", "0.59099597", "0.5575591", "0.5456198", "0.5451001", "0.5451001", "0.542809", "0.53596663", "0.53301585", "0.52945304", "0.52557594", "0.5235773", "0.5232545", "0.51846546", "0.5149977", "0.5139875", "0.5132247", "0.5104597", "0.5080405", "0.5079979", "0.5062472", "0.5053735", "0.50484884", "0.5018199", "0.5016435", "0.50072014", "0.50023025", "0.5000482", "0.49998888", "0.49870008", "0.49865514", "0.49693042", "0.49677294", "0.4963556", "0.4962033", "0.49608696", "0.49533322", "0.4947065", "0.49385384", "0.49321517", "0.49277723", "0.4909108", "0.49068052", "0.49003866", "0.48914704", "0.48865288", "0.48830464", "0.48695168", "0.48651433", "0.48597494", "0.48575345", "0.48543584", "0.48538554", "0.48514462", "0.48385018", "0.48362482", "0.4834328", "0.48285615", "0.48242062", "0.48242062", "0.48242062", "0.48236138", "0.48181412", "0.48178", "0.48146766", "0.48135343", "0.4812992", "0.48108232", "0.48095435", "0.4804239", "0.47974673", "0.47967157", "0.47946522", "0.47868618", "0.478589", "0.47848758", "0.47795898", "0.4776975", "0.47762212", "0.47755116", "0.47725534", "0.47677216", "0.47641787", "0.4757431", "0.47513887", "0.47473827", "0.4745947", "0.47446775", "0.47442645", "0.4741506", "0.47403178", "0.47364378", "0.47305837", "0.47281286" ]
0.59175324
7
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. / Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(seriesType) { return { seriesType: seriesType, reset: function (seriesModel, ecModel) { var legendModels = ecModel.findComponents({ mainType: 'legend' }); if (!legendModels || !legendModels.length) { return; } var data = seriesModel.getData(); data.filterSelf(function (idx) { var name = data.getName(idx); // If in any legend component the status is not selected. for (var i = 0; i < legendModels.length; i++) { if (!legendModels[i].isSelected(name)) { return false; } } return true; }); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onChildAppStart () {\n\n }", "get Android() {}", "onMessageStart() { }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "createStream () {\n\n }", "onComponentMount() {\n\n }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "didMount() {\n }", "requestContainerInfo() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "function bridgeAndroidAndIOS() {\r\n\r\n //ios\r\n function setupWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n return callback(WebViewJavascriptBridge);\r\n }\r\n if (window.WVJBCallbacks) {\r\n return window.WVJBCallbacks.push(callback);\r\n }\r\n window.WVJBCallbacks = [callback];\r\n var WVJBIframe = document.createElement('iframe');\r\n WVJBIframe.style.display = 'none';\r\n WVJBIframe.src = 'https://__bridge_loaded__';\r\n document.documentElement.appendChild(WVJBIframe);\r\n setTimeout(function() {\r\n document.documentElement.removeChild(WVJBIframe)\r\n }, 0)\r\n }\r\n\r\n //安卓\r\n function connectWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n callback(WebViewJavascriptBridge)\r\n } else {\r\n document.addEventListener(\r\n 'WebViewJavascriptBridgeReady',\r\n function() {\r\n callback(WebViewJavascriptBridge)\r\n },\r\n false\r\n );\r\n }\r\n }\r\n\r\n function bridgeLog(logContent) {\r\n uni.showModal({\r\n title: \"原始数据\",\r\n content: logContent,\r\n })\r\n }\r\n\r\n switch (uni.getSystemInfoSync().platform) {\r\n case 'android':\r\n connectWebViewJavascriptBridge(function(bridge) {\r\n bridge.init();\r\n bridge.registerHandler(\"GetUser\", function(data, responseCallback) {\r\n if(JSON.parse(data).guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: JSON.parse(data).guid,\r\n token: JSON.parse(data).token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: JSON.parse(data).activityID,\r\n AppCode: JSON.parse(data).AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: JSON.parse(data).Authorization,\r\n statusBarHeight: Number.parseInt(JSON.parse(data).statusBarHeight),\r\n };\r\n });\r\n\r\n })\r\n break;\r\n case 'ios':\r\n setupWebViewJavascriptBridge(function(bridge) {\r\n bridge.registerHandler('GetUser', function(data, responseCallback) {\r\n if(data.guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: data.guid,\r\n token: data.token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: data.activityID,\r\n AppCode: data.AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: data.Authorization,\r\n productID: data.productID,\r\n statusBarHeight: data.statusBarHeight,\r\n };\r\n })\r\n })\r\n break;\r\n default:\r\n console.log('运行在开发者工具上')\r\n break;\r\n }\r\n\r\n}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "constructor(speechCallback, clientId, streamId) {\n console.log(\"in gcloud\");\n const useOpus = false;\n this.clientId = clientId;\n this.streamId = streamId;\n this.isOpen = true;\n\n // Note: \n // 1) The client side detects silence and does a startStream, and endStream\n // The streamId is incremented everytime this happens, \n // so a combination of clientId + streamId can uniquely identify a stream.\n // The server will be transcribing each client's stream in parallel.\n //\n // 2) The streaming API has a limit of 5 minutes. So just before 5 minutes are up\n // there will timer that will close and reopen the stream. Any non final results will\n // we sent again to be re-transcribed,\n // The restartCounter will be incremented every time the stream is restarted. However\n // the streamId will remain the same.\n //\n // 3) Every stream will have set of results. Some results will be final and some won't be\n // After a result is final, that portion of the audio will not be transcribed again by the API\n // each final result will have resultEndTime, - this is time in seconds (and nanoseconds) \n // from the time the stream was started/restarted.\n // Results don'd have a startTime, it is implicit that the startTime is resultEndTime\n // of the last final stream, or 0 if there was no final stream before this\n // We augment the result to add this startTime\n //\n // We also keep a cumulative restartTime, which is the difference betwen the beginning of \n // stream start and begining of the most recent stream restart. And add this to \n // the startTime and endTime. This way the client is completely unaware of the internal restarts\n // \n \n // Have we started/restarted a new stream ?\n this.newStream = true;\n\n // number of times the stream has been restarted\n this.restartCounter = 0;\n\n // audio Input is any array of chunks (buffer)\n this.audioInput = [];\n this.audioInputSize = 0; // total size of all the buffers\n\n // the end time (in seconds) of the last result. \n // the End time is calculated from the beginning of start/restart stream\n this.resultEndTime = 0;\n\n // the end time of the last final result.\n this.finalEndTime = 0;\n\n // the start time (in seconds) of the current result. \n // It is calculated fom beginning of start/restart stream\n this.startTime = 0;\n \n // the time between the of beginning of start stream and the beginning of the most current restart stream.\n this.restartTime = 0;\n\n\n this.lastTranscriptWasFinal = false;\n\n this.restartTimer = null;\n\n this.config = {\n encoding: useOpus ? 'OGG_OPUS' : 'LINEAR16',\n sampleRateHertz: useOpus ? 48000 : 16000,\n languageCode: 'en_us',\n enableAutomaticPunctuation: true,\n speechContexts: [{ phrases: phrases}],\n };\n\n this.request = {\n config : this.config,\n interimResults: true,\n };\n\n this.startStreamInternal();\n }", "constructor() {\n }", "constructor(info) {\n super();\n\n _defineProperty(this, \"_peerConnectionId\", void 0);\n\n _defineProperty(this, \"_reactTag\", void 0);\n\n _defineProperty(this, \"_id\", void 0);\n\n _defineProperty(this, \"_label\", void 0);\n\n _defineProperty(this, \"_maxPacketLifeTime\", void 0);\n\n _defineProperty(this, \"_maxRetransmits\", void 0);\n\n _defineProperty(this, \"_negotiated\", void 0);\n\n _defineProperty(this, \"_ordered\", void 0);\n\n _defineProperty(this, \"_protocol\", void 0);\n\n _defineProperty(this, \"_readyState\", void 0);\n\n _defineProperty(this, \"_subscriptions\", []);\n\n _defineProperty(this, \"binaryType\", 'arraybuffer');\n\n _defineProperty(this, \"bufferedAmount\", 0);\n\n _defineProperty(this, \"bufferedAmountLowThreshold\", 0);\n\n this._peerConnectionId = info.peerConnectionId;\n this._reactTag = info.reactTag;\n this._label = info.label;\n this._id = info.id === -1 ? null : info.id; // null until negotiated.\n\n this._ordered = Boolean(info.ordered);\n this._maxPacketLifeTime = info.maxPacketLifeTime;\n this._maxRetransmits = info.maxRetransmits;\n this._protocol = info.protocol || '';\n this._negotiated = Boolean(info.negotiated);\n this._readyState = info.readyState;\n\n this._registerEvents();\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onChildAppSourceChangeRestart () {\n\n }", "constructor() {\n\n\t}", "async componentDidUpdate() {\n console.log(this.props.directory);\n //this needs to be replaced with environment variable\n const beginingUrl = \"http://10.34.1.30:8080/songs/\";\n const songLoc = this.props.directory + \"/outputlist.m3u8\";\n var hlsUrl = beginingUrl + songLoc;\n var audio = this.player;\n\n //Should this logic be loacated here??This looks hacky,\n const token = await getToken();\n let bearerTokenString = \"Bearer \" + token;\n\n if (Hls.isSupported()) {\n var hls = new Hls({\n // This configuration is required to insure that only the\n // viewer can access the content by sending a session cookie\n // to api.video service\n xhrSetup: function (xhr, url) {\n xhr.setRequestHeader(\"Authorization\", bearerTokenString);\n },\n });\n hls.loadSource(hlsUrl);\n hls.attachMedia(audio);\n hls.on(Hls.Events.MANIFEST_PARSED, function () {\n audio.play();\n });\n } else if (audio.canPlayType(\"application/vnd.apple.mpegurl\")) {\n console.log(\"Nigga we here!!\");\n audio.src = hlsUrl;\n audio.addEventListener(\"loadedmetadata\", function () {\n audio.play();\n });\n }\n }", "onMessageReceive() {}", "constructor() {\n\t}", "constructor() {\n\t}", "componentWillMount() {\n //CodePush.disallowRestart();\n //Alert.alert(\"mounted cool vite OK OK MAINTENANT CA MARCHE !!!!!\");\n/*CodePush.sync(\n{\ndeploymentKey: 'giMb817KrtTFkIuOg4i5ohnEUDyoBJvD1i-VN',\nupdateDialog: true,\ninstallMode: CodePush.InstallMode.IMMEDIATE,\n},\nthis.CodePushStatusDidChange.bind(this),\nthis.CodePushDownloadDidProgress.bind(this)\n);*/\n /* Animated.loop(\n Animated.sequence([\n Animated.timing(this.animatedValue, { toValue: 1, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n Animated.timing(this.animatedValue, { toValue: 0, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n ])).start();*/\n //this.toggleLike(); \n //CodePush.notifyApplicationReady();\n this._onLoadStart();\n }", "function version(){ return \"0.13.0\" }", "get supportStreaming() { return exists && has(WA.instantiateStreaming); }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "onChildAppRestart (/* reason */) {\n\n }", "_init(config) {\n this.name = config.name;\n this.appId = config.appid || config.appId;\n this.serverUrl = config.server_url + '/sync_xcx';\n this.autoTrackProperties = {};\n // cache commands.\n this._queue = [];\n\n if (config.isChildInstance) {\n this._state = {};\n } else {\n logger.enabled = config.enableLog;\n this.instances = []; // 子实例名称\n this._state = {\n getSystemInfo: false,\n initComplete: false,\n };\n systemInfo.getSystemInfo(() => {\n this._updateState({\n getSystemInfo: true,\n });\n });\n\n if (config.autoTrack) {\n this.autoTrack = PlatformAPI.initAutoTrackInstance(this, config);\n } else {\n var launchOptions = PlatformAPI.getAppOptions((options) => {\n if (options && options.scene) {\n this._setAutoTrackProperties({\n '#scene': options.scene,\n });\n }\n\n });\n if (launchOptions.scene) {\n this._setAutoTrackProperties({\n '#scene': launchOptions.scene,\n });\n }\n }\n }\n\n this.store = new ThinkingDataPersistence(config, () => {\n if (this.config.asyncPersistence && _.isFunction(this.config.persistenceComplete)) {\n this.config.persistenceComplete(this);\n }\n this._updateState();\n });\n }", "_addHMRClientCode(data) {\n// If we have it, grab supporting code...\n let prependage = fs.readFileSync('./lib/hmr/clientSocket.js'),\n appendage = fs.readFileSync('./lib/hmr/hmr.js')\n\n// Prepend clientSocket.js to bundle.... Append hmr runtime to bundle\n return `${prependage}${data}${appendage}`\n }", "componentDidMount() {\n this.setState({\n configuration: {\n flow: {\n name: \"sample1\",\n id: \"01\",\n components: [\n {\n type: \"http-listener\",\n id: \"http-list-01\",\n properties: {\n method: \"get\",\n port: 8000,\n path: \"http://localhost\"\n }\n },\n {\n type: \"logger\",\n id: \"logger-01\",\n properties: {\n level: \"info\"\n }\n },\n {\n type: \"file-writer\",\n id: \"file-write-01\",\n properties: {\n location: \"xx\",\n username: \"sachith\",\n password: \"\",\n filename: \"hello.txt\"\n }\n }\n ]\n }\n }\n\n });\n }", "componentWillUnmount(){\n Streaming.disconnect();\n }", "pushStart() {\n Cordova.exec(\n () => {},\n () => {},\n 'SparkProxy',\n 'pushStart',\n []);\n }", "async onReady() {\n // Initialize your adapter here\n // Subsribe to all state changes\n this.subscribeStates('*');\n this.axiosInstance = axios_1.default.create({\n baseURL: `http://${this.config.host}/api/v1/`,\n timeout: 1000\n });\n // try to ping volumio\n const connectionSuccess = await this.pingVolumio();\n if (this.config.checkConnection) {\n let interval = this.config.checkConnectionInterval;\n if (!interval || !isNumber(interval)) {\n this.log.error(`Invalid connection check interval setting. Will be set to 30s`);\n interval = 30;\n }\n this.checkConnectionInterval = setInterval(this.checkConnection, interval * 1000, this);\n }\n // get system infos\n if (connectionSuccess) {\n this.apiGet('getSystemInfo').then(sysInfo => {\n this.setStateAsync('info.id', sysInfo.id, true);\n this.setStateAsync('info.host', sysInfo.host, true);\n this.setStateAsync('info.name', sysInfo.name, true);\n this.setStateAsync('info.type', sysInfo.type, true);\n this.setStateAsync('info.serviceName', sysInfo.serviceName, true);\n this.setStateAsync('info.systemversion', sysInfo.systemversion, true);\n this.setStateAsync('info.builddate', sysInfo.builddate, true);\n this.setStateAsync('info.variant', sysInfo.variant, true);\n this.setStateAsync('info.hardware', sysInfo.hardware, true);\n });\n // get inital player state\n this.updatePlayerState();\n }\n if (this.config.subscribeToStateChanges && this.config.subscriptionPort && connectionSuccess) {\n this.log.debug('Subscription mode is activated');\n try {\n this.httpServerInstance = this.httpServer.listen(this.config.subscriptionPort);\n this.log.debug(`Server is listening on ${ip_1.default.address()}:${this.config.subscriptionPort}`);\n this.subscribeToVolumioNotifications();\n }\n catch (error) {\n this.log.error(`Starting server on ${this.config.subscriptionPort} for subscription mode failed: ${error.message}`);\n }\n }\n else if (this.config.subscribeToStateChanges && !this.config.subscriptionPort) {\n this.log.error('Subscription mode is activated, but port is not configured.');\n }\n else if (!this.config.subscribeToStateChanges && connectionSuccess) {\n this.unsubscribeFromVolumioNotifications();\n }\n this.httpServer.post('/volumiostatus', (req, res) => {\n this.onVolumioStateChange(req.body);\n res.sendStatus(200);\n });\n }", "function IbtRealTimeSJ(){/***********************************************************\n\t * @attributes\n\t ***********************************************************/var appKey;// application key\n\tvar authToken;// authentication token\n\tvar clusterUrl;// cluster URL to connect\n\tvar waitingClusterResponse;// indicates whether is waiting for a cluster response\n\tvar connectionTimeout;// connection timeout in milliseconds\n\tvar messageMaxSize;// message maximum size in bytes\n\tvar channelMaxSize;// channel maximum size in bytes\n\tvar channelsMaxSize;// maximum of channels for batchSend\n\tvar messagesBuffer;// buffer to hold the message parts\n\tvar id;// object identifier\n\tvar isConnected;// indicates whether the client object is connected\n\tvar isConnecting;// indicates whether the client object is connecting\n\tvar alreadyConnectedFirstTime;// indicates whether the client already connected for the first time\n\tvar stopReconnecting;// indicates whether the user disconnected (stop the reconnecting proccess)\n\tvar ortc;// represents the object itself\n\tvar sockjs;// socket connected to\n\tvar url;// URL to connect\n\tvar userPerms;// user permissions\n\tvar connectionMetadata;// connection metadata used to identify the client\n\tvar announcementSubChannel;// announcement subchannel\n\tvar subscribedChannels;// subscribed/subscribing channels\n\tvar lastKeepAlive;// holds the time of the last keep alive received\n\tvar invalidConnection;// indicates whether the connection is valid\n\tvar reconnectIntervalId;// id used for the reconnect interval\n\tvar reconnectStartedAt;// the time which the reconnect started\n\tvar validatedTimeoutId;// id used for the validated timeout\n\tvar validatedArrived;// indicates whether the validated message arrived\n\tvar retryingWithSsl;// indicates whether the connection is being retried with SSL\n\tvar protocol;// protocol to use\n\tvar sslSessionCookieName;// the SSL session cookie name\n\tvar sessionCookieName;// the session cookie name\n\tvar sessionId;// the session ID\n\tvar registrationId;// browser device token for push notifications\n\tvar pushPlatform;// push notifications platform\n\t/***********************************************************\n\t * @attributes initialization\n\t ***********************************************************/sslSessionCookieName=\"ortcssl\";sessionCookieName=\"ortcsession-\";connectionTimeout=5000;messageMaxSize=800;channelMaxSize=100;connectionMetadataMaxSize=256;channelsMaxSize=50;// Time in seconds\n\tvar heartbeatDefaultTime=15;// Heartbeat default interval time\n\tvar heartbeatDefaultFails=3;// Heartbeat default max fails\n\tvar heartbeatMaxTime=60;var heartbeatMinTime=10;var heartbeatMaxFails=6;var heartbeatMinFails=1;var heartbeatTime=heartbeatDefaultTime;// Heartbeat interval time\n\tvar heartbeatFails=heartbeatDefaultFails;// Heartbeat max fails\n\tvar heartbeatInterval=null;// Heartbeat interval\n\tvar heartbeatActive=false;messagesBuffer={};subscribedChannels={};isConnected=false;isConnecting=false;alreadyConnectedFirstTime=false;invalidConnection=false;waitingClusterResponse=false;validatedArrived=false;retryingWithSsl=false;ortc=this;lastKeepAlive=null;userPerms=null;reconnectStartedAt=null;protocol=undefined;pushPlatform=\"GCM\";var delegateExceptionCallback=function(ortcArg,event){if(ortcArg!==null&&ortcArg.onException!==null){ortcArg.onException(ortcArg,event);}};/***********************************************************\n\t * @properties\n\t ***********************************************************/this.getId=function(){return id;};this.setId=function(newId){id=newId;};this.getUrl=function(){return url;};this.setUrl=function(newUrl){url=newUrl;clusterUrl=null;};this.getClusterUrl=function(){return clusterUrl;};this.setClusterUrl=function(newUrl){clusterUrl=newUrl;url=null;};this.getConnectionTimeout=function(){return connectionTimeout;};this.setConnectionTimeout=function(newTimeout){connectionTimeout=newTimeout;};this.getIsConnected=function(){return isConnected&&ortc.sockjs!==null;};this.getConnectionMetadata=function(){return connectionMetadata;};this.setConnectionMetadata=function(newConnectionMetadata){connectionMetadata=newConnectionMetadata;};this.getAnnouncementSubChannel=function(){return announcementSubChannel;};this.setAnnouncementSubChannel=function(newAnnouncementSubChannel){announcementSubChannel=newAnnouncementSubChannel;};this.getProtocol=function(){return protocol;};this.setProtocol=function(newProtocol){protocol=newProtocol;};this.getSessionId=function(){return sessionId;};/*\n\t * Get heartbeat interval.\n\t */this.getHeartbeatTime=function(){return heartbeatTime;};/*\n\t * Set heartbeat interval.\n\t */this.setHeartbeatTime=function(newHeartbeatTime){if(newHeartbeatTime&&!isNaN(newHeartbeatTime)){if(newHeartbeatTime>heartbeatMaxTime||newHeartbeatTime<heartbeatMinTime){delegateExceptionCallback(ortc,`Heartbeat time is out of limits - Min: ${heartbeatMinTime} | Max: ${heartbeatMaxTime}`);}else{heartbeatTime=newHeartbeatTime;}}else{delegateExceptionCallback(ortc,`Invalid heartbeat time ${newHeartbeatTime}`);}};/*\n\t * Get how many times can the client fail the heartbeat.\n\t */this.getHeartbeatFails=function(){return heartbeatFails;};/*\n\t * Set heartbeat fails. Defines how many times can the client fail the heartbeat.\n\t */this.setHeartbeatFails=function(newHeartbeatFails){if(newHeartbeatFails&&!isNaN(newHeartbeatFails)){if(newHeartbeatFails>heartbeatMaxFails||newHeartbeatFails<heartbeatMinFails){delegateExceptionCallback(ortc,`Heartbeat fails is out of limits - Min: ${heartbeatMinFails} | Max: ${heartbeatMaxFails}`);}else{heartbeatFails=newHeartbeatFails;}}else{delegateExceptionCallback(ortc,`Invalid heartbeat fails ${newHeartbeatFails}`);}};/*\n\t * Get heart beat active.\n\t */this.getHeartbeatActive=function(){return heartbeatActive;};/*\n\t * Set heart beat active. Heart beat provides better accuracy for presence data.\n\t */this.setHeartbeatActive=function(active){heartbeatActive=active;};/***********************************************************\n\t * @events\n\t ***********************************************************/this.onConnected=null;this.onDisconnected=null;this.onSubscribed=null;this.onUnsubscribed=null;this.onException=null;this.onReconnecting=null;this.onReconnected=null;/***********************************************************\n\t * @public methods\n\t ***********************************************************//*\n\t * Connects to the gateway with the application key and authentication token.\n\t */this.connect=function(appKey,authToken){/*\n\t Sanity Checks\n\t */if(isConnected){delegateExceptionCallback(ortc,\"Already connected\");}else if(!url&&!clusterUrl){delegateExceptionCallback(ortc,\"URL and Cluster URL are null or empty\");}else if(!appKey){delegateExceptionCallback(ortc,\"Application Key is null or empty\");}else if(!authToken){delegateExceptionCallback(ortc,\"Authentication Token is null or empty\");}else if(url&&!ortcIsValidUrl(url)){delegateExceptionCallback(ortc,\"Invalid URL\");}else if(clusterUrl&&!ortcIsValidUrl(clusterUrl)){delegateExceptionCallback(ortc,\"Invalid Cluster URL\");}else if(!ortcIsValidInput(appKey)){delegateExceptionCallback(ortc,\"Application Key has invalid characters\");}else if(!ortcIsValidInput(authToken)){delegateExceptionCallback(ortc,\"Authentication Token has invalid characters\");}else if(!ortcIsValidInput(announcementSubChannel)){delegateExceptionCallback(ortc,\"Announcement Subchannel has invalid characters\");}else if(connectionMetadata&&connectionMetadata.length>connectionMetadataMaxSize){delegateExceptionCallback(ortc,\"Connection metadata size exceeds the limit of \"+connectionMetadataMaxSize+\" characters\");}else{ortc.appKey=appKey;ortc.authToken=authToken;isConnecting=true;stopReconnecting=false;validatedArrived=false;clearValidatedTimeout(self);// Read SSL session cookie\n\t//var sslConn = readCookie(sslSessionCookieName);\n\tvar sslConn=false;if(sslConn){changeUrlSsl();}if(clusterUrl&&clusterUrl!=null){clusterUrl=clusterUrl.ortcTreatUrl();clusterConnection();}else{url=url.ortcTreatUrl();ortc.sockjs=createSocketConnection(url);}//If ssl connection increase connection timeout\n\tif(clusterUrl&&clusterUrl!=null&&clusterUrl.indexOf(\"/ssl\")>=0||url&&url.indexOf(\"https\")>=0){if(!retryingWithSsl){ortc.setConnectionTimeout(30*1000);}else{if(ortc.getConnectionTimeout()<300*1000){if(ortc.getConnectionTimeout()<30*1000){ortc.setConnectionTimeout(30*1000);}else{ortc.setConnectionTimeout((ortc.getConnectionTimeout()+10)*1000);}}else{stopReconnecting=true;clearReconnectInterval();}}}if(!ortc.reconnectIntervalId&&!stopReconnecting){// Interval to reconnect\n\tortc.reconnectIntervalId=setInterval(function(){if(stopReconnecting){clearReconnectInterval();}else{var currentDateTime=new Date();if(ortc.sockjs==null&&!waitingClusterResponse){reconnectSocket();}// 35 seconds\n\tif(lastKeepAlive!=null&&lastKeepAlive+35000<new Date().getTime()){lastKeepAlive=null;// Server went down\n\tif(isConnected){disconnectSocket();}}}},ortc.getConnectionTimeout());}}};this.setNotificationConfig=function(config){config.cmd=\"config\";this.sendMessageToServiceWorker(config);};this.showNotification=function(notification){notification.cmd=\"notification\";this.sendMessageToServiceWorker(notification);};this.sendMessageToServiceWorker=function(message){return new Promise(function(resolve,reject){var messageChannel=new MessageChannel();messageChannel.port1.onmessage=function(event){if(event.data.error){reject(event.data.error);}else{resolve(event.data);}};navigator.serviceWorker.controller.postMessage(message,[messageChannel.port2]);});};/*\n\t * Subscribes to the channel so the client object can receive all messages sent to it by other clients with Notifications.\n\t */this.subscribeWithNotifications=function(channel,subscribeOnReconnected,regId,onMessageCallback){ortc.registrationId=regId;this._subscribe(channel,subscribeOnReconnected,regId,null,onMessageCallback);};/*\n\t * Subscribes to the channel so the client object can receive all messages sent that are valid according to the given filter\n\t */this.subscribeWithFilter=function(channel,subscribeOnReconnected,filter,onMessageCallback){this._subscribe(channel,subscribeOnReconnected,null,filter,onMessageCallback);};/*\n\t * Subscribes to the channel so the client object can receive all messages sent to it by other clients.\n\t */this.subscribe=function(channel,subscribeOnReconnected,onMessageCallback){this._subscribe(channel,subscribeOnReconnected,null,null,onMessageCallback);};this._subscribe=function(channel,subscribeOnReconnected,regId,filter,onMessageCallback){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribing){delegateExceptionCallback(ortc,\"Already subscribing to the channel \\\"\"+channel+\"\\\"\");}else if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed){delegateExceptionCallback(ortc,\"Already subscribed to the channel \\\"\"+channel+\"\\\"\");}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else if(!ortcIsValidBoolean(subscribeOnReconnected)){delegateExceptionCallback(ortc,\"The argument \\\"subscribeOnReconnected\\\" must be a boolean\");}else if(!ortcIsFunction(onMessageCallback)){delegateExceptionCallback(ortc,\"The argument \\\"onMessageCallback\\\" must be a function\");}else{if(ortc.sockjs!=null){var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){delegateExceptionCallback(ortc,\"No permission found to subscribe to the channel \\\"\"+channel+\"\\\"\");}else{if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=true;subscribedChannels[channel].isSubscribed=false;subscribedChannels[channel].subscribeOnReconnected=subscribeOnReconnected;subscribedChannels[channel].onMessageCallback=onMessageCallback;subscribedChannels[channel].filter=filter;}else{subscribedChannels[channel]={\"isSubscribing\":true,\"isSubscribed\":false,\"subscribeOnReconnected\":subscribeOnReconnected,\"onMessageCallback\":onMessageCallback,\"filter\":filter};}if(regId){subscribedChannels[channel].withNotifications=true;ortc.sockjs.send(\"subscribe;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+regId+\";\"+pushPlatform);}else{subscribedChannels[channel].withNotifications=false;if(filter){ortc.sockjs.send(\"subscribefilter;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+filter);}else{ortc.sockjs.send(\"subscribe;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm);}}}}}};/*\n\t * Unsubscribes from the channel so the client object stops receiving messages sent to it.\n\t */this.unsubscribe=function(channel){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(!subscribedChannels[channel]||subscribedChannels[channel]&&!subscribedChannels[channel].isSubscribed){delegateExceptionCallback(ortc,\"Not subscribed to the channel \"+channel);}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else{if(ortc.sockjs!=null){if(subscribedChannels[channel].withNotifications==true){ortc.sockjs.send(\"unsubscribe;\"+ortc.appKey+\";\"+channel+\";\"+ortc.registrationId+\";\"+pushPlatform);}else{ortc.sockjs.send(\"unsubscribe;\"+ortc.appKey+\";\"+channel);}}}};/*\n\t * Sends the message to the channel.\n\t */this.send=function(channel,message){/*\n\t Sanity Checks\n\t */if(!isConnected||ortc.sockjs==null){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(!message){delegateExceptionCallback(ortc,\"Message is null or empty\");}else if(!ortcIsString(message)){delegateExceptionCallback(ortc,\"Message must be a string\");}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else{var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){delegateExceptionCallback(ortc,\"No permission found to send to the channel \\\"\"+channel+\"\\\"\");}else{// Multi part\n\tvar messageParts=[];var messageId=generateId(8);var i;var allowedMaxSize=messageMaxSize-channel.length;for(i=0;i<message.length;i=i+allowedMaxSize){// Just one part\n\tif(message.length<=allowedMaxSize){messageParts.push(message);break;}if(message.substring(i,i+allowedMaxSize)){messageParts.push(message.substring(i,i+allowedMaxSize));}}for(var j=1;j<=messageParts.length;j++){ortc.sockjs.send(\"send;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+messageId+\"_\"+j+\"-\"+messageParts.length+\"_\"+messageParts[j-1]);}}}};/*\n\t * Sends the message to multiple channels.\n\t */this.batchSend=function(channels,message){/*\n\t Sanity Checks\n\t */channels=ortcStrToArray(channels);if(!isConnected||ortc.sockjs==null){delegateExceptionCallback(ortc,\"Not connected\");}else if(!ortcIsArray(channels)){delegateExceptionCallback(ortc,\"Channels must be a array\");}else if(!message){delegateExceptionCallback(ortc,\"Message is null or empty\");}else if(!ortcIsString(message)){delegateExceptionCallback(ortc,\"Message must be a string\");}else if(channels.length<=0){delegateExceptionCallback(ortc,\"Channels must be an array at least with one channel\");}else if(channels.length>channelsMaxSize){channels=[];delegateExceptionCallback(ortc,\"The channel maximum was reached (>\"+channelsMaxSize+\")\");}for(i=0;i<channels.length;i++){var channel=channels[i];if(channel.length>channelMaxSize){channels.splice(i,1);delegateExceptionCallback(ortc,\"Channel \"+channel+\" size exceeds the limit of \"+channelMaxSize+\" characters\");}}if(channels.length>0){var arrayHashPerm=[];for(i=0;i<channels.length;i++){var channel=channels[i];var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){channels.splice(i,1);delegateExceptionCallback(ortc,\"No permission found to send to the channel \\\"\"+channel+\"\\\"\");}else{arrayHashPerm.push(hashPerm);}}if(channels.length>0){var messageParts=[];var messageId=generateId(8);var allowedMaxSize=messageMaxSize-channels.toString().length;for(i=0;i<message.length;i=i+allowedMaxSize){// Just one part\n\tif(message.length<=allowedMaxSize){messageParts.push(message);break;}if(message.substring(i,i+allowedMaxSize)){messageParts.push(message.substring(i,i+allowedMaxSize));}}for(j=1;j<=messageParts.length;j++){ortc.sockjs.send(\"batchSend;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+JSON.stringify(channels)+\";\"+JSON.stringify(arrayHashPerm)+\";\"+messageId+\"_\"+j+\"-\"+messageParts.length+\"_\"+messageParts[j-1]);}}}};/*\n\t * Disconnects from the gateway.\n\t */this.disconnect=function(){clearReconnectInterval();stopReconnectProcess();// Clear subscribed channels\n\tsubscribedChannels={};/*\n\t Sanity Checks\n\t */if(!isConnected&&!invalidConnection){delegateExceptionCallback(ortc,\"Not connected\");}else{disconnectSocket();}};/*\n\t * Gets a value indicating whether this client object is subscribed to the channel.\n\t */this.isSubscribed=function(channel){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else{if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed){return subscribedChannels[channel].isSubscribed;}else{return false;}}};/*\n\t * Gets a json indicating the subscriptions in a channel.\n\t */this.presence=function(parameters,callback){try{var requestUrl=null,isCluster=false,appKey=ortc.appKey,authToken=ortc.authToken;if(parameters.url){requestUrl=parameters.url.ortcTreatUrl();isCluster=parameters.isCluster;appKey=parameters.applicationKey;authToken=parameters.authenticationToken;}else{if(clusterUrl&&clusterUrl!=null){requestUrl=clusterUrl;isCluster=true;}else{requestUrl=url.ortcTreatUrl();;}}getServerUrl({requestUrl:requestUrl,isCluster:isCluster,appKey:appKey},function(error,serverUrl){if(error){callback(error,null);}else{jsonp(serverUrl+\"/presence/\"+appKey+\"/\"+authToken+\"/\"+parameters.channel,callback);}});}catch(e){callback(\"Unable to get presence data\",null);}};var getServerUrl=function(parameters,callback){if(parameters.requestUrl&&parameters.isCluster){var guid=generateGuid();var queryString=\"guid=\"+generateGuid();queryString=parameters.appKey?queryString+\"&appkey=\"+parameters.appKey:queryString;loadClusterServerScript(parameters.requestUrl+\"/?\"+queryString,guid,function(clusterServerResolved,scriptGuid){if(clusterServerResolved){var resultUrl=SOCKET_SERVER;callback(null,resultUrl);}else{callback(null,\"Unable to get server from cluster\");}try{clearScripts(scriptGuid);}catch(loadError){}});}else{var resultUrl=parameters.requestUrl.ortcTreatUrl();callback(null,resultUrl);}};/*\n\t * Adds the Webspectator bootstrap script for the outmost frame on the same domain.\n\t */this.setMonetizerId=function(publicId){var tempWin;var win=tempWin=window;while(tempWin!=window.top){try{if(tempWin.frameElement){win=tempWin.parent;}}catch(e){}tempWin=tempWin.parent;}if(!win._WS_BOOT){var s=document.createElement(\"SCRIPT\");s.src=\"//wfpscripts.webspectator.com/bootstrap/ws-\"+publicId+\".js\";document.getElementsByTagName(\"head\")[0].appendChild(s);}};/***********************************************************\n\t * @private methods\n\t ***********************************************************//*\n\t * Change the current URL to use SSL\n\t */var changeUrlSsl=function(){if(!(\"ActiveXObject\"in window)){if(clusterUrl&&clusterUrl!=null){//clusterUrl = clusterUrl.replace(\"http://\", \"https://\");\n\tif(clusterUrl.indexOf(\"ssl/\")<0){var slashAtTheEnd=clusterUrl.search(/\\/([\\d.]*)\\/$/);if(slashAtTheEnd>-1){clusterUrl=clusterUrl.substring(0,slashAtTheEnd+1)+\"ssl/\"+clusterUrl.substring(slashAtTheEnd+1,clusterUrl.length);}else{clusterUrl=clusterUrl.substring(0,clusterUrl.lastIndexOf(\"/\")+1)+\"ssl/\"+clusterUrl.substring(clusterUrl.lastIndexOf(\"/\")+1);}}}else{url=url.replace(\"http://\",\"https://\");}}// Create session cookie\n\t//createSessionCookie(sslSessionCookieName, 1);\n\t};/*\n\t * Clear the reconnecting interval\n\t */var clearReconnectInterval=function(){if(ortc.reconnectIntervalId){clearInterval(ortc.reconnectIntervalId);ortc.reconnectIntervalId=null;}};/*\n\t * Clear the validated timeout\n\t */var clearValidatedTimeout=function(self){if(self.validatedTimeoutId){clearTimeout(self.validatedTimeoutId);self.validatedTimeoutId=null;}};/*\n\t * Stop the reconnecting process\n\t */var stopReconnectProcess=function(){stopReconnecting=true;alreadyConnectedFirstTime=false;};var startHeartBeatInterval=function(self){if(!self.heartbeatInterval&&heartbeatActive){self.sockjs.send(\"b\");self.heartbeatInterval=setInterval(function(){if(!heartbeatActive){stopHeartBeatInterval(self);}else{self.sockjs.send(\"b\");}},heartbeatTime*1000);}};var stopHeartBeatInterval=function(self){if(self.heartbeatInterval){clearInterval(self.heartbeatInterval);self.heartbeatInterval=null;}};/*\n\t * Creates a cookie with expiration time.\n\t */var createExpireCookie=function(name,value,minutes){var expires=\"\";if(minutes){var date=new Date();date.setTime(date.getTime()+minutes*60*1000);expires=\"; expires=\"+date.toGMTString();}document.cookie=name+\"=\"+value+expires+\"; path=/\";};/*\n\t * Creates a session cookie.\n\t */var createSessionCookie=function(name,value){document.cookie=name+\"=\"+value+\"; path=/\";};/*\n\t * Reads a cookie.\n\t */var readCookie=function(name){var nameEQ=name+\"=\";var ca=document.cookie.split(\";\");var result=null;for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==\" \"){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)==0){result=c.substring(nameEQ.length,c.length);break;}}return result;};/*\n\t * Generates an ID.\n\t */var generateId=function(size){var result=\"\";var S4=function(){return((1+Math.random())*0x10000|0).toString(16).substring(1);};for(var i=0;i<size/4;i++){result+=S4();}return result;};/*\n\t * Disconnects the socket.\n\t */var disconnectSocket=function(){stopHeartBeatInterval(ortc);reconnectStartedAt=null;isConnected=false;isConnecting=false;validatedArrived=false;retryingWithSsl=false;clearValidatedTimeout(self);if(ortc.sockjs!=null){ortc.sockjs.close();ortc.sockjs=null;}};/*\n\t * Reconnects the socket.\n\t */var reconnectSocket=function(){stopHeartBeatInterval(ortc);if(isConnecting){delegateExceptionCallback(ortc,\"Unable to connect\");}isConnecting=true;delegateReconnectingCallback(ortc);reconnectStartedAt=new Date().getTime();if(clusterUrl&&clusterUrl!=null){clusterConnection();}else{ortc.sockjs=createSocketConnection(url);}};/*\n\t * Tries a connection through the cluster gateway with the application key and authentication token.\n\t */var clusterConnection=function(){var guid=generateGuid();var queryString=\"guid=\"+generateGuid();queryString=ortc.appKey?queryString+\"&appkey=\"+ortc.appKey:queryString;loadClusterServerScript(clusterUrl+\"/?\"+queryString,guid,function(clusterServerResolved,scriptGuid){if(clusterServerResolved){url=SOCKET_SERVER;sockjs=createSocketConnection(ortc.getUrl());}try{clearScripts(scriptGuid);}catch(loadError){}});};/*\n\t * Clears the javascript scripts previously loaded into the page.\n\t */var clearScripts=function(guid){var headChildren=document.getElementsByTagName(\"head\")[0].children;var childrenToRemove=[];for(var i=0;i<headChildren.length;i++){if(headChildren[i].attributes!=null&&headChildren[i].attributes[\"ortcScriptId\"]&&headChildren[i].attributes[\"ortcScriptId\"].value==guid){childrenToRemove.push(i);}}for(var child in childrenToRemove){document.getElementsByTagName(\"head\")[0].removeChild(headChildren[childrenToRemove[child]]);}};/*\n\t * Loads the cluster server javascript script into the page.\n\t */var loadClusterServerScript=function(scriptUrl,guid,callback){var script=document.createElement(\"script\");script.type=\"text/javascript\";script.setAttribute(\"ortcScriptId\",guid);waitingClusterResponse=true;if(script.readyState){// IE\n\tscript.onreadystatechange=function(){if(script.readyState==\"loaded\"||script.readyState==\"complete\"){waitingClusterResponse=false;script.onreadystatechange=null;if(typeof SOCKET_SERVER!=\"undefined\"&&SOCKET_SERVER.indexOf(\"undefined\")<0&&SOCKET_SERVER.indexOf(\"unknown_server\")<0){callback(true,guid);}else{callback(false,guid);}}};}else{// Others\n\tscript.onload=function(){waitingClusterResponse=false;if(typeof SOCKET_SERVER!=\"undefined\"&&SOCKET_SERVER.indexOf(\"undefined\")<0&&SOCKET_SERVER.indexOf(\"unknown_server\")<0){callback(true,guid);}else{callback(false,guid);}};}script.onerror=function(){waitingClusterResponse=false;};script.src=scriptUrl;document.getElementsByTagName(\"head\")[0].appendChild(script);};/*\n\t * Generates a GUID.\n\t */var generateGuid=function(){var S4=function(){return((1+Math.random())*0x10000|0).toString(16).substring(1);};return S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4();};/*\n\t * Count the dictionary keys.\n\t */var countKeys=function(dic){var count=0;for(var i in dic){count++;}return count;};/*\n\t * Creates a socket connection.\n\t */var createSocketConnection=function(connectionUrl){var self=ortc;if(self.sockjs==null){if(navigator&&navigator.userAgent&&navigator.userAgent.indexOf(\"PlayStation Vita\")>=0){protocol=\"jsonp-polling\";}self.sockjs=new SockJS(connectionUrl+\"/broadcast\",protocol);// Timeout to receive the validated message\n\tif(!self.sslFallback){var validateTimeoutTime=5000;self.validatedTimeoutId=setTimeout(function(){self.sslFallback=true;stopReconnectProcess();disconnectSocket();invalidConnection=true;retryingWithSsl=true;if(connectionUrl.indexOf(\"https://\")>=0){// We are already using SSL, try streaming\n\tprotocol=\"xhr-streaming\";}else{protocol=undefined;}changeUrlSsl();},validateTimeoutTime);}else if(!self.xhrStreamingFallback){// The SSL fallback failed. Try xhr-streaming\n\tvar validateSslTimeoutTime=5000;self.validatedTimeoutId=setTimeout(function(){self.xhrStreamingFallback=true;stopReconnectProcess();disconnectSocket();invalidConnection=true;retryingWithSsl=true;protocol=\"xhr-streaming\";},validateSslTimeoutTime);}// Connect handler\n\tself.sockjs.onopen=function(){protocol=self.sockjs.protocol;// Update last keep alive time\n\tlastKeepAlive=new Date().getTime();// If is a reconnect do not count session\n\tif(alreadyConnectedFirstTime){sessionId=\"\";}else{// Read session cookie\n\tsessionId=readCookie(sessionCookieName+self.appKey+\"-s\");if(!sessionId){// Read expiration cookie\n\tsessionId=readCookie(sessionCookieName+self.appKey);if(!sessionId){sessionId=generateId(16);}// Create session cookie\n\tcreateSessionCookie(sessionCookieName+self.appKey+\"-s\",sessionId);// Check if session cookie was created\n\tif(!readCookie(sessionCookieName+self.appKey+\"-s\")){sessionId=\"\";}}}var heartbeatDetails=heartbeatActive?\";\"+self.getHeartbeatTime()+\";\"+self.getHeartbeatFails()+\";\":\"\";self.sockjs.send(\"validate;\"+self.appKey+\";\"+self.authToken+\";\"+(announcementSubChannel?announcementSubChannel:\"\")+\";\"+sessionId+\";\"+connectionMetadata+heartbeatDetails);};// Disconnect handler\n\tself.sockjs.onclose=function(e){// e.code=1000 - e.reason=Normal closure\n\t// e.code=1006 - e.reason=WebSocket connection broken\n\t// e.code=2000 - e.reason=All transports failed\n\tstopHeartBeatInterval(ortc);if(ortc.sockjs!=null){ortc.sockjs.close();ortc.sockjs=null;}// Clear user permissions\n\tuserPerms=null;if(e.code!=1000){if(isConnected){isConnected=false;isConnecting=false;protocol=undefined;delegateDisconnectedCallback(self);}if(!stopReconnecting){if(!reconnectStartedAt||reconnectStartedAt+connectionTimeout<new Date().getTime()){reconnectSocket();}}}else{if(!invalidConnection){isConnected=false;isConnecting=false;protocol=undefined;delegateDisconnectedCallback(self);}}if(retryingWithSsl){self.connect(self.appKey,self.authToken);retryingWithSsl=false;}invalidConnection=false;};// Receive handler\n\tself.sockjs.onmessage=function(e){// Update last keep alive time\n\tlastKeepAlive=new Date().getTime();var data=e.data;var channel=data.ch;var message=data.m;var filtered=data.f;// Multi part\n\tvar regexPattern=/^(\\w[^_]*)_{1}(\\d*)-{1}(\\d*)_{1}([\\s\\S.]*)$/;var match=regexPattern.exec(message);var messageId=null;var messageCurrentPart=1;var messageTotalPart=1;var lastPart=false;if(match&&match.length>0){if(match[1]){messageId=match[1];}if(match[2]){messageCurrentPart=match[2];}if(match[3]){messageTotalPart=match[3];}if(match[4]){message=match[4];}}if(messageId){if(!messagesBuffer[messageId]){messagesBuffer[messageId]={};}messagesBuffer[messageId][messageCurrentPart]=message;if(countKeys(messagesBuffer[messageId])==messageTotalPart){lastPart=true;}}else{lastPart=true;}if(lastPart){if(messageId){message=\"\";for(var i=1;i<=messageTotalPart;i++){message+=messagesBuffer[messageId][i];delete messagesBuffer[messageId][i];}delete messagesBuffer[messageId];}delegateMessagesCallback(self,channel,filtered,message);}};self.sockjs.onortcsubscribed=function(e){lastKeepAlive=new Date().getTime();var channel=e.data;if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;subscribedChannels[channel].isSubscribed=true;}delegateSubscribedCallback(self,channel);};self.sockjs.onortcunsubscribed=function(e){lastKeepAlive=new Date().getTime();var channel=e.data;if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribed=false;}delegateUnsubscribedCallback(self,channel);};self.sockjs.onheartbeat=function(){lastKeepAlive=new Date().getTime();};self.sockjs.onortcvalidated=function(e){var sessionExpirationTime=30;if(e.data){userPerms=e.data;}if(e.set){sessionExpirationTime=e.set;}clearValidatedTimeout(self);validatedArrived=true;retryingWithSsl=false;isConnecting=false;isConnected=true;reconnectStartedAt=null;if(sessionId){if(!readCookie(sessionCookieName+self.appKey+\"-s\")){createSessionCookie(sessionCookieName+self.appKey+\"-s\",sessionId);}if(!readCookie(sessionCookieName+self.appKey)){createExpireCookie(sessionCookieName+self.appKey,sessionId,sessionExpirationTime);}}if(alreadyConnectedFirstTime){var channelsToRemove={};// Subscribe to the previously subscribed channels\n\tfor(var key in subscribedChannels){// Subscribe again\n\tif(subscribedChannels[key].subscribeOnReconnected==true&&(subscribedChannels[key].isSubscribing||subscribedChannels[key].isSubscribed)){subscribedChannels[key].isSubscribing=true;subscribedChannels[key].isSubscribed=false;var domainChannelCharacterIndex=key.indexOf(\":\");var channelToValidate=key;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=key.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[key];}if(subscribedChannels[key].filter){self.sockjs.send(\"subscribefilter;\"+self.appKey+\";\"+self.authToken+\";\"+key+\";\"+hashPerm+\";\"+subscribedChannels[key].filter);}else{self.sockjs.send(\"subscribe;\"+self.appKey+\";\"+self.authToken+\";\"+key+\";\"+hashPerm);}}else{channelsToRemove[key]=key;}}for(var keyToRemove in channelsToRemove){delete subscribedChannels[keyToRemove];}messagesBuffer={};delegateReconnectedCallback(self);}else{alreadyConnectedFirstTime=true;delegateConnectedCallback(self);}};self.sockjs.onortcerror=function(e){lastKeepAlive=new Date().getTime();var data=e.data;var operation=data.op;var channel=data.ch;var error=data.ex?data.ex:data;delegateExceptionCallback(self,error);switch(operation){case\"validate\":if(error.indexOf(\"busy\")<0){invalidConnection=true;clearValidatedTimeout(self);retryingWithSsl=false;stopReconnectProcess();}else{clearValidatedTimeout(self);retryingWithSsl=false;}break;case\"subscribe\":if(channel&&subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;}break;case\"subscribe_maxsize\":case\"unsubscribe_maxsize\":case\"shutdown\":clearValidatedTimeout(self);retryingWithSsl=false;break;case\"send_maxsize\":if(channel&&subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;}stopReconnectProcess();break;default:break;}};}return self.sockjs;};var jsonp=function(url,callback){var head=document.head?document.head:document.getElementsByTagName(\"head\")[0];var script=document.createElement(\"script\");var guid=\"ortcJsonp\"+ +new Date();var jsonpCallTimeout=setTimeout(function(){try{callback(\"Unable to get data\",null);window[guid]=undefined;delete window[guid];head.removeChild(script);}catch(e){}},15*1000);window[guid]=function(data){clearTimeout(jsonpCallTimeout);if(data.error){callback(data.error,null);}else{callback(null,data.content);}try{window[guid]=undefined;delete window[guid];head.removeChild(script);}catch(e){}};script.setAttribute(\"src\",url+\"?callback=\"+guid);head.appendChild(script);};var delegateConnectedCallback=function(ortc){if(ortc!=null&&ortc.onConnected!=null){startHeartBeatInterval(ortc);ortc.onConnected(ortc);}};var delegateDisconnectedCallback=function(ortc){if(ortc!=null&&ortc.onDisconnected!=null){ortc.onDisconnected(ortc);}};var delegateSubscribedCallback=function(ortc,channel){if(ortc!=null&&ortc.onSubscribed!=null&&channel!=null){ortc.onSubscribed(ortc,channel);}};var delegateUnsubscribedCallback=function(ortc,channel){if(ortc!=null&&ortc.onUnsubscribed!=null&&channel!=null){ortc.onUnsubscribed(ortc,channel);}};var delegateMessagesCallback=function(ortc,channel,filtered,message){if(ortc!=null&&subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed&&subscribedChannels[channel].onMessageCallback!=null){if(filtered==null){// regular subscription\n\tsubscribedChannels[channel].onMessageCallback(ortc,channel,message);}else{// filtered subscription\n\tsubscribedChannels[channel].onMessageCallback(ortc,channel,filtered,message);}}};var delegateExceptionCallback=function(ortc,event){if(ortc!=null&&ortc.onException!=null){ortc.onException(ortc,event);}};var delegateReconnectingCallback=function(ortc){if(ortc!=null&&ortc.onReconnecting!=null){ortc.onReconnecting(ortc);}};var delegateReconnectedCallback=function(ortc){if(ortc!=null&&ortc.onReconnected!=null){startHeartBeatInterval(ortc);ortc.onReconnected(ortc);}};}", "componentDidMount() {\n //setLocalNotification();\n }", "function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\n\t\tMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n\t\t{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\t\t\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n\t\t(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n<s.length;n++)g=s[n],f==\"a.contentType\"?(h&&(h+=\",\"+g),w[g]=e[f]):a==\"view\"||a==\"segmentView\"||a==\"clicked\"||a==\"complete\"||a==\"timePlayed\"||a==\"CPM\"?(d&&(d+=\",\"+\r\n\t\tg),a==\"timePlayed\"||a==\"CPM\"?e[f]&&(w.events2+=(w.events2?\",\":\"\")+g+\"=\"+e[f]):e[f]&&(w.events2+=(w.events2?\",\":\"\")+g)):a==\"segment\"&&e[f+\"Num\"]?(h&&(h+=\",\"+g),w[g]=e[f+\"Num\"]+\":\"+e[f]):(h&&(h+=\",\"+g),w[g]=e[f])}else if(a==\"milestones\"||a==\"offsetMilestones\")f=f.substring(0,f.length-1),e[f]&&m.contextDataMapping[f+\"s\"][e[f]]&&(d&&(d+=\",\"+m.contextDataMapping[f+\"s\"][e[f]]),w.events2+=(w.events2?\",\":\"\")+m.contextDataMapping[f+\"s\"][e[f]]);e[f]&&(e[f]=0);a==\"segment\"&&e[f+\"Num\"]&&(e[f+\"Num\"]=0)}}w.linkTrackVars=\r\n\t\th;w.linkTrackEvents=d};m.g=function(w,b,c,h,d){var a={},g=(new Date).getTime()/1E3,e,f,s=m.trackVars,n=m.trackEvents,o=m.trackSeconds,p=m.trackMilestones,q=m.trackOffsetMilestones,r=m.segmentByMilestones,t=m.segmentByOffsetMilestones,k,j,l=1,i={},u;if(!m.channel)m.channel=m.s.w.location.hostname;if(a=w&&m.list&&m.list[w]?m.list[w]:0){if(a.l)o=m.adTrackSeconds,p=m.adTrackMilestones,q=m.adTrackOffsetMilestones,r=m.adSegmentByMilestones,t=m.adSegmentByOffsetMilestones;c<0&&(c=a.j==1&&a.r>0?g-a.r+a.a:\r\n\t\ta.a);a.length>0&&(c=c<a.length?c:a.length);c<0&&(c=0);a.u=c;if(a.length>0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\t\t\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f/a.length*100<e&&a.c>=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f<e&&c>=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j<k.length;j++)if(e=k[j]?parseFloat(\"\"+\r\n\t\tk[j]):0){if(a.c<e)h=j+1,d=\"M:\"+f+\"-\"+e,j=k.length;f=e}}}else if(t&&q&&(k=q.split(\",\"))){k.push(\"\"+(a.length>0?a.length:\"E\"));for(j=f=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)||k[j]==\"E\"){if(c<e||k[j]==\"E\")h=j+1,d=\"O:\"+f+\"-\"+e,j=k.length;f=e}}if(d)a.K=!0}if((d||a.e)&&d!=a.e){a.D=!0;if(!a.e)a.m=h,a.e=d;a.k>=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a<c)a.L+=c-a.a,a.f+=c-a.a;if(b<=2||b==3&&!a.j)a.B+=(b==1||b==3?\"S\":\"E\")+Math.floor(c),a.j=b==3?1:b;if(!l&&a.k>=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\t\t\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\n\t\ta.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\n\t\tb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\n\t\tb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b<w.length;b++)m.attach(w[b])};m.i(s,\"load\",m.N)}", "constructor(httpClient) {\n this.httpClient = httpClient;\n //public url_base = \"http://localhost:8080\";\n this.url_base = \"https://yaoyuan333.wm.r.appspot.com\";\n }", "function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\nMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n<s.length;n++)g=s[n],f==\"a.contentType\"?(h&&(h+=\",\"+g),w[g]=e[f]):a==\"view\"||a==\"segmentView\"||a==\"clicked\"||a==\"complete\"||a==\"timePlayed\"||a==\"CPM\"?(d&&(d+=\",\"+\r\ng),a==\"timePlayed\"||a==\"CPM\"?e[f]&&(w.events2+=(w.events2?\",\":\"\")+g+\"=\"+e[f]):e[f]&&(w.events2+=(w.events2?\",\":\"\")+g)):a==\"segment\"&&e[f+\"Num\"]?(h&&(h+=\",\"+g),w[g]=e[f+\"Num\"]+\":\"+e[f]):(h&&(h+=\",\"+g),w[g]=e[f])}else if(a==\"milestones\"||a==\"offsetMilestones\")f=f.substring(0,f.length-1),e[f]&&m.contextDataMapping[f+\"s\"][e[f]]&&(d&&(d+=\",\"+m.contextDataMapping[f+\"s\"][e[f]]),w.events2+=(w.events2?\",\":\"\")+m.contextDataMapping[f+\"s\"][e[f]]);e[f]&&(e[f]=0);a==\"segment\"&&e[f+\"Num\"]&&(e[f+\"Num\"]=0)}}w.linkTrackVars=\r\nh;w.linkTrackEvents=d};m.g=function(w,b,c,h,d){var a={},g=(new Date).getTime()/1E3,e,f,s=m.trackVars,n=m.trackEvents,o=m.trackSeconds,p=m.trackMilestones,q=m.trackOffsetMilestones,r=m.segmentByMilestones,t=m.segmentByOffsetMilestones,k,j,l=1,i={},u;if(!m.channel)m.channel=m.s.w.location.hostname;if(a=w&&m.list&&m.list[w]?m.list[w]:0){if(a.l)o=m.adTrackSeconds,p=m.adTrackMilestones,q=m.adTrackOffsetMilestones,r=m.adSegmentByMilestones,t=m.adSegmentByOffsetMilestones;c<0&&(c=a.j==1&&a.r>0?g-a.r+a.a:\r\na.a);a.length>0&&(c=c<a.length?c:a.length);c<0&&(c=0);a.u=c;if(a.length>0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f/a.length*100<e&&a.c>=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f<e&&c>=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j<k.length;j++)if(e=k[j]?parseFloat(\"\"+\r\nk[j]):0){if(a.c<e)h=j+1,d=\"M:\"+f+\"-\"+e,j=k.length;f=e}}}else if(t&&q&&(k=q.split(\",\"))){k.push(\"\"+(a.length>0?a.length:\"E\"));for(j=f=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)||k[j]==\"E\"){if(c<e||k[j]==\"E\")h=j+1,d=\"O:\"+f+\"-\"+e,j=k.length;f=e}}if(d)a.K=!0}if((d||a.e)&&d!=a.e){a.D=!0;if(!a.e)a.m=h,a.e=d;a.k>=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a<c)a.L+=c-a.a,a.f+=c-a.a;if(b<=2||b==3&&!a.j)a.B+=(b==1||b==3?\"S\":\"E\")+Math.floor(c),a.j=b==3?1:b;if(!l&&a.k>=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\na.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\nb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\nb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b<w.length;b++)m.attach(w[b])};m.i(s,\"load\",m.N)}", "create () {\r\n // Send a create-job message to the native-app.\r\n openPort();\r\n return browser.storage.local.get({ props: {} }).then(result => {\r\n // Get a cookie jar for the job.\r\n return getCookieJarForVideo(this.props.videoUrl).then(cookieJar => {\r\n state.port.postMessage({\r\n topic: 'create-job',\r\n data: {\r\n jobId: this.id,\r\n // Merge the default props and the job props.\r\n props: Object.assign({ cookieJar }, result.props, this.props)\r\n }\r\n });\r\n \r\n // Flag this job as active.\r\n this.state = 'active';\r\n \r\n // Make the icon blue because a job is running.\r\n browser.browserAction.setIcon({\r\n path: 'icons/film-blue.svg'\r\n });\r\n });\r\n });\r\n }", "supportsPlatform() {\n return true;\n }", "function FileSystemService($http, $q, $log) {\n var _directory = LocalFileSystem.PERSISTENT;\n var _fs = null;\n var _that = this;\n\n this.isInitalized = false;\n\n function errorHandler(e) {\n var msg = '';\n\n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n msg = 'QUOTA_EXCEEDED_ERR';\n break;\n case FileError.NOT_FOUND_ERR:\n msg = 'NOT_FOUND_ERR';\n break;\n case FileError.SECURITY_ERR:\n msg = 'SECURITY_ERR';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n msg = 'INVALID_MODIFICATION_ERR';\n break;\n case FileError.INVALID_STATE_ERR:\n msg = 'INVALID_STATE_ERR';\n break;\n default:\n msg = 'Unknown Error';\n break;\n };\n\n $log.error('FileSystemService: ' + msg);\n }\n\n // startup\n window.requestFileSystem(_directory, 0, function(fs){\n _fs = fs;\n _that.isInitalized = true;\n }, errorHandler);\n\n\n /**\n * Checks if file is in persistent storage\n */\n this.fileExists = function(filename) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n //var uri = _directory + \"/\" + filename;\n //return $http.get(uri);\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {}, function(fileEntry) {\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n deferred.resolve(e.target.result);\n };\n\n reader.readAsDataURL(file);\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n\n /**\n * Get File from perstistent storage\n */\n this.getFile = function(filename) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n //var uri = _directory + \"/\" + filename;\n //return $http.get(uri);\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {}, function(fileEntry) {\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n deferred.resolve(e.target.result);\n };\n\n reader.readAsDataURL(file);\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n\n /**\n * Save data into file (and create that if necessary).\n */\n this.saveFile = function(filename, data) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {create: true}, function(fileEntry) {\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function(fileWriter) {\n\n fileWriter.onwriteend = function(e) {\n $log.log('Write completed.');\n deferred.resolve();\n };\n\n fileWriter.onerror = function(e) {\n deferred.reject(e);\n $log.error('FileSystemService: write failed, ' + e.toString());\n };\n\n // Create a new Blob and write it to log.txt.\n var blob = new Blob([data], {type: 'text/plain'});\n\n fileWriter.write(blob);\n\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n}", "static initialize(app, changeLogService, deviceService, deviceFileService, deviceFileUploadService, file, httpService, localDBManagementService, localDbService, networkService, securityService) {\n if (this.initialized) {\n return;\n }\n deviceService.addStartUpService({\n serviceName: 'OfflineStartupService',\n start: () => {\n if (window['SQLitePlugin']) {\n localDBManagementService.setLogSQl((sessionStorage.getItem('wm.logSql') === 'true') || (sessionStorage.getItem('debugMode') === 'true'));\n window.logSql = (flag = true) => {\n localDBManagementService.setLogSQl(flag);\n sessionStorage.setItem('wm.logSql', flag ? 'true' : 'false');\n };\n window.executeLocalSql = (dbName, query, params) => {\n localDBManagementService.executeSQLQuery(dbName, query, params, true);\n };\n return localDBManagementService.loadDatabases().then(() => {\n changeLogService.addWorker(new IdResolver(localDBManagementService));\n changeLogService.addWorker(new ErrorBlocker(localDBManagementService));\n changeLogService.addWorker(new FileHandler());\n changeLogService.addWorker(new MultiPartParamTransformer(deviceFileService, localDBManagementService));\n new LiveVariableOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService, localDbService).add();\n new FileUploadOfflineBehaviour(changeLogService, deviceFileService, deviceFileUploadService, file, networkService, deviceFileService.getUploadDirectory()).add();\n new NamedQueryExecutionOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService).add();\n localDBManagementService.registerCallback(new UploadedFilesImportAndExportService(changeLogService, deviceFileService, localDBManagementService, file));\n changeLogService.addWorker({\n onAddCall: () => {\n if (!networkService.isConnected()) {\n networkService.disableAutoConnect();\n }\n },\n postFlush: stats => {\n if (stats.totalTaskCount > 0) {\n localDBManagementService.close()\n .catch(noop)\n .then(() => {\n location.assign(window.location.origin + window.location.pathname);\n });\n }\n }\n });\n });\n }\n return Promise.resolve();\n }\n });\n new SecurityOfflineBehaviour(app, file, deviceService, networkService, securityService).add();\n }", "constructor(){\n\t\t//console.log('API START');\n\t}", "get deviceServiceUUID() { return this._deviceServiceUUID ? this._deviceServiceUUID : 'FFE0'; }", "constructor () {\r\n\t\t\r\n\t}", "_sdkCompatibility() {\n // WebSocket\n // http://caniuse.com/#feat=websockets\n var canCreateWebSocket = 'WebSocket' in window;\n console.log('Native WebSocket capability: ' +\n canCreateWebSocket);\n\n if (!canCreateWebSocket) {\n throw new Error('No WebSocket capabilities');\n }\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x330b4067;\n this.SUBCLASS_OF_ID = 0xd3262a4a;\n\n this.phonecallsEnabled = args.phonecallsEnabled || null;\n this.defaultP2pContacts = args.defaultP2pContacts || null;\n this.preloadFeaturedStickers = args.preloadFeaturedStickers || null;\n this.ignorePhoneEntities = args.ignorePhoneEntities || null;\n this.revokePmInbox = args.revokePmInbox || null;\n this.blockedMode = args.blockedMode || null;\n this.pfsEnabled = args.pfsEnabled || null;\n this.date = args.date;\n this.expires = args.expires;\n this.testMode = args.testMode;\n this.thisDc = args.thisDc;\n this.dcOptions = args.dcOptions;\n this.dcTxtDomainName = args.dcTxtDomainName;\n this.chatSizeMax = args.chatSizeMax;\n this.megagroupSizeMax = args.megagroupSizeMax;\n this.forwardedCountMax = args.forwardedCountMax;\n this.onlineUpdatePeriodMs = args.onlineUpdatePeriodMs;\n this.offlineBlurTimeoutMs = args.offlineBlurTimeoutMs;\n this.offlineIdleTimeoutMs = args.offlineIdleTimeoutMs;\n this.onlineCloudTimeoutMs = args.onlineCloudTimeoutMs;\n this.notifyCloudDelayMs = args.notifyCloudDelayMs;\n this.notifyDefaultDelayMs = args.notifyDefaultDelayMs;\n this.pushChatPeriodMs = args.pushChatPeriodMs;\n this.pushChatLimit = args.pushChatLimit;\n this.savedGifsLimit = args.savedGifsLimit;\n this.editTimeLimit = args.editTimeLimit;\n this.revokeTimeLimit = args.revokeTimeLimit;\n this.revokePmTimeLimit = args.revokePmTimeLimit;\n this.ratingEDecay = args.ratingEDecay;\n this.stickersRecentLimit = args.stickersRecentLimit;\n this.stickersFavedLimit = args.stickersFavedLimit;\n this.channelsReadMediaPeriod = args.channelsReadMediaPeriod;\n this.tmpSessions = args.tmpSessions || null;\n this.pinnedDialogsCountMax = args.pinnedDialogsCountMax;\n this.pinnedInfolderCountMax = args.pinnedInfolderCountMax;\n this.callReceiveTimeoutMs = args.callReceiveTimeoutMs;\n this.callRingTimeoutMs = args.callRingTimeoutMs;\n this.callConnectTimeoutMs = args.callConnectTimeoutMs;\n this.callPacketTimeoutMs = args.callPacketTimeoutMs;\n this.meUrlPrefix = args.meUrlPrefix;\n this.autoupdateUrlPrefix = args.autoupdateUrlPrefix || null;\n this.gifSearchUsername = args.gifSearchUsername || null;\n this.venueSearchUsername = args.venueSearchUsername || null;\n this.imgSearchUsername = args.imgSearchUsername || null;\n this.staticMapsProvider = args.staticMapsProvider || null;\n this.captionLengthMax = args.captionLengthMax;\n this.messageLengthMax = args.messageLengthMax;\n this.webfileDcId = args.webfileDcId;\n this.suggestedLangCode = args.suggestedLangCode || null;\n this.langPackVersion = args.langPackVersion || null;\n this.baseLangPackVersion = args.baseLangPackVersion || null;\n }", "static _getName() {\n return 'ContentPlayback';\n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "start(callback){\n \n }", "async componentWillMount() {\n var _this = this\n _this.setUpUserDataFromFB()\n\n //ASK FOR CAMERA ONLT IF IS PREVIEW TRUE AND SHOWBARCODE TRUE\n if (Config.isPreview && Config.showBCScanner) {\n const { status } = await Permissions.askAsync(Permissions.CAMERA);\n this.setState({ hasCameraPermission: status === 'granted' });\n }\n\n\n\n AppEventEmitter.addListener('user.state.changes', this.alterUserState);\n if (Config.isTesterApp) {\n this.listenForUserAuth();\n } else if (Config.isPreview && !Config.isTesterApp) {\n //Load list of apps\n _this.retreiveAppDemos(\"apps\");\n }\n\n if (!Config.isPreview && !Config.isTesterApp) {\n\n //Load the data automatically, this is normal app and refister for Push notification\n this.registerForPushNotificationsAsync();\n Notifications.addListener(this._handleNotification);\n this.retreiveMeta();\n }\n\n\n await Font.loadAsync({\n //\"Material Icons\": require(\"@expo/vector-icons/fonts/MaterialIcons.ttf\"),\n //\"Ionicons\": require(\"@expo/vector-icons/fonts/Ionicons.ttf\"),\n // \"Feather\": require(\"@expo/vector-icons/fonts/Feather.ttf\"),\n 'open-sans': require('./assets/fonts/OpenSans-Regular.ttf'),\n 'lato-light': require('./assets/fonts/Lato-Light.ttf'),\n 'lato-regular': require('./assets/fonts/Lato-Regular.ttf'),\n 'lato-bold': require('./assets/fonts/Lato-Bold.ttf'),\n 'lato-black': require('./assets/fonts/Lato-Black.ttf'),\n 'roboto-medium': require('./assets/fonts/Roboto-Medium.ttf'),\n 'roboto-bold': require('./assets/fonts/Roboto-Bold.ttf'),\n 'roboto-light': require('./assets/fonts/Roboto-Light.ttf'),\n 'roboto-thin': require('./assets/fonts/Roboto-Thin.ttf'),\n\n });\n\n this.setState({ isReady: true, fontLoaded: true });\n }", "onStartHeaders() {}", "function writeHeader() {\n seekHead = createSeekHead();\n \n let\n ebmlHeader = {\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [\n {\n \"id\": 0x4286, // EBMLVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f7, // EBMLReadVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f2, // EBMLMaxIDLength\n \"data\": 4\n },\n {\n \"id\": 0x42f3, // EBMLMaxSizeLength\n \"data\": 8\n },\n {\n \"id\": 0x4282, // DocType\n \"data\": \"webm\"\n },\n {\n \"id\": 0x4287, // DocTypeVersion\n \"data\": 2\n },\n {\n \"id\": 0x4285, // DocTypeReadVersion\n \"data\": 2\n }\n ]\n },\n \n segmentInfo = {\n \"id\": 0x1549a966, // Info\n \"data\": [\n {\n \"id\": 0x2ad7b1, // TimecodeScale\n \"data\": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)\n },\n {\n \"id\": 0x4d80, // MuxingApp\n \"data\": \"webm-writer-js\",\n },\n {\n \"id\": 0x5741, // WritingApp\n \"data\": \"webm-writer-js\"\n },\n segmentDuration // To be filled in later\n ]\n },\n \n videoProperties = [\n {\n \"id\": 0xb0, // PixelWidth\n \"data\": videoWidth\n },\n {\n \"id\": 0xba, // PixelHeight\n \"data\": videoHeight\n }\n ];\n \n if (options.transparent) {\n videoProperties.push(\n {\n \"id\": 0x53C0, // AlphaMode\n \"data\": 1\n }\n );\n }\n \n let\n tracks = {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [\n {\n \"id\": 0xae, // TrackEntry\n \"data\": [\n {\n \"id\": 0xd7, // TrackNumber\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x73c5, // TrackUID\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x9c, // FlagLacing\n \"data\": 0\n },\n {\n \"id\": 0x22b59c, // Language\n \"data\": \"und\"\n },\n {\n \"id\": 0x86, // CodecID\n \"data\": \"V_VP8\"\n },\n {\n \"id\": 0x258688, // CodecName\n \"data\": \"VP8\"\n },\n {\n \"id\": 0x83, // TrackType\n \"data\": 1\n },\n {\n \"id\": 0xe0, // Video\n \"data\": videoProperties\n }\n ]\n }\n ]\n };\n \n ebmlSegment = {\n \"id\": 0x18538067, // Segment\n \"size\": -1, // Unbounded size\n \"data\": [\n seekHead,\n segmentInfo,\n tracks,\n ]\n };\n \n let\n bufferStream = new ArrayBufferDataStream(256);\n \n writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);\n blobBuffer.write(bufferStream.getAsDataArray());\n \n // Now we know where these top-level elements lie in the file:\n seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);\n seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);\n \n\t writtenHeader = true;\n }", "function AppMeasurement(){var s=this;s.version=\"1.0.3\";var w=window;if(!w.s_c_in)w.s_c_il=[],w.s_c_in=0;s._il=w.s_c_il;s._in=w.s_c_in;s._il[s._in]=s;w.s_c_in++;s._c=\"s_c\";var n=w,g,k;try{g=n.parent;for(k=n.location;g&&g.location&&k&&\"\"+g.location!=\"\"+k&&n.location&&\"\"+g.location!=\"\"+n.location&&g.location.host==k.host;)n=g,g=n.parent}catch(o){}s.za=function(s){try{console.log(s)}catch(a){}};s.ba=function(s){return\"\"+parseInt(s)==\"\"+s};s.replace=function(s,a,c){if(!s||s.indexOf(a)<0)return s;return s.split(a).join(c)};\r\ns.escape=function(b){var a,c;if(!b)return b;b=encodeURIComponent(b);for(a=0;a<7;a++)c=\"+~!*()'\".substring(a,a+1),b.indexOf(c)>=0&&(b=s.replace(b,c,\"%\"+c.charCodeAt(0).toString(16).toUpperCase()));return b};s.unescape=function(b){if(!b)return b;b=b.indexOf(\"+\")>=0?s.replace(b,\"+\",\" \"):b;try{return decodeURIComponent(b)}catch(a){}return unescape(b)};s.pa=function(){var b=w.location.hostname,a=s.fpCookieDomainPeriods,c;if(!a)a=s.cookieDomainPeriods;if(b&&!s.U&&!/^[0-9.]+$/.test(b)&&(a=a?parseInt(a):\r\n2,a=a>2?a:2,c=b.lastIndexOf(\".\"),c>=0)){for(;c>=0&&a>1;)c=b.lastIndexOf(\".\",c-1),a--;s.U=c>0?b.substring(c):b}return s.U};s.c_r=s.cookieRead=function(b){b=s.escape(b);var a=\" \"+s.d.cookie,c=a.indexOf(\" \"+b+\"=\"),e=c<0?c:a.indexOf(\";\",c);b=c<0?\"\":s.unescape(a.substring(c+2+b.length,e<0?a.length:e));return b!=\"[[B]]\"?b:\"\"};s.c_w=s.cookieWrite=function(b,a,c){var e=s.pa(),d=s.cookieLifetime,f;a=\"\"+a;d=d?(\"\"+d).toUpperCase():\"\";c&&d!=\"SESSION\"&&d!=\"NONE\"&&((f=a!=\"\"?parseInt(d?d:0):-60)?(c=new Date,c.setTime(c.getTime()+\r\nf*1E3)):c==1&&(c=new Date,f=c.getYear(),c.setYear(f+5+(f<1900?1900:0))));if(b&&d!=\"NONE\")return s.d.cookie=b+\"=\"+s.escape(a!=\"\"?a:\"[[B]]\")+\"; path=/;\"+(c&&d!=\"SESSION\"?\" expires=\"+c.toGMTString()+\";\":\"\")+(e?\" domain=\"+e+\";\":\"\"),s.cookieRead(b)==a;return 0};s.v=[];s.V=function(b,a){if(s.W)return 0;if(!s.maxDelay)s.maxDelay=250;var c=0,e=(new Date).getTime()+s.maxDelay,d=s.d.Ma,f=[\"webkitvisibilitychange\",\"visibilitychange\"];if(!d)d=s.d.Na;if(d&&d==\"prerender\"){if(!s.G){s.G=1;for(c=0;c<f.length;c++)s.d.addEventListener(f[c],\r\nfunction(){var b=s.d.Ma;if(!b)b=s.d.Na;if(b==\"visible\")s.G=0,s.delayReady()})}c=1;e=0}else s.u(\"_d\")&&(c=1);c&&(s.v.push({m:b,a:a,t:e}),s.G||setTimeout(s.delayReady,s.maxDelay));return c};s.delayReady=function(){var b=(new Date).getTime(),a=0,c;for(s.u(\"_d\")&&(a=1);s.v.length>0;){c=s.v.shift();if(a&&!c.t&&c.t>b){s.v.unshift(c);setTimeout(s.delayReady,parseInt(s.maxDelay/2));break}s.W=1;s[c.m].apply(s,c.a);s.W=0}};s.setAccount=s.sa=function(b){var a,c;if(!s.V(\"setAccount\",arguments))if(s.account=b,\r\ns.allAccounts){a=s.allAccounts.concat(b.split(\",\"));s.allAccounts=[];a.sort();for(c=0;c<a.length;c++)(c==0||a[c-1]!=a[c])&&s.allAccounts.push(a[c])}else s.allAccounts=b.split(\",\")};s.P=function(b,a,c,e,d){var f=\"\",i,j,w,q,g=0;b==\"contextData\"&&(b=\"c\");if(a){for(i in a)if(!Object.prototype[i]&&(!d||i.substring(0,d.length)==d)&&a[i]&&(!c||c.indexOf(\",\"+(e?e+\".\":\"\")+i+\",\")>=0)){w=!1;if(g)for(j=0;j<g.length;j++)i.substring(0,g[j].length)==g[j]&&(w=!0);if(!w&&(f==\"\"&&(f+=\"&\"+b+\".\"),j=a[i],d&&(i=i.substring(d.length)),\r\ni.length>0))if(w=i.indexOf(\".\"),w>0)j=i.substring(0,w),w=(d?d:\"\")+j+\".\",g||(g=[]),g.push(w),f+=s.P(j,a,c,e,w);else if(typeof j==\"boolean\"&&(j=j?\"true\":\"false\"),j){if(e==\"retrieveLightData\"&&d.indexOf(\".contextData.\")<0)switch(w=i.substring(0,4),q=i.substring(4),i){case \"transactionID\":i=\"xact\";break;case \"channel\":i=\"ch\";break;case \"campaign\":i=\"v0\";break;default:s.ba(q)&&(w==\"prop\"?i=\"c\"+q:w==\"eVar\"?i=\"v\"+q:w==\"list\"?i=\"l\"+q:w==\"hier\"&&(i=\"h\"+q,j=j.substring(0,255)))}f+=\"&\"+s.escape(i)+\"=\"+s.escape(j)}}f!=\r\n\"\"&&(f+=\"&.\"+b)}return f};s.ra=function(){var b=\"\",a,c,e,d,f,i,j,w,g=\"\",n=\"\",k=c=\"\";if(s.lightProfileID)a=s.J,(g=s.lightTrackVars)&&(g=\",\"+g+\",\"+s.ea.join(\",\")+\",\");else{a=s.e;if(s.pe||s.linkType)if(g=s.linkTrackVars,n=s.linkTrackEvents,s.pe&&(c=s.pe.substring(0,1).toUpperCase()+s.pe.substring(1),s[c]))g=s[c].Va,n=s[c].Ua;g&&(g=\",\"+g+\",\"+s.C.join(\",\")+\",\");n&&(n=\",\"+n+\",\",g&&(g+=\",events,\"));s.events2&&(k+=(k!=\"\"?\",\":\"\")+s.events2)}for(c=0;c<a.length;c++){d=a[c];f=s[d];e=d.substring(0,4);i=d.substring(4);\r\n!f&&d==\"events\"&&k&&(f=k,k=\"\");if(f&&(!g||g.indexOf(\",\"+d+\",\")>=0)){switch(d){case \"timestamp\":d=\"ts\";break;case \"dynamicVariablePrefix\":d=\"D\";break;case \"visitorID\":d=\"vid\";break;case \"pageURL\":d=\"g\";if(f.length>255)s.pageURLRest=f.substring(255),f=f.substring(0,255);break;case \"pageURLRest\":d=\"-g\";break;case \"referrer\":d=\"r\";break;case \"vmk\":case \"visitorMigrationKey\":d=\"vmt\";break;case \"visitorMigrationServer\":d=\"vmf\";s.ssl&&s.visitorMigrationServerSecure&&(f=\"\");break;case \"visitorMigrationServerSecure\":d=\r\n\"vmf\";!s.ssl&&s.visitorMigrationServer&&(f=\"\");break;case \"charSet\":d=\"ce\";break;case \"visitorNamespace\":d=\"ns\";break;case \"cookieDomainPeriods\":d=\"cdp\";break;case \"cookieLifetime\":d=\"cl\";break;case \"variableProvider\":d=\"vvp\";break;case \"currencyCode\":d=\"cc\";break;case \"channel\":d=\"ch\";break;case \"transactionID\":d=\"xact\";break;case \"campaign\":d=\"v0\";break;case \"resolution\":d=\"s\";break;case \"colorDepth\":d=\"c\";break;case \"javascriptVersion\":d=\"j\";break;case \"javaEnabled\":d=\"v\";break;case \"cookiesEnabled\":d=\r\n\"k\";break;case \"browserWidth\":d=\"bw\";break;case \"browserHeight\":d=\"bh\";break;case \"connectionType\":d=\"ct\";break;case \"homepage\":d=\"hp\";break;case \"plugins\":d=\"p\";break;case \"events\":k&&(f+=(f!=\"\"?\",\":\"\")+k);if(n){i=f.split(\",\");f=\"\";for(e=0;e<i.length;e++)j=i[e],w=j.indexOf(\"=\"),w>=0&&(j=j.substring(0,w)),w=j.indexOf(\":\"),w>=0&&(j=j.substring(0,w)),n.indexOf(\",\"+j+\",\")>=0&&(f+=(f?\",\":\"\")+i[e])}break;case \"events2\":f=\"\";break;case \"contextData\":b+=s.P(\"c\",s[d],g,d);f=\"\";break;case \"lightProfileID\":d=\r\n\"mtp\";break;case \"lightStoreForSeconds\":d=\"mtss\";s.lightProfileID||(f=\"\");break;case \"lightIncrementBy\":d=\"mti\";s.lightProfileID||(f=\"\");break;case \"retrieveLightProfiles\":d=\"mtsr\";break;case \"deleteLightProfiles\":d=\"mtsd\";break;case \"retrieveLightData\":s.retrieveLightProfiles&&(b+=s.P(\"mts\",s[d],g,d));f=\"\";break;default:s.ba(i)&&(e==\"prop\"?d=\"c\"+i:e==\"eVar\"?d=\"v\"+i:e==\"list\"?d=\"l\"+i:e==\"hier\"&&(d=\"h\"+i,f=f.substring(0,255)))}f&&(b+=\"&\"+d+\"=\"+(d.substring(0,3)!=\"pev\"?s.escape(f):f))}d==\"pev3\"&&s.g&&\r\n(b+=s.g)}return b};s.p=function(s){var a=s.tagName;if(\"\"+s.Ta!=\"undefined\"||\"\"+s.Ea!=\"undefined\"&&(\"\"+s.Ea).toUpperCase()!=\"HTML\")return\"\";a=a&&a.toUpperCase?a.toUpperCase():\"\";a==\"SHAPE\"&&(a=\"\");a&&((a==\"INPUT\"||a==\"BUTTON\")&&s.type&&s.type.toUpperCase?a=s.type.toUpperCase():!a&&s.href&&(a=\"A\"));return a};s.Y=function(s){var a=s.href?s.href:\"\",c,e,d;c=a.indexOf(\":\");e=a.indexOf(\"?\");d=a.indexOf(\"/\");if(a&&(c<0||e>=0&&c>e||d>=0&&c>d))e=s.protocol&&s.protocol.length>1?s.protocol:l.protocol?l.protocol:\r\n\"\",c=l.pathname.lastIndexOf(\"/\"),a=(e?e+\"//\":\"\")+(s.host?s.host:l.host?l.host:\"\")+(h.substring(0,1)!=\"/\"?l.pathname.substring(0,c<0?0:c)+\"/\":\"\")+a;return a};s.z=function(b){var a=s.p(b),c,e,d=\"\",f=0;if(a){c=b.protocol;e=b.onclick;if(b.href&&(a==\"A\"||a==\"AREA\")&&(!e||!c||c.toLowerCase().indexOf(\"javascript\")<0))d=s.Y(b);else if(e)d=s.replace(s.replace(s.replace(s.replace(\"\"+e,\"\\r\",\"\"),\"\\n\",\"\"),\"\\t\",\"\"),\" \",\"\"),f=2;else if(a==\"INPUT\"||a==\"SUBMIT\"){if(b.value)d=b.value;else if(b.innerText)d=b.innerText;\r\nelse if(b.textContent)d=b.textContent;f=3}else if(b.src&&a==\"IMAGE\")d=b.src;if(d)return{id:d.substring(0,100),type:f}}return 0};s.Qa=function(b){for(var a=s.p(b),c=s.z(b);b&&!c&&a!=\"BODY\";)if(b=b.parentElement?b.parentElement:b.parentNode)a=s.p(b),c=s.z(b);if(!c||a==\"BODY\")b=0;if(b&&(a=b.onclick?\"\"+b.onclick:\"\",a.indexOf(\".tl(\")>=0||a.indexOf(\".trackLink(\")>=0))b=0;return b};s.Ca=function(){var b,a,c=s.linkObject,e=s.linkType,d=s.linkURL,f,i;s.K=1;if(!c)s.K=0,c=s.j;if(c){b=s.p(c);for(a=s.z(c);c&&\r\n!a&&b!=\"BODY\";)if(c=c.parentElement?c.parentElement:c.parentNode)b=s.p(c),a=s.z(c);if(!a||b==\"BODY\")c=0;if(c){var j=c.onclick?\"\"+c.onclick:\"\";if(j.indexOf(\".tl(\")>=0||j.indexOf(\".trackLink(\")>=0)c=0}}else s.K=1;!d&&c&&(d=s.Y(c));d&&!s.linkLeaveQueryString&&(f=d.indexOf(\"?\"),f>=0&&(d=d.substring(0,f)));if(!e&&d){var g=0,n=0,k;if(s.trackDownloadLinks&&s.linkDownloadFileTypes){j=d.toLowerCase();f=j.indexOf(\"?\");i=j.indexOf(\"#\");f>=0?i>=0&&i<f&&(f=i):f=i;f>=0&&(j=j.substring(0,f));f=s.linkDownloadFileTypes.toLowerCase().split(\",\");\r\nfor(i=0;i<f.length;i++)(k=f[i])&&j.substring(j.length-(k.length+1))==\".\"+k&&(e=\"d\")}if(s.trackExternalLinks&&!e&&(j=d.toLowerCase(),s.aa(j))){if(!s.linkInternalFilters)s.linkInternalFilters=w.location.hostname;f=0;s.linkExternalFilters?(f=s.linkExternalFilters.toLowerCase().split(\",\"),g=1):s.linkInternalFilters&&(f=s.linkInternalFilters.toLowerCase().split(\",\"));if(f){for(i=0;i<f.length;i++)k=f[i],j.indexOf(k)>=0&&(n=1);n?g&&(e=\"e\"):g||(e=\"e\")}}}s.linkObject=c;s.linkURL=d;s.linkType=e;if(s.trackClickMap||\r\ns.trackInlineStats)if(s.g=\"\",c){e=s.pageName;d=1;c=c.sourceIndex;if(!e)e=s.pageURL,d=0;if(w.s_objectID)a.id=w.s_objectID,c=a.type=1;if(e&&a&&a.id&&b)s.g=\"&pid=\"+s.escape(e.substring(0,255))+(d?\"&pidt=\"+d:\"\")+\"&oid=\"+s.escape(a.id.substring(0,100))+(a.type?\"&oidt=\"+a.type:\"\")+\"&ot=\"+b+(c?\"&oi=\"+c:\"\")}};s.ta=function(){var b=s.K,a=s.linkType,c=s.linkURL,e=s.linkName;if(a&&(c||e))a=a.toLowerCase(),a!=\"d\"&&a!=\"e\"&&(a=\"o\"),s.pe=\"lnk_\"+a,s.pev1=c?s.escape(c):\"\",s.pev2=e?s.escape(e):\"\",b=1;s.abort&&(b=0);\r\nif(s.trackClickMap||s.trackInlineStats){a={};c=0;var d=s.cookieRead(\"s_sq\"),f=d?d.split(\"&\"):0,i,j,w;d=0;if(f)for(i=0;i<f.length;i++)j=f[i].split(\"=\"),e=s.unescape(j[0]).split(\",\"),j=s.unescape(j[1]),a[j]=e;e=s.account.split(\",\");if(b||s.g){b&&!s.g&&(d=1);for(j in a)if(!Object.prototype[j])for(i=0;i<e.length;i++){d&&(w=a[j].join(\",\"),w==s.account&&(s.g+=(j.charAt(0)!=\"&\"?\"&\":\"\")+j,a[j]=[],c=1));for(f=0;f<a[j].length;f++)w=a[j][f],w==e[i]&&(d&&(s.g+=\"&u=\"+s.escape(w)+(j.charAt(0)!=\"&\"?\"&\":\"\")+j+\"&u=0\"),\r\na[j].splice(f,1),c=1)}b||(c=1);if(c){d=\"\";i=2;!b&&s.g&&(d=s.escape(e.join(\",\"))+\"=\"+s.escape(s.g),i=1);for(j in a)!Object.prototype[j]&&i>0&&a[j].length>0&&(d+=(d?\"&\":\"\")+s.escape(a[j].join(\",\"))+\"=\"+s.escape(j),i--);s.cookieWrite(\"s_sq\",d)}}}return b};s.ua=function(){if(!s.Ka){var b=new Date,a=n.location,c,e,d,f=d=e=c=\"\",i=\"\",w=\"\",g=\"1.2\",k=s.cookieWrite(\"s_cc\",\"true\",0)?\"Y\":\"N\",o=\"\",p=\"\",r=0;if(b.setUTCDate&&(g=\"1.3\",r.toPrecision&&(g=\"1.5\",c=[],c.forEach))){g=\"1.6\";d=0;e={};try{d=new Iterator(e),\r\nd.next&&(g=\"1.7\",c.reduce&&(g=\"1.8\",g.trim&&(g=\"1.8.1\",Date.parse&&(g=\"1.8.2\",Object.create&&(g=\"1.8.5\")))))}catch(t){}}c=screen.width+\"x\"+screen.height;d=navigator.javaEnabled()?\"Y\":\"N\";e=screen.pixelDepth?screen.pixelDepth:screen.colorDepth;i=s.w.innerWidth?s.w.innerWidth:s.d.documentElement.offsetWidth;w=s.w.innerHeight?s.w.innerHeight:s.d.documentElement.offsetHeight;b=navigator.plugins;try{s.b.addBehavior(\"#default#homePage\"),o=s.b.Ra(a)?\"Y\":\"N\"}catch(u){}try{s.b.addBehavior(\"#default#clientCaps\"),\r\np=s.b.connectionType}catch(x){}if(b)for(;r<b.length&&r<30;){if(a=b[r].name)a=a.substring(0,100)+\";\",f.indexOf(a)<0&&(f+=a);r++}s.resolution=c;s.colorDepth=e;s.javascriptVersion=g;s.javaEnabled=d;s.cookiesEnabled=k;s.browserWidth=i;s.browserHeight=w;s.connectionType=p;s.homepage=o;s.plugins=f;s.Ka=1}};s.B={};s.loadModule=function(b,a){s.B[b]||(s[b]=w[\"AppMeasurement_Module_\"+b]?new w[\"AppMeasurement_Module_\"+b](s):{},s.B[b]=s[b]);a&&(s[b+\"_onLoad\"]=a,delayCall(b+\"_onLoad\",[s,m],1)||a(s,m))};s.u=function(b){var a,\r\nc;for(a in s.B)if(!Object.prototype[a]&&(c=s.B[a])&&c[b]&&c[b]())return 1;return 0};s.xa=function(){var b=Math.floor(Math.random()*1E13),a=s.visitorSampling,c=s.visitorSamplingGroup;c=\"s_vsn_\"+(s.visitorNamespace?s.visitorNamespace:s.account)+(c?\"_\"+c:\"\");var e=s.cookieRead(c);if(a){e&&(e=parseInt(e));if(!e){if(!s.cookieWrite(c,b))return 0;e=b}if(e%1E4>v)return 0}return 1};s.Q=function(b,a){var c,e,d,f,i,w;for(c=0;c<2;c++){e=c>0?s.R:s.e;for(d=0;d<e.length;d++)if(f=e[d],(i=b[f])||b[\"!\"+f]){if(!a&&\r\n(f==\"contextData\"||f==\"retrieveLightData\")&&s[f])for(w in s[f])i[w]||(i[w]=s[f][w]);s[f]=i}}};s.La=function(b){var a,c,e,d;for(a=0;a<2;a++){c=a>0?s.R:s.e;for(e=0;e<c.length;e++)d=c[e],b[d]=s[d],b[d]||(b[\"!\"+d]=1)}};s.oa=function(s){var a,c,e,d,f,w=0,g,n=\"\",k=\"\";if(s&&s.length>255&&(a=\"\"+s,c=a.indexOf(\"?\"),c>0&&(g=a.substring(c+1),a=a.substring(0,c),d=a.toLowerCase(),e=0,d.substring(0,7)==\"http://\"?e+=7:d.substring(0,8)==\"https://\"&&(e+=8),c=d.indexOf(\"/\",e),c>0&&(d=d.substring(e,c),f=a.substring(c),\r\na=a.substring(0,c),d.indexOf(\"google\")>=0?w=\",q,ie,start,search_key,word,kw,cd,\":d.indexOf(\"yahoo.co\")>=0&&(w=\",p,ei,\"),w&&g)))){if((s=g.split(\"&\"))&&s.length>1){for(e=0;e<s.length;e++)d=s[e],c=d.indexOf(\"=\"),c>0&&w.indexOf(\",\"+d.substring(0,c)+\",\")>=0?n+=(n?\"&\":\"\")+d:k+=(k?\"&\":\"\")+d;n&&k?g=n+\"&\"+k:k=\"\"}c=253-(g.length-k.length)-a.length;s=a+(c>0?f.substring(0,c):\"\")+\"?\"+g}return s};s.qa=function(){var b=s.cookieRead(\"s_fid\"),a=\"\",c=\"\",e;e=8;var d=4;if(!b||b.indexOf(\"-\")<0){for(b=0;b<16;b++)e=Math.floor(Math.random()*\r\ne),a+=\"0123456789ABCDEF\".substring(e,e+1),e=Math.floor(Math.random()*d),c+=\"0123456789ABCDEF\".substring(e,e+1),e=d=16;b=a+\"-\"+c}s.cookieWrite(\"s_fid\",b,1)||(b=0);return b};s.t=s.track=function(b){var a,c=new Date,e=\"s\"+Math.floor(c.getTime()/108E5)%10+Math.floor(Math.random()*1E13),d=c.getYear();d=\"t=\"+s.escape(c.getDate()+\"/\"+c.getMonth()+\"/\"+(d<1900?d+1900:d)+\" \"+c.getHours()+\":\"+c.getMinutes()+\":\"+c.getSeconds()+\" \"+c.getDay()+\" \"+c.getTimezoneOffset());if(!s.V(\"track\",arguments)){b&&(a={},s.La(a),\r\ns.Q(b));if(s.xa()&&(s.fid=s.qa(),s.Ca(),s.usePlugins&&s.doPlugins&&s.doPlugins(s),s.account)){if(!s.abort){if(s.trackOffline&&!s.timestamp)s.timestamp=Math.floor(c.getTime()/1E3);c=w.location;if(!s.pageURL)s.pageURL=c.href?c.href:c;if(!s.referrer&&!s.ia)s.referrer=n.document.referrer,s.ia=1;s.referrer=s.oa(s.referrer);s.u(\"_g\")}s.ta()&&!s.abort&&(s.ua(),d+=s.ra(),s.Ba(e,d));s.abort||s.u(\"_t\")}b&&s.Q(a,1);s.timestamp=s.linkObject=s.j=s.linkURL=s.linkName=s.linkType=w.Sa=s.pe=s.pev1=s.pev2=s.pev3=s.g=\r\n0}};s.tl=s.trackLink=function(b,a,c,e,d){s.linkObject=b;s.linkType=a;s.linkName=c;if(d)s.i=b,s.l=d;return s.track(e)};s.trackLight=function(b,a,c,e){s.lightProfileID=b;s.lightStoreForSeconds=a;s.lightIncrementBy=c;return s.track(e)};s.clearVars=function(){var b,a;for(b=0;b<s.e.length;b++)if(a=s.e[b],a.substring(0,4)==\"prop\"||a.substring(0,4)==\"eVar\"||a.substring(0,4)==\"hier\"||a.substring(0,4)==\"list\"||a==\"channel\"||a==\"events\"||a==\"eventList\"||a==\"products\"||a==\"productList\"||a==\"purchaseID\"||a==\r\n\"transactionID\"||a==\"state\"||a==\"zip\"||a==\"campaign\")s[a]=void 0};s.Ba=function(b,a){var c,e=s.trackingServer;c=\"\";var d=s.dc,f=\"sc.\",w=s.visitorNamespace;if(e){if(s.trackingServerSecure&&s.ssl)e=s.trackingServerSecure}else{if(!w)w=s.account,e=w.indexOf(\",\"),e>=0&&(w=w.Oa(0,e)),w=w.replace(/[^A-Za-z0-9]/g,\"\");c||(c=\"2o7.net\");d=d?(\"\"+d).toLowerCase():\"d1\";c==\"2o7.net\"&&(d==\"d1\"?d=\"112\":d==\"d2\"&&(d=\"122\"),f=\"\");e=w+\".\"+d+\".\"+f+c}c=s.ssl?\"https://\":\"http://\";c+=e+\"/b/ss/\"+s.account+\"/\"+(s.mobile?\"5.\":\r\n\"\")+\"1/JS-\"+s.version+(s.Ja?\"T\":\"\")+\"/\"+b+\"?AQB=1&ndh=1&\"+a+\"&AQE=1\";s.wa&&(c=c.substring(0,2047));s.ma(c);s.H()};s.ma=function(b){s.c||s.va();s.c.push(b);s.I=s.o();s.ha()};s.va=function(){s.c=s.ya();if(!s.c)s.c=[]};s.ya=function(){var b,a;if(s.M()){try{(a=w.localStorage.getItem(s.L()))&&(b=w.JSON.parse(a))}catch(c){}return b}};s.M=function(){var b=!0;if(!s.trackOffline||!s.offlineFilename||!w.localStorage||!w.JSON)b=!1;return b};s.Z=function(){var b=0;if(s.c)b=s.c.length;s.q&&b++;return b};s.H=function(){if(!s.q)if(s.$=\r\nnull,s.fa)s.I>s.A&&s.ga(s.c),s.O(500);else{var b=s.ja();if(b>0)s.O(b);else if(b=s.X())s.q=1,s.Aa(b),s.Fa(b)}};s.O=function(b){if(!s.$)b||(b=0),s.$=setTimeout(s.H,b)};s.ja=function(){var b;if(!s.trackOffline||s.offlineThrottleDelay<=0)return 0;b=s.o()-s.da;if(s.offlineThrottleDelay<b)return 0;return s.offlineThrottleDelay-b};s.X=function(){if(s.c.length>0)return s.c.shift()};s.Aa=function(b){if(s.debugTracking){var a=\"AppMeasurement Debug: \"+b;b=b.split(\"&\");var c;for(c=0;c<b.length;c++)a+=\"\\n\\t\"+\r\ns.unescape(b[c]);s.za(a)}};s.Fa=function(b){var a;a||(a=new Image);a.T=function(){try{if(s.N)clearTimeout(s.N),s.N=0;if(a.timeout)clearTimeout(a.timeout),a.timeout=0}catch(b){}};a.onload=a.Ia=function(){a.T();s.la();s.D();s.q=0;s.H()};a.onabort=a.onerror=a.na=function(){a.T();s.q&&s.c.unshift(s.ka);s.q=0;s.I>s.A&&s.ga(s.c);s.D();s.O(500)};a.onreadystatechange=function(){a.readyState==4&&(a.status==200?a.Ia():a.na())};s.da=s.o();a.src=b;if(a.abort)s.N=setTimeout(a.abort,5E3);s.ka=b;s.Pa=w[\"s_i_\"+s.replace(s.account,\r\n\",\",\"_\")]=a;if(s.useForcedLinkTracking&&s.r||s.l){if(!s.forcedLinkTrackingTimeout)s.forcedLinkTrackingTimeout=250;s.F=setTimeout(s.D,s.forcedLinkTrackingTimeout)}};s.la=function(){if(s.M()&&!(s.ca>s.A))try{w.localStorage.removeItem(s.L()),s.ca=s.o()}catch(b){}};s.ga=function(b){if(s.M()){s.ha();try{w.localStorage.setItem(s.L(),w.JSON.stringify(b)),s.A=s.o()}catch(a){}}};s.ha=function(){if(s.trackOffline){if(!s.offlineLimit||s.offlineLimit<=0)s.offlineLimit=10;for(;s.c.length>s.offlineLimit;)s.X()}};\r\ns.forceOffline=function(){s.fa=!0};s.forceOnline=function(){s.fa=!1};s.L=function(){return s.offlineFilename+\"-\"+s.visitorNamespace+s.account};s.o=function(){return(new Date).getTime()};s.aa=function(s){s=s.toLowerCase();if(s.indexOf(\"#\")!=0&&s.indexOf(\"about:\")!=0&&s.indexOf(\"javascript:\")!=0)return!0;return!1};s.setTagContainer=function(b){var a,c,e;s.Ja=b;for(a=0;a<s._il.length;a++)if((c=s._il[a])&&c._c==\"s_l\"&&c.tagContainerName==b){s.Q(c);if(c.lmq)for(a=0;a<c.lmq.length;a++)e=c.lmq[a],s.loadModule(e.n);\r\nif(c.ml)for(e in c.ml)if(s[e])for(a in b=s[e],e=c.ml[e],e)if(!Object.prototype[a]&&(typeof e[a]!=\"function\"||(\"\"+e[a]).indexOf(\"s_c_il\")<0))b[a]=e[a];if(c.mmq)for(a=0;a<c.mmq.length;a++)e=c.mmq[a],s[e.m]&&(b=s[e.m],b[e.f]&&typeof b[e.f]==\"function\"&&(e.a?b[e.f].apply(b,e.a):b[e.f].apply(b)));if(c.tq)for(a=0;a<c.tq.length;a++)s.track(c.tq[a]);c.s=s;break}};s.Util={urlEncode:s.escape,urlDecode:s.unescape,cookieRead:s.cookieRead,cookieWrite:s.cookieWrite,getQueryParam:function(b,a,c){var e;a||(a=s.pageURL?\r\ns.pageURL:w.location);c||(c=\"&\");if(b&&a&&(a=\"\"+a,e=a.indexOf(\"?\"),e>=0&&(a=c+a.substring(e+1)+c,e=a.indexOf(c+b+\"=\"),e>=0&&(a=a.substring(e+c.length+b.length+1),e=a.indexOf(c),e>=0&&(a=a.substring(0,e)),a.length>0))))return s.unescape(a);return\"\"}};s.C=[\"timestamp\",\"dynamicVariablePrefix\",\"visitorID\",\"anonymousVisitorID\",\"globalVisitorID\",\"globalLocationHint\",\"fid\",\"vmk\",\"visitorMigrationKey\",\"visitorMigrationServer\",\"visitorMigrationServerSecure\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\r\n\"fpCookieDomainPeriods\",\"cookieLifetime\",\"pageName\",\"pageURL\",\"referrer\",\"contextData\",\"currencyCode\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\",\"retrieveLightProfiles\",\"deleteLightProfiles\",\"retrieveLightData\",\"pe\",\"pev1\",\"pev2\",\"pev3\",\"pageURLRest\"];s.e=s.C.concat([\"purchaseID\",\"variableProvider\",\"channel\",\"server\",\"pageType\",\"transactionID\",\"campaign\",\"state\",\"zip\",\"events\",\"events2\",\"products\",\"tnt\"]);s.ea=[\"timestamp\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\"cookieLifetime\",\r\n\"contextData\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\"];s.J=s.ea.slice(0);s.R=[\"account\",\"allAccounts\",\"debugTracking\",\"visitor\",\"trackOffline\",\"offlineLimit\",\"offlineThrottleDelay\",\"offlineFilename\",\"usePlugins\",\"doPlugins\",\"configURL\",\"visitorSampling\",\"s.visitorSamplingGroup\",\"linkObject\",\"linkURL\",\"linkName\",\"linkType\",\"trackDownloadLinks\",\"trackExternalLinks\",\"trackClickMap\",\"trackInlineStats\",\"linkLeaveQueryString\",\"linkTrackVars\",\"linkTrackEvents\",\"linkDownloadFileTypes\",\r\n\"linkExternalFilters\",\"linkInternalFilters\",\"useForcedLinkTracking\",\"forcedLinkTrackingTimeout\",\"trackingServer\",\"trackingServerSecure\",\"ssl\",\"abort\",\"mobile\",\"dc\",\"lightTrackVars\",\"maxDelay\"];for(g=0;g<=75;g++)s.e.push(\"prop\"+g),s.J.push(\"prop\"+g),s.e.push(\"eVar\"+g),s.J.push(\"eVar\"+g),g<6&&s.e.push(\"hier\"+g),g<4&&s.e.push(\"list\"+g);g=[\"resolution\",\"colorDepth\",\"javascriptVersion\",\"javaEnabled\",\"cookiesEnabled\",\"browserWidth\",\"browserHeight\",\"connectionType\",\"homepage\",\"plugins\"];s.e=s.e.concat(g);\r\ns.C=s.C.concat(g);s.ssl=w.location.protocol.toLowerCase().indexOf(\"https\")>=0;s.charSet=\"UTF-8\";s.contextData={};s.offlineThrottleDelay=0;s.offlineFilename=\"AppMeasurement.offline\";s.da=0;s.I=0;s.A=0;s.ca=0;s.linkDownloadFileTypes=\"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";s.w=w;s.d=w.document;try{s.wa=navigator.appName==\"Microsoft Internet Explorer\"}catch(p){}s.D=function(){if(s.F)w.clearTimeout(s.F),s.F=null;s.i&&s.r&&s.i.dispatchEvent(s.r);if(s.l)if(typeof s.l==\"function\")s.l();\r\nelse if(s.i&&s.i.href)s.d.location=s.i.href;s.i=s.r=s.l=0};s.Ga=function(){s.b=s.d.body;if(s.b)if(s.k=function(b){var a,c,e,d,f;if(!(s.d&&s.d.getElementById(\"cppXYctnr\")||b&&b.Da)){if(s.S)if(s.useForcedLinkTracking)s.b.removeEventListener(\"click\",s.k,!1);else{s.b.removeEventListener(\"click\",s.k,!0);s.S=s.useForcedLinkTracking=0;return}else s.useForcedLinkTracking=0;s.j=b.srcElement?b.srcElement:b.target;try{if(s.j&&(s.j.tagName||s.j.parentElement||s.j.parentNode))if(e=s.Z(),s.track(),e<s.Z()&&s.useForcedLinkTracking&&\r\nb.target){for(d=b.target;d&&d!=s.b&&d.tagName.toUpperCase()!=\"A\"&&d.tagName.toUpperCase()!=\"AREA\";)d=d.parentNode;if(d&&(f=d.href,s.aa(f)||(f=0),c=d.target,b.target.dispatchEvent&&f&&(!c||c==\"_self\"||c==\"_top\"||c==\"_parent\"||w.name&&c==w.name))){try{a=s.d.createEvent(\"MouseEvents\")}catch(g){a=new w.MouseEvent}if(a){try{a.initMouseEvent(\"click\",b.bubbles,b.cancelable,b.view,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget)}catch(j){a=\r\n0}if(a)a.Da=1,b.stopPropagation(),b.Ha&&b.Ha(),b.preventDefault(),s.i=b.target,s.r=a}}}}catch(k){}s.j=0}},s.b&&s.b.attachEvent)s.b.attachEvent(\"onclick\",s.k);else{if(s.b&&s.b.addEventListener){if(navigator&&(navigator.userAgent.indexOf(\"WebKit\")>=0&&s.d.createEvent||navigator.userAgent.indexOf(\"Firefox/2\")>=0&&w.MouseEvent))s.S=1,s.useForcedLinkTracking=1,s.b.addEventListener(\"click\",s.k,!0);s.b.addEventListener(\"click\",s.k,!1)}}else setTimeout(setupBody,30)};s.Ga()}", "function getVersion(){return _VERSION}", "InitVsaEngine() {\n\n }", "constructor() {\n this.systemLog = false\n this.appName = '@codedungeon/messenger'\n this.logToFile = false\n this.methods = [\n 'write',\n 'critical',\n 'lblCritical',\n 'danger',\n 'lblDanger',\n 'debug',\n 'error',\n 'lblError',\n 'important',\n 'lblImportant',\n 'info',\n 'lblInfo',\n 'log',\n 'note',\n 'notice',\n 'lblNotice',\n 'status',\n 'success',\n 'lblSuccess',\n 'warn',\n 'lblWarn',\n 'warning',\n 'lblWarning'\n ]\n }", "private internal function m248() {}", "function WebSocketRpcConnection()\n{\nvar self = this;\n\nvar isNodeJs = (typeof window === \"undefined\" ? true : false);\n\nvar lib = null;\nvar SpaceifyError = null;\nvar SpaceifyUtility = null;\nvar RpcCommunicator = null;\n//var SpaceifyLogger = null;\nvar WebSocketConnection = null;\n\nif (isNodeJs)\n\t{\n\tlib = \"/var/lib/spaceify/code/\";\n\n\tSpaceifyError = require(lib + \"spaceifyerror\");\n\t//SpaceifyLogger = require(lib + \"spaceifylogger\");\n\tSpaceifyUtility = require(lib + \"spaceifyutility\");\n\tRpcCommunicator = require(lib + \"rpccommunicator\");\n\tWebSocketConnection = require(lib + \"websocketconnection\");\n\t}\nelse\n\t{\n\tlib = (window.WEBPACK_MAIN_LIBRARY ? window.WEBPACK_MAIN_LIBRARY : window);\n\n\t//SpaceifyLogger = lib.SpaceifyLogger;\n\tSpaceifyError = lib.SpaceifyError;\n\tSpaceifyUtility = lib.SpaceifyUtility;\n\tRpcCommunicator = lib.RpcCommunicator;\n\tWebSocketConnection = lib.WebSocketConnection;\n\t}\n\nvar errorc = new SpaceifyError();\nvar utility = new SpaceifyUtility();\nvar communicator = new RpcCommunicator();\nvar connection = new WebSocketConnection();\n//var logger = new SpaceifyLogger(\"WebSocketRpcConnection\");\n\nself.connect = function(options, callback)\n\t{\n\tconnection.connect(options, function(err, data)\n\t\t{\n\t\tif(!err)\n\t\t\t{\n\t\t\tcommunicator.addConnection(connection);\n\n\t\t\tif(callback)\n\t\t\t\tcallback(null, true);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif(callback)\n\t\t\t\tcallback(errorc.makeErrorObject(\"wsrpcc\", \"Failed to open WebsocketRpcConnection.\", \"WebSocketRpcConnection::connect\"), null);\n\t\t\t}\n\t\t});\n\t};\n\nself.close = function()\n\t{\n\t};\n\nself.getCommunicator = function()\n\t{\n\treturn communicator;\n\t};\n\nself.getConnection = function()\n\t{\n\treturn connection;\n\t};\n\n// Inherited methods\nself.getIsOpen = function()\n\t{\n\treturn connection.getIsOpen();\n\t}\n\nself.getIsSecure = function()\n\t{\n\treturn connection.getIsSecure();\n\t}\n\nself.getPort = function()\n\t{\n\treturn connection.getPort();\n\t}\n\nself.getId = function()\n\t{\n\treturn connection.getId();\n\t}\n\nself.connectionExists = function(connectionId)\n\t{\n\treturn communicator.connectionExists(connectionId);\n\t}\n\nself.exposeRpcMethod = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethod(name, object, method);\n\t}\n\nself.exposeRpcMethodSync = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethodSync(name, object, method);\n\t}\n\nself.callRpc = function(method, params, object, listener)\n\t{\n\treturn communicator.callRpc(method, params, object, listener, connection.getId());\n\t}\n\n// External event listeners\nself.setConnectionListener = function(listener)\n\t{\n\tcommunicator.setConnectionListener(listener);\n\t};\n\nself.setDisconnectionListener = function(listener)\n\t{\n\tcommunicator.setDisconnectionListener(listener);\n\t};\n\n}", "heartbeat () {\n }", "function _____SHARED_functions_____(){}", "function getString(key, params) {\n var result = WEB_PLATFORM.getString(\"org_opensds_storage_devices\", key, params);\n if(result == null){\n return key;\n }else{\n return result;\n }\n }", "onShareAppMessage() {\n\n }", "componentDidMount(){\n console.info(this.constructor.name+ 'Component mount process finished');\n }", "onMessage() {}", "onMessage() {}", "requestThumbnails() {\n let position = this.state.position;\n let ed = this.state.ed;\n let ts = position == 'start' ? ed.start : ed.end;\n\n this.props.socket.emit('frameSelect',{ ts: ts } );\n }", "static get tag(){return\"hal-9000\"}", "started() {\r\n\r\n\t}", "constructor(t){const e={...t};this.connectionState=new h,this.server=\"https://hub-server-2.heatgenius.co.uk\",this.username=\"\",this.signature=\"\",this.auth={header:{}},this.lastQueryTime=null,this._axios=i.a.create({}),this.logger=e.logger?e.logger:console,this.debug=!!e.debug&&e.debug}", "get EXTERNAL_API() {\n return ['setUsageMode',\n 'setBackupMode',\n 'setLocationMode',\n 'setUsageOptinHidden',\n ];\n }", "getVideoDataBuffer() {\n return this.videoDataBuffer;\n }", "addTPKLayer(){\n //<editor-fold desc=\"old code to eliminate\">\n /* if (typeof local == 'undefined') {\n\n //todo: maybe based on this url we could decide if taking the tpk from File API or form URL\n var xhrRequest = new XMLHttpRequest();\n var _this = this;\n xhrRequest.open(\"GET\", url, true);\n xhrRequest.responseType = \"blob\";\n xhrRequest.onprogress = function(evt){\n var percent = 0;\n if(/!*evt.hasOwnProperty(\"total\")*!/typeof evt[\"total\"] !== 'undefined'){\n percent = (parseFloat(evt.loaded / evt.total) * 100).toFixed(0);\n }\n else{\n percent = (parseFloat(evt.loaded / evt.totalSize) * 100).toFixed(0);\n }\n\n console.log(\"Get file via url \" + percent + \"%\");\n console.log(\"Begin downloading remote tpk file...\");\n };\n\n xhrRequest.error = function(err){\n console.log(\"ERROR retrieving TPK file: \" + err.toString());\n alert(\"There was a problem retrieve the file.\");\n };\n var __this = _this;\n xhrRequest.onload = function(oEvent) {\n if(this.status === 200) {\n console.log(\"Remote tpk download finished.\" + oEvent);\n __this.zipParser(this.response);\n }\n else{\n alert(\"There was a problem loading the file. \" + this.status + \": \" + this.statusText );\n }\n };\n xhrRequest.send();\n }\n*/\n //</editor-fold>\n if (this.get('ermesCordova').isNative()){\n\n var basemapName = this.get('parcels').get('basemapName');\n var store = cordova.file.dataDirectory;\n var fileName = basemapName;\n this.set(\"loading\", true);\n this.getBaseMapZip (store, fileName).then((binary)=>{\n if (binary!== null) {\n this.zipParser(binary);\n }\n else {\n Ember.debug(\"getBaseMapZip: error loading the zip file\");\n }\n });\n }\n\n }", "private public function m246() {}", "async onReady() {\n try {\n // Initialize your adapter here\n //Logging of adapter start\n this.log.info('start fb-checkpresence: ip-address: \"' + this.config.ipaddress + '\" - interval devices: ' + this.config.interval + ' Min.' + ' - interval members: ' + this.config.intervalFamily + ' s');\n this.log.debug('configuration user: <' + this.config.username + '>');\n this.log.debug('configuration history: <' + this.config.history + '>');\n this.log.debug('configuration dateformat: <' + this.config.dateformat + '>');\n this.log.debug('configuration familymembers: ' + JSON.stringify(this.config.familymembers));\n this.log.debug('configuration fb-devices ' + this.config.fbdevices);\n this.log.debug('configuratuion mesh info: ' + this.config.meshinfo); \n\n //decrypt fritzbox password\n const sysObj = await this.getForeignObjectAsync('system.config');\n if (sysObj && sysObj.native && sysObj.native.secret) {\n this.config.password = this.decrypt(sysObj.native.secret, this.config.password);\n } else {\n this.config.password = this.decrypt('SdoeQ85NTrg1B0FtEyzf', this.config.password);\n }\n\n //Configuration changes if needed\n let adapterObj = (await this.getForeignObjectAsync(`system.adapter.${this.namespace}`));\n let adapterObjChanged = false; //for changes\n \n //if interval <= 0 than set to 1\n if (this.config.interval <= 0) {\n adapterObj.native.interval = 1;\n adapterObjChanged = true;\n this.config.interval = 1;\n this.log.warn('interval is less than 1. Set to 1 Min.');\n }\n\n //if interval <= 0 than set to 1\n if (this.config.intervalFamily <= 9) {\n adapterObj.native.intervalFamily = 10;\n adapterObjChanged = true;\n this.config.intervalFamily = 10;\n this.log.warn('interval is less than 10. Set to 10s.');\n }\n\n //create new configuration items -> workaround for older versions\n for(let i=0;i<this.config.familymembers.length;i++){\n if (this.config.familymembers[i].useip == undefined) {\n adapterObj.native.familymembers[i].useip = false;\n adapterObj.native.familymembers[i].ipaddress = '';\n adapterObjChanged = true;\n }\n }\n\n if (adapterObjChanged === true){ //Save changes\n await this.setForeignObjectAsync(`system.adapter.${this.namespace}`, adapterObj);\n }\n\n const cfg = {\n ip: this.config.ipaddress,\n port: '49000',\n iv: this.config.interval,\n history: this.config.history,\n dateFormat: this.config.dateformat,\n uid: this.config.username,\n pwd: this.config.password,\n members: this.config.familymembers,\n wl: this.config.whitelist\n };\n \n const cron = cfg.iv * 60;\n const cronFamily = this.config.intervalFamily;\n \n const devInfo = {\n host: this.config.ipaddress,\n port: '49000',\n sslPort: null,\n uid: this.config.username,\n pwd: this.config.password\n };\n\n this.Fb = await fb.Fb.init(devInfo, this);\n if(this.Fb.services === null) {\n this.log.error('Can not get services! Adapter stops');\n this.stopAdapter();\n }\n\n //Check if services/actions are supported\n this.GETPATH = await this.Fb.chkService('X_AVM-DE_GetHostListPath', 'Hosts1', 'X_AVM-DE_GetHostListPath');\n this.GETMESHPATH = await this.Fb.chkService('X_AVM-DE_GetMeshListPath', 'Hosts1', 'X_AVM-DE_GetMeshListPath');\n this.GETBYMAC = await this.Fb.chkService('GetSpecificHostEntry', 'Hosts1', 'GetSpecificHostEntry');\n this.GETBYIP = await this.Fb.chkService('X_AVM-DE_GetSpecificHostEntryByIP', 'Hosts1', 'X_AVM-DE_GetSpecificHostEntryByIP');\n this.GETPORT = await this.Fb.chkService('GetSecurityPort', 'DeviceInfo1', 'GetSecurityPort');\n this.GETEXTIP = await this.Fb.chkService('GetInfo', 'WANPPPConnection1', 'GetInfo');\n if ( this.GETEXTIP == false) this.GETEXTIP = await this.Fb.chkService('GetInfo', 'WANIPConnection1', 'GetInfo');\n this.SETENABLE = await this.Fb.chkService('SetEnable', 'WLANConfiguration3', 'SetEnable');\n this.WLAN3INFO = await this.Fb.chkService('GetInfo', 'WLANConfiguration3', 'WLANConfiguration3-GetInfo');\n this.DEVINFO = await this.Fb.chkService('GetInfo', 'DeviceInfo1', 'DeviceInfo1-GetInfo');\n this.DISALLOWWANACCESSBYIP = await this.Fb.chkService('DisallowWANAccessByIP', 'X_AVM-DE_HostFilter', 'DisallowWANAccessByIP');\n this.GETWANACCESSBYIP = await this.Fb.chkService('GetWANAccessByIP', 'X_AVM-DE_HostFilter', 'GetWANAccessByIP');\n this.REBOOT = await this.Fb.chkService('Reboot', 'DeviceConfig1', 'Reboot');\n \n //const test = await Fb.soapAction(Fb, '/upnp/control/deviceconfig', 'urn:dslforum-org:service:DeviceConfig:1', 'X_AVM-DE_CreateUrlSID', null);\n\n //Create global objects\n await obj.createGlobalObjects(this, this.HTML+this.HTML_END, this.HTML_GUEST+this.HTML_END, this.enabled);\n await obj.createMemberObjects(this, cfg, this.HTML_HISTORY + this.HTML_END, this.enabled);\n\n //create Fb devices\n if (this.GETPATH != null && this.GETPATH == true && this.config.fbdevices == true){\n const items = await this.Fb.getDeviceList(this, cfg, this.Fb);\n if (items != null){\n let res = await obj.createFbDeviceObjects(this, items, this.enabled);\n if (res === true) this.log.info('createFbDeviceObjects finished successfully');\n res = await obj.createMeshObjects(this, items, 0, this.enabled); //create channel 0 as default interface\n if (res === true) this.log.info('createMeshObjects finished successfully');\n }else{\n this.log.error('createFbDeviceObjects -> ' + \"can't read devices from fritzbox! Adapter stops\");\n adapterObj = await this.getForeignObjectAsync(`system.adapter.${this.namespace}`);\n adapterObj.common.enabled = false; // Adapter ausschalten\n await this.setForeignObjectAsync(`system.adapter.${this.namespace}`, adapterObj);\n }\n await this.resyncFbObjects(items);\n }\n\n // states changes inside the adapters namespace are subscribed\n if (this.SETENABLE === true && this.WLAN3INFO === true) this.subscribeStates(`${this.namespace}` + '.guest.wlan');\n if (this.DISALLOWWANACCESSBYIP === true && this.GETWANACCESSBYIP === true) this.subscribeStates(`${this.namespace}` + '.fb-devices.*.disabled'); \n if (this.REBOOT === true) this.subscribeStates(`${this.namespace}` + '.reboot'); \n\n //get uuid for transaction\n //const sSid = await Fb.soapAction(Fb, '/upnp/control/deviceconfig', urn + 'DeviceConfig:1', 'X_GenerateUUID', null);\n //const uuid = sSid['NewUUID'].replace('uuid:', '');\n this.loop(10, 55, cronFamily, cron, cfg);\n } catch (error) {\n this.showError('onReady: ' + error);\n }\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "started () {}", "async onReady() {\n // Initialize your adapter here\n\n this.setState(\"info.connection\", false, true);\n // Reset the connection indicator during startup\n this.type = \"VW\";\n this.country = \"DE\";\n this.clientId = \"9496332b-ea03-4091-a224-8c746b885068%40apps_vw-dilab_com\";\n this.xclientId = \"38761134-34d0-41f3-9a73-c4be88d7d337\";\n this.scope = \"openid%20profile%20mbb%20email%20cars%20birthdate%20badge%20address%20vin\";\n this.redirect = \"carnet%3A%2F%2Fidentity-kit%2Flogin\";\n this.xrequest = \"de.volkswagen.carnet.eu.eremote\";\n this.responseType = \"id_token%20token%20code\";\n this.xappversion = \"5.1.2\";\n this.xappname = \"eRemote\";\n if (this.config.type === \"id\") {\n this.type = \"Id\";\n this.country = \"DE\";\n this.clientId = \"a24fba63-34b3-4d43-b181-942111e6bda8@apps_vw-dilab_com\";\n this.xclientId = \"\";\n this.scope = \"openid profile badge cars dealers birthdate vin\";\n this.redirect = \"weconnect://authenticated\";\n this.xrequest = \"com.volkswagen.weconnect\";\n this.responseType = \"code id_token token\";\n this.xappversion = \"\";\n this.xappname = \"\";\n }\n if (this.config.type === \"skoda\") {\n this.type = \"Skoda\";\n this.country = \"CZ\";\n this.clientId = \"7f045eee-7003-4379-9968-9355ed2adb06%40apps_vw-dilab_com\";\n this.xclientId = \"28cd30c6-dee7-4529-a0e6-b1e07ff90b79\";\n this.scope = \"openid%20profile%20phone%20address%20cars%20email%20birthdate%20badge%20dealers%20driversLicense%20mbb\";\n this.redirect = \"skodaconnect%3A%2F%2Foidc.login%2F\";\n this.xrequest = \"cz.skodaauto.connect\";\n this.responseType = \"code%20id_token\";\n this.xappversion = \"3.2.6\";\n this.xappname = \"cz.skodaauto.connect\";\n }\n if (this.config.type === \"seat\") {\n this.type = \"Seat\";\n this.country = \"ES\";\n this.clientId = \"50f215ac-4444-4230-9fb1-fe15cd1a9bcc@apps_vw-dilab_com\";\n this.xclientId = \"9dcc70f0-8e79-423a-a3fa-4065d99088b4\";\n this.scope = \"openid profile mbb cars birthdate nickname address phone\";\n this.redirect = \"seatconnect://identity-kit/login\";\n this.xrequest = \"cz.skodaauto.connect\";\n this.responseType = \"code%20id_token\";\n this.xappversion = \"1.1.29\";\n this.xappname = \"SEATConnect\";\n }\n if (this.config.type === \"audi\") {\n this.type = \"Audi\";\n this.country = \"DE\";\n this.clientId = \"09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com\";\n this.xclientId = \"77869e21-e30a-4a92-b016-48ab7d3db1d8\";\n this.scope = \"address profile badge birthdate birthplace nationalIdentifier nationality profession email vin phone nickname name picture mbb gallery openid\";\n this.redirect = \"myaudi:///\";\n this.xrequest = \"de.myaudi.mobile.assistant\";\n this.responseType = \"token%20id_token\";\n // this.responseType = \"code\";\n this.xappversion = \"3.22.0\";\n this.xappname = \"myAudi\";\n }\n if (this.config.type === \"go\") {\n this.type = \"\";\n this.country = \"\";\n this.clientId = \"ac42b0fa-3b11-48a0-a941-43a399e7ef84@apps_vw-dilab_com\";\n this.xclientId = \"\";\n this.scope = \"openid%20profile%20address%20email%20phone\";\n this.redirect = \"vwconnect%3A%2F%2Fde.volkswagen.vwconnect%2Foauth2redirect%2Fidentitykit\";\n this.xrequest = \"\";\n this.responseType = \"code\";\n this.xappversion = \"\";\n this.xappname = \"\";\n }\n if (this.config.interval === 0) {\n this.log.info(\"Interval of 0 is not allowed reset to 1\");\n this.config.interval = 1;\n }\n this.login()\n .then(() => {\n this.log.debug(\"Login successful\");\n this.setState(\"info.connection\", true, true);\n this.getPersonalData()\n .then(() => {\n this.getVehicles()\n .then(() => {\n if (this.config.type !== \"go\") {\n this.vinArray.forEach((vin) => {\n if (this.config.type === \"id\") {\n this.getIdStatus(vin).catch(() => {\n this.log.error(\"get id status Failed\");\n });\n } else {\n this.getHomeRegion(vin)\n .catch(() => {\n this.log.debug(\"get home region Failed\");\n })\n .finally(() => {\n this.getVehicleData(vin).catch(() => {\n this.log.error(\"get vehicle data Failed\");\n });\n this.getVehicleRights(vin).catch(() => {\n this.log.error(\"get vehicle rights Failed\");\n });\n this.requestStatusUpdate(vin)\n .finally(() => {\n this.statesArray.forEach((state) => {\n this.getVehicleStatus(vin, state.url, state.path, state.element, state.element2, state.element3, state.element4).catch(() => {\n this.log.debug(\"error while getting \" + state.url);\n });\n });\n })\n .catch(() => {\n this.log.error(\"status update Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Error getting home region\");\n });\n }\n });\n }\n\n this.updateInterval = setInterval(() => {\n if (this.config.type === \"go\") {\n this.getVehicles();\n return;\n } else if (this.config.type === \"id\") {\n this.vinArray.forEach((vin) => {\n this.getIdStatus(vin).catch(() => {\n this.log.error(\"get id status Failed\");\n this.refreshIDToken().catch(() => {});\n });\n this.getWcData();\n });\n return;\n } else {\n this.vinArray.forEach((vin) => {\n this.statesArray.forEach((state) => {\n this.getVehicleStatus(vin, state.url, state.path, state.element, state.element2).catch(() => {\n this.log.debug(\"error while getting \" + state.url);\n });\n });\n });\n }\n }, this.config.interval * 60 * 1000);\n\n if (this.config.forceinterval > 0) {\n this.fupdateInterval = setInterval(() => {\n if (this.config.type === \"go\") {\n this.getVehicles();\n return;\n }\n this.vinArray.forEach((vin) => {\n this.requestStatusUpdate(vin).catch(() => {\n this.log.error(\"force status update Failed\");\n });\n });\n }, this.config.forceinterval * 60 * 1000);\n }\n })\n .catch(() => {\n this.log.error(\"Get Vehicles Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"get personal data Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Login Failed\");\n });\n this.subscribeStates(\"*\");\n }", "_specializedInitialisation()\r\n\t{\r\n\t\tLogger.log(\"Specialisation for service AVTransport\", LogType.Info);\r\n\t\tvar relativeTime = this.getVariableByName(\"RelativeTimePosition\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!relativeTime)\r\n\t\t\trelativeTime = this.getVariableByName(\"A_ARG_TYPE_GetPositionInfo_RelTime\");\r\n\t\tvar transportState = this.getVariableByName(\"TransportState\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!transportState)\r\n\t\t\ttransportState = this.getVariableByName(\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\");\r\n\r\n\t\tif (transportState)\r\n\t\t{\r\n\t\t\ttransportState.on('updated', (variable, newVal) =>\r\n\t\t\t{\r\n\t\t\t\tLogger.log(\"On transportStateUpdate : \" + newVal, LogType.DEBUG);\r\n\t\t\t\tvar actPosInfo = this.getActionByName(\"GetPositionInfo\");\r\n\t\t\t\tvar actMediaInfo = this.getActionByName(\"GetMediaInfo\");\r\n\t\t\t\t/*\r\n\t\t\t\t“STOPPED” R\r\n\t\t\t\t“PLAYING” R\r\n\t\t\t\t“TRANSITIONING” O\r\n\t\t\t\t”PAUSED_PLAYBACK” O\r\n\t\t\t\t“PAUSED_RECORDING” O\r\n\t\t\t\t“RECORDING” O\r\n\t\t\t\t“NO_MEDIA_PRESENT”\r\n\t\t\t\t */\r\n\t\t\t\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this._intervalUpdateRelativeTime)\r\n\t\t\t\t\t\tclearInterval(this._intervalUpdateRelativeTime);\r\n\t\t\t\t\tif (newVal == \"PLAYING\" || newVal == \"RECORDING\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t} );\r\n\t\t\t\t\t\t//Déclenche la maj toutes les 4 secondes\r\n\t\t\t\t\t\tthis._intervalUpdateRelativeTime = setInterval(() =>{\r\n\t\t\t\t\t\t\t\t//Logger.log(\"On autoUpdate\", LogType.DEBUG);\r\n\t\t\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t}\t);\r\n\t\t\t\t\t\t\t}, 4000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//else if (newVal == \"STOPPED\" || newVal == \"PAUSED_PLAYBACK\" || newVal == \"PAUSED_RECORDING\" || newVal == \"NO_MEDIA_PRESENT\")\r\n\t\t\t\t//{\r\n\t\t\t\t//\r\n\t\t\t\t//}\r\n\t\t\t\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\r\n\t\t\t\tif (newVal == \"TRANSITIONING\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{InstanceID: 0}\t);\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{InstanceID: 0} );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newVal == \"STOPPED\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t});\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{\tInstanceID: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}", "async onReady() {\n // Initialize your adapter here\n await this.setObjectNotExistsAsync('speed', {\n type: 'channel',\n common: {\n name: 'speed'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.download', {\n type: 'state',\n common: {\n name: 'download',\n role: 'info.status',\n type: 'number',\n desc: 'Download speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.upload', {\n type: 'state',\n common: {\n name: 'upload',\n role: 'info.status',\n type: 'number',\n desc: 'Upload speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.ping', {\n type: 'state',\n common: {\n name: 'ping',\n role: 'info.status',\n type: 'number',\n desc: 'Ping Latency',\n def: 0,\n read: true,\n write: false,\n unit: 'ms',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.progress', {\n type: 'state',\n common: {\n name: 'progress',\n role: 'info.status',\n type: 'number',\n desc: 'Progress',\n def: 0,\n read: true,\n write: false,\n unit: '%',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.speedcheck', {\n type: 'state',\n common: {\n name: 'Run speed test',\n type: 'boolean',\n read: true,\n role: 'button',\n write: true,\n def: false\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress', {\n type: 'channel',\n common: {\n name: 'speed'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.download', {\n type: 'state',\n common: {\n name: 'download',\n role: 'info.status',\n type: 'number',\n desc: 'Download speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.upload', {\n type: 'state',\n common: {\n name: 'upload',\n role: 'info.status',\n type: 'number',\n desc: 'Upload speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.ping', {\n type: 'state',\n common: {\n name: 'ping',\n role: 'info.status',\n type: 'number',\n desc: 'Ping Latency',\n def: 0,\n read: true,\n write: false,\n unit: 'ms',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.progress', {\n type: 'state',\n common: {\n name: 'progress',\n role: 'info.status',\n type: 'number',\n desc: 'Progress',\n def: 0,\n read: true,\n write: false,\n unit: '%',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.speedcheck', {\n type: 'state',\n common: {\n name: 'Run speed test',\n type: 'boolean',\n read: true,\n role: 'button',\n write: true,\n def: false\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info', {\n type: 'channel',\n common: {\n name: 'Information'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info.externalip', {\n type: 'state',\n common: {\n name: 'External IP',\n role: 'info.status',\n type: 'string',\n desc: 'External IP',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info.internalip', {\n type: 'state',\n common: {\n name: 'Internal IP',\n role: 'info.status',\n type: 'string',\n desc: 'Internal IP',\n read: true,\n write: false,\n },\n native: {},\n });\n this.subscribeStates('*');\n await this.setStateAsync('info.connection', { val: true, ack: true });\n // let result = await this.checkPasswordAsync('admin', 'iobroker');\n // this.log.info('check user admin pw iobroker: ' + result);\n // result = await this.checkGroupAsync('admin', 'admin');\n // this.log.info('check group user admin group admin: ' + result);\n if (this.config.polltime > 1) {\n this.log.info('Checking internet speed every ' + this.config.polltime + ' minutes');\n } else {\n this.log.info('Checking internet speed every ' + this.config.polltime + ' minute');\n }\n await this.start(this.config.polltime);\n }", "enqueue() {\n\n }", "loadComponent(nodeURI, baseURI, callback_async /* nodeDescriptor */, errback_async /* errorMessage */) { // TODO: turn this into a generic xhr loader exposed as a kernel function?\n\n let self = this;\n\n if (nodeURI == self.kutility.protoNodeURI) {\n\n callback_async(self.kutility.protoNodeDescriptor);\n\n } else if (nodeURI.match(RegExp(\"^data:application/json;base64,\"))) {\n\n // Primarly for testing, parse one specific form of data URIs. We need to parse\n // these ourselves since Chrome can't load data URIs due to cross origin\n // restrictions.\n\n callback_async(JSON.parse(atob(nodeURI.substring(29)))); // TODO: support all data URIs\n\n } else {\n\n self.virtualTime.suspend(\"while loading \" + nodeURI); // suspend the queue\n\n let fetchUrl = self.remappedURI(nodeURI, baseURI);\n let dbName = fetchUrl.split(\".\").join(\"_\");\n\n const parseComp = function (f) {\n\n let result = JSON.parse(f);\n\n let nativeObject = result;\n // console.log(nativeObject);\n\n if (nativeObject) {\n callback_async(nativeObject);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n\n } else {\n\n self.logger.warnx(\"loadComponent\", \"error loading\", nodeURI + \":\", error);\n errback_async(error);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n }\n\n }\n\n\n //var fileName = \"\";\n // let userDB = _LCSDB.user(_LCS_WORLD_USER.pub); \n if (dbName.includes(\"proxy\")) {\n //userDB = await window._LCS_SYS_USER.get('proxy').then();\n let proxyDB = self.proxy ? _LCSDB.user(self.proxy) : _LCSDB.user(_LCS_WORLD_USER.pub);\n let fileName = dbName + '_json';\n let dbNode = proxyDB.get('proxy').get(fileName);\n let nodeProm = new Promise(res => dbNode.once(res));\n\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n\n } else {\n var worldName = dbName.split('/')[1];\n var fileName = dbName.split('/')[2];\n //+ '_json';\n\n if (!fileName) {\n worldName = self.helpers.appPath\n fileName = dbName + '_json';\n } else {\n fileName = fileName + '_json';\n }\n\n let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName);\n\n let nodeProm = new Promise(res => dbNode.once(res))\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n }\n\n //console.log(source);\n\n //userDB.get(fileName).once(async function(res) {\n\n\n\n\n // }, {wait: 1000})\n }\n\n }", "started() { }", "onBrowserStart(browser) {\n\n }", "getPort2() {\n return 0;\n }", "function OnChannelOpen()\n{\n}", "requestReceived(request,response){\n if(this.config.log){\n const logData={\n method : request.method,\n url : request.url,\n headers : request.headers\n };\n\n this.config.logFunction(\n logData\n );\n }\n\n let uri = url.parse(request.url);\n uri.protocol='http';\n uri.host=uri.hostname=request.headers.host;\n uri.port=80;\n uri.query=querystring.parse(uri.query);\n\n if(request.connection.encrypted){\n uri.protocol='https';\n uri.port=443;\n }\n\n (\n function(){\n if(!uri.host){\n return;\n }\n const host=uri.host.split(':');\n\n if(!host[1]){\n return;\n }\n uri.host=uri.hostname=host[0];\n uri.port=host[1];\n }\n )();\n\n for(let key in uri){\n if(uri[key]!==null){\n continue;\n }\n uri[key]='';\n }\n\n request.uri=uri;\n\n if(\n this.onRawRequest(\n request,\n response,\n completeServing.bind(this)\n )\n ){\n return;\n };\n\n uri=uri.pathname;\n\n if (uri=='/'){\n uri=`/${this.config.server.index}`;\n }\n\n let hostname= [];\n\n if (request.headers.host !== undefined){\n hostname = request.headers.host.split(':');\n }\n\n let root = this.config.root;\n\n if(this.config.verbose){\n console.log(`${this.config.logID} REQUEST ###\\n\\n`,\n request.headers,'\\n',\n uri,'\\n\\n',\n hostname,'\\n\\n'\n );\n }\n\n if(this.config.domain!='0.0.0.0' && hostname.length > 0 && hostname[0]!=this.config.domain){\n if(!this.config.domains[hostname[0]]){\n if(this.config.verbose){\n console.log(`${this.config.logID} INVALID HOST ###\\n\\n`);\n }\n this.serveFile(hostname[0],false,response);\n return;\n }\n root=this.config.domains[hostname[0]];\n }\n\n\n if(this.config.verbose){\n console.log(`${this.config.logID} USING ROOT : ${root}###\\n\\n`);\n }\n\n if(uri.slice(-1)=='/'){\n uri+=this.config.server.index;\n }\n\n request.url=uri;\n request.serverRoot=root;\n\n request.body='';\n\n request.on(\n 'data',\n function(chunk){\n request.body+=chunk;\n }.bind(this)\n ).on(\n 'end',\n function(){\n if(this.config.verbose){\n console.log(`###REQUEST BODY :\n ${request.body}\n ###\n `);\n }\n\n requestBodyComplete.bind(this,request,response)();\n }.bind(this)\n );\n }", "constructor() {\n throw new Error('Not implemented');\n }", "connect() {\n throw new Error(\n 'The Message Bus is not currently supported in browser environments'\n );\n }", "constructor() {\n this._connectionResolver = new pip_services3_components_node_1.ConnectionResolver();\n this._maxKeySize = 250;\n this._maxExpiration = 2592000;\n this._maxValue = 1048576;\n this._poolSize = 5;\n this._reconnect = 10000;\n this._timeout = 5000;\n this._retries = 5;\n this._failures = 5;\n this._retry = 30000;\n this._remove = false;\n this._idle = 5000;\n this._client = null;\n }", "componentDidMount()\n {\n\n }", "function OfflineStreamProcessor(config) {\n config = config || {};\n var context = this.context;\n var eventBus = config.eventBus;\n var events = config.events;\n var errors = config.errors;\n var debug = config.debug;\n var constants = config.constants;\n var settings = config.settings;\n var dashConstants = config.dashConstants;\n var manifestId = config.id;\n var type = config.type;\n var streamInfo = config.streamInfo;\n var errHandler = config.errHandler;\n var mediaPlayerModel = config.mediaPlayerModel;\n var abrController = config.abrController;\n var playbackController = config.playbackController;\n var adapter = config.adapter;\n var dashMetrics = config.dashMetrics;\n var baseURLController = config.baseURLController;\n var timelineConverter = config.timelineConverter;\n var bitrate = config.bitrate;\n var offlineStoreController = config.offlineStoreController;\n var completedCb = config.callbacks && config.callbacks.completed;\n var progressCb = config.callbacks && config.callbacks.progression;\n var instance, logger, mediaInfo, indexHandler, representationController, fragmentModel, updating, downloadedSegments, isInitialized, segmentsController, isStopped;\n\n function setup() {\n resetInitialSettings();\n logger = debug.getLogger(instance);\n segmentsController = Object(_dash_controllers_SegmentsController__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(context).create({\n events: events,\n eventBus: eventBus,\n streamInfo: streamInfo,\n timelineConverter: timelineConverter,\n dashConstants: dashConstants,\n segmentBaseController: config.segmentBaseController,\n type: type\n });\n indexHandler = Object(_dash_DashHandler__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(context).create({\n streamInfo: streamInfo,\n type: type,\n timelineConverter: timelineConverter,\n dashMetrics: dashMetrics,\n mediaPlayerModel: mediaPlayerModel,\n baseURLController: baseURLController,\n errHandler: errHandler,\n settings: settings,\n // boxParser: boxParser,\n eventBus: eventBus,\n events: events,\n debug: debug,\n requestModifier: Object(_streaming_utils_RequestModifier__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(context).getInstance(),\n dashConstants: dashConstants,\n constants: constants,\n segmentsController: segmentsController,\n urlUtils: Object(_streaming_utils_URLUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).getInstance()\n });\n representationController = Object(_dash_controllers_RepresentationController__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(context).create({\n streamInfo: streamInfo,\n type: type,\n abrController: abrController,\n dashMetrics: dashMetrics,\n playbackController: playbackController,\n timelineConverter: timelineConverter,\n dashConstants: dashConstants,\n events: events,\n eventBus: eventBus,\n errors: errors,\n segmentsController: segmentsController\n });\n fragmentModel = Object(_streaming_models_FragmentModel__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(context).create({\n streamInfo: streamInfo,\n dashMetrics: dashMetrics,\n fragmentLoader: Object(_streaming_FragmentLoader__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(context).create({\n dashMetrics: dashMetrics,\n mediaPlayerModel: mediaPlayerModel,\n errHandler: errHandler,\n requestModifier: Object(_streaming_utils_RequestModifier__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(context).getInstance(),\n settings: settings,\n eventBus: eventBus,\n events: events,\n errors: errors,\n constants: constants,\n dashConstants: dashConstants,\n urlUtils: Object(_streaming_utils_URLUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).getInstance()\n }),\n debug: debug,\n eventBus: eventBus,\n events: events\n });\n eventBus.on(events.STREAM_REQUESTING_COMPLETED, onStreamRequestingCompleted, instance);\n eventBus.on(events.FRAGMENT_LOADING_COMPLETED, onFragmentLoadingCompleted, instance);\n }\n\n function initialize(_mediaInfo) {\n mediaInfo = _mediaInfo;\n indexHandler.initialize(false);\n updateRepresentation(mediaInfo);\n }\n\n function isInitRequest(request) {\n return request.type === 'InitializationSegment';\n }\n\n function onFragmentLoadingCompleted(e) {\n if (e.sender !== fragmentModel) {\n return;\n }\n\n if (e.request !== null) {\n var isInit = isInitRequest(e.request);\n var suffix = isInit ? 'init' : e.request.index;\n var fragmentName = e.request.representationId + '_' + suffix;\n offlineStoreController.storeFragment(manifestId, fragmentName, e.response).then(function () {\n if (!isInit) {\n // store current index and downloadedSegments number\n offlineStoreController.setRepresentationCurrentState(manifestId, e.request.representationId, {\n index: e.request.index,\n downloaded: downloadedSegments\n });\n }\n });\n }\n\n if (e.error && e.request.serviceLocation && !isStopped) {\n fragmentModel.executeRequest(e.request);\n } else {\n downloadedSegments++;\n download();\n }\n }\n\n function onStreamRequestingCompleted(e) {\n if (e.fragmentModel !== fragmentModel) {\n return;\n }\n\n logger.info(\"[\".concat(manifestId, \"] Stream is complete\"));\n stop();\n completedCb();\n }\n\n function getRepresentationController() {\n return representationController;\n }\n\n function getRepresentationId() {\n return representationController.getCurrentRepresentation().id;\n }\n /**\n * Stops download of fragments\n * @memberof OfflineStreamProcessor#\n */\n\n\n function stop() {\n if (isStopped) {\n return;\n }\n\n isStopped = true;\n }\n\n function removeExecutedRequestsBeforeTime(time) {\n if (fragmentModel) {\n fragmentModel.removeExecutedRequestsBeforeTime(time);\n }\n }\n /**\n * Execute init request for the represenation\n * @memberof OfflineStreamProcessor#\n */\n\n\n function getInitRequest() {\n if (!representationController.getCurrentRepresentation()) {\n return null;\n }\n\n return indexHandler.getInitRequest(getMediaInfo(), representationController.getCurrentRepresentation());\n }\n /**\n * Get next request\n * @memberof OfflineStreamProcessor#\n */\n\n\n function getNextRequest() {\n return indexHandler.getNextSegmentRequest(getMediaInfo(), representationController.getCurrentRepresentation());\n }\n /**\n * Start download\n * @memberof OfflineStreamProcessor#\n */\n\n\n function start() {\n if (representationController) {\n if (!representationController.getCurrentRepresentation()) {\n throw new Error('Start denied to OfflineStreamProcessor');\n }\n\n isStopped = false;\n offlineStoreController.getRepresentationCurrentState(manifestId, representationController.getCurrentRepresentation().id).then(function (state) {\n if (state) {\n indexHandler.setCurrentIndex(state.index);\n downloadedSegments = state.downloaded;\n }\n\n download();\n })[\"catch\"](function () {\n // start from beginining\n download();\n });\n }\n }\n /**\n * Performs download of fragment according to type\n * @memberof OfflineStreamProcessor#\n */\n\n\n function download() {\n if (isStopped) {\n return;\n }\n\n if (isNaN(representationController.getCurrentRepresentation())) {\n var request = null;\n\n if (!isInitialized) {\n request = getInitRequest();\n isInitialized = true;\n } else {\n request = getNextRequest(); // update progression : done here because availableSegmentsNumber is done in getNextRequest from dash handler\n\n updateProgression();\n }\n\n if (request) {\n logger.info(\"[\".concat(manifestId, \"] download request : \").concat(request.url));\n fragmentModel.executeRequest(request);\n } else {\n logger.info(\"[\".concat(manifestId, \"] no request to be downloaded\"));\n }\n }\n }\n /**\n * Update representation\n * @param {Object} mediaInfo - mediaInfo\n * @memberof OfflineStreamProcessor#\n */\n\n\n function updateRepresentation(mediaInfo) {\n updating = true;\n var voRepresentations = adapter.getVoRepresentations(mediaInfo); // get representation VO according to id.\n\n var quality = voRepresentations.findIndex(function (representation) {\n return representation.id === bitrate.id;\n });\n\n if (type !== constants.VIDEO && type !== constants.AUDIO && type !== constants.TEXT) {\n updating = false;\n return;\n }\n\n representationController.updateData(null, voRepresentations, type, mediaInfo.isFragmented, quality);\n }\n\n function isUpdating() {\n return updating;\n }\n\n function getType() {\n return type;\n }\n\n function getMediaInfo() {\n return mediaInfo;\n }\n\n function getAvailableSegmentsNumber() {\n return representationController.getCurrentRepresentation().availableSegmentsNumber + 1; // do not forget init segment\n }\n\n function updateProgression() {\n if (progressCb) {\n progressCb(instance, downloadedSegments, getAvailableSegmentsNumber());\n }\n }\n\n function resetInitialSettings() {\n isInitialized = false;\n downloadedSegments = 0;\n updating = false;\n }\n /**\n * Reset\n * @memberof OfflineStreamProcessor#\n */\n\n\n function reset() {\n resetInitialSettings();\n indexHandler.reset();\n eventBus.off(events.STREAM_REQUESTING_COMPLETED, onStreamRequestingCompleted, instance);\n eventBus.off(events.FRAGMENT_LOADING_COMPLETED, onFragmentLoadingCompleted, instance);\n }\n\n instance = {\n initialize: initialize,\n getMediaInfo: getMediaInfo,\n getRepresentationController: getRepresentationController,\n removeExecutedRequestsBeforeTime: removeExecutedRequestsBeforeTime,\n getType: getType,\n getRepresentationId: getRepresentationId,\n isUpdating: isUpdating,\n start: start,\n stop: stop,\n getAvailableSegmentsNumber: getAvailableSegmentsNumber,\n reset: reset\n };\n setup();\n return instance;\n}", "constructor() {\r\n }", "constructor() {\n\t\t// ...\n\t}", "static get STATUS() {\n return 0;\n }", "onReady() {\n return __awaiter(this, void 0, void 0, function* () {\n this.logger = new log_1.ioBrokerLogger(this.log);\n yield this.setObjectNotExistsAsync(\"verify_code\", {\n type: \"state\",\n common: {\n name: \"2FA verification code\",\n type: \"number\",\n role: \"state\",\n read: true,\n write: true,\n },\n native: {},\n });\n yield this.setObjectNotExistsAsync(\"info\", {\n type: \"channel\",\n common: {\n name: \"info\"\n },\n native: {},\n });\n yield this.setObjectNotExistsAsync(\"info.connection\", {\n type: \"state\",\n common: {\n name: \"Global connection\",\n type: \"boolean\",\n role: \"indicator.connection\",\n read: true,\n write: false,\n },\n native: {},\n });\n yield this.setStateAsync(\"info.connection\", { val: false, ack: true });\n yield this.setObjectNotExistsAsync(\"info.push_connection\", {\n type: \"state\",\n common: {\n name: \"Push notification connection\",\n type: \"boolean\",\n role: \"indicator.connection\",\n read: true,\n write: false,\n },\n native: {},\n });\n // Remove old states of previous adapter versions\n try {\n const schedule_modes = yield this.getStatesAsync(\"*.schedule_mode\");\n Object.keys(schedule_modes).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const push_notifications = yield this.getStatesAsync(\"push_notification.*\");\n Object.keys(push_notifications).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n yield this.delObjectAsync(\"push_notification\");\n }\n catch (error) {\n }\n try {\n const last_camera_url = yield this.getStatesAsync(\"*.last_camera_url\");\n Object.keys(last_camera_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const captured_pic_url = yield this.getStatesAsync(\"*.captured_pic_url\");\n Object.keys(captured_pic_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const person_identified = yield this.getStatesAsync(\"*.person_identified\");\n Object.keys(person_identified).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const last_captured_pic_url = yield this.getStatesAsync(\"*.last_captured_pic_url\");\n Object.keys(last_captured_pic_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const last_captured_pic_html = yield this.getStatesAsync(\"*.last_captured_pic_html\");\n Object.keys(last_captured_pic_html).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n // End\n // Reset event states if necessary (for example because of an unclean exit)\n yield this.initializeEvents(types_1.CameraStateID.PERSON_DETECTED);\n yield this.initializeEvents(types_1.CameraStateID.MOTION_DETECTED);\n yield this.initializeEvents(types_1.DoorbellStateID.RINGING);\n yield this.initializeEvents(types_1.IndoorCameraStateID.CRYING_DETECTED);\n yield this.initializeEvents(types_1.IndoorCameraStateID.SOUND_DETECTED);\n yield this.initializeEvents(types_1.IndoorCameraStateID.PET_DETECTED);\n try {\n if (fs.statSync(this.persistentFile).isFile()) {\n const fileContent = fs.readFileSync(this.persistentFile, \"utf8\");\n this.persistentData = JSON.parse(fileContent);\n }\n }\n catch (err) {\n this.logger.debug(\"No stored data from last exit found.\");\n }\n //TODO: Temporary Test to be removed!\n /*await this.setObjectNotExistsAsync(\"test_button\", {\n type: \"state\",\n common: {\n name: \"Test button\",\n type: \"boolean\",\n role: \"button\",\n read: false,\n write: true,\n },\n native: {},\n });\n this.subscribeStates(\"test_button\");\n await this.setObjectNotExistsAsync(\"test_button2\", {\n type: \"state\",\n common: {\n name: \"Test button2\",\n type: \"boolean\",\n role: \"button\",\n read: false,\n write: true,\n },\n native: {},\n });\n this.subscribeStates(\"test_button2\");*/\n // END\n this.subscribeStates(\"verify_code\");\n const systemConfig = yield this.getForeignObjectAsync(\"system.config\");\n let countryCode = undefined;\n let languageCode = undefined;\n if (systemConfig) {\n countryCode = i18n_iso_countries_1.getAlpha2Code(systemConfig.common.country, \"en\");\n if (i18n_iso_languages_1.isValid(systemConfig.common.language))\n languageCode = systemConfig.common.language;\n }\n try {\n const adapter_info = yield this.getForeignObjectAsync(`system.adapter.${this.namespace}`);\n if (adapter_info && adapter_info.common && adapter_info.common.version) {\n if (this.persistentData.version !== adapter_info.common.version) {\n const currentVersion = Number.parseFloat(utils_1.removeLastChar(adapter_info.common.version, \".\"));\n const previousVersion = this.persistentData.version !== \"\" && this.persistentData.version !== undefined ? Number.parseFloat(utils_1.removeLastChar(this.persistentData.version, \".\")) : 0;\n this.logger.debug(`Handling of adapter update - currentVersion: ${currentVersion} previousVersion: ${previousVersion}`);\n if (previousVersion < currentVersion) {\n yield utils_1.handleUpdate(this, this.logger, previousVersion);\n this.persistentData.version = adapter_info.common.version;\n this.writePersistentData();\n }\n }\n }\n }\n catch (error) {\n this.logger.error(`Handling of adapter update - Error:`, error);\n }\n this.eufy = new EufySecurityAPI.EufySecurity(this, this.logger, countryCode, languageCode);\n this.eufy.on(\"stations\", (stations) => this.handleStations(stations));\n this.eufy.on(\"devices\", (devices) => this.handleDevices(devices));\n this.eufy.on(\"push message\", (messages) => this.handlePushNotification(messages));\n this.eufy.on(\"connect\", () => this.onConnect());\n this.eufy.on(\"close\", () => this.onClose());\n this.eufy.on(\"livestream start\", (station, device, url) => this.onStartLivestream(station, device, url));\n this.eufy.on(\"livestream stop\", (station, device) => this.onStopLivestream(station, device));\n this.eufy.on(\"push connect\", () => this.onPushConnect());\n this.eufy.on(\"push close\", () => this.onPushClose());\n const api = this.eufy.getApi();\n if (this.persistentData.api_base && this.persistentData.api_base != \"\") {\n this.logger.debug(`Load previous api_base: ${this.persistentData.api_base}`);\n api.setAPIBase(this.persistentData.api_base);\n }\n if (this.persistentData.login_hash && this.persistentData.login_hash != \"\") {\n this.logger.debug(`Load previous login_hash: ${this.persistentData.login_hash}`);\n if (utils_1.md5(`${this.config.username}:${this.config.password}`) != this.persistentData.login_hash) {\n this.logger.info(`Authentication properties changed, invalidate saved cloud token.`);\n this.persistentData.cloud_token = \"\";\n this.persistentData.cloud_token_expiration = 0;\n this.persistentData.api_base = \"\";\n }\n }\n else {\n this.persistentData.cloud_token = \"\";\n this.persistentData.cloud_token_expiration = 0;\n }\n if (this.persistentData.cloud_token && this.persistentData.cloud_token != \"\") {\n this.logger.debug(`Load previous token: ${this.persistentData.cloud_token} token_expiration: ${this.persistentData.cloud_token_expiration}`);\n api.setToken(this.persistentData.cloud_token);\n api.setTokenExpiration(new Date(this.persistentData.cloud_token_expiration));\n }\n if (!this.persistentData.openudid || this.persistentData.openudid == \"\") {\n this.persistentData.openudid = utils_1.generateUDID();\n this.logger.debug(`Generated new openudid: ${this.persistentData.openudid}`);\n }\n api.setOpenUDID(this.persistentData.openudid);\n if (!this.persistentData.serial_number || this.persistentData.serial_number == \"\") {\n this.persistentData.serial_number = utils_1.generateSerialnumber(12);\n this.logger.debug(`Generated new serial_number: ${this.persistentData.serial_number}`);\n }\n api.setSerialNumber(this.persistentData.serial_number);\n yield this.eufy.logon();\n });\n }", "function AppMeasurement(r){var a=this;a.version=\"2.8.2\";var k=window;k.s_c_in||(k.s_c_il=[],k.s_c_in=0);a._il=k.s_c_il;a._in=k.s_c_in;a._il[a._in]=a;k.s_c_in++;a._c=\"s_c\";var p=k.AppMeasurement.Xb;p||(p=null);var n=k,m,s;try{for(m=n.parent,s=n.location;m&&m.location&&s&&\"\"+m.location!=\"\"+s&&n.location&&\"\"+m.location!=\"\"+n.location&&m.location.host==s.host;)n=m,m=n.parent}catch(u){}a.F=function(a){try{console.log(a)}catch(b){}};a.Oa=function(a){return\"\"+parseInt(a)==\"\"+a};a.replace=function(a,b,d){return!a||\r\n0>a.indexOf(b)?a:a.split(b).join(d)};a.escape=function(c){var b,d;if(!c)return c;c=encodeURIComponent(c);for(b=0;7>b;b++)d=\"+~!*()'\".substring(b,b+1),0<=c.indexOf(d)&&(c=a.replace(c,d,\"%\"+d.charCodeAt(0).toString(16).toUpperCase()));return c};a.unescape=function(c){if(!c)return c;c=0<=c.indexOf(\"+\")?a.replace(c,\"+\",\" \"):c;try{return decodeURIComponent(c)}catch(b){}return unescape(c)};a.Fb=function(){var c=k.location.hostname,b=a.fpCookieDomainPeriods,d;b||(b=a.cookieDomainPeriods);if(c&&!a.Ga&&!/^[0-9.]+$/.test(c)&&\r\n(b=b?parseInt(b):2,b=2<b?b:2,d=c.lastIndexOf(\".\"),0<=d)){for(;0<=d&&1<b;)d=c.lastIndexOf(\".\",d-1),b--;a.Ga=0<d?c.substring(d):c}return a.Ga};a.c_r=a.cookieRead=function(c){c=a.escape(c);var b=\" \"+a.d.cookie,d=b.indexOf(\" \"+c+\"=\"),f=0>d?d:b.indexOf(\";\",d);c=0>d?\"\":a.unescape(b.substring(d+2+c.length,0>f?b.length:f));return\"[[B]]\"!=c?c:\"\"};a.c_w=a.cookieWrite=function(c,b,d){var f=a.Fb(),e=a.cookieLifetime,g;b=\"\"+b;e=e?(\"\"+e).toUpperCase():\"\";d&&\"SESSION\"!=e&&\"NONE\"!=e&&((g=\"\"!=b?parseInt(e?e:0):-60)?\r\n(d=new Date,d.setTime(d.getTime()+1E3*g)):1==d&&(d=new Date,g=d.getYear(),d.setYear(g+5+(1900>g?1900:0))));return c&&\"NONE\"!=e?(a.d.cookie=a.escape(c)+\"=\"+a.escape(\"\"!=b?b:\"[[B]]\")+\"; path=/;\"+(d&&\"SESSION\"!=e?\" expires=\"+d.toUTCString()+\";\":\"\")+(f?\" domain=\"+f+\";\":\"\"),a.cookieRead(c)==b):0};a.Cb=function(){var c=a.Util.getIeVersion();\"number\"===typeof c&&10>c&&(a.unsupportedBrowser=!0,a.rb(a,function(){}))};a.rb=function(a,b){for(var d in a)a.hasOwnProperty(d)&&\"function\"===typeof a[d]&&(a[d]=b)};\r\na.L=[];a.ja=function(c,b,d){if(a.Ha)return 0;a.maxDelay||(a.maxDelay=250);var f=0,e=(new Date).getTime()+a.maxDelay,g=a.d.visibilityState,h=[\"webkitvisibilitychange\",\"visibilitychange\"];g||(g=a.d.webkitVisibilityState);if(g&&\"prerender\"==g){if(!a.ka)for(a.ka=1,d=0;d<h.length;d++)a.d.addEventListener(h[d],function(){var c=a.d.visibilityState;c||(c=a.d.webkitVisibilityState);\"visible\"==c&&(a.ka=0,a.delayReady())});f=1;e=0}else d||a.p(\"_d\")&&(f=1);f&&(a.L.push({m:c,a:b,t:e}),a.ka||setTimeout(a.delayReady,\r\na.maxDelay));return f};a.delayReady=function(){var c=(new Date).getTime(),b=0,d;for(a.p(\"_d\")?b=1:a.za();0<a.L.length;){d=a.L.shift();if(b&&!d.t&&d.t>c){a.L.unshift(d);setTimeout(a.delayReady,parseInt(a.maxDelay/2));break}a.Ha=1;a[d.m].apply(a,d.a);a.Ha=0}};a.setAccount=a.sa=function(c){var b,d;if(!a.ja(\"setAccount\",arguments))if(a.account=c,a.allAccounts)for(b=a.allAccounts.concat(c.split(\",\")),a.allAccounts=[],b.sort(),d=0;d<b.length;d++)0!=d&&b[d-1]==b[d]||a.allAccounts.push(b[d]);else a.allAccounts=\r\nc.split(\",\")};a.foreachVar=function(c,b){var d,f,e,g,h=\"\";e=f=\"\";if(a.lightProfileID)d=a.P,(h=a.lightTrackVars)&&(h=\",\"+h+\",\"+a.oa.join(\",\")+\",\");else{d=a.g;if(a.pe||a.linkType)h=a.linkTrackVars,f=a.linkTrackEvents,a.pe&&(e=a.pe.substring(0,1).toUpperCase()+a.pe.substring(1),a[e]&&(h=a[e].Vb,f=a[e].Ub));h&&(h=\",\"+h+\",\"+a.H.join(\",\")+\",\");f&&h&&(h+=\",events,\")}b&&(b=\",\"+b+\",\");for(f=0;f<d.length;f++)e=d[f],(g=a[e])&&(!h||0<=h.indexOf(\",\"+e+\",\"))&&(!b||0<=b.indexOf(\",\"+e+\",\"))&&c(e,g)};a.r=function(c,\r\nb,d,f,e){var g=\"\",h,l,k,q,m=0;\"contextData\"==c&&(c=\"c\");if(b){for(h in b)if(!(Object.prototype[h]||e&&h.substring(0,e.length)!=e)&&b[h]&&(!d||0<=d.indexOf(\",\"+(f?f+\".\":\"\")+h+\",\"))){k=!1;if(m)for(l=0;l<m.length;l++)h.substring(0,m[l].length)==m[l]&&(k=!0);if(!k&&(\"\"==g&&(g+=\"&\"+c+\".\"),l=b[h],e&&(h=h.substring(e.length)),0<h.length))if(k=h.indexOf(\".\"),0<k)l=h.substring(0,k),k=(e?e:\"\")+l+\".\",m||(m=[]),m.push(k),g+=a.r(l,b,d,f,k);else if(\"boolean\"==typeof l&&(l=l?\"true\":\"false\"),l){if(\"retrieveLightData\"==\r\nf&&0>e.indexOf(\".contextData.\"))switch(k=h.substring(0,4),q=h.substring(4),h){case \"transactionID\":h=\"xact\";break;case \"channel\":h=\"ch\";break;case \"campaign\":h=\"v0\";break;default:a.Oa(q)&&(\"prop\"==k?h=\"c\"+q:\"eVar\"==k?h=\"v\"+q:\"list\"==k?h=\"l\"+q:\"hier\"==k&&(h=\"h\"+q,l=l.substring(0,255)))}g+=\"&\"+a.escape(h)+\"=\"+a.escape(l)}}\"\"!=g&&(g+=\"&.\"+c)}return g};a.usePostbacks=0;a.Ib=function(){var c=\"\",b,d,f,e,g,h,l,k,q=\"\",m=\"\",n=e=\"\";if(a.lightProfileID)b=a.P,(q=a.lightTrackVars)&&(q=\",\"+q+\",\"+a.oa.join(\",\")+\r\n\",\");else{b=a.g;if(a.pe||a.linkType)q=a.linkTrackVars,m=a.linkTrackEvents,a.pe&&(e=a.pe.substring(0,1).toUpperCase()+a.pe.substring(1),a[e]&&(q=a[e].Vb,m=a[e].Ub));q&&(q=\",\"+q+\",\"+a.H.join(\",\")+\",\");m&&(m=\",\"+m+\",\",q&&(q+=\",events,\"));a.events2&&(n+=(\"\"!=n?\",\":\"\")+a.events2)}if(a.visitor&&a.visitor.getCustomerIDs){e=p;if(g=a.visitor.getCustomerIDs())for(d in g)Object.prototype[d]||(f=g[d],\"object\"==typeof f&&(e||(e={}),f.id&&(e[d+\".id\"]=f.id),f.authState&&(e[d+\".as\"]=f.authState)));e&&(c+=a.r(\"cid\",\r\ne))}a.AudienceManagement&&a.AudienceManagement.isReady()&&(c+=a.r(\"d\",a.AudienceManagement.getEventCallConfigParams()));for(d=0;d<b.length;d++){e=b[d];g=a[e];f=e.substring(0,4);h=e.substring(4);g||(\"events\"==e&&n?(g=n,n=\"\"):\"marketingCloudOrgID\"==e&&a.visitor&&(g=a.visitor.marketingCloudOrgID));if(g&&(!q||0<=q.indexOf(\",\"+e+\",\"))){switch(e){case \"customerPerspective\":e=\"cp\";break;case \"marketingCloudOrgID\":e=\"mcorgid\";break;case \"supplementalDataID\":e=\"sdid\";break;case \"timestamp\":e=\"ts\";break;case \"dynamicVariablePrefix\":e=\r\n\"D\";break;case \"visitorID\":e=\"vid\";break;case \"marketingCloudVisitorID\":e=\"mid\";break;case \"analyticsVisitorID\":e=\"aid\";break;case \"audienceManagerLocationHint\":e=\"aamlh\";break;case \"audienceManagerBlob\":e=\"aamb\";break;case \"authState\":e=\"as\";break;case \"pageURL\":e=\"g\";255<g.length&&(a.pageURLRest=g.substring(255),g=g.substring(0,255));break;case \"pageURLRest\":e=\"-g\";break;case \"referrer\":e=\"r\";break;case \"vmk\":case \"visitorMigrationKey\":e=\"vmt\";break;case \"visitorMigrationServer\":e=\"vmf\";a.ssl&&\r\na.visitorMigrationServerSecure&&(g=\"\");break;case \"visitorMigrationServerSecure\":e=\"vmf\";!a.ssl&&a.visitorMigrationServer&&(g=\"\");break;case \"charSet\":e=\"ce\";break;case \"visitorNamespace\":e=\"ns\";break;case \"cookieDomainPeriods\":e=\"cdp\";break;case \"cookieLifetime\":e=\"cl\";break;case \"variableProvider\":e=\"vvp\";break;case \"currencyCode\":e=\"cc\";break;case \"channel\":e=\"ch\";break;case \"transactionID\":e=\"xact\";break;case \"campaign\":e=\"v0\";break;case \"latitude\":e=\"lat\";break;case \"longitude\":e=\"lon\";break;\r\ncase \"resolution\":e=\"s\";break;case \"colorDepth\":e=\"c\";break;case \"javascriptVersion\":e=\"j\";break;case \"javaEnabled\":e=\"v\";break;case \"cookiesEnabled\":e=\"k\";break;case \"browserWidth\":e=\"bw\";break;case \"browserHeight\":e=\"bh\";break;case \"connectionType\":e=\"ct\";break;case \"homepage\":e=\"hp\";break;case \"events\":n&&(g+=(\"\"!=g?\",\":\"\")+n);if(m)for(h=g.split(\",\"),g=\"\",f=0;f<h.length;f++)l=h[f],k=l.indexOf(\"=\"),0<=k&&(l=l.substring(0,k)),k=l.indexOf(\":\"),0<=k&&(l=l.substring(0,k)),0<=m.indexOf(\",\"+l+\",\")&&(g+=\r\n(g?\",\":\"\")+h[f]);break;case \"events2\":g=\"\";break;case \"contextData\":c+=a.r(\"c\",a[e],q,e);g=\"\";break;case \"lightProfileID\":e=\"mtp\";break;case \"lightStoreForSeconds\":e=\"mtss\";a.lightProfileID||(g=\"\");break;case \"lightIncrementBy\":e=\"mti\";a.lightProfileID||(g=\"\");break;case \"retrieveLightProfiles\":e=\"mtsr\";break;case \"deleteLightProfiles\":e=\"mtsd\";break;case \"retrieveLightData\":a.retrieveLightProfiles&&(c+=a.r(\"mts\",a[e],q,e));g=\"\";break;default:a.Oa(h)&&(\"prop\"==f?e=\"c\"+h:\"eVar\"==f?e=\"v\"+h:\"list\"==\r\nf?e=\"l\"+h:\"hier\"==f&&(e=\"h\"+h,g=g.substring(0,255)))}g&&(c+=\"&\"+e+\"=\"+(\"pev\"!=e.substring(0,3)?a.escape(g):g))}\"pev3\"==e&&a.e&&(c+=a.e)}a.na&&(c+=\"&lrt=\"+a.na,a.na=null);return c};a.D=function(a){var b=a.tagName;if(\"undefined\"!=\"\"+a.$b||\"undefined\"!=\"\"+a.Qb&&\"HTML\"!=(\"\"+a.Qb).toUpperCase())return\"\";b=b&&b.toUpperCase?b.toUpperCase():\"\";\"SHAPE\"==b&&(b=\"\");b&&((\"INPUT\"==b||\"BUTTON\"==b)&&a.type&&a.type.toUpperCase?b=a.type.toUpperCase():!b&&a.href&&(b=\"A\"));return b};a.Ka=function(a){var b=k.location,\r\nd=a.href?a.href:\"\",f,e,g;f=d.indexOf(\":\");e=d.indexOf(\"?\");g=d.indexOf(\"/\");d&&(0>f||0<=e&&f>e||0<=g&&f>g)&&(e=a.protocol&&1<a.protocol.length?a.protocol:b.protocol?b.protocol:\"\",f=b.pathname.lastIndexOf(\"/\"),d=(e?e+\"//\":\"\")+(a.host?a.host:b.host?b.host:\"\")+(\"/\"!=d.substring(0,1)?b.pathname.substring(0,0>f?0:f)+\"/\":\"\")+d);return d};a.M=function(c){var b=a.D(c),d,f,e=\"\",g=0;return b&&(d=c.protocol,f=c.onclick,!c.href||\"A\"!=b&&\"AREA\"!=b||f&&d&&!(0>d.toLowerCase().indexOf(\"javascript\"))?f?(e=a.replace(a.replace(a.replace(a.replace(\"\"+\r\nf,\"\\r\",\"\"),\"\\n\",\"\"),\"\\t\",\"\"),\" \",\"\"),g=2):\"INPUT\"==b||\"SUBMIT\"==b?(c.value?e=c.value:c.innerText?e=c.innerText:c.textContent&&(e=c.textContent),g=3):\"IMAGE\"==b&&c.src&&(e=c.src):e=a.Ka(c),e)?{id:e.substring(0,100),type:g}:0};a.Yb=function(c){for(var b=a.D(c),d=a.M(c);c&&!d&&\"BODY\"!=b;)if(c=c.parentElement?c.parentElement:c.parentNode)b=a.D(c),d=a.M(c);d&&\"BODY\"!=b||(c=0);c&&(b=c.onclick?\"\"+c.onclick:\"\",0<=b.indexOf(\".tl(\")||0<=b.indexOf(\".trackLink(\"))&&(c=0);return c};a.Pb=function(){var c,b,d=a.linkObject,\r\nf=a.linkType,e=a.linkURL,g,h;a.pa=1;d||(a.pa=0,d=a.clickObject);if(d){c=a.D(d);for(b=a.M(d);d&&!b&&\"BODY\"!=c;)if(d=d.parentElement?d.parentElement:d.parentNode)c=a.D(d),b=a.M(d);b&&\"BODY\"!=c||(d=0);if(d&&!a.linkObject){var l=d.onclick?\"\"+d.onclick:\"\";if(0<=l.indexOf(\".tl(\")||0<=l.indexOf(\".trackLink(\"))d=0}}else a.pa=1;!e&&d&&(e=a.Ka(d));e&&!a.linkLeaveQueryString&&(g=e.indexOf(\"?\"),0<=g&&(e=e.substring(0,g)));if(!f&&e){var m=0,q=0,n;if(a.trackDownloadLinks&&a.linkDownloadFileTypes)for(l=e.toLowerCase(),\r\ng=l.indexOf(\"?\"),h=l.indexOf(\"#\"),0<=g?0<=h&&h<g&&(g=h):g=h,0<=g&&(l=l.substring(0,g)),g=a.linkDownloadFileTypes.toLowerCase().split(\",\"),h=0;h<g.length;h++)(n=g[h])&&l.substring(l.length-(n.length+1))==\".\"+n&&(f=\"d\");if(a.trackExternalLinks&&!f&&(l=e.toLowerCase(),a.Na(l)&&(a.linkInternalFilters||(a.linkInternalFilters=k.location.hostname),g=0,a.linkExternalFilters?(g=a.linkExternalFilters.toLowerCase().split(\",\"),m=1):a.linkInternalFilters&&(g=a.linkInternalFilters.toLowerCase().split(\",\")),g))){for(h=\r\n0;h<g.length;h++)n=g[h],0<=l.indexOf(n)&&(q=1);q?m&&(f=\"e\"):m||(f=\"e\")}}a.linkObject=d;a.linkURL=e;a.linkType=f;if(a.trackClickMap||a.trackInlineStats)a.e=\"\",d&&(f=a.pageName,e=1,d=d.sourceIndex,f||(f=a.pageURL,e=0),k.s_objectID&&(b.id=k.s_objectID,d=b.type=1),f&&b&&b.id&&c&&(a.e=\"&pid=\"+a.escape(f.substring(0,255))+(e?\"&pidt=\"+e:\"\")+\"&oid=\"+a.escape(b.id.substring(0,100))+(b.type?\"&oidt=\"+b.type:\"\")+\"&ot=\"+c+(d?\"&oi=\"+d:\"\")))};a.Jb=function(){var c=a.pa,b=a.linkType,d=a.linkURL,f=a.linkName;b&&(d||\r\nf)&&(b=b.toLowerCase(),\"d\"!=b&&\"e\"!=b&&(b=\"o\"),a.pe=\"lnk_\"+b,a.pev1=d?a.escape(d):\"\",a.pev2=f?a.escape(f):\"\",c=1);a.abort&&(c=0);if(a.trackClickMap||a.trackInlineStats||a.ActivityMap){var b={},d=0,e=a.cookieRead(\"s_sq\"),g=e?e.split(\"&\"):0,h,l,k,e=0;if(g)for(h=0;h<g.length;h++)l=g[h].split(\"=\"),f=a.unescape(l[0]).split(\",\"),l=a.unescape(l[1]),b[l]=f;f=a.account.split(\",\");h={};for(k in a.contextData)k&&!Object.prototype[k]&&\"a.activitymap.\"==k.substring(0,14)&&(h[k]=a.contextData[k],a.contextData[k]=\r\n\"\");a.e=a.r(\"c\",h)+(a.e?a.e:\"\");if(c||a.e){c&&!a.e&&(e=1);for(l in b)if(!Object.prototype[l])for(k=0;k<f.length;k++)for(e&&(g=b[l].join(\",\"),g==a.account&&(a.e+=(\"&\"!=l.charAt(0)?\"&\":\"\")+l,b[l]=[],d=1)),h=0;h<b[l].length;h++)g=b[l][h],g==f[k]&&(e&&(a.e+=\"&u=\"+a.escape(g)+(\"&\"!=l.charAt(0)?\"&\":\"\")+l+\"&u=0\"),b[l].splice(h,1),d=1);c||(d=1);if(d){e=\"\";h=2;!c&&a.e&&(e=a.escape(f.join(\",\"))+\"=\"+a.escape(a.e),h=1);for(l in b)!Object.prototype[l]&&0<h&&0<b[l].length&&(e+=(e?\"&\":\"\")+a.escape(b[l].join(\",\"))+\r\n\"=\"+a.escape(l),h--);a.cookieWrite(\"s_sq\",e)}}}return c};a.Kb=function(){if(!a.Tb){var c=new Date,b=n.location,d,f,e=f=d=\"\",g=\"\",h=\"\",l=\"1.2\",k=a.cookieWrite(\"s_cc\",\"true\",0)?\"Y\":\"N\",m=\"\",p=\"\";if(c.setUTCDate&&(l=\"1.3\",(0).toPrecision&&(l=\"1.5\",c=[],c.forEach))){l=\"1.6\";f=0;d={};try{f=new Iterator(d),f.next&&(l=\"1.7\",c.reduce&&(l=\"1.8\",l.trim&&(l=\"1.8.1\",Date.parse&&(l=\"1.8.2\",Object.create&&(l=\"1.8.5\")))))}catch(r){}}d=screen.width+\"x\"+screen.height;e=navigator.javaEnabled()?\"Y\":\"N\";f=screen.pixelDepth?\r\nscreen.pixelDepth:screen.colorDepth;g=a.w.innerWidth?a.w.innerWidth:a.d.documentElement.offsetWidth;h=a.w.innerHeight?a.w.innerHeight:a.d.documentElement.offsetHeight;try{a.b.addBehavior(\"#default#homePage\"),m=a.b.Zb(b)?\"Y\":\"N\"}catch(s){}try{a.b.addBehavior(\"#default#clientCaps\"),p=a.b.connectionType}catch(t){}a.resolution=d;a.colorDepth=f;a.javascriptVersion=l;a.javaEnabled=e;a.cookiesEnabled=k;a.browserWidth=g;a.browserHeight=h;a.connectionType=p;a.homepage=m;a.Tb=1}};a.Q={};a.loadModule=function(c,\r\nb){var d=a.Q[c];if(!d){d=k[\"AppMeasurement_Module_\"+c]?new k[\"AppMeasurement_Module_\"+c](a):{};a.Q[c]=a[c]=d;d.kb=function(){return d.qb};d.sb=function(b){if(d.qb=b)a[c+\"_onLoad\"]=b,a.ja(c+\"_onLoad\",[a,d],1)||b(a,d)};try{Object.defineProperty?Object.defineProperty(d,\"onLoad\",{get:d.kb,set:d.sb}):d._olc=1}catch(f){d._olc=1}}b&&(a[c+\"_onLoad\"]=b,a.ja(c+\"_onLoad\",[a,d],1)||b(a,d))};a.p=function(c){var b,d;for(b in a.Q)if(!Object.prototype[b]&&(d=a.Q[b])&&(d._olc&&d.onLoad&&(d._olc=0,d.onLoad(a,d)),d[c]&&\r\nd[c]()))return 1;return 0};a.Mb=function(){var c=Math.floor(1E13*Math.random()),b=a.visitorSampling,d=a.visitorSamplingGroup,d=\"s_vsn_\"+(a.visitorNamespace?a.visitorNamespace:a.account)+(d?\"_\"+d:\"\"),f=a.cookieRead(d);if(b){b*=100;f&&(f=parseInt(f));if(!f){if(!a.cookieWrite(d,c))return 0;f=c}if(f%1E4>b)return 0}return 1};a.R=function(c,b){var d,f,e,g,h,l;for(d=0;2>d;d++)for(f=0<d?a.Ca:a.g,e=0;e<f.length;e++)if(g=f[e],(h=c[g])||c[\"!\"+g]){if(!b&&(\"contextData\"==g||\"retrieveLightData\"==g)&&a[g])for(l in a[g])h[l]||\r\n(h[l]=a[g][l]);a[g]=h}};a.Ya=function(c,b){var d,f,e,g;for(d=0;2>d;d++)for(f=0<d?a.Ca:a.g,e=0;e<f.length;e++)g=f[e],c[g]=a[g],b||c[g]||(c[\"!\"+g]=1)};a.Eb=function(a){var b,d,f,e,g,h=0,l,k=\"\",m=\"\";if(a&&255<a.length&&(b=\"\"+a,d=b.indexOf(\"?\"),0<d&&(l=b.substring(d+1),b=b.substring(0,d),e=b.toLowerCase(),f=0,\"http://\"==e.substring(0,7)?f+=7:\"https://\"==e.substring(0,8)&&(f+=8),d=e.indexOf(\"/\",f),0<d&&(e=e.substring(f,d),g=b.substring(d),b=b.substring(0,d),0<=e.indexOf(\"google\")?h=\",q,ie,start,search_key,word,kw,cd,\":\r\n0<=e.indexOf(\"yahoo.co\")&&(h=\",p,ei,\"),h&&l)))){if((a=l.split(\"&\"))&&1<a.length){for(f=0;f<a.length;f++)e=a[f],d=e.indexOf(\"=\"),0<d&&0<=h.indexOf(\",\"+e.substring(0,d)+\",\")?k+=(k?\"&\":\"\")+e:m+=(m?\"&\":\"\")+e;k&&m?l=k+\"&\"+m:m=\"\"}d=253-(l.length-m.length)-b.length;a=b+(0<d?g.substring(0,d):\"\")+\"?\"+l}return a};a.eb=function(c){var b=a.d.visibilityState,d=[\"webkitvisibilitychange\",\"visibilitychange\"];b||(b=a.d.webkitVisibilityState);if(b&&\"prerender\"==b){if(c)for(b=0;b<d.length;b++)a.d.addEventListener(d[b],\r\nfunction(){var b=a.d.visibilityState;b||(b=a.d.webkitVisibilityState);\"visible\"==b&&c()});return!1}return!0};a.fa=!1;a.J=!1;a.ub=function(){a.J=!0;a.j()};a.da=!1;a.V=!1;a.pb=function(c){a.marketingCloudVisitorID=c;a.V=!0;a.j()};a.ga=!1;a.W=!1;a.vb=function(c){a.visitorOptedOut=c;a.W=!0;a.j()};a.aa=!1;a.S=!1;a.$a=function(c){a.analyticsVisitorID=c;a.S=!0;a.j()};a.ca=!1;a.U=!1;a.bb=function(c){a.audienceManagerLocationHint=c;a.U=!0;a.j()};a.ba=!1;a.T=!1;a.ab=function(c){a.audienceManagerBlob=c;a.T=\r\n!0;a.j()};a.cb=function(c){a.maxDelay||(a.maxDelay=250);return a.p(\"_d\")?(c&&setTimeout(function(){c()},a.maxDelay),!1):!0};a.ea=!1;a.I=!1;a.za=function(){a.I=!0;a.j()};a.isReadyToTrack=function(){var c=!0,b=a.visitor,d,f,e;a.fa||a.J||(a.eb(a.ub)?a.J=!0:a.fa=!0);if(a.fa&&!a.J)return!1;b&&b.isAllowed()&&(a.da||a.marketingCloudVisitorID||!b.getMarketingCloudVisitorID||(a.da=!0,a.marketingCloudVisitorID=b.getMarketingCloudVisitorID([a,a.pb]),a.marketingCloudVisitorID&&(a.V=!0)),a.ga||a.visitorOptedOut||\r\n!b.isOptedOut||(a.ga=!0,a.visitorOptedOut=b.isOptedOut([a,a.vb]),a.visitorOptedOut!=p&&(a.W=!0)),a.aa||a.analyticsVisitorID||!b.getAnalyticsVisitorID||(a.aa=!0,a.analyticsVisitorID=b.getAnalyticsVisitorID([a,a.$a]),a.analyticsVisitorID&&(a.S=!0)),a.ca||a.audienceManagerLocationHint||!b.getAudienceManagerLocationHint||(a.ca=!0,a.audienceManagerLocationHint=b.getAudienceManagerLocationHint([a,a.bb]),a.audienceManagerLocationHint&&(a.U=!0)),a.ba||a.audienceManagerBlob||!b.getAudienceManagerBlob||(a.ba=\r\n!0,a.audienceManagerBlob=b.getAudienceManagerBlob([a,a.ab]),a.audienceManagerBlob&&(a.T=!0)),c=a.da&&!a.V&&!a.marketingCloudVisitorID,b=a.aa&&!a.S&&!a.analyticsVisitorID,d=a.ca&&!a.U&&!a.audienceManagerLocationHint,f=a.ba&&!a.T&&!a.audienceManagerBlob,e=a.ga&&!a.W,c=c||b||d||f||e?!1:!0);a.ea||a.I||(a.cb(a.za)?a.I=!0:a.ea=!0);a.ea&&!a.I&&(c=!1);return c};a.o=p;a.u=0;a.callbackWhenReadyToTrack=function(c,b,d){var f;f={};f.zb=c;f.yb=b;f.wb=d;a.o==p&&(a.o=[]);a.o.push(f);0==a.u&&(a.u=setInterval(a.j,\r\n100))};a.j=function(){var c;if(a.isReadyToTrack()&&(a.tb(),a.o!=p))for(;0<a.o.length;)c=a.o.shift(),c.yb.apply(c.zb,c.wb)};a.tb=function(){a.u&&(clearInterval(a.u),a.u=0)};a.mb=function(c){var b,d,f=p,e=p;if(!a.isReadyToTrack()){b=[];if(c!=p)for(d in f={},c)f[d]=c[d];e={};a.Ya(e,!0);b.push(f);b.push(e);a.callbackWhenReadyToTrack(a,a.track,b);return!0}return!1};a.Gb=function(){var c=a.cookieRead(\"s_fid\"),b=\"\",d=\"\",f;f=8;var e=4;if(!c||0>c.indexOf(\"-\")){for(c=0;16>c;c++)f=Math.floor(Math.random()*f),\r\nb+=\"0123456789ABCDEF\".substring(f,f+1),f=Math.floor(Math.random()*e),d+=\"0123456789ABCDEF\".substring(f,f+1),f=e=16;c=b+\"-\"+d}a.cookieWrite(\"s_fid\",c,1)||(c=0);return c};a.t=a.track=function(c,b){var d,f=new Date,e=\"s\"+Math.floor(f.getTime()/108E5)%10+Math.floor(1E13*Math.random()),g=f.getYear(),g=\"t=\"+a.escape(f.getDate()+\"/\"+f.getMonth()+\"/\"+(1900>g?g+1900:g)+\" \"+f.getHours()+\":\"+f.getMinutes()+\":\"+f.getSeconds()+\" \"+f.getDay()+\" \"+f.getTimezoneOffset());a.visitor&&a.visitor.getAuthState&&(a.authState=\r\na.visitor.getAuthState());a.p(\"_s\");a.mb(c)||(b&&a.R(b),c&&(d={},a.Ya(d,0),a.R(c)),a.Mb()&&!a.visitorOptedOut&&(a.analyticsVisitorID||a.marketingCloudVisitorID||(a.fid=a.Gb()),a.Pb(),a.usePlugins&&a.doPlugins&&a.doPlugins(a),a.account&&(a.abort||(a.trackOffline&&!a.timestamp&&(a.timestamp=Math.floor(f.getTime()/1E3)),f=k.location,a.pageURL||(a.pageURL=f.href?f.href:f),a.referrer||a.Za||(f=a.Util.getQueryParam(\"adobe_mc_ref\",null,null,!0),a.referrer=f||void 0===f?void 0===f?\"\":f:n.document.referrer),\r\na.Za=1,a.referrer=a.Eb(a.referrer),a.p(\"_g\")),a.Jb()&&!a.abort&&(a.visitor&&!a.supplementalDataID&&a.visitor.getSupplementalDataID&&(a.supplementalDataID=a.visitor.getSupplementalDataID(\"AppMeasurement:\"+a._in,a.expectSupplementalData?!1:!0)),a.Kb(),g+=a.Ib(),a.ob(e,g),a.p(\"_t\"),a.referrer=\"\"))),c&&a.R(d,1));a.abort=a.supplementalDataID=a.timestamp=a.pageURLRest=a.linkObject=a.clickObject=a.linkURL=a.linkName=a.linkType=k.s_objectID=a.pe=a.pev1=a.pev2=a.pev3=a.e=a.lightProfileID=0};a.Ba=[];a.registerPreTrackCallback=\r\nfunction(c){for(var b=[],d=1;d<arguments.length;d++)b.push(arguments[d]);\"function\"==typeof c?a.Ba.push([c,b]):a.debugTracking&&a.F(\"DEBUG: Non function type passed to registerPreTrackCallback\")};a.hb=function(c){a.xa(a.Ba,c)};a.Aa=[];a.registerPostTrackCallback=function(c){for(var b=[],d=1;d<arguments.length;d++)b.push(arguments[d]);\"function\"==typeof c?a.Aa.push([c,b]):a.debugTracking&&a.F(\"DEBUG: Non function type passed to registerPostTrackCallback\")};a.gb=function(c){a.xa(a.Aa,c)};a.xa=function(c,\r\nb){if(\"object\"==typeof c)for(var d=0;d<c.length;d++){var f=c[d][0],e=c[d][1];e.unshift(b);if(\"function\"==typeof f)try{f.apply(null,e)}catch(g){a.debugTracking&&a.F(g.message)}}};a.tl=a.trackLink=function(c,b,d,f,e){a.linkObject=c;a.linkType=b;a.linkName=d;e&&(a.l=c,a.A=e);return a.track(f)};a.trackLight=function(c,b,d,f){a.lightProfileID=c;a.lightStoreForSeconds=b;a.lightIncrementBy=d;return a.track(f)};a.clearVars=function(){var c,b;for(c=0;c<a.g.length;c++)if(b=a.g[c],\"prop\"==b.substring(0,4)||\r\n\"eVar\"==b.substring(0,4)||\"hier\"==b.substring(0,4)||\"list\"==b.substring(0,4)||\"channel\"==b||\"events\"==b||\"eventList\"==b||\"products\"==b||\"productList\"==b||\"purchaseID\"==b||\"transactionID\"==b||\"state\"==b||\"zip\"==b||\"campaign\"==b)a[b]=void 0};a.tagContainerMarker=\"\";a.ob=function(c,b){var d=a.ib()+\"/\"+c+\"?AQB=1&ndh=1&pf=1&\"+(a.ya()?\"callback=s_c_il[\"+a._in+\"].doPostbacks&et=1&\":\"\")+b+\"&AQE=1\";a.hb(d);a.fb(d);a.X()};a.ib=function(){var c=a.jb();return\"http\"+(a.ssl?\"s\":\"\")+\"://\"+c+\"/b/ss/\"+a.account+\"/\"+\r\n(a.mobile?\"5.\":\"\")+(a.ya()?\"10\":\"1\")+\"/JS-\"+a.version+(a.Sb?\"T\":\"\")+(a.tagContainerMarker?\"-\"+a.tagContainerMarker:\"\")};a.ya=function(){return a.AudienceManagement&&a.AudienceManagement.isReady()||0!=a.usePostbacks};a.jb=function(){var c=a.dc,b=a.trackingServer;b?a.trackingServerSecure&&a.ssl&&(b=a.trackingServerSecure):(c=c?(\"\"+c).toLowerCase():\"d1\",\"d1\"==c?c=\"112\":\"d2\"==c&&(c=\"122\"),b=a.lb()+\".\"+c+\".2o7.net\");return b};a.lb=function(){var c=a.visitorNamespace;c||(c=a.account.split(\",\")[0],c=c.replace(/[^0-9a-z]/gi,\r\n\"\"));return c};a.Xa=/{(%?)(.*?)(%?)}/;a.Wb=RegExp(a.Xa.source,\"g\");a.Db=function(c){if(\"object\"==typeof c.dests)for(var b=0;b<c.dests.length;++b){var d=c.dests[b];if(\"string\"==typeof d.c&&\"aa.\"==d.id.substr(0,3))for(var f=d.c.match(a.Wb),e=0;e<f.length;++e){var g=f[e],h=g.match(a.Xa),k=\"\";\"%\"==h[1]&&\"timezone_offset\"==h[2]?k=(new Date).getTimezoneOffset():\"%\"==h[1]&&\"timestampz\"==h[2]&&(k=a.Hb());d.c=d.c.replace(g,a.escape(k))}}};a.Hb=function(){var c=new Date,b=new Date(6E4*Math.abs(c.getTimezoneOffset()));\r\nreturn a.k(4,c.getFullYear())+\"-\"+a.k(2,c.getMonth()+1)+\"-\"+a.k(2,c.getDate())+\"T\"+a.k(2,c.getHours())+\":\"+a.k(2,c.getMinutes())+\":\"+a.k(2,c.getSeconds())+(0<c.getTimezoneOffset()?\"-\":\"+\")+a.k(2,b.getUTCHours())+\":\"+a.k(2,b.getUTCMinutes())};a.k=function(a,b){return(Array(a+1).join(0)+b).slice(-a)};a.ua={};a.doPostbacks=function(c){if(\"object\"==typeof c)if(a.Db(c),\"object\"==typeof a.AudienceManagement&&\"function\"==typeof a.AudienceManagement.isReady&&a.AudienceManagement.isReady()&&\"function\"==typeof a.AudienceManagement.passData)a.AudienceManagement.passData(c);\r\nelse if(\"object\"==typeof c&&\"object\"==typeof c.dests)for(var b=0;b<c.dests.length;++b){var d=c.dests[b];\"object\"==typeof d&&\"string\"==typeof d.c&&\"string\"==typeof d.id&&\"aa.\"==d.id.substr(0,3)&&(a.ua[d.id]=new Image,a.ua[d.id].alt=\"\",a.ua[d.id].src=d.c)}};a.fb=function(c){a.i||a.Lb();a.i.push(c);a.ma=a.C();a.Va()};a.Lb=function(){a.i=a.Nb();a.i||(a.i=[])};a.Nb=function(){var c,b;if(a.ta()){try{(b=k.localStorage.getItem(a.qa()))&&(c=k.JSON.parse(b))}catch(d){}return c}};a.ta=function(){var c=!0;a.trackOffline&&\r\na.offlineFilename&&k.localStorage&&k.JSON||(c=!1);return c};a.La=function(){var c=0;a.i&&(c=a.i.length);a.q&&c++;return c};a.X=function(){if(a.q&&(a.B&&a.B.complete&&a.B.G&&a.B.wa(),a.q))return;a.Ma=p;if(a.ra)a.ma>a.O&&a.Ta(a.i),a.va(500);else{var c=a.xb();if(0<c)a.va(c);else if(c=a.Ia())a.q=1,a.Ob(c),a.Rb(c)}};a.va=function(c){a.Ma||(c||(c=0),a.Ma=setTimeout(a.X,c))};a.xb=function(){var c;if(!a.trackOffline||0>=a.offlineThrottleDelay)return 0;c=a.C()-a.Ra;return a.offlineThrottleDelay<c?0:a.offlineThrottleDelay-\r\nc};a.Ia=function(){if(0<a.i.length)return a.i.shift()};a.Ob=function(c){if(a.debugTracking){var b=\"AppMeasurement Debug: \"+c;c=c.split(\"&\");var d;for(d=0;d<c.length;d++)b+=\"\\n\\t\"+a.unescape(c[d]);a.F(b)}};a.nb=function(){return a.marketingCloudVisitorID||a.analyticsVisitorID};a.Z=!1;var t;try{t=JSON.parse('{\"x\":\"y\"}')}catch(w){t=null}t&&\"y\"==t.x?(a.Z=!0,a.Y=function(a){return JSON.parse(a)}):k.$&&k.$.parseJSON?(a.Y=function(a){return k.$.parseJSON(a)},a.Z=!0):a.Y=function(){return null};a.Rb=function(c){var b,\r\nd,f;a.nb()&&2047<c.length&&(\"undefined\"!=typeof XMLHttpRequest&&(b=new XMLHttpRequest,\"withCredentials\"in b?d=1:b=0),b||\"undefined\"==typeof XDomainRequest||(b=new XDomainRequest,d=2),b&&(a.AudienceManagement&&a.AudienceManagement.isReady()||0!=a.usePostbacks)&&(a.Z?b.Da=!0:b=0));!b&&a.Wa&&(c=c.substring(0,2047));!b&&a.d.createElement&&(0!=a.usePostbacks||a.AudienceManagement&&a.AudienceManagement.isReady())&&(b=a.d.createElement(\"SCRIPT\"))&&\"async\"in b&&((f=(f=a.d.getElementsByTagName(\"HEAD\"))&&f[0]?\r\nf[0]:a.d.body)?(b.type=\"text/javascript\",b.setAttribute(\"async\",\"async\"),d=3):b=0);b||(b=new Image,b.alt=\"\",b.abort||\"undefined\"===typeof k.InstallTrigger||(b.abort=function(){b.src=p}));b.Sa=Date.now();b.Fa=function(){try{b.G&&(clearTimeout(b.G),b.G=0)}catch(a){}};b.onload=b.wa=function(){b.Sa&&(a.na=Date.now()-b.Sa);a.gb(c);b.Fa();a.Bb();a.ha();a.q=0;a.X();if(b.Da){b.Da=!1;try{a.doPostbacks(a.Y(b.responseText))}catch(d){}}};b.onabort=b.onerror=b.Ja=function(){b.Fa();(a.trackOffline||a.ra)&&a.q&&\r\na.i.unshift(a.Ab);a.q=0;a.ma>a.O&&a.Ta(a.i);a.ha();a.va(500)};b.onreadystatechange=function(){4==b.readyState&&(200==b.status?b.wa():b.Ja())};a.Ra=a.C();if(1==d||2==d){var e=c.indexOf(\"?\");f=c.substring(0,e);e=c.substring(e+1);e=e.replace(/&callback=[a-zA-Z0-9_.\\[\\]]+/,\"\");1==d?(b.open(\"POST\",f,!0),b.send(e)):2==d&&(b.open(\"POST\",f),b.send(e))}else if(b.src=c,3==d){if(a.Pa)try{f.removeChild(a.Pa)}catch(g){}f.firstChild?f.insertBefore(b,f.firstChild):f.appendChild(b);a.Pa=a.B}b.G=setTimeout(function(){b.G&&\r\n(b.complete?b.wa():(a.trackOffline&&b.abort&&b.abort(),b.Ja()))},5E3);a.Ab=c;a.B=k[\"s_i_\"+a.replace(a.account,\",\",\"_\")]=b;if(a.useForcedLinkTracking&&a.K||a.A)a.forcedLinkTrackingTimeout||(a.forcedLinkTrackingTimeout=250),a.ia=setTimeout(a.ha,a.forcedLinkTrackingTimeout)};a.Bb=function(){if(a.ta()&&!(a.Qa>a.O))try{k.localStorage.removeItem(a.qa()),a.Qa=a.C()}catch(c){}};a.Ta=function(c){if(a.ta()){a.Va();try{k.localStorage.setItem(a.qa(),k.JSON.stringify(c)),a.O=a.C()}catch(b){}}};a.Va=function(){if(a.trackOffline){if(!a.offlineLimit||\r\n0>=a.offlineLimit)a.offlineLimit=10;for(;a.i.length>a.offlineLimit;)a.Ia()}};a.forceOffline=function(){a.ra=!0};a.forceOnline=function(){a.ra=!1};a.qa=function(){return a.offlineFilename+\"-\"+a.visitorNamespace+a.account};a.C=function(){return(new Date).getTime()};a.Na=function(a){a=a.toLowerCase();return 0!=a.indexOf(\"#\")&&0!=a.indexOf(\"about:\")&&0!=a.indexOf(\"opera:\")&&0!=a.indexOf(\"javascript:\")?!0:!1};a.setTagContainer=function(c){var b,d,f;a.Sb=c;for(b=0;b<a._il.length;b++)if((d=a._il[b])&&\"s_l\"==\r\nd._c&&d.tagContainerName==c){a.R(d);if(d.lmq)for(b=0;b<d.lmq.length;b++)f=d.lmq[b],a.loadModule(f.n);if(d.ml)for(f in d.ml)if(a[f])for(b in c=a[f],f=d.ml[f],f)!Object.prototype[b]&&(\"function\"!=typeof f[b]||0>(\"\"+f[b]).indexOf(\"s_c_il\"))&&(c[b]=f[b]);if(d.mmq)for(b=0;b<d.mmq.length;b++)f=d.mmq[b],a[f.m]&&(c=a[f.m],c[f.f]&&\"function\"==typeof c[f.f]&&(f.a?c[f.f].apply(c,f.a):c[f.f].apply(c)));if(d.tq)for(b=0;b<d.tq.length;b++)a.track(d.tq[b]);d.s=a;break}};a.Util={urlEncode:a.escape,urlDecode:a.unescape,\r\ncookieRead:a.cookieRead,cookieWrite:a.cookieWrite,getQueryParam:function(c,b,d,f){var e,g=\"\";b||(b=a.pageURL?a.pageURL:k.location);d=d?d:\"&\";if(!c||!b)return g;b=\"\"+b;e=b.indexOf(\"?\");if(0>e)return g;b=d+b.substring(e+1)+d;if(!f||!(0<=b.indexOf(d+c+d)||0<=b.indexOf(d+c+\"=\"+d))){e=b.indexOf(\"#\");0<=e&&(b=b.substr(0,e)+d);e=b.indexOf(d+c+\"=\");if(0>e)return g;b=b.substring(e+d.length+c.length+1);e=b.indexOf(d);0<=e&&(b=b.substring(0,e));0<b.length&&(g=a.unescape(b));return g}},getIeVersion:function(){if(document.documentMode)return document.documentMode;\r\nfor(var a=7;4<a;a--){var b=document.createElement(\"div\");b.innerHTML=\"\\x3c!--[if IE \"+a+\"]><span></span><![endif]--\\x3e\";if(b.getElementsByTagName(\"span\").length)return a}return null}};a.H=\"supplementalDataID timestamp dynamicVariablePrefix visitorID marketingCloudVisitorID analyticsVisitorID audienceManagerLocationHint authState fid vmk visitorMigrationKey visitorMigrationServer visitorMigrationServerSecure charSet visitorNamespace cookieDomainPeriods fpCookieDomainPeriods cookieLifetime pageName pageURL customerPerspective referrer contextData currencyCode lightProfileID lightStoreForSeconds lightIncrementBy retrieveLightProfiles deleteLightProfiles retrieveLightData\".split(\" \");\r\na.g=a.H.concat(\"purchaseID variableProvider channel server pageType transactionID campaign state zip events events2 products audienceManagerBlob tnt\".split(\" \"));a.oa=\"timestamp charSet visitorNamespace cookieDomainPeriods cookieLifetime contextData lightProfileID lightStoreForSeconds lightIncrementBy\".split(\" \");a.P=a.oa.slice(0);a.Ca=\"account allAccounts debugTracking visitor visitorOptedOut trackOffline offlineLimit offlineThrottleDelay offlineFilename usePlugins doPlugins configURL visitorSampling visitorSamplingGroup linkObject clickObject linkURL linkName linkType trackDownloadLinks trackExternalLinks trackClickMap trackInlineStats linkLeaveQueryString linkTrackVars linkTrackEvents linkDownloadFileTypes linkExternalFilters linkInternalFilters useForcedLinkTracking forcedLinkTrackingTimeout trackingServer trackingServerSecure ssl abort mobile dc lightTrackVars maxDelay expectSupplementalData usePostbacks registerPreTrackCallback registerPostTrackCallback AudienceManagement\".split(\" \");\r\nfor(m=0;250>=m;m++)76>m&&(a.g.push(\"prop\"+m),a.P.push(\"prop\"+m)),a.g.push(\"eVar\"+m),a.P.push(\"eVar\"+m),6>m&&a.g.push(\"hier\"+m),4>m&&a.g.push(\"list\"+m);m=\"pe pev1 pev2 pev3 latitude longitude resolution colorDepth javascriptVersion javaEnabled cookiesEnabled browserWidth browserHeight connectionType homepage pageURLRest marketingCloudOrgID\".split(\" \");a.g=a.g.concat(m);a.H=a.H.concat(m);a.ssl=0<=k.location.protocol.toLowerCase().indexOf(\"https\");a.charSet=\"UTF-8\";a.contextData={};a.offlineThrottleDelay=\r\n0;a.offlineFilename=\"AppMeasurement.offline\";a.Ra=0;a.ma=0;a.O=0;a.Qa=0;a.linkDownloadFileTypes=\"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";a.w=k;a.d=k.document;try{if(a.Wa=!1,navigator){var v=navigator.userAgent;if(\"Microsoft Internet Explorer\"==navigator.appName||0<=v.indexOf(\"MSIE \")||0<=v.indexOf(\"Trident/\")&&0<=v.indexOf(\"Windows NT 6\"))a.Wa=!0}}catch(x){}a.ha=function(){a.ia&&(k.clearTimeout(a.ia),a.ia=p);a.l&&a.K&&a.l.dispatchEvent(a.K);a.A&&(\"function\"==typeof a.A?a.A():\r\na.l&&a.l.href&&(a.d.location=a.l.href));a.l=a.K=a.A=0};a.Ua=function(){a.b=a.d.body;a.b?(a.v=function(c){var b,d,f,e,g;if(!(a.d&&a.d.getElementById(\"cppXYctnr\")||c&&c[\"s_fe_\"+a._in])){if(a.Ea)if(a.useForcedLinkTracking)a.b.removeEventListener(\"click\",a.v,!1);else{a.b.removeEventListener(\"click\",a.v,!0);a.Ea=a.useForcedLinkTracking=0;return}else a.useForcedLinkTracking=0;a.clickObject=c.srcElement?c.srcElement:c.target;try{if(!a.clickObject||a.N&&a.N==a.clickObject||!(a.clickObject.tagName||a.clickObject.parentElement||\r\na.clickObject.parentNode))a.clickObject=0;else{var h=a.N=a.clickObject;a.la&&(clearTimeout(a.la),a.la=0);a.la=setTimeout(function(){a.N==h&&(a.N=0)},1E4);f=a.La();a.track();if(f<a.La()&&a.useForcedLinkTracking&&c.target){for(e=c.target;e&&e!=a.b&&\"A\"!=e.tagName.toUpperCase()&&\"AREA\"!=e.tagName.toUpperCase();)e=e.parentNode;if(e&&(g=e.href,a.Na(g)||(g=0),d=e.target,c.target.dispatchEvent&&g&&(!d||\"_self\"==d||\"_top\"==d||\"_parent\"==d||k.name&&d==k.name))){try{b=a.d.createEvent(\"MouseEvents\")}catch(l){b=\r\nnew k.MouseEvent}if(b){try{b.initMouseEvent(\"click\",c.bubbles,c.cancelable,c.view,c.detail,c.screenX,c.screenY,c.clientX,c.clientY,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,c.button,c.relatedTarget)}catch(m){b=0}b&&(b[\"s_fe_\"+a._in]=b.s_fe=1,c.stopPropagation(),c.stopImmediatePropagation&&c.stopImmediatePropagation(),c.preventDefault(),a.l=c.target,a.K=b)}}}}}catch(n){a.clickObject=0}}},a.b&&a.b.attachEvent?a.b.attachEvent(\"onclick\",a.v):a.b&&a.b.addEventListener&&(navigator&&(0<=navigator.userAgent.indexOf(\"WebKit\")&&\r\na.d.createEvent||0<=navigator.userAgent.indexOf(\"Firefox/2\")&&k.MouseEvent)&&(a.Ea=1,a.useForcedLinkTracking=1,a.b.addEventListener(\"click\",a.v,!0)),a.b.addEventListener(\"click\",a.v,!1))):setTimeout(a.Ua,30)};a.Cb();a.ac||(r?a.setAccount(r):a.F(\"Error, missing Report Suite ID in AppMeasurement initialization\"),a.Ua(),a.loadModule(\"ActivityMap\"))}" ]
[ "0.47173288", "0.46583715", "0.45286083", "0.45038942", "0.44843733", "0.44348565", "0.43834072", "0.4362673", "0.43318212", "0.43005583", "0.42536354", "0.42424083", "0.4222003", "0.42190567", "0.41818368", "0.41800052", "0.41799405", "0.41780844", "0.4177319", "0.41746554", "0.41731894", "0.4164861", "0.41408655", "0.41408655", "0.4126271", "0.41198462", "0.41181275", "0.41116533", "0.4109392", "0.41077578", "0.41055024", "0.41054586", "0.41040766", "0.41028202", "0.4101603", "0.40943187", "0.40915915", "0.40807727", "0.4080601", "0.40786958", "0.40776995", "0.4075226", "0.40742034", "0.4073683", "0.4069356", "0.405919", "0.40536937", "0.40535375", "0.40482554", "0.40477142", "0.40475637", "0.40444773", "0.40426528", "0.4042554", "0.404086", "0.40388995", "0.40339974", "0.40257978", "0.4021241", "0.40193477", "0.40186223", "0.40148717", "0.40133676", "0.40122312", "0.40120062", "0.4011317", "0.4006406", "0.4006406", "0.40057757", "0.4003313", "0.39914393", "0.39912254", "0.39903682", "0.3987383", "0.398352", "0.3981198", "0.3981053", "0.39806503", "0.39806503", "0.39806503", "0.39769232", "0.397633", "0.39746606", "0.39745283", "0.39735347", "0.39734355", "0.39696053", "0.3965437", "0.396171", "0.39597186", "0.3959575", "0.3957542", "0.39567924", "0.39551595", "0.39508852", "0.39458537", "0.39448595", "0.39432395", "0.3940848", "0.39408445", "0.39383444" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function simpleLayout(seriesModel) { var coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type !== 'view') { return; } var graph = seriesModel.getGraph(); graph.eachNode(function (node) { var model = node.getModel(); node.setLayout([+model.get('x'), +model.get('y')]); }); simpleLayoutEdge(graph, seriesModel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "started () {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "function SigV4Utils() { }", "started() {\r\n\r\n\t}", "static get NOT_READY () {return 0}", "initialize() {\n\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "heartbeat () {\n }", "static final private internal function m106() {}", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53504926", "0.4896905", "0.48514667", "0.48116106", "0.4775166", "0.4743932", "0.47342455", "0.47035336", "0.4694186", "0.4694186", "0.46744877", "0.46453032", "0.46394095", "0.4629355", "0.46211302", "0.45832416", "0.45812932", "0.45752546", "0.45698234", "0.45625272", "0.4557475", "0.4549714", "0.45494938", "0.4545794", "0.45383474", "0.4523037", "0.45180768", "0.45005357", "0.4496748", "0.4486438", "0.447462", "0.44716924", "0.4468301", "0.44601226", "0.4456266", "0.4455926", "0.44557476", "0.4445067", "0.44378054", "0.44258687", "0.44258553", "0.4424118", "0.44097725", "0.4406038", "0.4404498", "0.4404498", "0.4404498", "0.43926418", "0.43781474", "0.43708664", "0.43657827", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43526813", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4349645", "0.43450522", "0.43440443", "0.43390423", "0.43347356", "0.43347356", "0.43332103", "0.43318707" ]
0.0
-1
Do not execute util needed.
function getLabelDefaultText(idx, opt) { return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Util() {}", "function DWRUtil() { }", "function AeUtil() {}", "function Utils(){}", "function Utils() {}", "function Utils() {}", "private public function m246() {}", "function _____SHARED_functions_____(){}", "private internal function m248() {}", "static private internal function m121() {}", "function run() {}", "function run() {\n\n }", "function Utils() {\n}", "transient private protected internal function m182() {}", "function setup() {}", "transient private internal function m185() {}", "execute() {}", "execute() {}", "function run() {\n }", "execute() {\n throw new Error(\"Must be implemented in subclass\");\n }", "static final private internal function m106() {}", "function AppUtils() {}", "protected internal function m252() {}", "systemCheck() {\n\n }", "function alwaysRunOnload () {\n\t\t// Placeholder/Future use.\n\t}", "function _main() {\n try {\n // the modules own main routine\n //_logCalls();\n\n // enable a global accessability from window\n window.tools = {} || window.tools;\n window.tools._log = _log;\n window.tools._addNavigation = _addNavigation;\n } catch (error) {\n console.log(error);\n }\n\n }", "run() {\n\t\tthrow new Error;\n\t}", "function Execute() {\n util.panic(\"Execute() is static-only!\");\n }", "transient protected internal function m189() {}", "static ready() { }", "static transient final protected internal function m47() {}", "static cleanBin() {\n // TODO:\n }", "function _main() {\n window.tools = {} || window.tools;\n window.tools.log = _log;\n }", "function _setup () {\n }", "execute() {\n throw new Error(\"The execute method has not been defined for this class.\");\n }", "function Tools(){}", "Run() {\n\n }", "static private protected internal function m118() {}", "function run() {\n\n}", "run () {\n }", "firstRun() { }", "async setup() { }", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "prepare() {}", "static transient final private internal function m43() {}", "function CCUtility() {}", "function FunctionUtils() {}", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "static transient final protected public internal function m46() {}", "static transient private protected internal function m55() {}", "setup() {}", "setup() {}", "setup() {}", "function Common(){}", "cacheLoader (mainNameSpace) {\n \n let NoEmptyNamespace = false \n if (mainNameSpace) {\n \n let keys_exists = Object.keys(mainNameSpace) ; \n\n (keys_exists || keys_exists.length > 0)?NoEmptyNamespace = true : NoEmptyNamespace \n \n if(NoEmptyNamespace){\n \n for(let method in mainNameSpace){\n \n (typeof mainNameSpace[method] == \"function\") ? mainNameSpace[method]() : console.warn(`no module found on ${mainNameSpace}`)\n }\n }\n }\n \n }", "transient private protected public internal function m181() {}", "function Helper() {}", "static first(context) {\n throw new Error(\"TODO: Method not implemented\");\n }", "expected(_utils) {\n return 'nothing';\n }", "transient final protected internal function m174() {}", "static private protected public internal function m117() {}", "setupFinal() {}", "function noOP() {\n }", "function noOP() {\n }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function Main()\n {\n \n }", "static protected internal function m125() {}", "function jessica() {\n $log.debug(\"TODO\");\n }", "requiredOperations1() {}", "function setup() {\n\n\t\t\t\t\t}", "function kp() {\n $log.debug(\"TODO\");\n }", "static setup() {\r\n if (!Utils.exists(Utils.log)) {\r\n super.setup(C.LOG_SRC.UTILS);\r\n }\r\n }", "function GranularSanityChecks() {}", "transient final private protected internal function m167() {}", "process() {}", "process() {}", "function Kutility() {\n\n}", "function Kutility() {\n\n}", "prepare() {\n }", "static transient final private protected internal function m40() {}", "function da(){}", "function da(){}", "function da(){}", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "beforeRun() {}", "function testFunction() {\r\n console.log(\"myutil.js testFunction called\");\r\n}", "function main(){\n\n\n}", "function SafeScript(){}", "function Runner() {\n }", "constructor() {\n /**\n * @member {Object} Utils.Utils#_env The Environment variables to be stored for a given runtime\n */\n privateStuff.set(_env, {\n WORKDIR: process.cwd(),\n RUNTIMEDIR: path.resolve(__dirname + \"/../\"),\n RUNTIMEINFO: require(__dirname + \"/../package.json\")\n });\n /**\n * @member {Symbol.iterable} Utils.Utils#_args The arguments object that will keep the arguments schema (descriptions, pattern to extract)\n */\n privateStuff.set(_args,require(__dirname + \"/../data/arguments.json\"));\n }", "function noop() {\n\t\t // No operation performed.\n\t\t}" ]
[ "0.6675781", "0.6511974", "0.63683903", "0.6353246", "0.633664", "0.633664", "0.61127895", "0.6072407", "0.600812", "0.5830197", "0.57776296", "0.5775812", "0.5761761", "0.57195854", "0.5696808", "0.5674436", "0.56700087", "0.56700087", "0.5631267", "0.5621573", "0.5604435", "0.5597372", "0.5596602", "0.5585382", "0.5580229", "0.5557277", "0.5554091", "0.5551626", "0.55391985", "0.55360204", "0.55191505", "0.55109096", "0.54956615", "0.5493127", "0.5475655", "0.5462957", "0.5457416", "0.5456984", "0.5452719", "0.5452491", "0.5448314", "0.543043", "0.5428062", "0.5428062", "0.5428062", "0.5428062", "0.5428062", "0.5428062", "0.5428062", "0.5425392", "0.5415158", "0.5409856", "0.54065776", "0.540186", "0.5381938", "0.53783584", "0.5356066", "0.5356066", "0.5356066", "0.5321148", "0.5312187", "0.53120065", "0.5310057", "0.5300101", "0.5297715", "0.5291542", "0.5287187", "0.5280805", "0.52680445", "0.52680445", "0.526401", "0.526401", "0.526401", "0.5263022", "0.5260064", "0.5251212", "0.52436066", "0.52416134", "0.52312994", "0.52288944", "0.5222611", "0.522029", "0.5212379", "0.5212379", "0.5206711", "0.5206711", "0.5200556", "0.519403", "0.51923674", "0.51923674", "0.51923674", "0.51896745", "0.51896745", "0.51896745", "0.5187891", "0.5184784", "0.5180453", "0.517837", "0.5175526", "0.5174417", "0.51716006" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(ecModel, api) { ecModel.eachSeriesByType('themeRiver', function (seriesModel) { var data = seriesModel.getData(); var single = seriesModel.coordinateSystem; var layoutInfo = {}; // use the axis boundingRect for view var rect = single.getRect(); layoutInfo.rect = rect; var boundaryGap = seriesModel.get('boundaryGap'); var axis = single.getAxis(); layoutInfo.boundaryGap = boundaryGap; if (axis.orient === 'horizontal') { boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.height); boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.height); var height = rect.height - boundaryGap[0] - boundaryGap[1]; themeRiverLayout(data, seriesModel, height); } else { boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.width); boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.width); var width = rect.width - boundaryGap[0] - boundaryGap[1]; themeRiverLayout(data, seriesModel, width); } data.setLayout('layoutInfo', layoutInfo); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Pick color from palette for each data item. Applicable for charts that require applying color palette in data level (like pie, funnel, chord).
function _default(seriesType) { return { getTargetSeries: function (ecModel) { // Pie and funnel may use diferrent scope var paletteScope = {}; var seiresModelMap = createHashMap(); ecModel.eachSeriesByType(seriesType, function (seriesModel) { seriesModel.__paletteScope = paletteScope; seiresModelMap.set(seriesModel.uid, seriesModel); }); return seiresModelMap; }, reset: function (seriesModel, ecModel) { var dataAll = seriesModel.getRawData(); var idxMap = {}; var data = seriesModel.getData(); data.each(function (idx) { var rawIdx = data.getRawIndex(idx); idxMap[rawIdx] = idx; }); dataAll.each(function (rawIdx) { var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true); var singleDataBorderColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'borderColor', true); var itemModel; if (!singleDataColor || !singleDataBorderColor) { // FIXME Performance itemModel = dataAll.getItemModel(rawIdx); } if (!singleDataColor) { var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Data is not filtered if (filteredIdx != null) { data.setItemVisual(filteredIdx, 'color', color); } } if (!singleDataBorderColor) { var borderColor = itemModel.get('itemStyle.borderColor'); // Data is not filtered if (filteredIdx != null) { data.setItemVisual(filteredIdx, 'borderColor', borderColor); } } }); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickColor(d, data, colorIds) {\n var candidateId;\n for (var i=0; i<colorIds.length; i++) {\n candidateId = colorIds[i];\n if (isAvailableColor(d, data, candidateId)) {\n return candidateId;\n }\n }\n return -1; // no colors are available\n }", "function randomColorFromPalette() { return palette[Math.floor(Math.random() * palette.length)][2]; }", "function interpolateColor(d) {\n\t\t\t\t\t\treturn d['mtd3-color'] ? d['mtd3-color'] : colorPalette(d);\n\t\t\t\t\t}", "function pickColorFromPalette(index) {\n const color = currentPalette[index];\n if (color === undefined) {\n console.log(\n `Color is undefined. You are currently using this palette:\\n${currentPalette}`\n );\n throw `color undefined`;\n return \"#FF55FF\";\n } else {\n return color;\n }\n}", "function getItemColor(d) {\n if (!(d.labels[0] in itemColorMap))\n itemColorMap[d.labels[0]] = colorScale(d.labels[0]);\n return itemColorMap[d.labels[0]];\n }", "function chartcolors (type) {\n\tswitch (type) {\n\t\tcase qojl_data:\n\t\t\treturn '#d66761';\n\t\t\tbreak;\n\t\tcase qutip_data:\n\t\t\treturn '#a87db6';\n\t\t\tbreak;\n\t\tcase qutipcython_data:\n\t\t\treturn '#666666';\n\t\t\tbreak;\n\t\tcase toolbox_data:\n\t\t\treturn '#6cac5b';\n\t\t\tbreak;\n\t}\n}", "function getPalette(data) {\n const rgbData = data.filter((_, i) => (i + 1) % 4 !== 0)\n const colors = palette(rgbData)\n const result = rgbToNum(colors)\n return result\n}", "function highcharts_color_set (base) {\n var colors = [];\n colors.push(Highcharts.Color(base).get());\n for (var i = 0; i < 9; i ++) {\n colors.push(Highcharts.Color(base).brighten((i - 3) / 14).get());\n }\n return colors;\n }", "colors(data) {\n let uniqueTypeNames = this.getUniqueNames(data)\n let colors = []\n\n for (var i = 0; i < uniqueTypeNames.length; i++) {\n let toTrim = uniqueTypeNames[i]\n let trimmedType = toTrim.replace(/\\s+/g, '')\n\n let color = this.props.data[0].styles[trimmedType][0].backgroundColor\n colors.push(color)\n }\n return colors\n }", "function getColor(d) {\n return d == 1 ? '#fec44f' :\n d == 2 ? '#41ab5d' :\n d == 3 ? '#e7298a' :\n d == 4 ? '#636363' :\n '#F2F0F7' ;\n }", "function getColor(d) {\n return barColor;\n }", "function getColorsCreatePalette(){\n cp.$container.html(\" \");\n $.getJSON('/static/coloring/vendors/material/material-colors.json', function(colors){\n var keys = Object.keys(colors);\n for (var i = keys.length - 1; i >= 0; i--) {\n cp.options.push(colors[keys[i]][500]);\n }\n createColorPalette(cp.options);\n });\n }", "function getColor(d) {\n return d.length>1? \"#ffffff\" : \n d[0]==1 ? \"#FECE00\":\n d[0]==2 ? \"#0065AE\" :\n d[0]==\"3B\" ? \"#99D4DE\":\n d[0]==3 ? \"#9F971A\":\n d[0]==4 ?\"#BE418D\":\n d[0]==5 ? \"#F19043\":\n d[0]==6 ? \"#84C28E\":\n d[0]==7 ?\"#F2A4B7\":\n d[0]==\"7B\" ? \"#84C28E\":\n d[0]==8?\"#CDACCF\":\n d[0]==9? \"#D5C900\":\n d[0]==10?\"#E4B327\":\n d[0]==11?\"#8C5E24\" :\n d[0]==12?\"#007E49\":\n d[0]==13?\"#99D4DE\":\n d[0]==14?\"#622280\":\n '#FC4E2A';\n}", "getColor(state) {\n return this.palette[state];\n }", "function mapColor(id,type) {\n var arrColors = guiData.colorPalette;\n var resColor = \"hsl(195, 100%, 35%)\";\n //console.log(emailDomains);\n //console.log(id);\n if (id != -1) {\n if (id < arrColors.length - 1) {\n resColor = arrColors[id];\n }else{\n resColor = arrColors[arrColors.length - 1];\n }\n }else{\n switch (type) {\n case 'node': resColor = arrColors[0]; break;\n case 'edge': resColor = arrColors[0];\n //\"rgba(0, 134, 179,0.5)\";\n //\"rgba(59, 124, 171, 0.42)\";\n break;\n }\n }\n return resColor;\n }", "function getColor(d){\n\n\t\t\tif(colCounter < data.length-1){\n\t\t\t\tcolCounter++;\n\t\t\t\treturn colDict[colIndex];\n\t\t\t}else{\n\t\t\t\tcolCounter = 0;\n\t\t\t\tcolIndex = colIndex + 1;\n\t\t\t\treturn colDict[colIndex-1];\n\t\t\t}\n\t\t}", "GetPalette(color) {\n const baseLight = tinyColor$2('#ffffff');\n const baseDark = this.utilsService.Multiply(tinyColor$2(color).toRgb(), tinyColor$2(color).toRgb());\n const [, , , baseTriad] = tinyColor$2(color).tetrad();\n const primary = Object.keys(ThemeBuilderConstants.MIX_AMOUNTS_PRIMARY)\n .map(k => {\n const [light, amount] = ThemeBuilderConstants.MIX_AMOUNTS_PRIMARY[k];\n return [k, tinyColor$2.mix(light ? baseLight : baseDark, tinyColor$2(color), amount)];\n });\n const accent = Object.keys(ThemeBuilderConstants.MIX_AMOUNTS_SECONDARY)\n .map(k => {\n const [amount, sat, light] = ThemeBuilderConstants.MIX_AMOUNTS_SECONDARY[k];\n return [k, tinyColor$2.mix(baseDark, baseTriad, amount)\n .saturate(sat).lighten(light)];\n });\n return [...primary, ...accent].reduce((acc, [k, c]) => {\n acc[k] = c.toHexString();\n return acc;\n }, {});\n }", "function mapColors(data) {\n let strValue = [];\n for (let i = 0; i < data.length; i ++){\n strValue.push(String(JSON.stringify(data[i]))); // particolare tipo di hashing \n }\n oScale.domain(strValue);\n}", "color(data) {\n\t\treturn d3\n\t\t\t.scaleLinear()\n\t\t\t.domain([0, Math.round(data.length / 2), data.length])\n\t\t\t.range(['#BBE4A0', '#52A8AF', '#00305C'])\n\t}", "function thisColor(i) { \n colors = ['#001f3f', '#0074D9', '#B10DC9', '#AAAAAA', '#39CCCC', '#FFDC00', '#FF851B', \n '#01FF70', '#F012BE', '#7FDBFF', '#3D9970', '#85144b', '#2ECC40', '##FF4136', '#F012BE', \n \"#3366cc\", \"#dc3912\", \"#ff9900\"];\n\n cc = d3.scaleLinear()\n .domain([-2, 17])\n .range([1, 0]);\n\n return d3.interpolateSpectral(cc(i));\n}", "colorsPie() {\n this.colorArray=[\"#CA6A63\", \"#A4C2C5\", \"#CE808E\", \"#C8D3A8\", \"#200E62\", \"#469343\", \"#6C1EE1\", \"#5de35e\", \"#ec9576\", \"#fa173a\", \"#6c7160\", \"#bc0d79\", \"#8fbab4\", \"#1d61d6\", \"#656234\", \"#2d04df\", \"#d16881\", \"#f9b799\", \"#595875\", \"#35644e\"];\n }", "getColors() {\n const d = this.items\n return Object.keys(d)\n .map(function (index) {\n if (\n (d[index].style && d[index].style.color !== undefined) ||\n (d[index].style && d[index].style.backgroundColor !== undefined)\n )\n return d[index].style.color || d[index].style.backgroundColor\n })\n .filter((notUndefined) => notUndefined !== undefined)\n }", "function mapColorToPalette(red,green,blue){\n var color,diffR,diffG,diffB,diffDistance,mappedColor;\n var distance=250000;\n for(var i=0;i<palette.length;i++){\n color=palette[i];\n diffR=( color.r - red );\n diffG=( color.g - green );\n diffB=( color.b - blue );\n diffDistance = diffR*diffR + diffG*diffG + diffB*diffB;\n if( diffDistance < distance ){\n distance=diffDistance;\n mappedColor=palette[i];\n };\n }\n return(mappedColor);\n }", "@autobind\n processColors(data) {\n var self = this;\n var colorsetindex = 0;\n var colorindex = 0;\n\n for (var i=0; i<data.colors.length; i++) {\n this.colors[i] = new Array();\n for (var a=0; a<4; a++) {\n this.colors[i][a] = new Array();\n }\n }\n\n data.colors.forEach(function(colset) {\n colorindex = 0;\n colset.colors.forEach(function(col){\n switch (col.label) {\n case \"red\":\n colorindex = 1;\n break;\n case \"green\":\n colorindex = 3;\n break;\n case \"blue\":\n colorindex = 0;\n break;\n case \"yellow\":\n colorindex = 2;\n break;\n }\n col.colors.forEach(function(color) {\n self.colors[colorsetindex][colorindex].push(self.hexToRgb(color));\n });\n });\n\n colorsetindex++;\n });\n }", "function getColor(d) {\r\n\t\t\treturn d > 611142 ? '#8A4E8A' :\r\n\t\t\t d > 509285 ? '#A05AA0' :\r\n\t\t\t d > 407428 ? '#B379B3' :\r\n\t\t\t d > 305571 ? '#C08FC0' :\r\n\t\t\t d > 203714 ? '#CCA5CC' :\r\n\t\t\t d > 101857 ? '#D8BBD8' :\r\n\t\t\t d > 0 ? '#F1E6F1' :\r\n\t\t\t '#FFFFFF';\r\n\t\t}", "function getColor(d) {\n\t\t\t\treturn d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5514999 ? '#2E64FE' :\n\t\t\t\t\t d > 5564048 ? '#3B0B0B' :\n\t\t\t\t\t\t\t\t '#3B0B0B';\n\t\t\t}", "get color(){\n return this.getPalette(this.currentColor);\n }", "function getColor(d){\n return d > 5 ? \"#a54500\":\n d > 4 ? \"#FF0000\":\n d > 3 ? \"#ff6f08\":\n d > 2 ? \"#ff9143\":\n d > 1 ? \"#ffb37e\":\n \"#ffcca5\";\n }", "function getColor(d) {\n return d >= legend5 ? color_map[5] :\n d >= legend4 ? color_map[4] :\n d >= legend3 ? color_map[3] :\n d >= legend2 ? color_map[2] :\n d >= legend1 ? color_map[1] :\n d >= legend0 ? color_map[0] :\n 'grey';\n }", "function colors() {\n \n\tmap.getLayer('countylayer').style('fill', function(data) {\n\t\tvar ddi = parseFloat(data.ddi);\n\t\tif (ddi <= 38.12357875) { //1st quartile\n\t\t\treturn \"#fef0d9\";\n\t\t} else if (ddi <= 50.8602104) {\n\t\t\treturn \"#fdcc8a\";\n\t\t} else if (ddi <= 64.03133336 ) {\n\t\t\treturn \"#fc8d59\";\n\t\t} else { //4th quartile\n\t\t\treturn \"#d7301f\";\n\t\t}\n\t});\n}", "generateColors(palette, allColorsFilterBy){\n let shades=[];\n let allColors = palette.colors;\n for(let key in allColors){\n shades = shades.concat(\n allColors[key].filter(colors =>(\n colors.id ===allColorsFilterBy\n ))\n )\n }\n //return all shades of given colors \n return shades.slice(1); \n }", "changeColor(color){\n this.panel.data[0].color = color;\n this.panel.hData[0].color = color;\n this.panel.dataPlus[0].color = color;\n this.panel.pieData[0].color = color;\n this.panel.options.series.gauges.threshold.values.forEach(function(value){\n value.color = color;\n })\n this.render();\n }", "get color() {\n return this._color ||\n (this.datepickerInput ? this.datepickerInput.getThemePalette() : undefined);\n }", "function setBarColors (d,i) {\n var colors = ['#64b5f6','#4dd0e1','#4fc3f7','#4db6ac','#0283AF','#7EBC89','#00187B'];\n return colors[i];\n}", "function getColor(d){\n if (d <= 1){return '#addd8e';}\n else if (d <= 2) {return '#fee391';}\n else if (d <= 3) {return '#feb24c';}\n else if (d <= 4) {return '#fd8d3c';}\n else if (d <= 5) {return '#f03b20';}\n else {return '#bd0026';}\n}", "get color() {\n return this._color ||\n (this._datepickerInput ? this._datepickerInput.getThemePalette() : undefined);\n }", "function getColorScheme(dropDownValue, largestValueInDataSet) {\n var colorMap = {\n \"AVG_CURRENT_AR_DELTA_MO\": getGreenAndRedColors(largestValueInDataSet),\n \"AVG_CURRENT_AR_DELTA_WK\": getGreenAndRedColors(largestValueInDataSet),\n \"AVG_CURRENT_AR\": getGreenColors(largestValueInDataSet),\n \"AVG_DBT\": getRedColors(largestValueInDataSet),\n \"AVG_CPR\": getRedColors(largestValueInDataSet),\n \"AVG_PCT_LATE\": getRedColors(largestValueInDataSet),\n \"INITIAL_CLAIMS\": getBlueColors(largestValueInDataSet),\n \"INSURED_UNEMPLOYMENT_RATE\": getBlueColors(largestValueInDataSet)\n };\n return colorMap[dropDownValue];\n}", "getDefaultColor() {\n return [0.69921875, 0.69921875, 0.69921875];\n }", "configColors(data) {\n const colors = {\n deaths: { \".3\": \"yellow\", \".4\": \"orange\", \"1\": \"red\" },\n kills: { \".3\": \"white\", \".4\": \"aqua\", \"1\": \"blue\" }\n };\n\n return colors[data];\n }", "function _getColors() {\n return [\n '#000000',\n '#AA0000',\n '#BB5500',\n '#DDDD00',\n '#00AA00'\n ];\n }", "function getColor(d) {\n\n return d < 1 ? 'rgb(85,255,51)' :\n\n d < 2 ? 'rgb(221,255,153)' :\n\n d < 3 ? 'rgb(255,230,102)' :\n\n d < 4 ? 'rgb(255,213,0)' :\n\n d < 5 ? 'rgb(255,179,25)' :\n\n d < 6 ? 'rgb(255,140,25)' :\n 'rgb(255,77,77)';\n}", "function ColorIntensityPalette() {\n this.positive = [255, 0, 0];\n this.neutral = [200, 200, 200];\n this.negative = [0, 93, 144];\n\n this.rgb = function(color) {\n rgb = \"rgb(\" + \n color[0] + \",\" +\n color[1] + \",\" +\n color[2] + \")\";\n return rgb;\n }\n\n this.str = function(intensity) {\n if (intensity > 0) {\n var top_color = this.positive;\n } else {\n var top_color = this.negative;\n intensity = -intensity;\n }\n\n s = \"rgb(\";\n for (var i=0; i<3; i++) {\n diff = top_color[i] - this.neutral[i];\n s += Math.floor(this.neutral[i] + diff*intensity);\n if (i < 2) {\n s += \",\"\n }\n }\n s += \")\"\n return s;\n }\n}", "function getColor(d) {\n/*\t\t\treturn d > 600 ? '#d98472' :\n\t\t\t\t d > 304 ? '#e4b76e' :\n\t\t\t '#bcc64d';*/\n\t\t\treturn d > 600 ? '#ca6554' :\n\t\t\t\t d > 304 ? '#d6877a' :\n\t\t\t '#e7bab3';\n\t\t}", "function getColor(d) {\n return d >= 15 ? '#9932cc' :\n d >= 14 ? '#cb2e8f' :\n d >= 13 ? '#e03d6a' :\n d >= 12 ? '#ed5052' :\n d >= 11 ? '#f5653f' :\n d >= 10 ? '#fa7930' :\n d >= 9 ? '#fe8c22' :\n d >= 8 ? '#ffa015' :\n d >= 7 ? '#ffb307' :\n d >= 6 ? '#ffc500' :\n d >= 5 ? '#ffd700' :\n \"#90ee90\";\n }", "function _default(seriesType, ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.normal.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx), paletteScope); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n });\n}", "function _default(seriesType, ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.normal.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx), paletteScope); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n });\n}", "function _default(seriesType, ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.normal.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx), paletteScope); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n });\n}", "function GetColorList() {\n // return ['#4e73df', '#1cc88a', '#36b9cc', '#e74a3b', '#e67e22', '#f6c23e', '#9b59b6', '#1abc9c', '#2ecc71', '#3498db'];\n return ['#1abc9c', '#2ecc71', '#3498db', '#9b59b6', '#34495e', '#16a085', '#27ae60', '#2980b9', '#8e44ad', '#2c3e50'];\n}", "function getColor(d) {\n return d >= 15 ? '#9932cc' :\n d >= 14 ? '#cb2e8f' :\n d >= 13 ? '#e03d6a' :\n d >= 12 ? '#ed5052' :\n d >= 11 ? '#f5653f' :\n d >= 10 ? '#fa7930' :\n d >= 9 ? '#fe8c22' :\n d >= 8 ? '#ffa015' :\n d >= 7 ? '#ffb307' :\n d >= 6 ? '#ffc500' :\n d >= 5 ? '#ffd700' :\n \"#90ee90\";\n }", "setColors() {\n this.colors = new _swimlane_ngx_charts__WEBPACK_IMPORTED_MODULE_2__[\"ColorHelper\"](this.scheme, 'ordinal', this.seriesDomain, this.customColors);\n }", "function getGreenAndRedColors(largestValueInDataSet) {\n var colorDomain = [\n -1*largestValueInDataSet,\n -.9*largestValueInDataSet,\n -.8*largestValueInDataSet,\n -.7*largestValueInDataSet,\n -.6*largestValueInDataSet,\n -.5*largestValueInDataSet,\n -.4*largestValueInDataSet,\n -.3*largestValueInDataSet,\n -.2*largestValueInDataSet, \n -.1*largestValueInDataSet, \n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#ff1919\",\n \"#ff3232\",\n \"#ff4c4c\",\n \"#ff6666\",\n \"#ff7f7f\",\n \"#ff9999\",\n \"#ffb2b2\",\n \"#ffcccc\",\n \"#ffe5e5\",\n \"#d0d6cd\",\n \"#bdc9be\",\n \"#aabdaf\",\n \"#97b0a0\",\n \"#84a491\",\n \"#719782\",\n \"#5e8b73\",\n \"#4b7e64\",\n \"#387255\",\n \"#256546\",\n \"#125937\",\n \"#004d28\",\n \"#004524\"\n ];\n return [colorDomain, colorRange];\n}", "function getColorsCreatePalette(){\n\t\tcp.$container.html(\" \");\n\t\t$.getJSON('/static/coloring/colors.json', function(colors){\n\t\t\tvar keys = Object.keys(colors);\n\t\t\tfor (var i = keys.length - 1; i >= 0; i--) {\n\t\t\t\tcp.options.push(colors[keys[i]]);\n\t\t\t}\n\t\t\tcreateColorPalette(cp.options);\n\t\t});\n\t}", "function getColor(colorId) {\n return service.colors[colorId % service.colors.length];\n }", "function color(d) {\n return '#2960b5'\n }", "function assign_Random_Color(layers) {\r\n let res = Palettes.slice(0)\r\n if (layers.length < res.length) {\r\n res = d3.shuffle(res).slice(0, layers.length)\r\n } else {\r\n while (res.length < layers.length) {\r\n res = res.concat(d3.shuffle(Palettes))\r\n }\r\n res = d3.shuffle(res.slice(0, layers.length))\r\n }\r\n layers = layers.map((d, i) => {\r\n d.fillcolor = res[i]\r\n return d\r\n })\r\n return layers\r\n}", "function onGetPNGPalette() {\r\n \r\n}", "function getColor(d) {\n\n\t\tswitch (valueType) {\n\t\tcase \"percent\":\n\t\t\treturn d > 500 ? colours[6] :\n\t\t\td > 200 ? colours[5] :\n\t\t\td > 100 ? colours[4] :\n\t\t\td > 50 ? colours[3] :\n\t\t\td > 25 ? colours[2] :\n\t\t\td > 0 ? colours[1] :\n\t\t\t colours[0];\n\t\t\tbreak;\n\t\tcase \"difference\":\n\t\t zoomDiff = 11 - zoomLevel;\n\t\t if (zoomDiff > 0) {\n d = d / Math.pow(4, zoomDiff)\n\t\t }\n\n\t\t\treturn d > 500 ? colours[6] :\n\t\t\td > 200 ? colours[5] :\n\t\t\td > 100 ? colours[4] :\n\t\t\td > 50 ? colours[3] :\n\t\t\td > 25 ? colours[2] :\n\t\t\td > 0 ? colours[1] :\n\t\t\t colours[0];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn d > 500 ? colours[6] :\n\t\t\td > 200 ? colours[5] :\n\t\t\td > 100 ? colours[4] :\n\t\t\td > 50 ? colours[3] :\n\t\t\td > 25 ? colours[2] :\n\t\t\td > 0 ? colours[1] :\n\t\t\t colours[0];\n\t\t}\n\t}", "function getColor(name) {\n\td = {\"Conservative\": \"#00F\", \"Labour\": \"#F00\", \"Liberal Democrat\": \"#FC0\", \"UKIP\": \"#B3009D\", \"Green Party\": \"#0F0\", \"Scottish National Party\": \"#FF0\", \"Plaid Cymru\": \"#6C3\", \"Democratic Unionist Party\": \"#C30\", \"Ulster Unionist Party\": \"#99F\", \"Sinn Fein\": \"#060;\", \"Social Democratic & Labour Party\": \"#3C3\"};\n\tif (name in d) {\n\t\treturn d[name];\n\t} else {\n\t\treturn \"#C0C0C0\";\n\t}\n}", "function generateColors() {\n var colors = defaultColors.slice();\n var customColors = Fliplet.Themes && Fliplet.Themes.Current.getSettingsForWidgetInstance(chartUuid);\n\n if (!Fliplet.Themes) {\n return colors;\n }\n\n colors.forEach(function(defaultColor, index) {\n var colorKey = 'chartColor' + (index + 1);\n var newColor = customColors\n ? customColors.values[colorKey]\n : Fliplet.Themes.Current.get(colorKey);\n\n if (themeValues && !customColors) {\n newColor = themeValues[colorKey];\n }\n\n if (newColor) {\n colors[index] = newColor;\n inheritColor1 = colorKey !== 'chartColor1';\n inheritColor2 = colorKey !== 'chartColor2';\n } else if (Fliplet.Themes.Current.get(colorKey)) {\n colors[index] = Fliplet.Themes.Current.get(colorKey);\n }\n\n if (colorKey === 'chartColor1' && inheritColor1) {\n colors[index] = getThemeColor('highlightColor', newColor, index, colorKey);\n } else if (colorKey === 'chartColor2' && inheritColor2) {\n colors[index] = getThemeColor('secondaryColor', newColor, index, colorKey);\n }\n });\n\n return colors;\n }", "function getColor(d) {\n\treturn d >= 5 ? \"rgb(240, 107, 107)\" :\n\t\t\t\t\td >= 4 ? \"rgb(240, 167, 107)\" :\n\t\t\t\t\td >= 3 ? \"rgb(243, 186, 77)\" :\n\t\t\t\t\td >= 2 ? \"rgb(243, 219, 77)\" :\n\t\t\t\t\td >= 1 ? \"rgb(225, 243, 77)\" :\n\t\t\t\t\t\t\t\t\t\t\"rgb(183, 243, 77)\";\n}", "function mix_colors(d) {\n var value = d.target.value;\n var sum = d3.sum(value);\n var col = d3.rgb(0, 0, 0);\n value.forEach(function(val, i) {\n var label_color = d3.rgb(color_map(i));\n var mix_coef = val / sum;\n col.r += mix_coef * label_color.r;\n col.g += mix_coef * label_color.g;\n col.b += mix_coef * label_color.b;\n });\n return col;\n}", "function genColor(seed) {\n const CHART_COLOURS = [\n 'rgba(255,0,0,0.66)',\n 'rgba(255,128,0,0.66)',\n 'rgba(255,255,0,0.62)',\n 'rgba(128,255,0,0.6)',\n 'rgba(0,255,255,0.47)',\n 'rgba(0,64,255,0.5)',\n 'rgba(191,0,255,0.53)'];\n if (seed < CHART_COLOURS.length) {\n return CHART_COLOURS[seed];\n } else {\n return '#000000';\n }\n}", "function getColor31(d){\n return d> 3000 ? '#355C7D':\n d> 535 ? '#6C5B7B':\n d> 103 ? '#C06C84':\n d> 22 ? '#F67280':\n '#F8B195';\n\n}", "getColor() {\n if (this.type == 'home' || this.type == 'goal') {\n return ['#B5FEB4', '#B5FEB4'];\n }\n\n else if (this.type == 'board') {\n return ['#F7F7FF', '#E6E6FF'];\n }\n\n else if (this.type == 'back'){\n return ['#B4B5FE', '#B4B5FE'];\n }\n }", "function getColor(d) {\n\n\t\t\t //example logic to get color based on number\n\t\t\t return d > .25 ? colors.red :\n\t\t\t \t\td > .20 ? colors.tangerine :\n\t\t\t \t\td > .15 ? colors.orange :\n\t\t\t \t\td > .125 ? colors.yellow :\n\t\t\t\t\td > 0 ? colors.dkgreen :\n\t\t\t\t \tcolors.brown;\n\n\t\t\t\t\t \n\t\t\t\t\t // example logic to get color based on string\n\t\t\t\t\t // (d == 'dropped' ? colors.green :\n\t\t\t\t\t // d == 'new' ? colors.red :\n\t\t\t\t\t // colors.maroon)\n\t\t\t\t\t\t \n\t\t\t\t\t }", "colors() {\n return ['#B1BCBC', '#3ACF80', '#70F2F2', '#B3F2C9', '#528C18', '#C3F25C']\n }", "function getColor(){\n //var colors = [ \"rgba(237, 106, 90, 1)\", \"rgba(247, 244, 205, 1)\", \"rgba(155, 193, 188, 1)\", \"rgba(92, 164, 169, 1)\", \"rgba(230, 235, 224, 1)\"];\n var colors = cscheme;\n\n //generates random n to select a color from the array above\n //if new color (colors[n]) is equal to last color selected, it loops again to not repeat colors\n do{\n n = Math.floor(Math.random() * colors.length);\n }while( colors[n] === color );\n\n return colors[n];\n }", "function getColor(d) {\n\n return d > 0.9 ? colours[9]:\n d > 0.8 ? colours[8]:\n d > 0.7 ? colours[7]:\n d > 0.6 ? colours[6]:\n d > 0.5 ? colours[5]:\n d > 0.4 ? colours[4]:\n d > 0.3 ? colours[3]:\n d > 0.2 ? colours[2]:\n d > 0.1 ? colours[1]:\n colours[0];\n}", "paintFill(prop) {\r\n let fillColorArray = [\r\n 'step',\r\n ['get', prop.key]\r\n ];\r\n\r\n prop.colorScale.map((color, index) => {\r\n if (index > 0) {\r\n fillColorArray.push(prop.step[index]) \r\n }\r\n\r\n fillColorArray.push(color);\r\n })\r\n\r\n return fillColorArray;\r\n }", "decideColors() {\n return ([\n // team colors\n DeepSpaceGame.colorCombinations.get(this.gameVars.setupData.teams.length).sample().shuffle(),\n\n // light shading\n LIGHT.randomDraw()\n ]);\n }", "function fittsColors() {\n let colors;\n\n colors = d3.schemeSet1;\n\n colors.target = colors[5];\n colors.distance = colors[1];\n colors.width = colors[0];\n colors.indexOfDifficulty = colors[4];\n colors.logarithm = colors[2];\n colors.hotspot = colors[4];\n colors.pointer = colors[7];\n colors.ratio = colors[3];\n colors.design = colors[8];\n\n return colors;\n}", "function getBlueColors(largestValueInDataSet) {\n var colorDomain = [\n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#ebecf3\",\n \"#d8d9e7\",\n \"#c4c6dc\",\n \"#b1b4d0\",\n \"#9ea1c5\",\n \"#8a8eb9\",\n \"#777cad\",\n \"#6369a2\",\n \"#505696\",\n \"#484d87\",\n \"#404579\"\n ];\n return [colorDomain, colorRange];\n}", "getColor(i) {\n switch(i) {\n case 1:\n return 'blue';\n case 2:\n return 'red';\n case 3:\n return 'yellow';\n default:\n return 'grey';\n }\n }", "function getColor() {\n let hue = Math.floor(Math.random() * amountOfColors) * (360 / amountOfColors);\n return `hsl(${hue}, 90%, 50%)`;\n }", "function getColor(d) {\n return d < 1 ? '#fef0d9' :\n d < 2 ? '#fdcc8a' :\n d < 3 ? '#fc8d59' :\n d < 4 ? '#e34a33' :\n d < 5 ? '#b30000' :\n '#800026';\n}", "_mapDataToColors() {\n // switch rendering destination to our framebuffer\n twgl.bindFramebufferInfo(this._gl, this._framebuffers.gridded);\n\n glDraw(this._gl, this._programs.colormap, this._buffers.colormap, {\n u_data: this._textures.data,\n u_colormap: this._textures.colormap,\n u_colormapN: this._colormap.lut.length,\n u_domain: this._domain,\n u_scale: this._scale === 'log' ? 1 : 0,\n u_baseColor: this._baseColor.map((v, i) => i === 3 ? v : v / 255),\n });\n\n // switch rendering destination back to canvas\n twgl.bindFramebufferInfo(this._gl, null);\n }", "function _default(ecModel) {\n var paletteScope = {};\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var categoriesData = seriesModel.getCategoriesData();\n var data = seriesModel.getData();\n var categoryNameIdxMap = {};\n categoriesData.each(function (idx) {\n var name = categoriesData.getName(idx); // Add prefix to avoid conflict with Object.prototype.\n\n categoryNameIdxMap['ec-' + name] = idx;\n var itemModel = categoriesData.getItemModel(idx);\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(name, paletteScope);\n categoriesData.setItemVisual(idx, 'color', color);\n }); // Assign category color to visual\n\n if (categoriesData.count()) {\n data.each(function (idx) {\n var model = data.getItemModel(idx);\n var category = model.getShallow('category');\n\n if (category != null) {\n if (typeof category === 'string') {\n category = categoryNameIdxMap['ec-' + category];\n }\n\n if (!data.getItemVisual(idx, 'color', true)) {\n data.setItemVisual(idx, 'color', categoriesData.getItemVisual(category, 'color'));\n }\n }\n });\n }\n });\n}", "function getColor1(d){\n return d> 200 ? '#355C7D':\n d> 120 ? '#6C5B7B':\n d> 80 ? '#C06C84':\n d> 40 ? '#F67280':\n '#F8B195';\n }", "function getColor(d) {\n return d > 5 ? 'rgb(240,107,107)' :\n d > 4 ? 'rgb(240,167,107)' :\n d > 3 ? 'rgb(243,186,77)' :\n d > 2 ? 'rgb(243,219,77)' :\n d > 1 ? 'rgb(225,243,77)' :\n 'rgb(183,243,77)';\n}", "generateColors(itemCount) {\r\n let colors = [];\r\n let number = Math.round(360 / itemCount);\r\n //this loop splits the colour spectrum evenly and gives each\r\n //div a colour so that when in order, they resemble the colour spectrum\r\n for (let i = 0; i < itemCount; i++) {\r\n let color = chroma(\"#ff0000\");\r\n colors.push(color.set(\"hsl.h\", i * number));\r\n }\r\n return colors;\r\n }", "function getColor(d) {\n return d > 5 ? '#f45f42' :\n d > 4 ? '#f48641' :\n d > 3 ? '#f49a41' :\n d > 2 ? '#f4cd41' :\n d > 1 ? '#f4f141' :\n '#97f441';\n}", "function chooseColor() {\n const colorPalette = [\n \"#ffb25d\",\n \"#21f3c5\",\n \"#217bf3\",\n \"#ecf321\",\n \"#f32192\",\n \"#a621f3\",\n ];\n\n let index = Math.floor(Math.random() * 6);\n let color = colorPalette[index];\n return color;\n }", "styler(d) {\n const stroke = (d.id === this.state.selected) ? 'red' : 'white';\n return {\n fill: this.colorScale(this.valueAccessor(d)),\n stroke: stroke\n };\n }", "function getColor(d) {\n\t\treturn d > 5550000 ? '#800026' :\n\t\t\t d > 5555000 ? '#BD0026' :\n\t\t\t d > 5560000 ? '#E31A1C' :\n\t\t\t d > 5556500 ? '#FC4E2A' :\n\t\t\t d > 5570000 ? '#FD8D3C' :\n\t\t\t d > 5575000 ? '#FEB24C' :\n\t\t\t d > 5580000 ? '#FED976' :\n\t\t\t\t\t\t\t '#FFEDA0';\n\t}", "function loadPalette(palette_name) {\n if (palette_name == 'violent_red') {\n palette = violent_red\n } else if (palette_name == 'garden_green') {\n palette = garden_green\n } else if (palette_name == 'whites') {\n palette = whites\n } else if (palette_name == 'red_white') {\n palette = red_white\n } else if (palette_name == 'bella_pink') {\n palette = bella_pink\n }\n\n return palette\n}", "function colorOptions (dificuldade) {\n\tfor (var i = 0 ; i<dificuldade;i++){\n\t\tcolorPick = colorGeneration();\n\t\tcolors[i].style.background = \"rgb(\"+colorPick[0]+\", \"+colorPick[1]+\", \"+colorPick[2]+\")\";\n\t}\n\tfor (var j = dificuldade; j< colors.length; j++){\n\t\tcolors[j].style.background = \"#232323\";\n\t}\n}", "set color(value) {}", "function assignColor(dataArray) {\n\n dict = {};\n\n for (var i = 0; i < dataArray.length; i++) {\n dict[dataArray[i]] = getRandomColor();\n }\n\n return dict;\n}", "function getColor(color)\n{\n\tcolorCode = color.selectedIndex;\n}", "_setItemColor() {\n const that = this,\n label = that.querySelector('.jqx-content-label'),\n color = /(^#[0-9A-F]{3}$)|(^#[0-9A-F]{6}$)|(^#[0-9A-F]{8}$)/i.test(that.color) ? that.color : ''; //HEX check\n\n label.style.backgroundColor = color;\n label.style.color = that._getContrastColor(color);\n }", "function colorOf(idx) {\n return colors[idx] || \"#000\";\n }", "function Palette(name, colors) {\n this.name = name;\n this.colors = colors;\n }", "getColor() {\n const result = ColorPicker.colors[this.index];\n this.index++;\n this.index %= ColorPicker.colors.length;\n return result;\n }", "function getRedColors(largestValueInDataSet) {\n var colorDomain = [\n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#ffe5e5\",\n \"#ffcccc\",\n \"#ffb2b2\",\n \"#ff9999\",\n \"#ff7f7f\",\n \"#ff6666\",\n \"#ff4c4c\",\n \"#ff3232\",\n \"#ff1919\",\n \"#e51616\",\n \"#ce1313\"\n ];\n return [colorDomain, colorRange];\n}", "function sanitizePalette(palette,name){var defaultContrast=palette.contrastDefaultColor;var lightColors=palette.contrastLightColors||[];var strongLightColors=palette.contrastStrongLightColors||[];var darkColors=palette.contrastDarkColors||[];// These colors are provided as space-separated lists\n\tif(typeof lightColors==='string')lightColors=lightColors.split(' ');if(typeof strongLightColors==='string')strongLightColors=strongLightColors.split(' ');if(typeof darkColors==='string')darkColors=darkColors.split(' ');// Cleanup after ourselves\n\tdelete palette.contrastDefaultColor;delete palette.contrastLightColors;delete palette.contrastStrongLightColors;delete palette.contrastDarkColors;// Change { 'A100': '#fffeee' } to { 'A100': { value: '#fffeee', contrast:DARK_CONTRAST_COLOR }\n\tangular.forEach(palette,function(hueValue,hueName){if(angular.isObject(hueValue))return;// Already converted\n\t// Map everything to rgb colors\n\tvar rgbValue=colorToRgbaArray(hueValue);if(!rgbValue){throw new Error(\"Color %1, in palette %2's hue %3, is invalid. Hex or rgb(a) color expected.\".replace('%1',hueValue).replace('%2',palette.name).replace('%3',hueName));}palette[hueName]={hex:palette[hueName],value:rgbValue,contrast:getContrastColor()};function getContrastColor(){if(defaultContrast==='light'){if(darkColors.indexOf(hueName)>-1){return DARK_CONTRAST_COLOR;}else{return strongLightColors.indexOf(hueName)>-1?STRONG_LIGHT_CONTRAST_COLOR:LIGHT_CONTRAST_COLOR;}}else{if(lightColors.indexOf(hueName)>-1){return strongLightColors.indexOf(hueName)>-1?STRONG_LIGHT_CONTRAST_COLOR:LIGHT_CONTRAST_COLOR;}else{return DARK_CONTRAST_COLOR;}}}});}", "function getColor(d) {\n \n if (d > 800000.00) {\n return 'seagreen';\n } else if ( d > 700000.00 ){\n return 'orange';\n } else if (d > 600000.00) {\n return 'red' ;\n } else if (d > 500000.00) {\n return 'brown' ;\n } else if (d > 400000.00) {\n return 'lavender'; \n } else if (d > 300000.00) {\n return 'yellow'; \n } else if (d > 150000.00) {\n return 'pink';\n } else if (d > 100000.00) {\n return 'aqua';\n } else if (d > 50000.00) {\n return 'coral';\n } else {\n return 'slategrey';\n } \n}", "function getColor(d){\n return d > 5 ? \"darkred\":\n d > 4 ? \"darkorange\":\n d > 3 ? \"orange\":\n d > 2 ? \"yellow\":\n d > 1 ? \"yellowgreen\":\n \"green\";\n }", "function getColor(d) {\n return d > 5 ? '#ff0000' :\n d > 4 ? '#ff5900' :\n d > 3 ? '#ee9c00' :\n d > 2 ? '#eecc00' :\n d > 1 ? '#d4ee00' :\n '#98ee00';\n }", "function getColor(d){\n if(d<10){\n return \"#ffffb2\"\n } else if (d > 10 && d < 20 ){\n return \"#fed976\"\n } else if (d > 20 && d < 50){\n return \"#feb24c\"\n } else if (d > 50 && d < 100){\n return \"#fd8d3c\"\n } else if (d > 100 && d < 200){\n return \"#fc4e2a\"\n } else if (d > 200 && d < 300){\n return \"#e31a1c\"\n } else if (d > 300 && d < 450){\n return \"#b10026\"\n } else {\n return \"blue\"\n };\n}" ]
[ "0.6433456", "0.6427001", "0.63661575", "0.63516146", "0.6293389", "0.6179588", "0.61693805", "0.6082315", "0.6061434", "0.60444456", "0.60351753", "0.6022115", "0.6020953", "0.6009073", "0.600888", "0.59864014", "0.59861124", "0.59814674", "0.5944339", "0.5918118", "0.59071964", "0.5903635", "0.5883126", "0.58499676", "0.58476704", "0.5847018", "0.58449847", "0.58400905", "0.583337", "0.5830091", "0.5825928", "0.5821011", "0.58193004", "0.58172864", "0.5816925", "0.578742", "0.5781018", "0.5777799", "0.5771817", "0.5762949", "0.57531273", "0.5745923", "0.57453096", "0.574374", "0.57423645", "0.57423645", "0.57423645", "0.57335025", "0.5731719", "0.57265484", "0.57111317", "0.5709349", "0.5704316", "0.5701727", "0.5699944", "0.5691994", "0.56850815", "0.56850314", "0.56776583", "0.5666403", "0.5663551", "0.5661361", "0.5632427", "0.56283116", "0.5627148", "0.56259483", "0.5624626", "0.5624129", "0.56178075", "0.5614744", "0.5611774", "0.5605214", "0.5603688", "0.5600179", "0.55992305", "0.5597574", "0.5596971", "0.55958813", "0.5587563", "0.5585903", "0.55776227", "0.557201", "0.556611", "0.5561422", "0.555946", "0.5554561", "0.55539906", "0.5542605", "0.5541621", "0.5535444", "0.5531967", "0.55310136", "0.55219615", "0.5521088", "0.55197024", "0.55190885", "0.5510375", "0.550802", "0.5507466" ]
0.5517558
97
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function getFixedItemStyle(model) { var itemStyle = model.getItemStyle(); var areaColor = model.get('areaColor'); // If user want the color not to be changed when hover, // they should both set areaColor and color to be null. if (areaColor != null) { itemStyle.fill = areaColor; } return itemStyle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "started () {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "function SigV4Utils() { }", "started() {\r\n\r\n\t}", "static get NOT_READY () {return 0}", "initialize() {\n\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "heartbeat () {\n }", "static final private internal function m106() {}", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53504926", "0.4896905", "0.48514667", "0.48116106", "0.4775166", "0.4743932", "0.47342455", "0.47035336", "0.4694186", "0.4694186", "0.46744877", "0.46453032", "0.46394095", "0.4629355", "0.46211302", "0.45832416", "0.45812932", "0.45752546", "0.45698234", "0.45625272", "0.4557475", "0.4549714", "0.45494938", "0.4545794", "0.45383474", "0.4523037", "0.45180768", "0.45005357", "0.4496748", "0.4486438", "0.447462", "0.44716924", "0.4468301", "0.44601226", "0.4456266", "0.4455926", "0.44557476", "0.4445067", "0.44378054", "0.44258687", "0.44258553", "0.4424118", "0.44097725", "0.4406038", "0.4404498", "0.4404498", "0.4404498", "0.43926418", "0.43781474", "0.43708664", "0.43657827", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43526813", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4349645", "0.43450522", "0.43440443", "0.43390423", "0.43347356", "0.43347356", "0.43332103", "0.43318707" ]
0.0
-1
|1|2|3|4|. So the displayed ticks and splitLine/splitArea should between each data item, otherwise cause misleading (e.g., split tow bars of a single data item when there are two bar series). Also consider if tickCategoryInterval > 0 and onBand, ticks and splitLine/spliteArea should layout appropriately corresponding to displayed labels. (So we should not use `getBandWidth` in this case).
function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) { var ticksLen = ticksCoords.length; if (!axis.onBand || alignWithLabel || !ticksLen) { return; } var axisExtent = axis.getExtent(); var last; var diffSize; if (ticksLen === 1) { ticksCoords[0].coord = axisExtent[0]; last = ticksCoords[1] = { coord: axisExtent[0] }; } else { var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue; var shift = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen; each(ticksCoords, function (ticksItem) { ticksItem.coord -= shift / 2; }); var dataExtent = axis.scale.getExtent(); diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue; last = { coord: ticksCoords[ticksLen - 1].coord + shift * diffSize }; ticksCoords.push(last); } var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp. if (littleThan(ticksCoords[0].coord, axisExtent[0])) { clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift(); } if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) { ticksCoords.unshift({ coord: axisExtent[0] }); } if (littleThan(axisExtent[1], last.coord)) { clamp ? last.coord = axisExtent[1] : ticksCoords.pop(); } if (clamp && littleThan(last.coord, axisExtent[1])) { ticksCoords.push({ coord: axisExtent[1] }); } function littleThan(a, b) { // Avoid rounding error cause calculated tick coord different with extent. // It may cause an extra unecessary tick added. a = round(a); b = round(b); return inverse ? a > b : a < b; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency) {\n const that = this.context;\n\n let majorTicks = '', majorLabels = '', valuePlusExponent;\n\n for (let i = 1; i < tickscount; i++) {\n let number = distanceFromFirstToSecond.add(i * ticksDistance), value;\n\n if (normalLayout) {\n value = ticksFrequency.multiply(i).add(distanceModifier.add(new JQX.Utilities.BigNumber(that._drawMin)));\n }\n else {\n value = new JQX.Utilities.BigNumber(that._drawMax).subtract(distanceModifier).subtract(ticksFrequency.multiply(i));\n\n // if the value of the penultimate is 0 we add the exponent to accurately calculate its size\n if (i === tickscount - 1 && value.compare(0) === 0) {\n that._numberRenderer.numericValue = that._tickIntervalHandler.nearestPowerOfTen;\n valuePlusExponent = that._numberRenderer.bigNumberToExponent(1);\n }\n }\n if (value.compare(that._drawMax) !== 0) {\n let htmlValue = that._formatLabel(value.toString()),\n plot = true;\n\n that._labelDummy.innerHTML = valuePlusExponent ? valuePlusExponent : htmlValue;\n let dimensionValue = that._labelDummy[that._settings.size];\n\n if (number.add(dimensionValue).compare(tickscount * ticksDistance) >= 0) { // + 5 is an experimental value\n plot = false; // does not plot the second to last label if it intersects with the last one\n }\n\n const currentTickAndLabel = this._addMajorTickAndLabel(htmlValue, undefined, plot, value, true);\n\n majorTicks += currentTickAndLabel.tick;\n majorLabels += currentTickAndLabel.label;\n }\n }\n return { tick: majorTicks, label: majorLabels };\n }", "addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency) {\n const that = this.context;\n\n let majorTicks = '', majorLabels = '';\n\n for (let i = 1; i < tickscount; i++) {\n let number = i * ticksDistance + distanceFromFirstToSecond,\n value;\n\n if (normalLayout) {\n value = parseFloat(that._drawMin) + ticksFrequency * i + distanceModifier;\n }\n else {\n value = parseFloat(that._drawMax) - ticksFrequency * i - distanceModifier;\n }\n if (value.toString() !== that._drawMax.toString()) {\n let htmlValue = that._formatLabel(value.toString()),\n plot = true;\n\n that._labelDummy.innerHTML = htmlValue;\n let dimensionValue = that._labelDummy[that._settings.size];\n\n if (number + dimensionValue >= tickscount * ticksDistance) { // + 32 is an Experimental value\n plot = false;\n }\n const currentTickAndLabel = this._addMajorTickAndLabel(htmlValue, undefined, plot, value, true);\n\n majorTicks += currentTickAndLabel.tick;\n majorLabels += currentTickAndLabel.label;\n }\n }\n return { tick: majorTicks, label: majorLabels };\n }", "function tickCount() {\n if (displayWidth <= 500) {\n xAxis.ticks(5);\n yAxis.ticks(5);\n } else {\n xAxis.ticks(10);\n yAxis.ticks(10);\n }\n }", "addTicksAndLabels() {\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = Math.round(that._range / parseFloat((ticksFrequency.toString()))),\n ticksDistance = trackLength / tickscount,\n min = parseFloat(that._drawMin),\n max = parseFloat(that._drawMax);\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n\n //handling specific case\n if (that.logarithmicScale && min < 0 && min !== -1) {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n }\n else {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency) + parseFloat(ticksFrequency));\n }\n\n distanceModifier = second - first;\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n distanceModifier = first - second;\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier / ticksFrequency * ticksDistance;\n\n if (second.toString() !== that._drawMax.toString() && distanceFromFirstToSecond < trackLength) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = firstLabelSize < distanceFromFirstToSecond;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n ticks += this.addMinorTicks(normalLayout);\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n }", "function tickCount() {\n if (width <= 530) {\n xAxis.ticks(5);\n yAxis.ticks(5);\n }\n else {\n xAxis.ticks(10);\n yAxis.ticks(10);\n } \n }", "function tickCount() {\n if (width <= 500) {\n xAxis.ticks(5);\n yAxis.ticks(5);\n }\n else {\n xAxis.ticks(10);\n yAxis.ticks(10);\n }\n }", "function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var shift = ticksCoords[1].coord - ticksCoords[0].coord;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 2;\n var tickCategoryInterval = tickCategoryInterval || 0; // Avoid split a single data item when odd interval.\n\n if (tickCategoryInterval % 2 > 0) {\n ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);\n }\n });\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1];\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n return inverse ? a > b : a < b;\n }\n}", "function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var shift = ticksCoords[1].coord - ticksCoords[0].coord;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 2;\n var tickCategoryInterval = tickCategoryInterval || 0; // Avoid split a single data item when odd interval.\n\n if (tickCategoryInterval % 2 > 0) {\n ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);\n }\n });\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1];\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n return inverse ? a > b : a < b;\n }\n}", "function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var shift = ticksCoords[1].coord - ticksCoords[0].coord;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 2;\n var tickCategoryInterval = tickCategoryInterval || 0; // Avoid split a single data item when odd interval.\n\n if (tickCategoryInterval % 2 > 0) {\n ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);\n }\n });\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1];\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n return inverse ? a > b : a < b;\n }\n}", "addTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = this.round(new JQX.Utilities.BigNumber(that._range).divide(ticksFrequency)),\n ticksDistance = trackLength / tickscount,\n min = new JQX.Utilities.BigNumber(that._drawMin),\n max = new JQX.Utilities.BigNumber(that._drawMax);\n\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n second = ticksFrequency.add(first.subtract(first.mod(ticksFrequency)));\n distanceModifier = second.subtract(first);\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = first.subtract(first.mod(ticksFrequency));\n distanceModifier = first.subtract(second);\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier.divide(ticksFrequency).multiply(ticksDistance);\n\n if (second.compare(that.max) !== 0 && distanceFromFirstToSecond.compare(trackLength) < 0) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = distanceFromFirstToSecond.compare(firstLabelSize) > 0;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n if (that.mode !== 'date') {\n ticks += this.addMinorTicks(normalLayout);\n }\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\n\t var ticksLen = ticksCoords.length;\n\t\n\t if (!axis.onBand || alignWithLabel || !ticksLen) {\n\t return;\n\t }\n\t\n\t var axisExtent = axis.getExtent();\n\t var last;\n\t var diffSize;\n\t\n\t if (ticksLen === 1) {\n\t ticksCoords[0].coord = axisExtent[0];\n\t last = ticksCoords[1] = {\n\t coord: axisExtent[0]\n\t };\n\t } else {\n\t var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\n\t var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n\t each(ticksCoords, function (ticksItem) {\n\t ticksItem.coord -= shift_1 / 2;\n\t });\n\t var dataExtent = axis.scale.getExtent();\n\t diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\n\t last = {\n\t coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize\n\t };\n\t ticksCoords.push(last);\n\t }\n\t\n\t var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp.\n\t\n\t if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n\t clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n\t }\n\t\n\t if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n\t ticksCoords.unshift({\n\t coord: axisExtent[0]\n\t });\n\t }\n\t\n\t if (littleThan(axisExtent[1], last.coord)) {\n\t clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n\t }\n\t\n\t if (clamp && littleThan(last.coord, axisExtent[1])) {\n\t ticksCoords.push({\n\t coord: axisExtent[1]\n\t });\n\t }\n\t\n\t function littleThan(a, b) {\n\t // Avoid rounding error cause calculated tick coord different with extent.\n\t // It may cause an extra unecessary tick added.\n\t a = round(a);\n\t b = round(b);\n\t return inverse ? a > b : a < b;\n\t }\n\t }", "_setTicksAndInterval() {\n const that = this;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n //Set the New Format here\n let minLabel = that._formatLabel(that.min),\n maxLabel = that._formatLabel(that.max);\n\n //gets the range with the new min/max\n that._getRange();\n\n //creates a new tickIntervalHandler instance\n that._tickIntervalHandler = new JQX.Utilities.TickIntervalHandler(that, minLabel, maxLabel, 'jqx-label', that._settings.size, that.scaleType === 'integer', that.logarithmicScale);\n\n //re-arranges the layout\n that._layout();\n\n if (!that.customInterval) {\n // calculates the tickInterval\n that._calculateTickInterval();\n\n if (that._dateInterval) {\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n else {\n // Add the ticks and labels\n that._numericProcessor.addTicksAndLabels();\n }\n }\n else {\n if (that.mode === 'date') {\n that._calculateTickInterval()\n }\n\n // custom ticks\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n }", "function splitTickText(d, maxWidthValue) {\n\n\t\t\t\tfunction split(splitted, text) {\n\t\t\t\t\tspaceIndex = undefined;\n\n\t\t\t\t\tfor (var i = 1; i < text.length; i++)\n\n\t\t\t\t\t// if text width gets over tick width, split by space index or crrent index\n\t\t\t\t\tif (text.charAt(i) === \" \" && (spaceIndex = i), subtext = text.substr(0, i + 1), textWidth = sizeFor1Char.w * subtext.length, maxWidth < textWidth) return split(splitted.concat(text.substr(0, spaceIndex || i)), text.slice(spaceIndex ? spaceIndex + 1 : i));\n\n\t\t\t\t\treturn splitted.concat(text);\n\t\t\t\t}\n\n\t\t\t\tvar tickText = textFormatted(d),\n\t\t\t\t maxWidth = maxWidthValue,\n\t\t\t\t subtext = void 0,\n\t\t\t\t spaceIndex = void 0,\n\t\t\t\t textWidth = void 0;\n\t\t\t\treturn Object.prototype.toString.call(tickText) === \"[object Array]\" ? tickText : ((!maxWidth || maxWidth <= 0) && (maxWidth = isVertical ? 95 : params.isCategory ? Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12 : 110), split([], tickText + \"\"));\n\t\t\t}", "function splitTickText(d, maxWidthValue) {\n\n\t\t\t\tfunction split(splitted, text) {\n\t\t\t\t\tspaceIndex = undefined;\n\n\t\t\t\t\tfor (var i = 1; i < text.length; i++)\n\n\t\t\t\t\t// if text width gets over tick width, split by space index or current index\n\t\t\t\t\tif (text.charAt(i) === \" \" && (spaceIndex = i), subtext = text.substr(0, i + 1), textWidth = sizeFor1Char.w * subtext.length, maxWidth < textWidth) return split(splitted.concat(text.substr(0, spaceIndex || i)), text.slice(spaceIndex ? spaceIndex + 1 : i));\n\n\t\t\t\t\treturn splitted.concat(text);\n\t\t\t\t}\n\n\t\t\t\tvar tickText = textFormatted(d),\n\t\t\t\t maxWidth = maxWidthValue,\n\t\t\t\t subtext = void 0,\n\t\t\t\t spaceIndex = void 0,\n\t\t\t\t textWidth = void 0;\n\t\t\t\treturn Object.prototype.toString.call(tickText) === \"[object Array]\" ? tickText : ((!maxWidth || maxWidth <= 0) && (maxWidth = isVertical ? 95 : params.isCategory ? Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12 : 110), split([], tickText + \"\"));\n\t\t\t}", "function splitTickText(d, maxWidth) {\n var tickText = textFormatted(d),\n subtext, spaceIndex, textWidth, splitted = [];\n\n if (Object.prototype.toString.call(tickText) === \"[object Array]\") {\n return tickText;\n }\n\n if (!maxWidth || maxWidth <= 0) {\n maxWidth = isVertical ? 95 : params.isCategory ? (Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12) : 110;\n }\n\n function split(splitted, text) {\n spaceIndex = undefined;\n for (var i = 1; i < text.length; i++) {\n if (text.charAt(i) === ' ') {\n spaceIndex = i;\n }\n subtext = text.substr(0, i + 1);\n textWidth = sizeFor1Char.w * subtext.length;\n // if text width gets over tick width, split by space index or crrent index\n if (maxWidth < textWidth) {\n return split(\n splitted.concat(text.substr(0, spaceIndex ? spaceIndex : i)),\n text.slice(spaceIndex ? spaceIndex + 1 : i)\n );\n }\n }\n return splitted.concat(text);\n }\n\n return split(splitted, tickText + \"\");\n }", "function splitTickText(d, maxWidth) {\n var tickText = textFormatted(d),\n subtext, spaceIndex, textWidth, splitted = [];\n\n if (Object.prototype.toString.call(tickText) === \"[object Array]\") {\n return tickText;\n }\n\n if (!maxWidth || maxWidth <= 0) {\n maxWidth = isVertical ? 95 : params.isCategory ? (Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12) : 110;\n }\n\n function split(splitted, text) {\n spaceIndex = undefined;\n for (var i = 1; i < text.length; i++) {\n if (text.charAt(i) === ' ') {\n spaceIndex = i;\n }\n subtext = text.substr(0, i + 1);\n textWidth = sizeFor1Char.w * subtext.length;\n // if text width gets over tick width, split by space index or crrent index\n if (maxWidth < textWidth) {\n return split(\n splitted.concat(text.substr(0, spaceIndex ? spaceIndex : i)),\n text.slice(spaceIndex ? spaceIndex + 1 : i)\n );\n }\n }\n return splitted.concat(text);\n }\n\n return split(splitted, tickText + \"\");\n }", "function splitTickText(d, maxWidth) {\n var tickText = textFormatted(d),\n subtext, spaceIndex, textWidth, splitted = [];\n\n if (Object.prototype.toString.call(tickText) === \"[object Array]\") {\n return tickText;\n }\n\n if (!maxWidth || maxWidth <= 0) {\n maxWidth = isVertical ? 95 : params.isCategory ? (Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12) : 110;\n }\n\n function split(splitted, text) {\n spaceIndex = undefined;\n for (var i = 1; i < text.length; i++) {\n if (text.charAt(i) === ' ') {\n spaceIndex = i;\n }\n subtext = text.substr(0, i + 1);\n textWidth = sizeFor1Char.w * subtext.length;\n // if text width gets over tick width, split by space index or crrent index\n if (maxWidth < textWidth) {\n return split(\n splitted.concat(text.substr(0, spaceIndex ? spaceIndex : i)),\n text.slice(spaceIndex ? spaceIndex + 1 : i)\n );\n }\n }\n return splitted.concat(text);\n }\n\n return split(splitted, tickText + \"\");\n }", "function splitTickText(d, maxWidth) {\n var tickText = textFormatted(d),\n subtext, spaceIndex, textWidth, splitted = [];\n\n if (Object.prototype.toString.call(tickText) === \"[object Array]\") {\n return tickText;\n }\n\n if (!maxWidth || maxWidth <= 0) {\n maxWidth = isVertical ? 95 : params.isCategory ? (Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12) : 110;\n }\n\n function split(splitted, text) {\n spaceIndex = undefined;\n for (var i = 1; i < text.length; i++) {\n if (text.charAt(i) === ' ') {\n spaceIndex = i;\n }\n subtext = text.substr(0, i + 1);\n textWidth = sizeFor1Char.w * subtext.length;\n // if text width gets over tick width, split by space index or crrent index\n if (maxWidth < textWidth) {\n return split(\n splitted.concat(text.substr(0, spaceIndex ? spaceIndex : i)),\n text.slice(spaceIndex ? spaceIndex + 1 : i)\n );\n }\n }\n return splitted.concat(text);\n }\n\n return split(splitted, tickText + \"\");\n }", "function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n var diffSize;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift_1 / 2;\n });\n var dataExtent = axis.scale.getExtent();\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp.\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n // Avoid rounding error cause calculated tick coord different with extent.\n // It may cause an extra unecessary tick added.\n a = round(a);\n b = round(b);\n return inverse ? a > b : a < b;\n }\n}", "function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n var diffSize;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n Object(util[\"k\" /* each */])(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift_1 / 2;\n });\n var dataExtent = axis.scale.getExtent();\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp.\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n // Avoid rounding error cause calculated tick coord different with extent.\n // It may cause an extra unecessary tick added.\n a = Object(number[\"t\" /* round */])(a);\n b = Object(number[\"t\" /* round */])(b);\n return inverse ? a > b : a < b;\n }\n}", "_addMajorTickAndLabel(htmlValue, labelSize, plot, value, middle) {\n const that = this.context,\n leftOrTop = that._settings.leftOrTop,\n offset = this.valueToPx(value);\n\n let currentTick = '',\n currentLabel = '';\n\n if (parseInt(offset) > parseInt(that._measurements.trackLength)) {\n return { tick: currentTick, label: currentLabel };\n }\n\n if (that.logarithmicScale) {\n htmlValue = that._formatLabel(Math.pow(10, value));\n }\n\n if (that.nodeName.toLowerCase() === 'jqx-tank' || that._intervalHasChanged) {\n let tickIntervalLabelSize = that._tickIntervalHandler.labelsSize;\n\n if (middle) {\n that._labelDummy.innerHTML = htmlValue;\n\n let tickPosition = this.valueToPx(value),\n maxPosition = this.valueToPx(that._drawMax),\n minPosition = this.valueToPx(that._drawMin),\n labelSize = that._labelDummy[that._settings.size],\n labelOtherSize = that.orientation === 'vertical' ? that._labelDummy.offsetWidth : that._labelDummy.offsetHeight,\n distanceToMin = (labelSize + tickIntervalLabelSize.minLabelSize) / 2,\n distanceToMax = (labelSize + tickIntervalLabelSize.maxLabelSize) / 2;\n\n that._normalLayout ?\n plot = (tickPosition + distanceToMax < maxPosition) && (tickPosition - distanceToMin > minPosition) :\n plot = (tickPosition - distanceToMax > maxPosition) && (tickPosition + distanceToMin < minPosition);\n\n if (labelOtherSize > this._longestLabelSize) {\n this._longestLabelSize = labelOtherSize;\n }\n\n }\n else {\n this._longestLabelSize = Math.max(tickIntervalLabelSize.minLabelOtherSize, tickIntervalLabelSize.maxLabelOtherSize, this._longestLabelSize);\n }\n }\n\n that._tickValues.push(value);\n\n currentTick = '<div style=\"' + leftOrTop + ': ' + offset + 'px;\" class=\"jqx-tick\"></div>';\n\n if (plot !== false) {\n if (labelSize === undefined) {\n that._labelDummy.innerHTML = htmlValue;\n labelSize = that._labelDummy[that._settings.size];\n }\n const labelOffset = offset - labelSize / 2;\n\n currentLabel += '<div class=\"jqx-label' + (middle ? ' jqx-label-middle' : '') + '\" style=\"' + leftOrTop + ': ' + labelOffset + 'px;\">' + htmlValue + '</div>';\n }\n\n return { tick: currentTick, label: currentLabel };\n }", "addGaugeTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n numericProcessor = this,\n maxLabelHeight = Math.max(that._tickIntervalHandler.labelsSize.minLabelSize, that._tickIntervalHandler.labelsSize.maxLabelSize),\n majorStep = that._majorTicksInterval,\n minorStep = that._minorTicksInterval,\n majorTickValues = {},\n distance = that._distance,\n radius = that._measurements.radius,\n majorTickWidth = radius - distance.majorTickDistance,\n minorTickWidth = radius - distance.minorTickDistance,\n bigDrawMin = new JQX.Utilities.BigNumber(that._drawMin),\n bigDrawMax = new JQX.Utilities.BigNumber(that._drawMax);\n let drawMajor, drawMinor, addLabel, currentAngle, angleAtMin, angleAtMax;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawMajor = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n\n drawMinor = function (value) {\n that._drawTick(numericProcessor.getAngleByValue(value, true), minorTickWidth, 'minor');\n };\n }\n else {\n drawMajor = function () { };\n drawMinor = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n addLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n addLabel = function () { };\n }\n\n if (!that.inverted) {\n angleAtMin = that.endAngle;\n angleAtMax = that.startAngle;\n }\n else {\n angleAtMin = that.startAngle;\n angleAtMax = that.endAngle;\n }\n\n // first major tick and label\n currentAngle = numericProcessor.getAngleByValue(bigDrawMin, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMin.toString()] = true;\n addLabel(currentAngle, that.min, false);\n\n let second = bigDrawMin.subtract(bigDrawMin.mod(majorStep)),\n firstMinTick;\n\n if (bigDrawMin.compare(0) !== -1) {\n second = second.add(majorStep);\n }\n\n // determines the value at the first minor tick\n for (let i = new JQX.Utilities.BigNumber(second); i.compare(bigDrawMin) !== -1; i = i.subtract(minorStep)) {\n firstMinTick = i;\n }\n\n // second major tick and label\n currentAngle = numericProcessor.getAngleByValue(second, false);\n drawMajor(currentAngle);\n majorTickValues[second.toString()] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMin, numericProcessor.getAngleByValue(second, false, true)) / 360) > maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(second), second.compare(bigDrawMax) === -1);\n }\n\n let i;\n // middle major ticks and labels\n for (i = second.add(majorStep); i.compare(bigDrawMax.subtract(majorStep)) === -1; i = i.add(majorStep)) {\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i.toString()] = true;\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (majorTickValues[i.toString()] === undefined && i.compare(bigDrawMax) !== 1) {\n // second-to-last major tick and label\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i.toString()] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, numericProcessor.getAngleByValue(i, false, true)) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (that._normalizedStartAngle !== that.endAngle) {\n // last major tick and label\n currentAngle = numericProcessor.getAngleByValue(bigDrawMax, false);\n drawMajor(currentAngle);\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, angleAtMin) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, that.max, false);\n }\n }\n }\n\n if (that.mode === 'date') {\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n return;\n }\n\n // minor ticks\n if (!that.logarithmicScale) {\n for (let j = firstMinTick; j.compare(bigDrawMax) === -1; j = j.add(minorStep)) {\n if (majorTickValues[j.toString()]) {\n continue; // does not plot minor ticks over major ones\n }\n drawMinor(j);\n }\n }\n else {\n this.drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor);\n }\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "addGaugeTicksAndLabels() {\n const that = this.context,\n numericProcessor = this,\n maxLabelHeight = Math.max(that._tickIntervalHandler.labelsSize.minLabelSize, that._tickIntervalHandler.labelsSize.maxLabelSize),\n majorStep = that._majorTicksInterval,\n minorStep = that._minorTicksInterval,\n majorTickValues = {},\n distance = that._distance,\n radius = that._measurements.radius,\n majorTickWidth = radius - distance.majorTickDistance,\n minorTickWidth = radius - distance.minorTickDistance;\n let drawMajor, drawMinor, addLabel, currentAngle, angleAtMin, angleAtMax;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawMajor = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n\n drawMinor = function (value) {\n that._drawTick(numericProcessor.getAngleByValue(value, true), minorTickWidth, 'minor');\n };\n }\n else {\n drawMajor = function () { };\n drawMinor = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n addLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n addLabel = function () { };\n }\n\n if (!that.inverted) {\n angleAtMin = that.endAngle;\n angleAtMax = that.startAngle;\n }\n else {\n angleAtMin = that.startAngle;\n angleAtMax = that.endAngle;\n }\n\n // first major tick and label\n currentAngle = numericProcessor.getAngleByValue(that._drawMin, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMin] = true;\n addLabel(currentAngle, that.min, false);\n\n let second = that._drawMin - numericProcessor.getPreciseModulo(that._drawMin, majorStep),\n firstMinTick;\n\n if (that._drawMin >= 0) {\n second += majorStep;\n }\n\n // determines the value at the first minor tick\n for (let i = second; i >= that._drawMin; i = i - minorStep) {\n firstMinTick = i;\n }\n\n // second major tick and label\n currentAngle = numericProcessor.getAngleByValue(second, false);\n drawMajor(currentAngle);\n majorTickValues[second] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMin, numericProcessor.getAngleByValue(second, false, true)) / 360) > maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(second), second < that._drawMax);\n }\n\n let i;\n // middle major ticks and labels\n for (i = second + majorStep; i < that._drawMax - majorStep; i += majorStep) {\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i] = true;\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (majorTickValues[i] === undefined && i <= that._drawMax) {\n // second-to-last major tick and label\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, numericProcessor.getAngleByValue(i, false, true)) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (that._normalizedStartAngle !== that.endAngle) {\n // last major tick and label\n currentAngle = numericProcessor.getAngleByValue(that._drawMax, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMax] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, angleAtMin) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, that.max, false);\n }\n }\n }\n\n // minor ticks\n if (!that.logarithmicScale) {\n for (let j = firstMinTick; j < that._drawMax; j += minorStep) {\n if (majorTickValues[j]) {\n continue; // does not plot minor ticks over major ones\n }\n drawMinor(j);\n }\n }\n else {\n this.drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor);\n }\n }", "function make_xMajor_gridlines() {\n return d3.axisBottom(x)\n .ticks(xGridLength)\n }", "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount_1 = 0;\n boxplotLayout_each(seriesModels, function (seriesModel) {\n maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount_1;\n }\n\n boxplotLayout_each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!util[\"t\" /* isArray */](boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([Object(number[\"o\" /* parsePercent */])(boxWidthBound[0], bandWidth) || 0, Object(number[\"o\" /* parsePercent */])(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n boxplotLayout_each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "function calculateSpacing(){\n\t\t\tvar max_label = '';\n\t\t\tfor(var i = 0; i < yaxis.ticks.length; ++i){\n\t\t\t\tvar l = yaxis.ticks[i].label.length;\n\t\t\t\tif(l > max_label.length){\n\t\t\t\t\tmax_label = yaxis.ticks[i].label;\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tvar dummyDiv = target.insert('<div style=\"position:absolute;top:-10000px;font-size:smaller\" class=\"flotr-grid-label\">' + max_label + '</div>').down(0).next(1);\n\t\t\tlabelMaxWidth = dummyDiv.getWidth();\n\t\t\tlabelMaxHeight = dummyDiv.getHeight();\n\t\t\tdummyDiv.remove();\n\t\n\t\t\t/**\n\t\t\t * Grid outline line width.\n\t\t\t */\n\t\t\tvar maxOutset = 2;\n\t\t\tif(options.points.show){\n\t\t\t\tmaxOutset = Math.max(maxOutset, options.points.radius + options.points.lineWidth/2);\n\t\t\t}\n\t\t\tfor(var j = 0; j < series.length; ++j){\n\t\t\t\tif (series[j].points.show){\n\t\t\t\t\tmaxOutset = Math.max(maxOutset, series[j].points.radius + series[j].points.lineWidth/2);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tplotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = maxOutset;\n\t\t\tplotOffset.left += labelMaxWidth + options.grid.labelMargin;\n\t\t\tplotOffset.bottom += labelMaxHeight + options.grid.labelMargin;\t\t\t\n\t\t\tplotWidth = canvasWidth - plotOffset.left - plotOffset.right;\n\t\t\tplotHeight = canvasHeight - plotOffset.bottom - plotOffset.top;\n\t\t\thozScale = plotWidth / (xaxis.max - xaxis.min);\n\t\t\tvertScale = plotHeight / (yaxis.max - yaxis.min);\n\t\t}", "function createBars(data, options) {\n // Calculating bar width given the spacing of the bars\n var numberOfBars = data.length;\n var xAxisLength = $(\"#chartarea\").width();\n var barWidth = (xAxisLength - ((numberOfBars + 1) * parseInt(options.barspacing)))/numberOfBars;\n barWidth = Math.floor(barWidth);\n var yScale = yAxis(data, options)[1];\n var barHeight;\n var barColour;\n var barStartPosition;\n\n //for loop that creates the bars for each of the data\n for (var i = 0; i < data.length; i++) {\n barStartPosition = 0;\n //Calculate x offset from y axis\n var xOffset = (i * barWidth) + ((i + 1) * parseInt(options.barspacing));\n var barId = \"bar\" + i;\n for ( var j = 0; j < data[i].length; j++) {\n barId = barId + j;\n barHeight = data[i][j] * yScale;\n drawBar(data, options, barId, xOffset, barHeight, barWidth, options.barcolour[j], barStartPosition, i, j);\n barStartPosition += barHeight;\n if(j === 0) {\n xAxisLabels(options.datalabels[i], barId);\n }\n }\n\n }\n\n // sets CSS formatting options for all bars, data and labels\n $(\".bar\").css({\n \"width\": barWidth,\n \"margin\": 0,\n \"padding\": 0,\n \"border\": 0\n });\n\n // formats the x labels in the color defined in options\n $(\".xaxislabels\").css({\"color\": options.datalabelcolor,\n \"top\": \"100%\",\n \"padding\": \"5%\"\n });\n\n $(\".xaxislabels, .xaxisdata\").css({ \"border\": \"0\",\n \"margin-bottom\": \"2%\",\n \"margin-top\": \"2%\",\n \"padding\": \"0\",\n \"position\": \"absolute\",\n \"text-align\": \"center\",\n \"width\": \"100%\",\n \"font-size\": \"small\"\n })\n}", "Separator()\n {\n let win = this.getCurrentWindow();\n if (win.SkipItems)\n return;\n let g = this.guictx;\n\n // Those flags should eventually be overridable by the user\n let flags = (win.DC.LayoutType == LayoutType.Horizontal) ?\n SeparatorFlags.Vertical : SeparatorFlags.Horizontal;\n // console.assert(ImIsPowerOfTwo(flags & (SeparatorFlags_Horizontal | SeparatorFlags_Vertical))); // Check that only 1 option is selected\n if (flags & SeparatorFlags.Vertical)\n {\n this.VerticalSeparator();\n return;\n }\n\n // Horizontal Separator\n if (win.DC.CurrentColumns)\n this.PopClipRect();\n\n let x1 = win.Pos.x;\n let x2 = win.Pos.x + win.Size.x;\n if (win.DC.GroupStack.empty())\n x1 += win.DC.Indent.x;\n\n const bb = Rect.FromXY(x1, win.DC.CursorPos.y,\n x2, win.DC.CursorPos.y+1);\n // NB: we don't provide our width so that it doesn't get feed back into\n // AutoFit, we don't provide height to not alter layout.\n this.itemSize(Vec2.Zero());\n if (!this.itemAdd(bb, 0))\n {\n if (win.DC.CurrentColumns)\n this.pushColumnClipRect();\n return;\n }\n\n win.DrawList.AddLine(bb.Min, new Vec2(bb.Max.x, bb.Min.y),\n g.Style.GetColor(\"Separator\"));\n\n if (g.LogEnabled)\n this.LogRenderedText(bb.Min, \"--------------------------------\");\n\n if (win.DC.CurrentColumns)\n {\n this.pushColumnClipRect();\n win.DC.CurrentColumns.LineMinY = win.DC.CursorPos.y;\n }\n }", "function drawMultiBarGraph(svg, coords, data, yAttrs, attributes) {\n\n // compute the axes\n var xData = data[0]['data'].map(function(elt) { return elt[0] });\n var xAxis = createBarAxisX(\n xData,\n [coords['x'], coords['x'] + coords['width']],\n coords['axisPadding']);\n xAxis.scale().padding(style('multiBarPadding'));\n var yAxis = createLinearAxisY(\n [yAttrs['min'], yAttrs['max']],\n [coords['y'] + coords['height'], coords['y']],\n yAttrs['ticks'], coords['axisPadding']);\n\n // draw gridlines\n if (style('barGraphGridlines'))\n drawYGridlines(svg, yAxis, coords['width'] - 2 * coords['axisPadding'],\n yAttrs['ticks'], coords['x'] + coords['axisPadding'], {});\n\n // draw axes\n drawAxisX(svg, xAxis, coords['y'] + coords['height'], coords['axisPadding']);\n drawAxisY(svg, yAxis, coords['x'], coords['axisPadding']);\n labelAxes(svg, coords, attributes);\n\n // go through each set of bars\n var numBars = data.length;\n var totalBarWidth = xAxis.scale().bandwidth();\n var eachBarWidth = totalBarWidth / numBars;\n for (var i = 0; i < data.length; i++) {\n var barColor = data[i]['color'];\n var barData = data[i]['data'];\n \n // go through each bar in the set\n for (var j = 0; j < barData.length; j++) {\n var bar = svg.append('rect')\n .attr('x', xAxis.scale()(barData[j][0]) + i * eachBarWidth)\n .attr('y', yAxis.scale()(barData[j][1]))\n .attr('width', eachBarWidth)\n .attr('height', coords['y'] + coords['height']\n - coords['axisPadding'] - yAxis.scale()(barData[j][1]))\n .style('fill', barColor);\n\n if (style('showTooltips'))\n addTooltipToPoint(svg, bar, barData[j][1], attributes);\n }\n }\n\n return [xAxis, yAxis];\n}", "function groupTicks(d) {\n var width = d.endAngle - d.startAngle\n var offset = 0//width / 2\n return [{\n angle: d.endAngle - offset,\n label: d.value > 0 ? authorIndex[d.index] : \"\"\n }];\n }", "function d3_svg_axisSubdivide(scale, ticks, m) {\n var subticks = [];\n if (m && ticks.length > 1) {\n var extent = d3_scaleExtent(scale.domain()),\n i = -1,\n n = ticks.length,\n d = (ticks[1] - ticks[0]) / ++m,\n j,\n v;\n while (++i < n) {\n for (j = m; --j > 0;) {\n if ((v = +ticks[i] - j * d) >= extent[0]) {\n subticks.push(v);\n }\n }\n }\n for (--i, j = 0; ++j < m && (v = +ticks[i] + j * d) < extent[1];) {\n subticks.push(v);\n }\n }\n return subticks;\n}", "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "_appendTicksAndLabelsToScales(ticks, labels) {\n const that = this;\n\n function applyTicksAndLabels(scaleElement) {\n scaleElement.innerHTML = labels;\n\n if (that.ticksPosition === 'scale')\n scaleElement.innerHTML += ticks;\n }\n\n switch (that.scalePosition) {\n case 'near':\n applyTicksAndLabels(that.$.scaleNear);\n break;\n case 'far':\n applyTicksAndLabels(that.$.scaleFar);\n break;\n case 'both':\n applyTicksAndLabels(that.$.scaleNear);\n applyTicksAndLabels(that.$.scaleFar);\n break;\n }\n\n if (that.ticksPosition === 'track') {\n that.$.trackTicksContainer.innerHTML = ticks;\n }\n }", "function calculateBase(groupItem){var extent;var baseAxis=groupItem.axis;var seriesModels=groupItem.seriesModels;var seriesCount=seriesModels.length;var boxWidthList=groupItem.boxWidthList = [];var boxOffsetList=groupItem.boxOffsetList = [];var boundList=[];var bandWidth;if(baseAxis.type === 'category'){bandWidth = baseAxis.getBandWidth();}else {var maxDataCount=0;each(seriesModels,function(seriesModel){maxDataCount = Math.max(maxDataCount,seriesModel.getData().count());});extent = baseAxis.getExtent(),Math.abs(extent[1] - extent[0]) / maxDataCount;}each(seriesModels,function(seriesModel){var boxWidthBound=seriesModel.get('boxWidth');if(!zrUtil.isArray(boxWidthBound)){boxWidthBound = [boxWidthBound,boxWidthBound];}boundList.push([parsePercent(boxWidthBound[0],bandWidth) || 0,parsePercent(boxWidthBound[1],bandWidth) || 0]);});var availableWidth=bandWidth * 0.8 - 2;var boxGap=availableWidth / seriesCount * 0.3;var boxWidth=(availableWidth - boxGap * (seriesCount - 1)) / seriesCount;var base=boxWidth / 2 - availableWidth / 2;each(seriesModels,function(seriesModel,idx){boxOffsetList.push(base);base += boxGap + boxWidth;boxWidthList.push(Math.min(Math.max(boxWidth,boundList[idx][0]),boundList[idx][1]));});}", "function setSliderTicks(){\n\t var $slider = $('#slider');\n\t var max = $slider.slider(\"option\", \"max\"); \n\t if (max > 1) {\n\t \tvar spacing = 100 / (max -1);\n\t } else {\n\t \tvar spacing = 50;\n\t }\n\n\t $slider.find('.ui-slider-tick-mark').remove();\n\t for (var i = 0; i < max ; i++) {\n\t $('<span class=\"ui-slider-tick-mark\"></span>').css('left', (spacing * i) + '%').appendTo($slider); \n\t }\n\t}", "function getYAxisTickCount(areaWidth) {\n //set tick count to 10\n let tickCount = 10,\n maxValueRatio = getMaxYValue();\n\n //set max value ratio\n if (diagram.maxMeasureValue)\n maxValueRatio = diagram.maxMeasureValue;\n\n //attach text\n tempTextSVG = diagramG.append('text')\n .style('font-size', diagram.yAxis.labelFontSize + 'px')\n .style('color', diagram.yAxis.labelFontColor)\n .style('font-family', diagram.yAxis.labelFontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', diagram.yAxis.labelFontStyle == 'bold' ? 'normal' : diagram.yAxis.labelFontStyle)\n .style('font-weight', diagram.yAxis.labelFontStyle == 'bold' ? 'bold' : 'normal')\n .text(e.formatNumber(maxValueRatio, diagram.yAxis.labelFormat));\n\n //get offset for x axis value\n tempXAxisSVGOffset = tempTextSVG.node().getBoundingClientRect();\n\n //remove svg text for x axis\n tempTextSVG.remove();\n\n //check whether the axis tick count is auto\n if (diagram.yAxis.tickCount === 'auto') {\n //set tick count\n tickCount = Math.ceil(areaWidth / tempXAxisSVGOffset.width) - 1;\n } else {\n //set manuel tick count\n tickCount = parseInt(diagram.yAxis.tickCount);\n }\n\n if (tickCount > 10)\n tickCount = 10;\n\n //return updated tick count\n return 5;//e.closestPower(Math.ceil(tickCount));\n }", "function drawXTicks() {\n drawBarGraph();\n var tickSpread\n for( i = 0; i < xTicks; i++) {\n tickSpread = margin * 1.6 + ((width - margin * 1.5)/xTicks)*i;\n line(tickSpread, height - margin, tickSpread, height - margin + 20); \n drawText(xTickLabels[i], tickSpread, 540, 10, NORMAL);\n barGraph(tickSpread - margin/2, height - margin - mappedHeights[i], mappedHeights[i]);\n }\n}", "addGaugeCustomTicks() {\n const numericProcessor = this,\n that = numericProcessor.context,\n distance = that._distance,\n majorTickWidth = that._measurements.radius - distance.majorTickDistance;\n let drawTick, drawLabel;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawTick = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n }\n else {\n drawTick = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n drawLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n drawLabel = function () { };\n }\n\n function createTickAndLabel(i) {\n const currentLabel = that.customTicks[i],\n value = numericProcessor.createDescriptor(currentLabel),\n angle = numericProcessor.getAngleByValue(value, true),\n middle = i > 0 && i < that.customTicks.length - 1;\n\n drawTick(angle);\n drawLabel(angle, currentLabel, middle);\n }\n\n for (let i = that.customTicks.length - 1; i >= 0; i--) {\n createTickAndLabel(i);\n }\n }", "_groupData(realBarData, groupInterval, labelTicks) {\n let barData = [];\n for (let n = 0; n < groupInterval; n++) {\n barData.push([]);\n for (let realData of realBarData) {\n let i = 0;\n let mean = 0;\n let meanArray = [];\n for (let i = 0; i < realData.length && (new Date(realData[i][0]) < new Date(labelTicks.startDate.getTime() + labelTicks.interval * (n + 1))); i++) {\n if (new Date(realData[i][0]) >= new Date(labelTicks.startDate.getTime() + labelTicks.interval * (n))) {\n meanArray.push(realData[i][1]);\n }\n }\n barData[n].push(this._calcMeanFromArray(meanArray));\n }\n }\n return barData;\n }", "function calculateBase(groupItem) {\n var extent;\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n\n var bandWidth;\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n }\n else {\n var maxDataCount = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n });\n extent = baseAxis.getExtent(),\n Math.abs(extent[1] - extent[0]) / maxDataCount;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n boundList.push([\n parsePercent(boxWidthBound[0], bandWidth) || 0,\n parsePercent(boxWidthBound[1], bandWidth) || 0\n ]);\n });\n\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n\n boxWidthList.push(\n Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1])\n );\n });\n }", "function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitAreaModel = axisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var gridRect = gridModel.coordinateSystem.getRect();\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitAreaModel,\n clamp: true\n });\n\n if (!ticksCoords.length) {\n return;\n } // For Making appropriate splitArea animation, the color and anid\n // should be corresponding to previous one if possible.\n\n\n var areaColorsLen = areaColors.length;\n var lastSplitAreaColors = axisView.__splitAreaColors;\n var newSplitAreaColors = zrUtil.createHashMap();\n var colorIndex = 0;\n\n if (lastSplitAreaColors) {\n for (var i = 0; i < ticksCoords.length; i++) {\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\n\n if (cIndex != null) {\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\n break;\n }\n }\n }\n\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\n var areaStyle = areaStyleModel.getAreaStyle();\n areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n var x;\n var y;\n var width;\n var height;\n\n if (axis.isHorizontal()) {\n x = prev;\n y = gridRect.y;\n width = tickCoord - x;\n height = gridRect.height;\n prev = x + width;\n } else {\n x = gridRect.x;\n y = prev;\n width = gridRect.width;\n height = tickCoord - y;\n prev = y + height;\n }\n\n var tickValue = ticksCoords[i - 1].tickValue;\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\n axisGroup.add(new graphic.Rect({\n anid: tickValue != null ? 'area_' + tickValue : null,\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n },\n style: zrUtil.defaults({\n fill: areaColors[colorIndex]\n }, areaStyle),\n silent: true\n }));\n colorIndex = (colorIndex + 1) % areaColorsLen;\n }\n\n axisView.__splitAreaColors = newSplitAreaColors;\n}", "function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitAreaModel = axisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var gridRect = gridModel.coordinateSystem.getRect();\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitAreaModel,\n clamp: true\n });\n\n if (!ticksCoords.length) {\n return;\n } // For Making appropriate splitArea animation, the color and anid\n // should be corresponding to previous one if possible.\n\n\n var areaColorsLen = areaColors.length;\n var lastSplitAreaColors = axisView.__splitAreaColors;\n var newSplitAreaColors = zrUtil.createHashMap();\n var colorIndex = 0;\n\n if (lastSplitAreaColors) {\n for (var i = 0; i < ticksCoords.length; i++) {\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\n\n if (cIndex != null) {\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\n break;\n }\n }\n }\n\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\n var areaStyle = areaStyleModel.getAreaStyle();\n areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n var x;\n var y;\n var width;\n var height;\n\n if (axis.isHorizontal()) {\n x = prev;\n y = gridRect.y;\n width = tickCoord - x;\n height = gridRect.height;\n prev = x + width;\n } else {\n x = gridRect.x;\n y = prev;\n width = gridRect.width;\n height = tickCoord - y;\n prev = y + height;\n }\n\n var tickValue = ticksCoords[i - 1].tickValue;\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\n axisGroup.add(new graphic.Rect({\n anid: tickValue != null ? 'area_' + tickValue : null,\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n },\n style: zrUtil.defaults({\n fill: areaColors[colorIndex]\n }, areaStyle),\n silent: true\n }));\n colorIndex = (colorIndex + 1) % areaColorsLen;\n }\n\n axisView.__splitAreaColors = newSplitAreaColors;\n}", "_calcWidthBar(d, i) {\n if (d.indexData !== -1) {\n return this.model.barScale(this.model.data.children.data[this._vOrder[d.indexData]].edge.values[i]);\n }\n else\n return 0; // Do not draw the rectangle\n }", "function multiColumnBarPlotter(e) {\n // We need to handle all the series simultaneously.\n if (e.seriesIndex !== 0) return;\n\n var g = e.dygraph;\n var ctx = e.drawingContext;\n var sets = e.allSeriesPoints;\n var y_bottom = e.dygraph.toDomYCoord(0);\n\n // Find the minimum separation between x-values.\n // This determines the bar width.\n var min_sep = Infinity;\n for (var j = 0; j < 1; j++) {\n var points = sets[j];\n for (var i = 1; i < points.length; i++) {\n var sep = points[i].canvasx - points[i - 1].canvasx;\n if (sep < min_sep) min_sep = sep;\n }\n }\n var bar_width = Math.floor(2.5 / 3 * min_sep);\n\n var fillColors = [];\n var strokeColors = g.getColors();\n for (var i = 0; i < strokeColors.length; i++) {\n fillColors.push(strokeColors[i]);\n }\n\n for (var j = 0; j < sets.length; j++) {\n ctx.fillStyle = fillColors[j];\n ctx.strokeStyle = strokeColors[j];\n for (var i = 0; i < sets[j].length; i++) {\n var p = sets[j][i];\n var center_x = p.canvasx;\n var x_left = center_x - (bar_width / 2);\n\n ctx.fillRect(x_left, p.canvasy,\n bar_width/1, y_bottom - p.canvasy);\n\n ctx.strokeRect(x_left, p.canvasy,\n bar_width/1, y_bottom - p.canvasy);\n }\n }\n }", "function xSplitter(sSplId, uSplX, uSplY, uSplW, uSplH, bHorizontal, uBarW, uBarPos, uBarLimit, bBarEnabled, uSplBorderW, oSplChild1, oSplChild2)\r\n{\r\n // Private\r\n\r\n var pane1, pane2, splW, splH;\r\n var splEle, barPos, barLim, barEle;\r\n\r\n function barOnDrag(ele, dx, dy)\r\n {\r\n var bp;\r\n if (bHorizontal)\r\n {\r\n bp = barPos + dx;\r\n if (bp < uBarLimit || bp > splW - uBarLimit) { return; }\r\n xWidth(pane1, xWidth(pane1) + dx);\r\n xLeft(barEle, xLeft(barEle) + dx);\r\n xWidth(pane2, xWidth(pane2) - dx);\r\n xLeft(pane2, xLeft(pane2) + dx);\r\n barPos = bp;\r\n }\r\n else\r\n {\r\n bp = barPos + dy;\r\n if (bp < uBarLimit || bp > splH - uBarLimit) { return; }\r\n xHeight(pane1, xHeight(pane1) + dy);\r\n xTop(barEle, xTop(barEle) + dy);\r\n xHeight(pane2, xHeight(pane2) - dy);\r\n xTop(pane2, xTop(pane2) + dy);\r\n barPos = bp;\r\n }\r\n if (oSplChild1) { oSplChild1.paint(xWidth(pane1), xHeight(pane1)); }\r\n if (oSplChild2) { oSplChild2.paint(xWidth(pane2), xHeight(pane2)); }\r\n }\r\n\r\n // Public\r\n\r\n this.paint = function(uNewW, uNewH, uNewBarPos, uNewBarLim) // uNewBarPos and uNewBarLim are optional\r\n {\r\n if (uNewW == 0) { return; }\r\n var w1, h1, w2, h2;\r\n splW = uNewW;\r\n splH = uNewH;\r\n barPos = uNewBarPos || barPos;\r\n barLim = uNewBarLim || barLim;\r\n xMoveTo(splEle, uSplX, uSplY);\r\n xResizeTo(splEle, uNewW, uNewH);\r\n if (bHorizontal)\r\n {\r\n w1 = barPos;\r\n h1 = uNewH - 2 * uSplBorderW;\r\n w2 = uNewW - w1 - uBarW - 2 * uSplBorderW;\r\n h2 = h1;\r\n xMoveTo(pane1, 0, 0);\r\n xResizeTo(pane1, w1, h1);\r\n xMoveTo(barEle, w1, 0);\r\n xResizeTo(barEle, uBarW, h1);\r\n xMoveTo(pane2, w1 + uBarW, 0);\r\n xResizeTo(pane2, w2, h2);\r\n }\r\n else\r\n {\r\n w1 = uNewW - 2 * uSplBorderW;;\r\n h1 = barPos;\r\n w2 = w1;\r\n h2 = uNewH - h1 - uBarW - 2 * uSplBorderW;\r\n xMoveTo(pane1, 0, 0);\r\n xResizeTo(pane1, w1, h1);\r\n xMoveTo(barEle, 0, h1);\r\n xResizeTo(barEle, w1, uBarW);\r\n xMoveTo(pane2, 0, h1 + uBarW);\r\n xResizeTo(pane2, w2, h2);\r\n }\r\n if (oSplChild1)\r\n {\r\n pane1.style.overflow = 'hidden';\r\n oSplChild1.paint(w1, h1);\r\n }\r\n if (oSplChild2)\r\n {\r\n pane2.style.overflow = 'hidden';\r\n oSplChild2.paint(w2, h2);\r\n }\r\n };\r\n\r\n // Constructor\r\n\r\n splEle = xGetElementById(sSplId); // we assume the splitter has 3 DIV children and in this order:\r\n pane1 = xFirstChild(splEle, 'DIV');\r\n pane2 = xNextSib(pane1, 'DIV');\r\n barEle = xNextSib(pane2, 'DIV');\r\n // --- slightly dirty hack\r\n pane1.style.zIndex = 2;\r\n pane2.style.zIndex = 2;\r\n barEle.style.zIndex = 1;\r\n // ---\r\n barPos = uBarPos;\r\n barLim = uBarLimit;\r\n this.paint(uSplW, uSplH);\r\n if (bBarEnabled)\r\n {\r\n xEnableDrag(barEle, null, barOnDrag, null);\r\n barEle.style.cursor = bHorizontal ? 'e-resize' : 'n-resize';\r\n }\r\n splEle.style.visibility = 'visible';\r\n\r\n} // end xSplitter", "function calculateBase(groupItem) {\n\t var extent;\n\t var baseAxis = groupItem.axis;\n\t var seriesModels = groupItem.seriesModels;\n\t var seriesCount = seriesModels.length;\n\t var boxWidthList = groupItem.boxWidthList = [];\n\t var boxOffsetList = groupItem.boxOffsetList = [];\n\t var boundList = [];\n\t var bandWidth;\n\t\n\t if (baseAxis.type === 'category') {\n\t bandWidth = baseAxis.getBandWidth();\n\t } else {\n\t var maxDataCount_1 = 0;\n\t each$7(seriesModels, function (seriesModel) {\n\t maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\n\t });\n\t extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount_1;\n\t }\n\t\n\t each$7(seriesModels, function (seriesModel) {\n\t var boxWidthBound = seriesModel.get('boxWidth');\n\t\n\t if (!isArray(boxWidthBound)) {\n\t boxWidthBound = [boxWidthBound, boxWidthBound];\n\t }\n\t\n\t boundList.push([parsePercent$1(boxWidthBound[0], bandWidth) || 0, parsePercent$1(boxWidthBound[1], bandWidth) || 0]);\n\t });\n\t var availableWidth = bandWidth * 0.8 - 2;\n\t var boxGap = availableWidth / seriesCount * 0.3;\n\t var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n\t var base = boxWidth / 2 - availableWidth / 2;\n\t each$7(seriesModels, function (seriesModel, idx) {\n\t boxOffsetList.push(base);\n\t base += boxGap + boxWidth;\n\t boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n\t });\n\t }", "getXScale(width) {\n let domainValues = _.map(this.props.data, (d) => d[this.props.x]);\n let sortedVals = _.sortBy(domainValues, [(d) => {\n let rank = this.props.xRank[d];\n return (rank) ? rank : 8;\n \n }]);\n\n return scaleBand()\n .padding(this.props.padding)\n .domain(sortedVals)\n .range([this.props.margins.left, width - this.props.margins.left]);\n }", "function calculateBase(groupItem) {\n\t var extent;\n\t var baseAxis = groupItem.axis;\n\t var seriesModels = groupItem.seriesModels;\n\t var seriesCount = seriesModels.length;\n\n\t var boxWidthList = groupItem.boxWidthList = [];\n\t var boxOffsetList = groupItem.boxOffsetList = [];\n\t var boundList = [];\n\n\t var bandWidth;\n\t if (baseAxis.type === 'category') {\n\t bandWidth = baseAxis.getBandWidth();\n\t } else {\n\t var maxDataCount = 0;\n\t each(seriesModels, function (seriesModel) {\n\t maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());\n\t });\n\t extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / maxDataCount;\n\t }\n\n\t each(seriesModels, function (seriesModel) {\n\t var boxWidthBound = seriesModel.get('boxWidth');\n\t if (!zrUtil.isArray(boxWidthBound)) {\n\t boxWidthBound = [boxWidthBound, boxWidthBound];\n\t }\n\t boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n\t });\n\n\t var availableWidth = bandWidth * 0.8 - 2;\n\t var boxGap = availableWidth / seriesCount * 0.3;\n\t var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n\t var base = boxWidth / 2 - availableWidth / 2;\n\n\t each(seriesModels, function (seriesModel, idx) {\n\t boxOffsetList.push(base);\n\t base += boxGap + boxWidth;\n\n\t boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n\t });\n\t}", "function renderTickNumbers() {\n var labelSpacing = largeTickSpacing * renderAttrs.tickSpacing.largeIntervalsPerText,\n tickCoord, labelIndex, minLabelIndex, maxLabelIndex,\n labelValue, tickNumber,\n labelOffset = renderAttrs.majorTickLength + 3;\n\n // Determine range of x and y values to render (cf. CoordSysKind_RenderProc())\n // Use ~~ to efficiently truncate to integer\n // (cf. http://stackoverflow.com/questions/4055633/what-does-do-in-javascript)\n /*jslint bitwise:true */\n minLabelIndex = ~~((renderMin - originAlongAxisCoord) / labelSpacing) - 1;\n maxLabelIndex = ~~((renderMax - originAlongAxisCoord) / labelSpacing) + 1;\n // Note that we render one additional label on each end just in case.\n // Desktop GSP heuristically determines the maximum label size and then\n // only renders an additional label if it's within half the maximum extent.\n // We bypass that level of optimization until it is deemed worthwhile.\n \n ctx.font = defaultFontSpec;\n ctx.textAlign = 'left';\n\n for (labelIndex = minLabelIndex; labelIndex <= maxLabelIndex; ++labelIndex) {\n if( labelIndex !== 0) {\n var largeTickIndex = labelIndex * renderAttrs.tickSpacing.largeIntervalsPerText;\n tickCoord = originAlongAxisCoord + labelIndex * labelSpacing;\n labelValue = labelIndex * labelSpacing / renderAttrs.unitPixels;\n \n // Polar coordinates, vertical axis can affect sign\n if( renderAttrs.isPolar) {\n largeTickIndex = Math.abs( largeTickIndex);\n labelValue = Math.abs( labelValue);\n }\n else if( renderAttrs.orientation === 'vertical') {\n largeTickIndex = -largeTickIndex;\n labelValue = -labelValue;\n }\n \n // Format the tick number/label appropriately\n tickNumber = formatTickNumber( largeTickIndex, labelValue);\n \n // Render the tick number/label next to its associated tick\n renderTickNumber( tickNumber, tickCoord, labelOffset);\n }\n }\n }", "function updateXTickCount() {\n // console.log(\"data -> \" + JSON.stringify(data));\n // console.log(\"data.length -> \" + data.length);\n // console.log(\"(.77 * window.innerWidth - 280) / 15 -> \" + (.77 * window.innerWidth - 280) / 15);\n // console.log((Math.floor(data.length / ((.77 * window.innerWidth - 280) / 15))) - 1);\n setXTickInterval((Math.floor(data.length / ((.77 * window.innerWidth - 280) / 15))) - 1);\n }", "function sameTicksLength(data, yaxisTicks) {\n return yaxisTicks.length == data.length;\n }", "_calcLabelTicks(startDate, endDate, groups) {\n let offset = -Math.ceil((new Date().getTimezoneOffset()) / 60);\n // Calculated intervall length\n let unitTime = this._calcBiggestTimeUnitDifference(startDate, endDate);\n let interval = Math.ceil(unitTime.difference / groups);\n let labels = [];\n\n for (let n = 0; n < groups - 1; n++) {\n labels.push(this._formatDate(new Date(unitTime.startDate.getTime() + interval * n), offset) + \"\\n - \\n\" + this._formatDate(new Date(unitTime.startDate.getTime() + interval * (n + 1)), offset));\n }\n labels.push(this._formatDate(new Date(unitTime.startDate.getTime() + interval * (groups - 1)), offset) + \"\\n - \\n\" + this._formatDate(new Date(unitTime.endDate.getTime()), offset));\n\n return {label: labels, interval: interval, startDate: unitTime.startDate, endDate: unitTime.endDate};\n }", "drawMinMaxes(ctx, ymin, ymax)\n{\n var barData = new Array();\n\n var minValue = 1000000000.0;\n var maxValue = -1000000000.0;\n var minIndex = -1;\n var maxIndex = -1;\n var minLine = -1;\n var maxLine = -1;\n\n for ( var jndx=0; jndx<this.plotData.length; jndx++ )\n {\n barData = this.plotData[jndx];\n\n for ( var indx=0; indx<barData.length; indx++ )\n {\n if ( barData[indx] > maxValue )\n {\n maxValue = barData[indx];\n maxIndex = indx;\n maxLine = jndx;\n }\n if ( barData[indx] < minValue )\n {\n minValue = barData[indx];\n minIndex = indx;\n minLine = jndx;\n }\n }\n }\n\n if ( this.labelMax == true && maxIndex != -1 )\n {\n barData = this.plotData[maxLine];\n\n if ( this.DEBUG == true )\n alert(\"Max Line: \" + maxLine + \", Index: \" + maxIndex +\n \", Value: \" + barData[maxIndex]);\n\n var x = this.xScale*maxIndex + this.xOrg + this.xScale/2.0;\n var y = this.yOrg - (barData[maxIndex]-ymin)*this.yScale - this.xLabelsFontSize;\n\n var max_val = barData[maxIndex];\n ctx.lineWidth = 1;\n ctx.strokeStyle = this.BLACK;\n ctx.drawTextCenter(this.xLabelsFont, this.xLabelsFontSize, x, y, max_val + \"\");\n }\n\n if ( this.labelMin == true && minIndex != -1 )\n {\n barData = this.plotData[minLine];\n\n if ( this.DEBUG == true )\n alert(\"Min Line: \" + minLine + \", Index: \" + minIndex +\n \", Value: \" + barData[minIndex]);\n\n var x = this.xScale*minIndex + this.xOrg + this.xScale/2.0;\n var y = this.yOrg - (barData[minIndex]-ymin)*this.yScale - this.xLabelsFontSize;\n\n var min_val = barData[minIndex];\n ctx.lineWidth = 1;\n ctx.strokeStyle = this.BLACK;\n ctx.drawTextCenter(this.xLabelsFont, this.xLabelsFontSize, x, y, min_val + \"\");\n }\n}", "function shiftLayoutOnX(list, leftBound, rightBound, // If average the shifts on all labels and add them to 0\n// TODO: Not sure if should enable it.\n// Pros: The angle of lines will distribute more equally\n// Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly.\nbalanceShift) {\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\n}", "function show_percentage_split_of_under_40_seconds(ndx) {\n var percentageUnder40 = ndx.groupAll().reduce(\n function(p, v) {\n p.count++;\n if (v.PizzaTime <= 40) {\n p.under_40++;\n }\n return p;\n },\n function(p, v) {\n p.count--;\n if (v.PizzaTime <= 40) {\n p.under_40--;\n }\n return p;\n },\n function(p, v) {\n return { count: 0, under_40: 0 };\n }\n );\n\n dc.numberDisplay(\"#under40Secs\")\n .formatNumber(d3.format(\".2%\"))\n .valueAccessor(function(d) {\n if (d.count == 0) {\n return 0;\n }\n else {\n return (d.under_40 / d.count);\n }\n })\n .group(percentageUnder40);\n\n var percentageOver40 = ndx.groupAll().reduce(\n function(p, v) {\n p.count++;\n if (v.PizzaTime > 40) {\n p.over_40++;\n }\n return p;\n },\n function(p, v) {\n p.count--;\n if (v.PizzaTime > 40) {\n p.over_40--;\n }\n return p;\n },\n function(p, v) {\n return { count: 0, over_40: 0 };\n }\n );\n\n dc.numberDisplay(\"#over40Secs\")\n .formatNumber(d3.format(\".2%\"))\n .valueAccessor(function(d) {\n if (d.count == 0) {\n return 0;\n }\n else {\n return (d.over_40 / d.count);\n }\n })\n .group(percentageOver40);\n}", "function componentBarsHorizontal () {\n\n /* Default Properties */\n var width = 400;\n var height = 500;\n var transition = { ease: d3.easeBounce, duration: 500 };\n var colors = palette.categorical(3);\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n var xScale = void 0;\n var yScale = void 0;\n var colorScale = void 0;\n var classed = \"barsHorizontal\";\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n var _dataTransform$summar = dataTransform(data).summary(),\n columnKeys = _dataTransform$summar.columnKeys,\n valueMax = _dataTransform$summar.valueMax;\n\n var valueExtent = [0, valueMax];\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain(columnKeys).range(colors);\n }\n\n if (typeof xScale === \"undefined\") {\n xScale = d3.scaleLinear().domain(valueExtent).range([0, height]).nice();\n }\n\n if (typeof yScale === \"undefined\") {\n yScale = d3.scaleBand().domain(columnKeys).rangeRound([0, width]).padding(0.15);\n }\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias barsHorizontal\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n init(selection.data());\n selection.each(function () {\n\n // Update series group\n var seriesGroup = d3.select(this);\n seriesGroup.classed(classed, true).attr(\"id\", function (d) {\n return d.key;\n }).on(\"mouseover\", function (d) {\n dispatch.call(\"customSeriesMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customSeriesClick\", this, d);\n });\n\n // Add bars to series\n var bars = seriesGroup.selectAll(\".bar\").data(function (d) {\n return d.values;\n });\n\n bars.enter().append(\"rect\").classed(\"bar\", true).attr(\"fill\", function (d) {\n return colorScale(d.key);\n }).attr(\"width\", yScale.bandwidth()).attr(\"y\", function (d) {\n return yScale(d.key);\n }).attr(\"height\", yScale.bandwidth()).on(\"mouseover\", function (d) {\n dispatch.call(\"customValueMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customValueClick\", this, d);\n }).merge(bars).transition().ease(transition.ease).duration(transition.duration).attr(\"x\", 0).attr(\"width\", function (d) {\n return xScale(d.value);\n });\n\n bars.exit().transition().style(\"opacity\", 0).remove();\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return my;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return my;\n };\n\n /**\n * X Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.xScale = function (_v) {\n if (!arguments.length) return xScale;\n xScale = _v;\n return my;\n };\n\n /**\n * Y Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.yScale = function (_v) {\n if (!arguments.length) return yScale;\n yScale = _v;\n return my;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "function BarDrawUtil() {\n var me = this;\n /****Constants****/\n var BAR_COLOR = /*\"#4A87F8\"*/\"#178FB7\";\n //Layout\n var MAX_BAR_WIDTH = 24;\n var NICE_BAR_WIDTH = 12;\n var MIN_BAR_WIDTH = 2;\n var BEST_PAD_BETWEEN_BARS = 1;\n\n /****Externally set****/\n //Data\n var dataList;\n //Utils\n var yAxis;\n var xAxis;\n //Structure\n var barGroup;\n var concealerGroup;\n //Layout\n var bottomExtraPadding;\n\n /**Internally Set**/\n //Data\n var barCount;\n //Layout\n var barWidth;\n\n\n /**Public Functions***/\n this.setLayoutParams = function (bottomExtraPaddingInput) {\n bottomExtraPadding = bottomExtraPaddingInput;\n };\n\n this.setData = function (dataListInput, xAxisInput, yAxisInput) {\n dataList = dataListInput;\n xAxis = xAxisInput;\n yAxis = yAxisInput;\n };\n\n this.setPapaGroups = function (barGroupInput, concealerGroupInput) {\n barGroup = barGroupInput;\n concealerGroup = concealerGroupInput;\n };\n\n this.drawComponent = function () {\n createAllBars();\n };\n\n /**Construct***/\n function createAllBars() {\n calculateBarWidth();\n for (var i = 0; i < dataList.length; i++) {\n createBar(i);\n }\n }\n\n function createBar(index) {\n var dataPoint = dataList[index];\n var value = dataPoint.close;\n var x = xAxis.scale(index) - barWidth / 2;\n var baseY = yAxis.scale(0);\n var y = yAxis.scale(value);\n var height;\n\n\n\n if (value > 0) {\n height = baseY - y;\n } else {\n height = y - baseY;\n y = baseY;\n }\n\n x = trimToTwoDecimalDigits(x);\n height = trimToTwoDecimalDigits(height);\n y = trimToTwoDecimalDigits(y);\n var bar = barGroup.append(\"rect\")\n .attr({\n x: x,\n y: y,\n height: height,\n width: barWidth\n })\n .style({\n fill: BAR_COLOR\n });\n }\n\n /**Calculate***/\n function calculateBarWidth() {\n var barWithPadWidth = xAxis.scale(1) - xAxis.scale(0);\n barWidth = barWithPadWidth * 0.9;\n barCount = dataList.length;\n\n\n barWidth = trimToTwoDecimalDigits(barWidth);\n }\n}", "function gridXaxis() {\t\t\n return d3.axisBottom(x)\n .ticks(5)\n}", "function createBars(vals) {\n var barLeft;\n if (that.model.get(\"columnShift\")) {\n barLeft = \" style=left:\" + that.model.get(\"columnShift\") + \"px\";\n }\n var html = [\"<div class='bars'\" + barLeft + \">\"];\n for (var i = 0; i < vals.length; i++) {\n html.push(\"<div class='bar bar\" + (i + 1) + \"' style='height:\" + Math.round(100 * vals[i]) + \"%'></div>\");\n }\n html.push(\"</div>\");\n return html.join(\"\");\n }", "function shiftLayoutOnX(list, leftBound, rightBound, // If average the shifts on all labels and add them to 0\n\t // TODO: Not sure if should enable it.\n\t // Pros: The angle of lines will distribute more equally\n\t // Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly.\n\t balanceShift) {\n\t return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\n\t }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v + \"%\"\n };\n });\n}", "function groupTicks(d, step, senses) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, step).map(function(value) {\n return {value: senses[d.index], angle: value * k + d.startAngle};\n });\n }", "function drawBlockSeparations() {\n\n // remove all block separations\n svg.selectAll('.' + config.blockSeparatorClass).remove();\n\n console.log(scope.priorityMarkup)\n // terminate if the grouping is not by priority\n if (grouping != 'priority' || !scope.priorityMarkup) {\n return null;\n }\n\n // get coordinates\n var blockXCoordinates = [0,0,0,0,0,0];\n var xTicks = svg.selectAll(\".x.axis .tick\");\n xTicks.forEach(function(d, i) {\n d.forEach(function(e, j) {\n var x = d3.select(e).attr('transform')\n .split('(')[1].split(',')[0];\n var f = e['__data__'];\n for(var i = 6; i > 0; i--) {\n var g = scope.$parent.$parent.priorityPerBlock[i];\n if (f == '' || f <= g) {\n if (f == g) {\n blockXCoordinates[6-i] = x;\n } else {\n blockXCoordinates[6-i] = x-column_width/2;\n }\n }\n }\n });\n });\n // draw blocks\n var tmp = 0;\n blockXCoordinates.forEach(function(d, i) {\n if (parseInt(d,10) > parseInt(tmp,10)) {\n var w = d;\n svg.append('g')\n .attr('class', config.blockSeparatorClass)\n .attr('transform', 'translate(' + w + ',0)')\n .append('line')\n .attr('x2', 0)\n .attr('y2', height)\n .attr('opacity', config.blockSeparatorOpacity)\n .style('stroke', config.blockSeparatorColor)\n .style('stroke-dasharray', ('3, 6'))\n .style('stroke-width', config.blockSeparatorWidth)\n .append('title')\n .text(function(){return \"B\"+(6-i)});\n tmp = d;\n }\n });\n }", "function make_x_gridlines(xScale, ticks) { \n return d3.axisBottom(xScale)\n .ticks(ticks)\n \n}", "function make_x_gridlines() {\t\t\n return d3.axisBottom(x)\n .ticks( 2*favoriteTicks )\n }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function (v, i) {\n return {\n angle: v * k + d.startAngle,\n //label: i % 5 ? null : v / 1000 + \"k\"\n label: chordData.header[d.index]\n };\n });\n }", "beforeDatasetsDraw(chart) {\n if (!this._enabled(chart)) {\n return;\n }\n const scale = this._findScale(chart);\n const flat = chart.data.flatLabels;\n const visible = chart.data.labels;\n const roots = chart.data.rootNodes;\n const visibles = new Set(visible);\n const ctx = chart.ctx;\n const hor = scale.isHorizontal();\n\n const boxSize = scale.options.hierarchyBoxSize;\n const boxSize05 = boxSize * 0.5;\n const boxSize01 = boxSize * 0.1;\n const boxRow = scale.options.hierarchyBoxLineHeight;\n const boxColor = scale.options.hierarchyBoxColor;\n const boxWidth = scale.options.hierarchyBoxWidth;\n const boxSpanColor = scale.options.hierarchySpanColor;\n const boxSpanWidth = scale.options.hierarchySpanWidth;\n const renderLabel = scale.options.hierarchyLabelPosition;\n const groupLabelPosition = scale.options.hierarchyGroupLabelPosition;\n\n const scaleLabel = scale.options.scaleLabel;\n const scaleLabelFontColor = helpers.valueOrDefault(scaleLabel.fontColor, defaults.global.defaultFontColor);\n const scaleLabelFont = parseFontOptions(scaleLabel);\n\n ctx.save();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n ctx.fillStyle = scaleLabelFontColor; // render in correct color\n ctx.font = scaleLabelFont.font;\n\n const renderHorLevel = (node) => {\n if (node.children.length === 0) {\n return false;\n }\n const offset = node.level * boxRow;\n\n if (!node.expand) {\n if (visibles.has(node)) {\n // expand button\n ctx.strokeRect(node.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(node.center - boxSize05 + 2, offset + boxSize05 - 1, boxSize - 4, 2);\n ctx.fillRect(node.center - 1, offset + 2, 2, boxSize - 4);\n }\n return false;\n }\n const r = spanLogic(node, flat, visibles, groupLabelPosition);\n if (!r) {\n return false;\n }\n const {\n hasFocusBox,\n hasCollapseBox,\n leftVisible,\n rightVisible,\n leftFirstVisible,\n rightLastVisible,\n groupLabelCenter\n } = r;\n\n // render group label\n if (renderLabel === 'below') {\n ctx.fillText(node.label, groupLabelCenter, offset + boxSize);\n } else if (renderLabel === 'above') {\n ctx.fillText(node.label, groupLabelCenter, offset - boxSize);\n }\n\n if (hasCollapseBox) {\n // collapse button\n ctx.strokeRect(leftVisible.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(leftVisible.center - boxSize05 + 2, offset + boxSize05 - 1, boxSize - 4, 2);\n }\n\n if (hasFocusBox) {\n // focus button\n ctx.strokeRect(rightVisible.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(rightVisible.center - 2, offset + boxSize05 - 2, 4, 4);\n }\n\n if (leftVisible !== rightVisible) {\n // helper span line\n ctx.strokeStyle = boxSpanColor;\n ctx.lineWidth = boxSpanWidth;\n ctx.beginPath();\n if (hasCollapseBox) {\n // stitch to box\n ctx.moveTo(leftVisible.center + boxSize05, offset + boxSize05);\n } else if (leftFirstVisible) {\n // add starting group hint\n ctx.moveTo(leftVisible.center, offset + boxSize01);\n ctx.lineTo(leftVisible.center, offset + boxSize05);\n } else {\n // just a line\n ctx.moveTo(leftVisible.center, offset + boxSize05);\n }\n\n if (hasFocusBox) {\n ctx.lineTo(rightVisible.center - boxSize05, offset + boxSize05);\n } else if (rightLastVisible) {\n ctx.lineTo(rightVisible.center, offset + boxSize05);\n ctx.lineTo(rightVisible.center, offset + boxSize01);\n } else {\n ctx.lineTo(rightVisible.center, offset + boxSize05);\n }\n ctx.stroke();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n }\n\n return true;\n };\n\n const renderVertLevel = (node) => {\n if (node.children.length === 0) {\n return false;\n }\n const offset = node.level * boxRow * -1;\n\n if (!node.expand) {\n if (visibles.has(node)) {\n ctx.strokeRect(offset - boxSize, node.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize + 2, node.center - 1, boxSize - 4, 2);\n ctx.fillRect(offset - boxSize05 - 1, node.center - boxSize05 + 2, 2, boxSize - 4);\n }\n return false;\n }\n const r = spanLogic(node, flat, visibles);\n if (!r) {\n return false;\n }\n const {\n hasFocusBox,\n hasCollapseBox,\n leftVisible,\n rightVisible,\n leftFirstVisible,\n rightLastVisible,\n groupLabelCenter\n } = r;\n\n // render group label\n ctx.fillText(node.label, offset - boxSize, groupLabelCenter);\n\n if (hasCollapseBox) {\n // collapse button\n ctx.strokeRect(offset - boxSize, leftVisible.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize + 2, leftVisible.center - 1, boxSize - 4, 2);\n }\n\n if (hasFocusBox) {\n // focus\n ctx.strokeRect(offset - boxSize, rightVisible.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize05 - 2, rightVisible.center - 2, 4, 4);\n }\n\n if (leftVisible !== rightVisible) {\n // helper span line\n ctx.strokeStyle = boxSpanColor;\n ctx.lineWidth = boxSpanWidth;\n ctx.beginPath();\n if (hasCollapseBox) {\n // stitch to box\n ctx.moveTo(offset - boxSize05, leftVisible.center + boxSize05);\n } else if (leftFirstVisible) {\n // add starting group hint\n ctx.moveTo(offset - boxSize01, leftVisible.center);\n ctx.lineTo(offset - boxSize05, leftVisible.center);\n } else {\n // just a line\n ctx.lineTo(offset - boxSize05, leftVisible.center);\n }\n\n if (hasFocusBox) {\n ctx.lineTo(offset - boxSize05, rightVisible.center - boxSize05);\n } else if (rightLastVisible) {\n ctx.lineTo(offset - boxSize05, rightVisible.center - boxSize05);\n ctx.lineTo(offset - boxSize01, rightVisible.center - boxSize05);\n } else {\n ctx.lineTo(offset - boxSize05, rightVisible.center);\n }\n ctx.stroke();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n }\n\n return true;\n };\n\n if (hor) {\n ctx.textAlign = 'center';\n ctx.textBaseline = renderLabel === 'above' ? 'bottom' : 'top';\n ctx.translate(scale.left, scale.top + scale.options.padding);\n roots.forEach((n) => preOrderTraversal(n, renderHorLevel));\n } else {\n ctx.textAlign = 'right';\n ctx.textBaseline = 'center';\n ctx.translate(scale.left - scale.options.padding, scale.top);\n\n roots.forEach((n) => preOrderTraversal(n, renderVertLevel));\n }\n\n ctx.restore();\n }", "_validateBarsSize() {\n const that = this;\n\n //Check if size of the SplitterBar is explicitly set\n if ((getComputedStyle(that).getPropertyValue('--jqx-splitter-bar-fit-size') + '').trim() !== '100%') {\n return;\n }\n\n let biggestItem = that._items[0];\n const size = 'offset' + that._measurements.restricredDimension,\n bars = that.bars;\n\n if (bars.length === 0) {\n return;\n }\n\n for (let i = 0; i < that._items.length; i++) {\n if (that._items[i][size] > biggestItem[size]) {\n biggestItem = that._items[i];\n }\n }\n\n if (!biggestItem) {\n return;\n }\n\n if (biggestItem[size] !== bars[0][size]) {\n bars.map(bar => bar.style[that._measurements.restricredDimension.toLowerCase()] = biggestItem[size] + 'px');\n }\n }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 10).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v\n };\n });\n}//groupTicks", "ticks (count = 7) {\n const domain = this.getDomain()\n\n return ticks(domain[0], domain[domain.length - 1], count)\n }", "function adjustTicks(evt, obj) {\n //Using adjustTM attribute to adjust the \n //number of major ticks to a best feasible value\n if(adjustTickCB.checked) {\n cpuGauge.setChartAttribute('adjustTM', 1);\n }\n else{\n cpuGauge.setChartAttribute('adjustTM', 0);\n }\n }", "function createGroupedBars() {\n //set all values by series\n chart.data.forEach(function (d) {\n d.values = axis.serieNames.map(function (name) {\n return {\n name: name,\n xValue: d[chart.xField],\n yValue: +d[name]\n };\n })\n });\n\n //get new y domain\n var newYDomain = [0, d3.max(chart.data, function (d) {\n return d3.max(d.values, function (v) {\n return v.yValue * 1.1;\n });\n })];\n\n //check whether the chart is reversed\n if (isReversed) {\n //set new domain\n newYDomain = [d3.max(chart.data, function (d) {\n return d3.max(d.values, function (v) {\n return v.yValue * 1.1;\n });\n }), 0];\n\n //update x axis\n axis.x.domain(newYDomain);\n } else {\n //update y axis\n axis.y.domain(newYDomain);\n }\n\n //get range band\n var rangeBand = groupAxis.rangeBand();\n\n //create bar groups on canvas\n groupedBars = chart.svg.selectAll('.eve-series')\n .data(chart.data)\n .enter().append('g')\n .attr('class', 'eve-series')\n .attr('transform', function (d) {\n if (isReversed)\n return 'translate(' + (axis.offset.left) + ',' + (axis.y(d[chart.xField])) + ')';\n else\n return 'translate(' + (axis.x(d[chart.xField]) + axis.offset.left) + ',0)';\n });\n\n //create bar group rectangles\n groupedBarsRects = groupedBars.selectAll('rect')\n .data(function (d) { return d.values; })\n .enter().append('rect')\n .attr('class', function (d, i) { return 'eve-bar-serie eve-bar-serie-' + i; })\n .attr('width', function (d) { return isReversed ? (axis.offset.width - axis.x(d.yValue)) : rangeBand; })\n .attr('x', function (d) { return isReversed ? 0 : groupAxis(d.name); })\n .attr('y', function (d) { return isReversed ? groupAxis(d.name) : axis.y(d.yValue); })\n .attr('height', function (d) { return isReversed ? rangeBand : (axis.offset.height - axis.y(d.yValue)); })\n .style('fill', function (d, i) {\n //check whether the serie has color\n if (chart.series[i].color === '')\n return i <= e.colors.length ? e.colors[i] : e.randColor();\n else\n return chart.series[i].color;\n })\n .style('stroke', '#ffffff')\n .style('stroke-width', function (d, i) { return chart.series[i].strokeSize + 'px'; })\n .style('stroke-opacity', function (d, i) { return chart.series[i].alpha; })\n .style('fill-opacity', function (d, i) { return chart.series[i].alpha; })\n .on('mousemove', function(d, i) {\n var balloonContent = chart.getXYFormat(d, chart.series[d.index]);\n\n //show balloon\n chart.showBalloon(balloonContent);\n\n //increase bullet stroke size\n d3.select(this)\n .style('stroke-width', function (d) { return chart.series[i].strokeSize + 1; });\n })\n .on('mouseout', function(d, i) {\n //hide balloon\n chart.hideBalloon();\n\n //increase bullet stroke size\n d3.select(this)\n .style('stroke-width', function (d) { return chart.series[i].strokeSize; });\n });\n\n //set serie labels\n groupedBarsTexts = groupedBars.selectAll('text')\n .data(function(d) { return d.values; })\n .enter().append('text')\n .attr('class', function(d, i) { return 'eve-bar-label eve-bar-label-' + i; })\n .style('cursor', 'pointer')\n .style('fill', function(d, i) { return chart.series[i].labelFontColor; })\n .style('font-weight', function(d, i) { return chart.series[i].labelFontStyle == 'bold' ? 'bold' : 'normal'; })\n .style('font-style', function(d, i) { return chart.series[i].labelFontStyle == 'bold' ? 'normal' : chart.series[i].labelFontStyle; })\n .style(\"font-family\", function(d, i) { return chart.series[i].labelFontFamily; })\n .style(\"font-size\", function(d, i) { return chart.series[i].labelFontSize + 'px'; })\n .text(function(d, i) {\n //check whether the label format is enabled\n if(chart.series[i].labelFormat != '')\n return chart.getXYFormat(d, chart.series[i], 'label');\n })\n .attr('x', function(d, i) {\n //return calculated x pos\n return isReversed ? (axis.offset.width - axis.x(d.yValue)) : (i * rangeBand);\n })\n .attr('y', function(d, i) {\n //return calculated y pos\n return isReversed ? groupAxis(d.name) + rangeBand : axis.y(d.yValue) - 2;\n });\n }", "function multiColumnBarPlotter(e) {\n function darkenColor(colorStr) {\n // Defined in dygraph-utils.js\n var color = Dygraph.toRGB_(colorStr);\n color.r = Math.floor((255 + color.r) / 2);\n color.g = Math.floor((255 + color.g) / 2);\n color.b = Math.floor((255 + color.b) / 2);\n return 'rgb(' + color.r + ',' + color.g + ',' + color.b + ')';\n }\n // We need to handle all the series simultaneously.\n if (e.seriesIndex !== 0) {\n return;\n }\n\n var g = e.dygraph;\n var ctx = e.drawingContext;\n var sets = e.allSeriesPoints;\n var y_bottom = e.dygraph.toDomYCoord(0);\n\n // Find the minimum separation between x-values.\n // This determines the bar width.\n var min_sep = Infinity;\n for (var j = 0; j < sets.length; j++) {\n var points = sets[j];\n for (var i = 1; i < points.length; i++) {\n var sep = points[i].canvasx - points[i - 1].canvasx;\n if (sep < min_sep) {\n min_sep = sep;\n }\n }\n }\n var bar_width = Math.floor(2.0 / 3 * min_sep);\n var fillColors = [];\n var strokeColors = g.getColors();\n for (var i = 0; i < strokeColors.length; i++) {\n fillColors.push(darkenColor(strokeColors[i]));\n }\n\n for (var j = 0; j < sets.length; j++) {\n ctx.fillStyle = fillColors[j];\n ctx.strokeStyle = strokeColors[j];\n for (var i = 0; i < sets[j].length; i++) {\n var p = sets[j][i];\n var center_x = p.canvasx;\n var x_left;\n if (sets.length === 1) {\n x_left = center_x - (bar_width / 2);\n } else {\n x_left = center_x - (bar_width / 2) * (1 - j/(sets.length-1));\n }\n ctx.fillRect(x_left, p.canvasy, bar_width/sets.length, y_bottom - p.canvasy);\n ctx.strokeRect(x_left, p.canvasy, bar_width/sets.length, y_bottom - p.canvasy);\n }\n }\n }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: labels[d.index]\n };\n });\n }", "function initDivChart() {\n console.log(\"initDivChart\");\n\n var dataSet = [4, 8, 15, 16, 23, 42];\n var barH = 15;\n\n var xScale = d3.scale.linear() // function: returns scaled display value in range for given data value in domain\n .domain([0, d3.max(dataSet)]) // domain: minimum (set to 0) and maximum data values (dataSet max)\n .range([0, 420]); // range: display space (width of chart)\n\n d3.select(\"#chartDiv\") // select the chart container using id selector\n .selectAll(\"div\") // initiate the data join (define selection to which we will join data)\n .data(dataSet) // join data to the selection using selection.data\n .enter().append(\"div\") // instantiate and append missinf elements to selection\n .style(\"width\", function(d) { return xScale(d) + \"px\"; }) // set bar width as multiple of associated data value (d)\n .style(\"height\", function(d) { return barH + \"px\"; }) // set bar height as multiple of associated data value (d)\n .text(function(d) { return d; }) // set the text content of each bar (produces a label)\n .style({'color':'white', 'font-size':'10px'}); // text color for labels ('color' for divs, 'fill' for svgs)\n\n // console.log(\" d3.max(dataSet): \" + d3.max(dataSet));\n // console.log(\" xScale.domain: \" + xScale.domain());\n // console.log(\" xScale.range: \" + xScale.range());\n\n}", "drawPlot(ctx, curr_set, num_sets)\n{\n var xpt;\n var y1, y2;\n var bar_width;\n\n var max_bars = this.calcMaxBars();\n var set_width = this.calcBarWidth(max_bars);\n\n var color = this.colors[curr_set % 8];\n if ( color != null )\n ctx.strokeStyle = color;\n else\n ctx.strokeStyle = this.BLACK;\n\n var barData = new Array();\n barData = this.plotData[curr_set];\n\n // Draw each bar set\n for ( var indx=0; indx<barData.length; indx++ )\n {\n xpt = this.xScale*indx + this.xOrg + this.xScale/2.0;\n\n switch ( this.plotType )\n {\n case this.ADJACENT:\n default:\n bar_width = set_width/num_sets;\n xpt -= (set_width/2);\n xpt += (bar_width*curr_set);\n y1 = this.yOrg;\n y2 = this.yOrg - (barData[indx]-this.plotYMin)*this.yScale;\n break;\n\n case this.INLAID:\n bar_width = set_width - ((set_width/num_sets)*curr_set);\n xpt -= bar_width/2;\n y1 = this.yOrg;\n y2 = this.yOrg - (barData[indx]-this.plotYMin)*this.yScale;\n break;\n\n case this.STACKED:\n bar_width = set_width;\n xpt -= bar_width/2;\n\n // Sum up previous data points\n if ( curr_set > 0 )\n {\n var tmpData = new Array();\n var ytmp = 0;\n for ( var jndx=0; jndx<=curr_set; jndx++ )\n {\n tmpData = this.plotData[jndx];\n ytmp += tmpData[indx];\n }\n\n y1 = this.yOrg - ((ytmp-barData[indx])-this.plotYMin)*this.yScale;\n y2 = this.yOrg - (ytmp-this.plotYMin)*this.yScale;\n }\n else\n {\n y1 = this.yOrg;\n y2 = this.yOrg - (barData[indx]-this.plotYMin)*this.yScale;\n }\n break;\n\n case this.PERCENT:\n bar_width = set_width;\n xpt -= bar_width/2;\n\n // Sum up previous data points\n if ( curr_set > 0 )\n {\n var tmpData = new Array();\n var ytmp = 0;\n for ( var jndx=0; jndx<=curr_set; jndx++ )\n {\n tmpData = this.plotData[jndx];\n ytmp += tmpData[indx];\n }\n\n var yp1 = ((ytmp - barData[indx]) / this.percentData[indx]) * 100.0;\n var yp2 = (ytmp / this.percentData[indx]) * 100.0;\n\n y1 = this.yOrg - yp1*this.yScale;\n y2 = this.yOrg - yp2*this.yScale;\n }\n else\n {\n y1 = this.yOrg;\n y2 = this.yOrg - ((barData[indx] / this.percentData[indx]) * 100.0) * this.yScale;\n }\n break;\n }\n\n try\n {\n var lineargradient = ctx.createLinearGradient(xpt, y2, (xpt+bar_width), y1);\n lineargradient.addColorStop(0, this.WHITE);\n }\n catch ( ex )\n {\n }\n\n var bar_color;\n if ( this.color_bars_flag == true ) // Force color of bar to given values\n {\n if ( lineargradient )\n lineargradient.addColorStop(1, this.color_bars[indx]);\n bar_color = this.color_bars[indx];\n }\n else // Use standard color for this particular data set\n {\n if ( lineargradient )\n lineargradient.addColorStop(1, color);\n bar_color = color;\n }\n\n if ( lineargradient )\n ctx.fillStyle = lineargradient;\n\nvar xpp = xpt;\nvar bwidth = bar_width;\nif ( curr_set == this.highlightSet ) // What if highlite = 0 or last\n{\n xpp = xpt - 2;\n bwidth = bar_width + 4;\n}\nelse if ( curr_set == this.highlightSet - 1 )\n{\n xpp = xpt;\n bwidth = bar_width - 2;\n}\nelse if ( curr_set == this.highlightSet + 1 ) // What about the rest of the bars\n{\n xpp = xpt + 2;\n bwidth = bar_width - 2;\n}\n\n var bar_height = y1 - y2;\n //ctx.fillRect(xpt, y2, bar_width, bar_height);\n ctx.fillRect(xpp, y2, bwidth, bar_height);\n\n//Highlite: increase stroke width?\n//if ( this.highlightSet == curr_set )\n// ctx.lineWidth = 3;\n//else\n ctx.lineWidth = 1;\n\n ctx.strokeStyle = this.BLACK;\n //ctx.strokeRect(xpt, y2, bar_width, bar_height);\n ctx.strokeRect(xpp, y2, bwidth, bar_height);\n\n if ( this.threeD == true && barData[indx] != 0 &&\n (this.plotType == this.ADJACENT ||\n this.plotType == this.STACKED ||\n this.plotType == this.PERCENT ||\n (this.plotType == this.INLAID && curr_set == 0)) )\n {\n //this.drawShadows(ctx, bar_width, xpt, y2, bar_height, bar_color);\n this.drawShadows(ctx, bwidth, xpp, y2, bar_height, bar_color);\n }\n\n//ZZZZ\nif ( this.labelBars == true )\n ctx.drawTextCenter(this.xLabelsFont, this.xLabelsFontSize,\n xpp+bwidth/2, y2+30, barData[indx].toFixed(0));\n\n if ( this.plotType == this.PERCENT && barData[indx] != 0 )\n {\n ctx.strokeStyle = this.BLACK;\n ctx.drawTextCenter(this.xLabelsFont, this.xLabelsFontSize,\n xpp+bwidth/2, y2+bar_height/2, barData[indx] + \"\");\n //xpt+bar_width/2, y2+bar_height/2, barData[indx] + \"\");\n }\n }\n}", "function drawBarChart(data, ctx, can) {\n if (clear) ctx.clearRect(0, 0, can.width, can.height);\n var y, tx, ty, metrics, words, line, testLine, testWidth;\n var dataName = data.name;\n var dataValue = data.value;\n var colHead = 50;\n var rowHead = 30;\n var margin = 10;\n var maxVal = Math.ceil(Math.max.apply(Math, dataValue)/5) * 5;\n var stepSize = 5;\n var yScalar = (can.height - colHead - margin) / (maxVal);\n var xScalar = (can.width - rowHead) / (dataName.length + 1);\n ctx.lineWidth = 0.5;\n ctx.strokeStyle = \"rgba(128,128,255, 0.5)\"; // light blue line\n ctx.beginPath();\n // print row header and draw horizontal grid lines\n ctx.font = \"10pt Open Sans\"\n var count = 0;\n for (scale = maxVal; scale >= 0; scale -= stepSize) {\n y = colHead + (yScalar * count * stepSize);\n ctx.fillText(scale, margin,y + margin);\n ctx.moveTo(rowHead, y + margin - 1)\n ctx.lineTo(can.width, y + margin -1)\n count++;\n }\n ctx.stroke();\n ctx.save();\n // set a color\n ctx.fillStyle = \"rgba(151,187,205,1)\";\n // translate to bottom of graph and scale x,y to match data\n ctx.translate(0, can.height - margin);\n ctx.scale(xScalar, -1 * yScalar);\n // draw bars\n for (i = 0; i < dataName.length; i++) {\n ctx.fillRect(i + 1, -2, 0.5, dataValue[i]);\n }\n ctx.restore();\n \n // label samples\n ctx.font = \"8pt Open Sans\";\n ctx.textAlign = \"center\";\n for (i = 0; i < dataName.length; i++) {\n calcY(dataValue[i]);\n ty = y - margin - 5;\n tx = xScalar * (i + 1) + 14;\n words = dataName[i].split(' ');\n line = '';\n for(var n = 0; n < words.length; n++) {\n testLine = line + words[n] + ' ';\n metrics = ctx.measureText(testLine);\n testWidth = metrics.width;\n if (testWidth > 20 && n > 0) {\n ctx.fillText(line, tx, ty - 8);\n line = words[n] + ' ';\n }\n else {\n line = testLine;\n }\n }\n ctx.fillText(line, tx, ty + 8);\n }\n function calcY(value) {\n y = can.height - value * yScalar;\n } \n}", "showBar(item) {\n const that = this;\n\n if (item instanceof JQX.SplitterBar) {\n item.show();\n return;\n }\n\n if (typeof item !== 'number') {\n that.error(that.localize('invalidIndex', { elementType: that.nodeName.toLowerCase(), method: 'showBar' }));\n return;\n }\n\n item = that.bars[item];\n\n if (!(item instanceof JQX.SplitterBar)) {\n that.error(that.localize('indexOutOfBound', { elementType: that.nodeName.toLowerCase(), method: 'showBar' }));\n return;\n }\n\n item.show();\n }", "function make_yMajor_gridlines() {\n return d3.axisLeft(y)\n .ticks(yGridLength)\n }", "function make_x_gridlines() {\t\t\n return d3.axisBottom(x)\n .ticks(5)\n }", "function setSliderTicks(el) {\r\n // initialise reelvant slider variables in function.\r\n var $slider = $(el);\r\n\r\n var max = $slider.slider(\"option\", \"max\");\r\n var min = $slider.slider(\"option\", \"min\");\r\n var range = max - min;\r\n var step = $slider.slider(\"option\", \"step\");\r\n var spacing = 100 / ((max - min) / step);\r\n\r\n // remove previuous ticks and labels before redrawing\r\n $slider.find(\".ui-slider-tick-mark\").remove();\r\n $slider.find(\".ui-slider-tick-label\").remove();\r\n\r\n // loop through number of ticks calculated to add\r\n for (var i = 0; i <= (max - min) / step; i++) {\r\n // append tick span DOM item\r\n $('<span class=\"ui-slider-tick-mark\"></span>')\r\n .css(\"left\", spacing * i - 0.0 + \"%\")\r\n .appendTo($slider);\r\n\r\n // append tick label span DOM item\r\n $('<span class=\"ui-slider-tick-label\"></span>')\r\n .text(aleph.years[i])\r\n .css(\"top\", function () {\r\n return \"-5px\";\r\n })\r\n .css(\"left\", function () {\r\n if (i == 0) {\r\n return spacing * i - 7.5 + \"%\";\r\n } else if (i == range) {\r\n return spacing * i + 1.5 + \"%\";\r\n } else {\r\n return \"none\";\r\n }\r\n })\r\n .css(\"display\", function () {\r\n if (i == 0 || i == range) {\r\n return \"inline\";\r\n } else {\r\n return \"none\";\r\n }\r\n })\r\n .appendTo($slider);\r\n }\r\n\r\n d3.selectAll(\".ui-slider-svg\").moveToFront();\r\n\r\n return;\r\n}", "function make_x_gridlines() {\n\t return d3.axisBottom(x)\n\t\t.ticks(11)\n\t}", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle)/ (d.value );\n return d3.range(0, d.value, 1).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 1 ? null : v \n };\n });\n}", "function make_x_gridlines() {\n\t\treturn d3.axisBottom(xScale)\n\t\t\t.ticks(5)\n\t}", "setLeftEmptyBarCount (barCount) {\n if (!isNumber(barCount) || barCount < 0) {\n logWarn('setLeftEmptyBarCount', 'barCount', 'barCount must be a number and greater than zero!!!')\n return\n }\n this._chartPane.chartData().setLeftEmptyBarCount(Math.ceil(barCount))\n }", "function layoutSingleSeries(seriesModel, offset, boxWidth) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var dimensions = seriesModel.dimensions;\n var chartLayout = seriesModel.get('layout');\n var halfWidth = boxWidth / 2;\n\n data.each(dimensions, function () {\n var args = arguments;\n var dimLen = dimensions.length;\n var axisDimVal = args[0];\n var idx = args[dimLen];\n var variableDim = chartLayout === 'horizontal' ? 0 : 1;\n var constDim = 1 - variableDim;\n\n var median = getPoint(args[3]);\n var end1 = getPoint(args[1]);\n var end5 = getPoint(args[5]);\n var whiskerEnds = [\n [end1, getPoint(args[2])],\n [end5, getPoint(args[4])]\n ];\n layEndLine(end1);\n layEndLine(end5);\n layEndLine(median);\n\n var bodyEnds = [];\n addBodyEnd(whiskerEnds[0][1], 0);\n addBodyEnd(whiskerEnds[1][1], 1);\n\n data.setItemLayout(idx, {\n chartLayout: chartLayout,\n initBaseline: median[constDim],\n median: median,\n bodyEnds: bodyEnds,\n whiskerEnds: whiskerEnds\n });\n\n function getPoint(val) {\n var p = [];\n p[variableDim] = axisDimVal;\n p[constDim] = val;\n var point;\n if (isNaN(axisDimVal) || isNaN(val)) {\n point = [NaN, NaN];\n }\n else {\n point = coordSys.dataToPoint(p);\n point[variableDim] += offset;\n }\n return point;\n }\n\n function addBodyEnd(point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[variableDim] += halfWidth;\n point2[variableDim] -= halfWidth;\n start\n ? bodyEnds.push(point1, point2)\n : bodyEnds.push(point2, point1);\n }\n\n function layEndLine(endCenter) {\n var line = [endCenter.slice(), endCenter.slice()];\n line[0][variableDim] -= halfWidth;\n line[1][variableDim] += halfWidth;\n whiskerEnds.push(line);\n }\n });\n }", "getScales(data) {\n let positionScale = d3.scaleBand()\n .domain(data.map(d => d[this.categoricalColumn]))\n .range([0, this.BAR_CHART_WIDTH])\n .padding(0.1)\n\n let yScale = d3.scaleLinear() \n .domain([0, d3.max(data.map(d => d3.sum(d[this.numericalColumn].split(\"-\").map(k => +k))))])\n .range([this.BAR_CHART_HEIGHT, 0])\n \n return {positionScale, yScale}\n }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: d.value\n };\n });\n }", "function make_x_gridlines() {\n return d3.axisBottom(xScale).ticks(10);\n}", "function getSmartTicks(val) {\n // Base step between nearby two ticks\n var step = Math.pow(10, Math.trunc(val).toString().length - 1);\n\n // Modify steps either: 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000...\n if (val / step < 2) {\n step = step / 5;\n } else if (val / step < 5) {\n step = step / 2;\n }\n\n // Add one more step if the last tick value is the same as the max value\n // If you don't want to add, remove \"+1\"\n var slicesCount = Math.ceil((val + 1) / step);\n\n return {\n endPoint: slicesCount * step,\n count: Math.min(10, slicesCount), //show max 10 ticks\n };\n }", "function make_x_gridlines() { \n return d3.axisBottom(x)\n .ticks(10)\n }", "createVisualBoundaries() {\n this.groups.forEach(item => {\n if (item.id != ID_GROUP_TOTAL) {\n this.items.add({\n group: item.id,\n start: item.end,\n end: item.end,\n type: \"background\"\n });\n }\n });\n }", "_calculateTickInterval() {\n const that = this;\n let intervals = that._tickIntervalHandler.getInterval('linear', that._drawMin, that._drawMax, that.$.track, that.logarithmicScale);\n\n if (intervals.major !== that._majorTicksInterval) {\n that._intervalHasChanged = true;\n that._majorTicksInterval = intervals.major;\n }\n else {\n that._intervalHasChanged = true;\n }\n\n that._minorTicksInterval = intervals.minor;\n\n if (that.mode === 'date') {\n that._calculateDateInterval(intervals.major);\n }\n }", "function make_x_gridlines() {\n return d3.axisBottom(x)\n .ticks(5)\n }" ]
[ "0.60392827", "0.60314906", "0.6030362", "0.59701616", "0.59503067", "0.5904751", "0.58438474", "0.58438474", "0.58438474", "0.5722795", "0.57056075", "0.55909246", "0.5581331", "0.55562097", "0.5527876", "0.5527876", "0.5527876", "0.5527876", "0.5525694", "0.5498436", "0.54696405", "0.5331182", "0.5324092", "0.5307043", "0.52011555", "0.51666623", "0.51509976", "0.5086541", "0.5077502", "0.50688165", "0.5054178", "0.50484264", "0.50484264", "0.50484264", "0.50484264", "0.50484264", "0.50484264", "0.5033713", "0.50248826", "0.5024155", "0.5018491", "0.50129026", "0.50062394", "0.5001915", "0.49985763", "0.49882165", "0.49882165", "0.4982818", "0.49803057", "0.49654976", "0.49603796", "0.49479607", "0.49416485", "0.49253535", "0.49204913", "0.4912727", "0.49057242", "0.4900901", "0.48925415", "0.48888254", "0.48874414", "0.48801878", "0.48753193", "0.4856402", "0.48401812", "0.4837558", "0.4826936", "0.48262662", "0.48166174", "0.4807523", "0.48035628", "0.4803417", "0.47945714", "0.47871703", "0.47805047", "0.47746822", "0.47743735", "0.4774043", "0.47617397", "0.47423565", "0.47403416", "0.47399095", "0.47344396", "0.47327715", "0.47224623", "0.4716007", "0.47154367", "0.47141686", "0.4711151", "0.47109354", "0.4710179", "0.4709627", "0.4704685", "0.47026402", "0.46994543", "0.4695368", "0.46916243", "0.46878135", "0.46820545" ]
0.5525234
20
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. TODO clockwise
function Radar(radarModel, ecModel, api) { this._model = radarModel; /** * Radar dimensions * @type {Array.<string>} */ this.dimensions = []; this._indicatorAxes = zrUtil.map(radarModel.getIndicatorModels(), function (indicatorModel, idx) { var dim = 'indicator_' + idx; var indicatorAxis = new IndicatorAxis(dim, indicatorModel.get('axisType') === 'log' ? new LogScale() : new IntervalScale()); indicatorAxis.name = indicatorModel.get('name'); // Inject model and axis indicatorAxis.model = indicatorModel; indicatorModel.axis = indicatorAxis; this.dimensions.push(dim); return indicatorAxis; }, this); this.resize(radarModel, api); /** * @type {number} * @readOnly */ this.cx; /** * @type {number} * @readOnly */ this.cy; /** * @type {number} * @readOnly */ this.r; /** * @type {number} * @readOnly */ this.r0; /** * @type {number} * @readOnly */ this.startAngle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get FREE_ROTATION() { return 1; }", "static get TWO_ANGLE_ROTATION() { return 0; }", "extractSlice(requestedOrientation,index){\n\n }", "isRotateSupported() {\n return true;\n }", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "getRotation() {\nreturn this.rotation;\n}", "constructor(context) {\n this._context = context;\n this._splitter = this._context.createChannelSplitter(4);\n this._inX = this._context.createGain();\n this._inY = this._context.createGain();\n this._inZ = this._context.createGain();\n this._m0 = this._context.createGain();\n this._m1 = this._context.createGain();\n this._m2 = this._context.createGain();\n this._m3 = this._context.createGain();\n this._m4 = this._context.createGain();\n this._m5 = this._context.createGain();\n this._m6 = this._context.createGain();\n this._m7 = this._context.createGain();\n this._m8 = this._context.createGain();\n this._outX = this._context.createGain();\n this._outY = this._context.createGain();\n this._outZ = this._context.createGain();\n this._merger = this._context.createChannelMerger(4);\n // ACN channel ordering: [1, 2, 3] => [X, Y, Z]\n // X (from channel 1)\n this._splitter.connect(this._inX, 1);\n // Y (from channel 2)\n this._splitter.connect(this._inY, 2);\n // Z (from channel 3)\n this._splitter.connect(this._inZ, 3);\n this._inX.gain.value = -1;\n this._inY.gain.value = -1;\n this._inZ.gain.value = -1;\n // Apply the rotation in the world space.\n // |X| | m0 m3 m6 | | X * m0 + Y * m3 + Z * m6 | | Xr |\n // |Y| * | m1 m4 m7 | = | X * m1 + Y * m4 + Z * m7 | = | Yr |\n // |Z| | m2 m5 m8 | | X * m2 + Y * m5 + Z * m8 | | Zr |\n this._inX.connect(this._m0);\n this._inX.connect(this._m1);\n this._inX.connect(this._m2);\n this._inY.connect(this._m3);\n this._inY.connect(this._m4);\n this._inY.connect(this._m5);\n this._inZ.connect(this._m6);\n this._inZ.connect(this._m7);\n this._inZ.connect(this._m8);\n this._m0.connect(this._outX);\n this._m1.connect(this._outY);\n this._m2.connect(this._outZ);\n this._m3.connect(this._outX);\n this._m4.connect(this._outY);\n this._m5.connect(this._outZ);\n this._m6.connect(this._outX);\n this._m7.connect(this._outY);\n this._m8.connect(this._outZ);\n // Transform 3: world space to audio space.\n // W -> W (to channel 0)\n this._splitter.connect(this._merger, 0, 0);\n // X (to channel 1)\n this._outX.connect(this._merger, 0, 1);\n // Y (to channel 2)\n this._outY.connect(this._merger, 0, 2);\n // Z (to channel 3)\n this._outZ.connect(this._merger, 0, 3);\n this._outX.gain.value = -1;\n this._outY.gain.value = -1;\n this._outZ.gain.value = -1;\n this.setRotationMatrix3(mat3.identity(mat3.create()));\n // input/output proxy.\n this.input = this._splitter;\n this.output = this._merger;\n }", "private internal function m248() {}", "getDefaultPose() {\nreturn CASFrame.create(0, 40, this.defaultPose, null);\n}", "function DeviceOrientationControlMethod() {\n this._dynamics = {\n yaw: new Marzipano.Dynamics(),\n pitch: new Marzipano.Dynamics()\n };\n\n this._deviceOrientationHandler = this._handleData.bind(this);\n\n if (window.DeviceOrientationEvent) {\n window.addEventListener('deviceorientation', this._deviceOrientationHandler);\n } else {\n alert('DeviceOrientationEvent not defined');\n }\n\n this._previous = {};\n this._current = {};\n this._tmp = {};\n\n this._getPitchCallbacks = [];\n}", "get Android() {}", "componentDidMount() {\n // For Dimention Changing Runtime Responsiveness\n AddOrientation(this);\n }", "getLocalRot() {\nreturn this.localRot;\n}", "rotateImage() {\n let newRotation = this.state.rotation + 90;\n if(newRotation >= 360) {newRotation = 0;}\n this.setState({rotation: newRotation,})\n\n }", "rotate(rotateAmount) {\n }", "getCameraMatrix() {\n ...\n }", "get direction() {\n return {\n 37: -1,\n 38: -1,\n 39: 1,\n 40: 1\n };\n }", "componentDidMount() {\n AddOrientation(this);\n }", "componentDidMount() {\n AddOrientation(this);\n }", "componentDidMount() {\n AddOrientation(this);\n }", "get baseRotationDegree() { return this._baseRotation * 180.0 / Math.PI; }", "constructor(d, audioCtx, source, muted=true, dir=\"vertical\") {\n this.clipping = false;\n this.lastClip = 0;\n this.clipLag = 250;\n this.clipLevel = 250;\n this.mode = MeterMode.RMS;\n this.klipKludge = 0;\n\n this.analyser = audioCtx.createAnalyser();\n this.analyser.fftSize = 256;\n this.analyser.smoothingTimeConstant = 0.8;\n\n this.bufferLength = 128; // this.analyser.frequencyBinCount;\n this.dataArray = new Uint8Array(this.bufferLength);\n //this.dataArray = new Float32Array(this.bufferLength);\n\n\tsource.connect(this.analyser);\n // this.canvas = document.createElement(\"canvas\");\n this.canvas = document.createElement(\"div\");\n this.canvas.setAttribute(\"id\", \"audioCanvas\"+canvases++);\n this.canvas.classList.add(\"audioCanvas\");\n\n //this.canvas.width = d.offsetWidth - 4;\n //this.canvas.height = d.offsetHeight - 26;\n\n // this.canvas.style.position = \"absolute\"\n this.canvas.style.width = d.offsetWidth - 4 +\"px\";\n this.canvas.style.height = d.offsetHeight - 26 +\"px\";\n\n this.height = d.offsetHeight;\n\n //this.canvasCtx = this.canvas.getContext(\"2d\");\n this.dir = dir;\n if (this.dir === \"vertical\") {\n //this.canvas.style.opacity = 0.9;\n }\n if (d) {\n d.appendChild(this.canvas);\n }\n\n this.volume = 0;\n this.averaging = 0.95;\n //this.image = new Image(this.canvas.width, this.canvas.height);\n //this.image.src = \"./images/microphone.png\";\n // this.image.onload = () => this.draw;\n this.draw();\n this.muted = muted;\n }", "function example3() {try {kony.accelerometer.retrieveCurrentAcceleration(onSuccessCallback, onFailureCallback);} catch (err) {alert(\"Accelerometer not supported\");}}", "constructor(props){\n super(props);\n this.state={\n rotation: 0,\n stop: 0,\n \n\n\n }\n this.tick=this.tick.bind(this);\n\n\n }", "_updateInitialRotation() {\n this.arNodeRef.getTransformAsync().then((retDict)=>{\n let rotation = retDict.rotation;\n let absX = Math.abs(rotation[0]);\n let absZ = Math.abs(rotation[2]);\n\n let yRotation = (rotation[1]);\n\n // If the X and Z aren't 0, then adjust the y rotation.\n if (absX > 1 && absZ > 1) {\n yRotation = 180 - (yRotation);\n }\n\n this.setState({\n markerRotation: [0,yRotation,0],\n shouldBillboard : false,\n });\n });\n }", "function v(){var t=_();return 90===h._viewrotation||270===h._viewrotation?C(t):t}", "getEmptyPose() {\nreturn CASFrame.create(0, 40, [], null);\n}", "function SimpleRotator(canvas, callback, viewDirectionVector, viewUpVector, viewDistance) {\n var unitx = new Array(3);\n var unity = new Array(3);\n var unitz = new Array(3);\n var viewZ;\n this.setView = function( viewDirectionVector, viewUpVector, viewDistance ) {\n var viewpoint = viewDirectionVector || [0,0,10];\n var viewup = viewUpVector || [0,1,0];\n\tif (viewDistance && typeof viewDistance == \"number\")\n\t viewZ = viewDistance;\n\telse\n\t viewZ = length(viewpoint);\n copy(unitz,viewpoint);\n normalize(unitz, unitz);\n copy(unity,unitz);\n scale(unity, unity, dot(unitz,viewup));\n subtract(unity,viewup,unity);\n normalize(unity,unity);\n cross(unitx,unity,unitz);\n }\n this.getViewMatrix = function (){\n return new Float32Array( this.getViewMatrixArray() );\n }\n this.getViewMatrixArray = function() {\n\treturn [ unitx[0], unity[0], unitz[0], 0,\n unitx[1], unity[1], unitz[1], 0, \n unitx[2], unity[2], unitz[2], 0,\n\t 0, 0, -viewZ, 1 ];\n }\n this.getViewDistance = function() {\n\treturn viewZ;\n }\n this.setViewDistance = function(viewDistance) {\n\tviewZ = viewDistance;\n }\n function applyTransvection(e1, e2) { // rotate vector e1 onto e2\n function reflectInAxis(axis, source, destination) {\n \tvar s = 2 * (axis[0] * source[0] + axis[1] * source[1] + axis[2] * source[2]);\n\t\t destination[0] = s*axis[0] - source[0];\n\t\t destination[1] = s*axis[1] - source[1];\n\t\t destination[2] = s*axis[2] - source[2];\n }\n normalize(e1,e1);\n normalize(e2,e2);\n var e = [0,0,0];\n add(e,e1,e2);\n normalize(e,e);\n var temp = [0,0,0];\n reflectInAxis(e,unitz,temp);\n\treflectInAxis(e1,temp,unitz);\n\treflectInAxis(e,unitx,temp);\n\treflectInAxis(e1,temp,unitx);\n\treflectInAxis(e,unity,temp);\n\treflectInAxis(e1,temp,unity);\n }\n var centerX = canvas.width/2;\n var centerY = canvas.height/2;\n var radius = Math.min(centerX,centerY);\n var radius2 = radius*radius;\n var prevx,prevy;\n var prevRay = [0,0,0];\n var dragging = false;\n function doMouseDown(evt) {\n if (dragging)\n return;\n dragging = true;\n document.addEventListener(\"mousemove\", doMouseDrag, false);\n document.addEventListener(\"mouseup\", doMouseUp, false);\n var box = canvas.getBoundingClientRect();\n prevx = window.pageXOffset + evt.clientX - box.left;\n prevy = window.pageYOffset + evt.clientY - box.top;\n }\n function doMouseDrag(evt) {\n if (!dragging)\n return;\n var box = canvas.getBoundingClientRect();\n var x = window.pageXOffset + evt.clientX - box.left;\n var y = window.pageYOffset + evt.clientY - box.top;\n var ray1 = toRay(prevx,prevy);\n var ray2 = toRay(x,y);\n applyTransvection(ray1,ray2);\n prevx = x;\n prevy = y;\n\tif (callback) {\n\t\ttheta -= 0.5; //*** theta must be decremented to compensate for the increment caused by the render callback (every 0.1 sec)\n\t callback();\n\t\t\n\t}\n }\n function doMouseUp(evt) {\n if (dragging) {\n document.removeEventListener(\"mousemove\", doMouseDrag, false);\n document.removeEventListener(\"mouseup\", doMouseUp, false);\n\t dragging = false;\n }\n }\n function doTouchDown(evt) { //--- function added to handle touch events\n if (dragging)\n return;\n dragging = true;\n document.addEventListener(\"touchmove\", doTouchMove, false);\n document.addEventListener(\"touchend\", doTouchEnd, false);\n var box = canvas.getBoundingClientRect();\n prevx = window.pageXOffset + evt.changedTouches[0].clientX - box.left;\n prevy = window.pageYOffset + evt.changedTouches[0].clientY - box.top;\n }\n function doTouchMove(evt) { //--- function added to handle touch events\n if (!dragging)\n return;\n var box = canvas.getBoundingClientRect();\n var x = window.pageXOffset + evt.changedTouches[0].clientX - box.left;\n var y = window.pageYOffset + evt.changedTouches[0].clientY - box.top;\n var ray1 = toRay(prevx,prevy);\n var ray2 = toRay(x,y);\n applyTransvection(ray1,ray2);\n prevx = x;\n prevy = y;\n\tif (callback) {\n\t\ttheta -= 0.5; //*** theta must be decremented to compensate for the increment caused by the render callback (every 0.1 sec)\n\t callback();\n\t\t\n\t}\n }\n function doTouchEnd(evt) { //--- function added to handle touch events\n if (dragging) {\n document.removeEventListener(\"mousemove\", doTouchMove, false);\n document.removeEventListener(\"mouseup\", doTouchEnd, false);\n\t dragging = false;\n }\n }\n\n function toRay(x,y) {\n var dx = x - centerX;\n var dy = centerY - y;\n var vx = dx * unitx[0] + dy * unity[0]; // The mouse point as a vector in the image plane.\n var vy = dx * unitx[1] + dy * unity[1];\n var vz = dx * unitx[2] + dy * unity[2];\n var dist2 = vx*vx + vy*vy + vz*vz;\n if (dist2 > radius2) {\n return [vx,vy,vz];\n }\n else {\n var z = Math.sqrt(radius2 - dist2);\n return [vx+z*unitz[0], vy+z*unitz[1], vz+z*unitz[2]];\n }\n }\n function dot(v,w) {\n\treturn v[0]*w[0] + v[1]*w[1] + v[2]*w[2];\n }\n function length(v) {\n\treturn Math.sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);\n }\n function normalize(v,w) {\n\tvar d = length(w);\n\tv[0] = w[0]/d;\n\tv[1] = w[1]/d;\n\tv[2] = w[2]/d;\n }\n function copy(v,w) {\n\tv[0] = w[0];\n\tv[1] = w[1];\n\tv[2] = w[2];\n }\n function add(sum,v,w) {\n\tsum[0] = v[0] + w[0];\n\tsum[1] = v[1] + w[1];\n\tsum[2] = v[2] + w[2];\n }\n function subtract(dif,v,w) {\n\tdif[0] = v[0] - w[0];\n\tdif[1] = v[1] - w[1];\n\tdif[2] = v[2] - w[2];\n }\n function scale(ans,v,num) {\n\tans[0] = v[0] * num;\n\tans[1] = v[1] * num;\n\tans[2] = v[2] * num;\n }\n function cross(c,v,w) {\n\tvar x = v[1]*w[2] - v[2]*w[1];\n\tvar y = v[2]*w[0] - v[0]*w[2];\n\tvar z = v[0]*w[1] - v[1]*w[0];\n\tc[0] = x;\n\tc[1] = y;\n\tc[2] = z;\n }\n this.setView(viewDirectionVector, viewUpVector, viewDistance);\n canvas.addEventListener(\"mousedown\", doMouseDown, false);\n canvas.addEventListener(\"touchstart\", doTouchDown, false); //--- line added to handle touch screen events\n}", "componentDidMount() {\n Orientation.addOrientationListener(this.orientationDidChange);\n }", "rotateLeft(value){\n let rotation = value / 90;\n this.facing = (this.facing + rotation) % 4\n }", "applyRotation() {\n this.forwardFacing[0] = Math.sin(this.xzAngle) * Math.cos(this.yzAngle);\n this.forwardFacing[1] = Math.sin(this.yzAngle);\n this.forwardFacing[2] = Math.cos(this.xzAngle) * Math.cos(this.yzAngle);\n\n this.rightFacing[0] = Math.cos(this.xzAngle);\n this.rightFacing[1] = 0\n this.rightFacing[2] = -Math.sin(this.xzAngle);\n\n this.upFacing[0] = -Math.sin(this.xzAngle) * Math.sin(this.yzAngle);\n this.upFacing[1] = Math.cos(this.yzAngle);\n this.upFacing[2] = -Math.cos(this.xzAngle) * Math.sin(this.yzAngle);\n }", "rot() {\nreturn this._r;\n}", "function yFirstAccelerometer()\n{\n return YAccelerometer.FirstAccelerometer();\n}", "getInvInitRotX() {\nreturn this.inverseInitRotationX;\n}", "rotation() {\n return this.rotationInRadians().map(VrMath.radToDeg);\n }", "getCameraStart() {\n return 5;\n }", "rotateAntiClockwise()\r\n {\r\n this.rotation -= Math.PI / 180;\r\n }", "ensureClockwise() {\n let vectorsRelativeToCenter = [];\n let headingValues = [];\n for (let v of this.pixelVectorPositions) {\n vectorsRelativeToCenter.push(p5.Vector.sub(v, this.center));\n }\n\n\n for (let v of vectorsRelativeToCenter) {\n let temp = v.heading();\n if (temp < 0) {\n temp += 2 * PI;\n }\n\n headingValues.push(temp);\n }\n //print(headingValues);\n\n let rotationalDifferenceTotal = 0;\n for (let i = 0; i < headingValues.length; i++) {\n let difference = 0;\n if (i === headingValues.length - 1) {\n difference = headingValues[0] - headingValues[i];\n } else {\n difference = headingValues[i + 1] - headingValues[i];\n }\n if (difference > 0) {\n rotationalDifferenceTotal += 1;\n } else {\n rotationalDifferenceTotal -= 1;\n }\n }\n\n if (rotationalDifferenceTotal < 0) {\n this.pixelVectorPositions.reverse();\n }\n }", "rotate(e3v) {\nRQ.rotateV3(e3v.xyz, e3v.xyz, this.xyzw);\nreturn e3v;\n}", "constructor(props) {\n super(props);\n\n this.state = {\n open: false,\n playing: false,\n slash: true,\n dragging: false,\n loadingProgress: 0,\n loadingSamples: true,\n currentTableIndex: 4,\n gate: 0.2,\n vol: 100,\n bpm: 120,\n instructionStage: 0,\n waitingServer: false,\n screen: {\n width: window.innerWidth,\n height: window.innerHeight,\n ratio: window.devicePixelRatio || 1,\n },\n };\n\n this.audioManager = new AudioManager((i) => {\n this.handleLoadingSamples(i);\n }),\n\n this.canvas = [];\n this.matrix = [];\n this.rawMatrix = [];\n this.beat = 0;\n this.diffMatrix = [];\n this.diffAnimationAlpha = 0;\n\n this.serverUrl = 'http://musicai.citi.sinica.edu.tw/drumvae/';\n // this.serverUrl = 'http://140.109.16.227:5002/';\n // this.serverUrl = 'http://140.109.135.76:5010/';\n\n // animation\n this.TWEEN = TWEEN;\n this.pauseChangeMatrix = false;\n }", "get baseRotation() { return this._baseRotation; }", "getTransformation() {\n let globalUp = vec3.fromValues(0, 0, 1);\n let direction = vec3.fromValues(0, 0, 0);\n vec3.subtract(direction, this.p2.position, this.p1.position);\n let angleRadians = this.getCounterClockwiseAngle(globalUp, direction);\n let globalRotate = vec3.fromValues(0, 1, 0);\n let rotationQuat = quat.create();\n quat.setAxisAngle(rotationQuat, globalRotate, angleRadians);\n let translate = this.midpoint();\n let scaleX = this.isHighway ? 15 : 5;\n let scaleY = 1;\n let scaleZ = vec3.length(direction);\n let scaleVector = vec3.fromValues(scaleX, scaleY, scaleZ);\n let transformationMat = mat4.create();\n mat4.fromRotationTranslationScale(transformationMat, rotationQuat, translate, scaleVector);\n return transformationMat;\n }", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "get trackRotation() {\n return this._trackRotation;\n }", "rotate(axis, angle) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n\n let xx = x * x;\n let yy = y * y;\n let zz = z * z;\n let c = Math.cos(angle);\n let s = Math.sin(angle);\n let oneMinusCosine = 1 - c;\n\n let r00 = xx + (1 - xx) * c;\n let r01 = x * y * oneMinusCosine + z * s;\n let r02 = x * z * oneMinusCosine - y * s;\n let r10 = x * y * oneMinusCosine - z * s;\n let r11 = yy + (1 - yy) * c;\n let r12 = y * z * oneMinusCosine + x * s;\n let r20 = x * z * oneMinusCosine + y * s;\n let r21 = y * z * oneMinusCosine - x * s;\n let r22 = zz + (1 - zz) * c;\n\n let m00 = this._matrix[0 * 4 + 0];\n let m01 = this._matrix[0 * 4 + 1];\n let m02 = this._matrix[0 * 4 + 2];\n let m03 = this._matrix[0 * 4 + 3];\n let m10 = this._matrix[1 * 4 + 0];\n let m11 = this._matrix[1 * 4 + 1];\n let m12 = this._matrix[1 * 4 + 2];\n let m13 = this._matrix[1 * 4 + 3];\n let m20 = this._matrix[2 * 4 + 0];\n let m21 = this._matrix[2 * 4 + 1];\n let m22 = this._matrix[2 * 4 + 2];\n let m23 = this._matrix[2 * 4 + 3];\n\n this._matrix[0] = r00 * m00 + r01 * m10 + r02 * m20;\n this._matrix[1] = r00 * m01 + r01 * m11 + r02 * m21;\n this._matrix[2] = r00 * m02 + r01 * m12 + r02 * m22;\n this._matrix[3] = r00 * m03 + r01 * m13 + r02 * m23;\n this._matrix[4] = r10 * m00 + r11 * m10 + r12 * m20;\n this._matrix[5] = r10 * m01 + r11 * m11 + r12 * m21;\n this._matrix[6] = r10 * m02 + r11 * m12 + r12 * m22;\n this._matrix[7] = r10 * m03 + r11 * m13 + r12 * m23;\n this._matrix[8] = r20 * m00 + r21 * m10 + r22 * m20;\n this._matrix[9] = r20 * m01 + r21 * m11 + r22 * m21;\n this._matrix[10] = r20 * m02 + r21 * m12 + r22 * m22;\n this._matrix[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n return this._matrix;\n }", "get Acceleration() {}", "angle () {\n \treturn Math.atan2(this.y,this.x );\n }", "GetDirection()\n {\n //AddStatus(\"Entering GetDirection\");\n let x=this.x;\n if(x==0)x=.00000000001;\n let dir=(Math.atan(this.y/x))/this.toRadian;\n //AddStatus(dir);\n if (x<0)dir+=180;\n if (x>0 && this.y<0)dir+=360;\n //AddStatus(dir);\n return dir;\n }", "onNativePause() {\n\t\t//TODO: Implement this if required\n\t}", "static create() {\nreturn this.from_xyzw(0, 0, 0, 1);\n}", "function PositionSensorVRDevice() {\n\t}", "setFromAxisRotations(roll, pitch, yaw) {\nvar D2R_BY2, RPY_by2, cp, cr, cy, cycp, cysp, rpy, rpyb2, sp, sr, sy, sycp, sysp;\n//-------------------\n// The Euler-angle-to-axis bindings,and the order in which\n// the Euler angle rotations are applied are:\n// X-roll ; Y-pitch ; Z-yaw .\n// [See note below on the orientation of the notional craft.]\n// Hence to get the required quaternion components, we\n// compute the quaternion product:\n// Q-yaw x Q-pitch x Q-roll .\n// NB\n// These axis bindings assume a notional craft lying in\n// the XY-plane, with its body lying along the X-axis\n// (facing +X), with +Y on its right/starboard side, and\n// with +Z _below_ it.\n// For a craft with this orientation, an increase in ROLL\n// (from 0) dips the right/starboard wing, an increase in\n// PITCH raises the nose, and an increase in YAW turns the\n// nose to the right/starboard.\nD2R_BY2 = RQ.DEGS_TO_RADS / 2;\n// Angles of rotation by 2 (i.e quaternion angles) in radians, and\n// the cosines and sines of these half-angles.\nRPY_by2 = (function() {\nvar j, len, ref, results;\nref = [roll, pitch, yaw];\nresults = [];\nfor (j = 0, len = ref.length; j < len; j++) {\nrpy = ref[j];\nresults.push(rpy * D2R_BY2);\n}\nreturn results;\n})();\n[cr, cp, cy] = (function() {\nvar j, len, results;\nresults = [];\nfor (j = 0, len = RPY_by2.length; j < len; j++) {\nrpyb2 = RPY_by2[j];\nresults.push(Math.cos(rpyb2));\n}\nreturn results;\n})();\n[sr, sp, sy] = (function() {\nvar j, len, results;\nresults = [];\nfor (j = 0, len = RPY_by2.length; j < len; j++) {\nrpyb2 = RPY_by2[j];\nresults.push(Math.sin(rpyb2));\n}\nreturn results;\n})();\n// Compute components of Q-yaw (Z) x Q-pitch (Y)\n[cycp, sysp, sycp, cysp] = [cy * cp, sy * sp, sy * cp, cy * sp];\n// Finally, compute the product of the three axis-rotation quaternions:\n// (cy; 0 0 sy) * (cp; 0 sp 0) * (cr; sr 0 0)\nreturn this.set_xyzw(cycp * sr - sysp * cr, cysp * cr + sycp * sr, sycp * cr - cysp * sr, cycp * cr + sysp * sr);\n}", "encryptBuffers() {\n //\n }", "function getImageAudio_DataIndex() {\n\treturn 4; \n}", "_onRotate(rotateState, rotationFactor, source) {\n\n if (rotateState == 3) {\n this.setState({\n rotation : [this.state.rotation[0], this.state.rotation[1] + rotationFactor, this.state.rotation[2]]\n });\n //this.props.onClickStateCallback(this.props.modelIDProps.uuid, rotateState, UIConstants.LIST_MODE_MODEL);\n return;\n }\n\n this.arNodeRef.setNativeProps({rotation:[this.state.rotation[0], this.state.rotation[1] + rotationFactor, this.state.rotation[2]]});\n \n }", "getCamForward()\n {\n return this.game.camera.getWorldDirection();\n /*\n var cam = this.game.camera;\n var vL = new THREE.Vector3(0,0,-1);\n var vW = vL.applyMatrix4(cam.matrixWorld);\n vW.sub(cam.position).normalize();\n return vW;\n */\n }", "function OnStart() {\n //Create the frame for the diagnostic data to be shown on\n lay_diag = app.CreateLayout(\"linear\");\n diag_text_voltage = app.CreateText(\"Voltage: \");\n diag_text_current = app.CreateText(\"Current: \");\n lay_diag.AddChild(diag_text_voltage);\n lay_diag.AddChild(diag_text_current);\n //Create a layout with objects vertically centered.\n lay = app.CreateLayout(\"linear\", \"VCenter,FillXY\");\n\n btn = app.CreateButton(\"Connect\", 0.4, 0.15);\n btn.SetOnTouch(btn_OnTouch);\n lay.AddChild(btn);\n\n text = app.CreateText(\"Speed\")\n lay.AddChild(text);\n\n skb = app.CreateSeekBar(0.8);\n skb.SetRange(1000);\n skb.SetValue(500);\n skb.SetOnTouch(skb_OnTouch);\n lay.AddChild(skb);\n\n text1 = app.CreateText(\"Angle\")\n lay.AddChild(text1);\n\n skb1 = app.CreateSeekBar(0.8);\n skb1.SetRange(1800);\n skb1.SetValue(900);\n skb1.SetOnTouch(skb1_OnTouch);\n lay.AddChild(skb1);\n\n //Add layout to app. \n app.AddLayout(lay);\n app.AddLayout(lay_diag);\n\n //Create Bluetooth serial object. \n bt = app.CreateBluetoothSerial();\n bt.SetOnConnect(bt_OnConnect);\n bt.SetOnReceive(bt_OnReceive);\n bt.SetSplitMode(\"End\", \"\\n\");\n\n //Create the stop button\n stop_btn = app.CreateButton(\"STOP\", 0.4, 0.15, \"lego\");\n stop_btn.SetOnTouch(stop_btn_OnTouch);\n lay.AddChild(stop_btn);\n}", "function orientationDevice(_callback){\n \n navigator.compass.getCurrentHeading(\n\n function(heading){ hd = heading.magneticHeading;\n _callback(hd);\n //biba = 300;\n },\n function(error){ alert('CompassError: ' + error.code);}\n );\n\n //return hd;\n }//Ende of orientationDevice", "static get acceleration() {}", "ensureClockwise() {\n let vectorsRelativeToCenter = [];\n let headingValues = [];\n for (var v of this.pixelVectorPositions) {\n vectorsRelativeToCenter.push(p5.Vector.sub(v, this.center));\n }\n\n\n for (var v of vectorsRelativeToCenter) {\n let temp = v.heading();\n if (temp < 0) {\n temp += 2 * PI;\n }\n\n headingValues.push(temp);\n }\n\n\n let rotationalDifferenceTotal = 0;\n for (var i = 0; i < headingValues.length; i++) {\n let difference = 0;\n if (i == headingValues.length - 1) {\n difference = headingValues[0] - headingValues[i];\n } else {\n difference = headingValues[i + 1] - headingValues[i];\n }\n if (difference > 0) {\n rotationalDifferenceTotal += 1;\n } else {\n rotationalDifferenceTotal -= 1;\n }\n }\n\n if (rotationalDifferenceTotal < 0) {\n this.pixelVectorPositions.reverse();\n }\n }", "get orientation() {\n return this._orientation;\n }", "function Plane() {\n const { ref, playState, getAnimation } = useWebAnimations({\n keyframes: [\n { transform: \"translate(0,45vh) rotate(0deg)\" },\n { transform: \"translate(15vw,45vh) rotate(0deg)\" }, //\n\n { transform: \"translate(20vw,30vh) rotate(-40deg)\" }, //12312312\n { transform: \"translate(25vw,20vh) rotate(-25deg)\" }, // 23\n { transform: \"translate(30vw,17vh) rotate(-10deg)\" },\n { transform: \"translate(45vw,15vh) rotate(0deg)\" },\n { transform: \"translate(50vw,15vh) rotate(0deg)\" },\n { transform: \"translate(55vw,15vh) rotate(15deg)\" },\n { transform: \"translate(70vw,30vh) rotate(30deg)\" },\n { transform: \"translate(80vw,35vh) rotate(20deg)\" },\n\n { transform: \"translate(85vw,40vh) rotate(0deg)\" },\n { transform: \"translate(100vw,45vh) rotate(0deg)\" },\n\n ],\n animationOptions: {\n duration: 12000,\n iterations: Infinity,\n }\n });\n\n\n return (\n <div className=\"Main\">\n\n <Header />\n\n <div className=\"plane\" >\n <img ref={ref} src=\"https://raw.githubusercontent.com/MuhammadMohsin/PanacloudBootcamp2020/session_13/Html_sample/plane.gif\" alt=\"Plane\" id=\"plane\" />\n </div>\n\n\n <button onClick={() => { getAnimation().play() }} >Play</button>\n <button onClick={() => { getAnimation().pause() }} >Pause</button>\n <button onClick={() => { getAnimation().updatePlaybackRate(getAnimation().playbackRate * 2) }} >Increase Speed</button>\n <button onClick={() => { getAnimation().updatePlaybackRate(getAnimation().playbackRate * 0.5) }} >Decrease Speed</button>\n <h2 style={{ color: \"white\" }}>Plane is {playState} </h2>\n\n <div className=\"moon\" >\n <img src=\"https://images.pexels.com/photos/821718/pexels-photo-821718.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500\" alt=\"Moon\" id=\"moon\" />\n </div>\n\n </div>\n );\n}", "angle() {\n return this.get(Math.PI * 2, true)\n }", "static createRotation(axis, angle) {\n//--------------\nreturn RQ.setAxisAngleQV(RQ.makeQV(0, 0, 0, 0), axis, angle);\n}", "readSample() {\n return 0;\n }", "function Orientation() {\n\tthis.started = false;\n}", "rotate() {\n const now = Date.now();\n const delta = now - this.lastUpdate;\n this.lastUpdate = now;\n\n this.setState({rotation: this.state.rotation + delta / 20});\n this.frameHandle = requestAnimationFrame(this.rotate);\n }", "function onMotionRawValueChanged(event) {\r\n var v = event.target.value;\r\n\r\n // accel: 6Q10\r\n var _ax = cnvtEndian16(v, 0).getInt16(0);\r\n var ax = toFixedPoint(_ax, 10);\r\n var _ay = cnvtEndian16(v, 2).getInt16(2);\r\n var ay = toFixedPoint(_ay, 10);\r\n var _az = cnvtEndian16(v, 4).getInt16(4);\r\n var az = toFixedPoint(_az, 10);\r\n document.querySelector('#ax').value = ax;\r\n document.querySelector('#ay').value = ay;\r\n document.querySelector('#az').value = az;\r\n\r\n // gyro: 11Q5\r\n var _gx = cnvtEndian16(v, 6).getInt16(6);\r\n var gx = toFixedPoint(_gx, 5);\r\n var _gy = cnvtEndian16(v, 8).getInt16(8);\r\n var gy = toFixedPoint(_gy, 5);\r\n var _gz = cnvtEndian16(v, 10).getInt16(10);\r\n var gz = toFixedPoint(_gz, 5);\r\n document.querySelector('#gx').value = gx;\r\n document.querySelector('#gy').value = gy;\r\n document.querySelector('#gz').value = gz;\r\n\r\n // compass: 12Q4\r\n var _cx = cnvtEndian16(v, 12).getInt16(12);\r\n var cx = toFixedPoint(_cx, 4);\r\n var _cy = cnvtEndian16(v, 14).getInt16(14);\r\n var cy = toFixedPoint(_cy, 4);\r\n var _cz = cnvtEndian16(v, 16).getInt16(16);\r\n var cz = toFixedPoint(_cz, 4);\r\n\r\n document.querySelector('#cx').value = cx;\r\n document.querySelector('#cy').value = cy;\r\n document.querySelector('#cz').value = cz;\r\n\r\n var accel = { x: ax, y: ay, z: az };\r\n appendAccelData(accel);\r\n var gyro = { x: gx, y: gy, z: gz };\r\n appendGyroData(gyro);\r\n var compass = { x: cx, y: cy, z: cz };\r\n appendCompassData(compass);\r\n frames.a += 1;\r\n frames.g += 1;\r\n frames.c += 1;\r\n\r\n save(accel.x.toString() + ',' + accel.y.toString() + ',' + accel.z.toString() +\r\n gyro.x.toString() + ',' + gyro.y.toString() + ',' + gyro.z.toString() +\r\n compass.x.toString() + ',' + compass.y.toString() + ',' + compass.z.toString());\r\n}", "get RightCenter() {}", "constructor() {\n this.m_angles = new math_ds.Vector3();\n this.m_acc = new math_ds.Vector3();\n this.m_gyro_err = new math_ds.Vector3();\n this.m_mag = new math_ds.Vector3();\n this.m_mag_raw = new math_ds.Vector3();\n this.m_mag_local = new math_ds.Vector3();\n\n this.m_fps = 0.0;\n this.m_temp = 0.0;\n this.m_beta = 0.0;\n this.m_zeta = 0.0;\n this.m_neta = 0.0;\n this.m_zeta_mag = 0.0;\n\n this.m_index = 0;\n\n this.m_g = 0;\n this.m_overload = 0;\n this.m_filter_err = new math_ds.Vector3();\n this.m_time = \"\";\n\n\n this.m_orientation_mtx = new math_ds.Matrix3();\n this.m_orientation_mtx.set(-1,0,0, 0,-1,0, 0,0,1);\n }", "counterRotation() {\n let OffsetX = this.x + (this.width/2);\n let OffsetY = this.y + (this.height/2);\n ctx.translate(OffsetX,OffsetY);\n ctx.rotate(-this.spin * Math.PI/180);\n ctx.translate(-OffsetX,-OffsetY);\n }", "canSeek(){\n return (\n this.props.sound && this.props.sound.duration && (\n (this.props.sound.playState != 0 && !this.props.sound.paused) || \n this.props.sound.paused\n )\n );\n }", "static fromRot(axis, angle) {\nvar q;\n//-------\nq = new RQ();\nq.setFromAxisAngle(axis, angle);\nreturn q;\n}", "function isRotation(str1, str2) {\n // your code here\n }", "GetAngle(First, Next) {\n let dRotateAngle = Math.atan2(Math.abs(First.Latitude - Next.Latitude), Math.abs(First.Longitude - Next.Longitude));\n if (Next.Latitude >= First.Latitude) {\n if (Next.Longitude >= First.Longitude) {\n } else {\n dRotateAngle = Math.PI - dRotateAngle;\n }\n } else {\n if (Next.Longitude >= First.Longitude) {\n dRotateAngle = 2 * Math.PI - dRotateAngle;\n } else {\n dRotateAngle = Math.PI + dRotateAngle;\n }\n }\n dRotateAngle = dRotateAngle * 180 / Math.PI;\n return dRotateAngle;\n\n}", "rotate(direction) {\n // let current_heading = []\n // let last_element = current_heading.concat(heading).concat(direction).slice(-1);\n // return this.rotateMap[last_element][direction];\n this.state.heading = this.rotateMap[this.state.heading][direction];\n }", "constructor() {\n super();\n\n this.minDistance = 1;\n this.minDistanceSq = 1;\n this.maxDistance = 10;\n this.maxDistanceSq = 100;\n this.rolloff = 1;\n this.transitionTime = 0.5;\n\n /** @type {InterpolatedPose} */\n this.pose = new InterpolatedPose();\n\n /** @type {Map.<string, InterpolatedPose>} */\n this.users = new Map();\n\n /** @type {Map.<string, InterpolatedPose>} */\n this.clips = new Map();\n\n /**\n * Forwards on the audioActivity of an audio source.\n * @param {AudioActivityEvent} evt\n * @fires AudioManager#audioActivity\n */\n this.onAudioActivity = (evt) => {\n audioActivityEvt.id = evt.id;\n audioActivityEvt.isActive = evt.isActive;\n this.dispatchEvent(audioActivityEvt);\n };\n\n /** @type {AudioContext} */\n this.audioContext = null;\n\n /** @type {BaseListener} */\n this.listener = null;\n\n Object.seal(this);\n }", "get true_position() { return this.position.copy().rotateX(Ribbon.LATITUDE).rotateZ(Earth.rotation).rotateZ(Ribbon.LONGITUDE); }", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "function getSectorRotation(q) {\n return q > 1 && q < 8 ? Math.floor(q / 2) : 0;\n }", "constructor() {\n // we assume that Koala Push 2 is also loaded, or will be, and so start in \n // shared known state\n //this.viewMode = ViewMode.koala;\n this.viewMode = ViewMode.session; \n this.inputMode = InputMode.normal;\n this.stopping = new Set(); // Set<TrackSlotPad>\n this.highlighting = new Set(); // Set<TrackSlotPad>\n this.momentaryInputMode = MomentaryInputMode.none;\n }", "get sweepDegrees() { return Angle_1.Angle.radiansToDegrees(this._radians1 - this._radians0); }", "get Facing() {}", "setRotate(angle, x, y, z){\n let e, s, c, len, rlen, nc, xy, yz, zx, xs, ys, zs;\n\n angle = Math.PI * angle / 180;\n e = this.elements;\n\n s = Math.sin(angle);\n c = Math.cos(angle);\n\n if (0 !== x && 0 === y && 0 === z) {\n // Rotation around X axis\n if (x < 0) {\n s = -s;\n }\n e[0] = 1; e[4] = 0; e[ 8] = 0; e[12] = 0;\n e[1] = 0; e[5] = c; e[ 9] =-s; e[13] = 0;\n e[2] = 0; e[6] = s; e[10] = c; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n } else if (0 === x && 0 !== y && 0 === z) {\n // Rotation around Y axis\n if (y < 0) {\n s = -s;\n }\n e[0] = c; e[4] = 0; e[ 8] = s; e[12] = 0;\n e[1] = 0; e[5] = 1; e[ 9] = 0; e[13] = 0;\n e[2] =-s; e[6] = 0; e[10] = c; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n } else if (0 === x && 0 === y && 0 !== z) {\n // Rotation around Z axis\n if (z < 0) {\n s = -s;\n }\n e[0] = c; e[4] =-s; e[ 8] = 0; e[12] = 0;\n e[1] = s; e[5] = c; e[ 9] = 0; e[13] = 0;\n e[2] = 0; e[6] = 0; e[10] = 1; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n } else {\n // Rotation around another axis\n len = Math.sqrt(x*x + y*y + z*z);\n if (len !== 1) {\n rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n nc = 1 - c;\n xy = x * y;\n yz = y * z;\n zx = z * x;\n xs = x * s;\n ys = y * s;\n zs = z * s;\n\n e[ 0] = x*x*nc + c;\n e[ 1] = xy *nc + zs;\n e[ 2] = zx *nc - ys;\n e[ 3] = 0;\n\n e[ 4] = xy *nc - zs;\n e[ 5] = y*y*nc + c;\n e[ 6] = yz *nc + xs;\n e[ 7] = 0;\n\n e[ 8] = zx *nc + ys;\n e[ 9] = yz *nc - xs;\n e[10] = z*z*nc + c;\n e[11] = 0;\n\n e[12] = 0;\n e[13] = 0;\n e[14] = 0;\n e[15] = 1;\n }\n\n return this;\n }", "getBoneIndex(fourcc) {\nreturn this.boneIndicesBy4CC[fourcc];\n}", "function getDirection(angle) {\n var directions = ['North', 'North-West', 'West', 'South-West', 'South', 'South-East', 'East', 'North-East'];\n return directions[Math.round(((angle %= 360) < 0 ? angle + 360 : angle) / 45) % 8];\n }", "getRotation() {\n var x1 = this.point1.getX();\n var y1 = this.point1.getY();\n var x2 = this.point2.getX();\n var y2 = this.point2.getY();\n return Math.atan2(x2 - x1, y2 - y1);\n }", "function orient(data, p, q, r) {\n var o = (data[q + 1] - data[p + 1]) * (data[r] - data[q]) - (data[q] - data[p]) * (data[r + 1] - data[q + 1]);\n return o > 0 ? 1 :\n o < 0 ? -1 : 0;\n}", "static get DIRECTION_UP() {\n return \"up\";\n }", "componentWillMount() {\n //CodePush.disallowRestart();\n //Alert.alert(\"mounted cool vite OK OK MAINTENANT CA MARCHE !!!!!\");\n/*CodePush.sync(\n{\ndeploymentKey: 'giMb817KrtTFkIuOg4i5ohnEUDyoBJvD1i-VN',\nupdateDialog: true,\ninstallMode: CodePush.InstallMode.IMMEDIATE,\n},\nthis.CodePushStatusDidChange.bind(this),\nthis.CodePushDownloadDidProgress.bind(this)\n);*/\n /* Animated.loop(\n Animated.sequence([\n Animated.timing(this.animatedValue, { toValue: 1, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n Animated.timing(this.animatedValue, { toValue: 0, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n ])).start();*/\n //this.toggleLike(); \n //CodePush.notifyApplicationReady();\n this._onLoadStart();\n }", "rotate() {\n this.direction < 3 ? this.direction++ : (this.direction = 0);\n return RESULTS.DANGER;\n }", "function rtd(r)\n{\n return (r * 180.0) / Math.PI;\n}", "calculateRotationAngle(dy, dx) {\n let theta = Math.atan2(dy, dx);\n this.angle = theta;\n\n //console.log( \"Angle: \"+ this.angle);\n }", "_onCreateStop() {\n this.props.onCreateStop();\n }" ]
[ "0.5294491", "0.5209744", "0.51446456", "0.51192975", "0.4876428", "0.4870541", "0.47322673", "0.47205248", "0.47182938", "0.46515015", "0.46481043", "0.46409717", "0.4629595", "0.46273243", "0.46244168", "0.46191004", "0.46133575", "0.4586382", "0.4586382", "0.4586382", "0.4584324", "0.4583057", "0.45805418", "0.45768306", "0.456409", "0.4558743", "0.45481947", "0.45427504", "0.45392758", "0.4529032", "0.4526041", "0.45180637", "0.44994196", "0.44951195", "0.44910872", "0.44795388", "0.4455308", "0.44512704", "0.4431991", "0.4425452", "0.44229653", "0.44220933", "0.44175857", "0.44175857", "0.44175857", "0.44175857", "0.44175857", "0.44175857", "0.44175857", "0.4413863", "0.4407505", "0.43952885", "0.4390878", "0.43885607", "0.43871585", "0.43854874", "0.4381727", "0.43746513", "0.436958", "0.4364535", "0.4362417", "0.435938", "0.4355051", "0.43500084", "0.43478003", "0.43424425", "0.43414178", "0.43308043", "0.4330078", "0.43299973", "0.43259615", "0.4322781", "0.4317158", "0.43120712", "0.43100134", "0.4309964", "0.43070123", "0.4304603", "0.43045282", "0.42926738", "0.42840827", "0.42817506", "0.42811415", "0.42789277", "0.4277289", "0.42770708", "0.42757934", "0.42703256", "0.42673796", "0.42667398", "0.42655635", "0.4265556", "0.426085", "0.42606577", "0.42568865", "0.4239596", "0.42380208", "0.42372617", "0.4236112", "0.42347774", "0.42339206" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function getSeriesStackId(seriesModel) { return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "function getImplementation( cb ){\n\n }", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53492224", "0.48935446", "0.48514137", "0.48082927", "0.47720826", "0.4744996", "0.47347993", "0.47019523", "0.46926585", "0.46926585", "0.46730793", "0.46452278", "0.46379203", "0.46256977", "0.4618543", "0.45818752", "0.45806864", "0.45742333", "0.4568166", "0.45616665", "0.45558366", "0.4549164", "0.45481402", "0.45447382", "0.4537214", "0.4522665", "0.451785", "0.4497493", "0.44942656", "0.4484697", "0.4472648", "0.44683102", "0.4465637", "0.44581723", "0.44557354", "0.4454013", "0.44524705", "0.44436827", "0.44380364", "0.4427005", "0.44242096", "0.44237852", "0.44070554", "0.44050547", "0.44050547", "0.44050547", "0.4404598", "0.4393088", "0.43767613", "0.43684104", "0.43635124", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43511948", "0.43502447", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43443355", "0.43417493", "0.43380377", "0.43350744", "0.43350744", "0.4332956", "0.43327877" ]
0.0
-1
Calculate bar width and offset for radial bar charts
function calRadialBar(barSeries, api) { // Columns info on each category axis. Key is polar name var columnsMap = {}; zrUtil.each(barSeries, function (seriesModel, idx) { var data = seriesModel.getData(); var polar = seriesModel.coordinateSystem; var baseAxis = polar.getBaseAxis(); var axisKey = getAxisKey(polar, baseAxis); var axisExtent = baseAxis.getExtent(); var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count(); var columnsOnAxis = columnsMap[axisKey] || { bandWidth: bandWidth, remainedWidth: bandWidth, autoWidthCount: 0, categoryGap: '20%', gap: '30%', stacks: {} }; var stacks = columnsOnAxis.stacks; columnsMap[axisKey] = columnsOnAxis; var stackId = getSeriesStackId(seriesModel); if (!stacks[stackId]) { columnsOnAxis.autoWidthCount++; } stacks[stackId] = stacks[stackId] || { width: 0, maxWidth: 0 }; var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth); var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth); var barGap = seriesModel.get('barGap'); var barCategoryGap = seriesModel.get('barCategoryGap'); if (barWidth && !stacks[stackId].width) { barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); stacks[stackId].width = barWidth; columnsOnAxis.remainedWidth -= barWidth; } barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); barGap != null && (columnsOnAxis.gap = barGap); barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap); }); var result = {}; zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) { result[coordSysName] = {}; var stacks = columnsOnAxis.stacks; var bandWidth = columnsOnAxis.bandWidth; var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth); var barGapPercent = parsePercent(columnsOnAxis.gap, 1); var remainedWidth = columnsOnAxis.remainedWidth; var autoWidthCount = columnsOnAxis.autoWidthCount; var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth zrUtil.each(stacks, function (column, stack) { var maxWidth = column.maxWidth; if (maxWidth && maxWidth < autoWidth) { maxWidth = Math.min(maxWidth, remainedWidth); if (column.width) { maxWidth = Math.min(maxWidth, column.width); } remainedWidth -= maxWidth; column.width = maxWidth; autoWidthCount--; } }); // Recalculate width again autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); autoWidth = Math.max(autoWidth, 0); var widthSum = 0; var lastColumn; zrUtil.each(stacks, function (column, idx) { if (!column.width) { column.width = autoWidth; } lastColumn = column; widthSum += column.width * (1 + barGapPercent); }); if (lastColumn) { widthSum -= lastColumn.width * barGapPercent; } var offset = -widthSum / 2; zrUtil.each(stacks, function (column, stackId) { result[coordSysName][stackId] = result[coordSysName][stackId] || { offset: offset, width: column.width }; offset += column.width * (1 + barGapPercent); }); }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calRadialBar(barSeries) {\n // Columns info on each category axis. Key is polar name\n var columnsMap = {};\n util[\"k\" /* each */](barSeries, function (seriesModel, idx) {\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisKey = barPolar_getAxisKey(polar, baseAxis);\n var axisExtent = baseAxis.getExtent();\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n var columnsOnAxis = columnsMap[axisKey] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: '20%',\n gap: '30%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[axisKey] = columnsOnAxis;\n var stackId = barPolar_getSeriesStackId(seriesModel);\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n };\n var barWidth = Object(number[\"o\" /* parsePercent */])(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = Object(number[\"o\" /* parsePercent */])(seriesModel.get('barMaxWidth'), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n\n if (barWidth && !stacks[stackId].width) {\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n stacks[stackId].width = barWidth;\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n barGap != null && (columnsOnAxis.gap = barGap);\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n util[\"k\" /* each */](columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGap = Object(number[\"o\" /* parsePercent */])(columnsOnAxis.categoryGap, bandWidth);\n var barGapPercent = Object(number[\"o\" /* parsePercent */])(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n util[\"k\" /* each */](stacks, function (column, stack) {\n var maxWidth = column.maxWidth;\n\n if (maxWidth && maxWidth < autoWidth) {\n maxWidth = Math.min(maxWidth, remainedWidth);\n\n if (column.width) {\n maxWidth = Math.min(maxWidth, column.width);\n }\n\n remainedWidth -= maxWidth;\n column.width = maxWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n util[\"k\" /* each */](stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n util[\"k\" /* each */](stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}", "function barXFunc (d, i) { return (i * barwidth)+\"%\" ; }", "_calcWidthBar(d, i) {\n if (d.indexData !== -1) {\n return this.model.barScale(this.model.data.children.data[this._vOrder[d.indexData]].edge.values[i]);\n }\n else\n return 0; // Do not draw the rectangle\n }", "function calRadialBar(barSeries) {\n\t // Columns info on each category axis. Key is polar name\n\t var columnsMap = {};\n\t each(barSeries, function (seriesModel, idx) {\n\t var data = seriesModel.getData();\n\t var polar = seriesModel.coordinateSystem;\n\t var baseAxis = polar.getBaseAxis();\n\t var axisKey = getAxisKey$1(polar, baseAxis);\n\t var axisExtent = baseAxis.getExtent();\n\t var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n\t var columnsOnAxis = columnsMap[axisKey] || {\n\t bandWidth: bandWidth,\n\t remainedWidth: bandWidth,\n\t autoWidthCount: 0,\n\t categoryGap: '20%',\n\t gap: '30%',\n\t stacks: {}\n\t };\n\t var stacks = columnsOnAxis.stacks;\n\t columnsMap[axisKey] = columnsOnAxis;\n\t var stackId = getSeriesStackId$1(seriesModel);\n\t\n\t if (!stacks[stackId]) {\n\t columnsOnAxis.autoWidthCount++;\n\t }\n\t\n\t stacks[stackId] = stacks[stackId] || {\n\t width: 0,\n\t maxWidth: 0\n\t };\n\t var barWidth = parsePercent$1(seriesModel.get('barWidth'), bandWidth);\n\t var barMaxWidth = parsePercent$1(seriesModel.get('barMaxWidth'), bandWidth);\n\t var barGap = seriesModel.get('barGap');\n\t var barCategoryGap = seriesModel.get('barCategoryGap');\n\t\n\t if (barWidth && !stacks[stackId].width) {\n\t barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n\t stacks[stackId].width = barWidth;\n\t columnsOnAxis.remainedWidth -= barWidth;\n\t }\n\t\n\t barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n\t barGap != null && (columnsOnAxis.gap = barGap);\n\t barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n\t });\n\t var result = {};\n\t each(columnsMap, function (columnsOnAxis, coordSysName) {\n\t result[coordSysName] = {};\n\t var stacks = columnsOnAxis.stacks;\n\t var bandWidth = columnsOnAxis.bandWidth;\n\t var categoryGap = parsePercent$1(columnsOnAxis.categoryGap, bandWidth);\n\t var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1);\n\t var remainedWidth = columnsOnAxis.remainedWidth;\n\t var autoWidthCount = columnsOnAxis.autoWidthCount;\n\t var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n\t autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\t\n\t each(stacks, function (column, stack) {\n\t var maxWidth = column.maxWidth;\n\t\n\t if (maxWidth && maxWidth < autoWidth) {\n\t maxWidth = Math.min(maxWidth, remainedWidth);\n\t\n\t if (column.width) {\n\t maxWidth = Math.min(maxWidth, column.width);\n\t }\n\t\n\t remainedWidth -= maxWidth;\n\t column.width = maxWidth;\n\t autoWidthCount--;\n\t }\n\t }); // Recalculate width again\n\t\n\t autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n\t autoWidth = Math.max(autoWidth, 0);\n\t var widthSum = 0;\n\t var lastColumn;\n\t each(stacks, function (column, idx) {\n\t if (!column.width) {\n\t column.width = autoWidth;\n\t }\n\t\n\t lastColumn = column;\n\t widthSum += column.width * (1 + barGapPercent);\n\t });\n\t\n\t if (lastColumn) {\n\t widthSum -= lastColumn.width * barGapPercent;\n\t }\n\t\n\t var offset = -widthSum / 2;\n\t each(stacks, function (column, stackId) {\n\t result[coordSysName][stackId] = result[coordSysName][stackId] || {\n\t offset: offset,\n\t width: column.width\n\t };\n\t offset += column.width * (1 + barGapPercent);\n\t });\n\t });\n\t return result;\n\t }", "function calRadialBar(barSeries, api) {\n // Columns info on each category axis. Key is polar name\n var columnsMap = {};\n zrUtil.each(barSeries, function (seriesModel, idx) {\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisExtent = baseAxis.getExtent();\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n var columnsOnAxis = columnsMap[getAxisKey(baseAxis)] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: '20%',\n gap: '30%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[getAxisKey(baseAxis)] = columnsOnAxis;\n var stackId = getSeriesStackId(seriesModel);\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n };\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n\n if (barWidth && !stacks[stackId].width) {\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n stacks[stackId].width = barWidth;\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n barGap != null && (columnsOnAxis.gap = barGap);\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n zrUtil.each(stacks, function (column, stack) {\n var maxWidth = column.maxWidth;\n\n if (maxWidth && maxWidth < autoWidth) {\n maxWidth = Math.min(maxWidth, remainedWidth);\n\n if (column.width) {\n maxWidth = Math.min(maxWidth, column.width);\n }\n\n remainedWidth -= maxWidth;\n column.width = maxWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n zrUtil.each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n zrUtil.each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}", "function calRadialBar(barSeries, api) {\n // Columns info on each category axis. Key is polar name\n var columnsMap = {};\n zrUtil.each(barSeries, function (seriesModel, idx) {\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisExtent = baseAxis.getExtent();\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n var columnsOnAxis = columnsMap[getAxisKey(baseAxis)] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: '20%',\n gap: '30%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[getAxisKey(baseAxis)] = columnsOnAxis;\n var stackId = getSeriesStackId(seriesModel);\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n };\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n\n if (barWidth && !stacks[stackId].width) {\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n stacks[stackId].width = barWidth;\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n barGap != null && (columnsOnAxis.gap = barGap);\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n zrUtil.each(stacks, function (column, stack) {\n var maxWidth = column.maxWidth;\n\n if (maxWidth && maxWidth < autoWidth) {\n maxWidth = Math.min(maxWidth, remainedWidth);\n\n if (column.width) {\n maxWidth = Math.min(maxWidth, column.width);\n }\n\n remainedWidth -= maxWidth;\n column.width = maxWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n zrUtil.each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n zrUtil.each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}", "function calRadialBar(barSeries, api) {\n // Columns info on each category axis. Key is polar name\n var columnsMap = {};\n zrUtil.each(barSeries, function (seriesModel, idx) {\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisExtent = baseAxis.getExtent();\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n var columnsOnAxis = columnsMap[getAxisKey(baseAxis)] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: '20%',\n gap: '30%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[getAxisKey(baseAxis)] = columnsOnAxis;\n var stackId = getSeriesStackId(seriesModel);\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n };\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n\n if (barWidth && !stacks[stackId].width) {\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n stacks[stackId].width = barWidth;\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n barGap != null && (columnsOnAxis.gap = barGap);\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n zrUtil.each(stacks, function (column, stack) {\n var maxWidth = column.maxWidth;\n\n if (maxWidth && maxWidth < autoWidth) {\n maxWidth = Math.min(maxWidth, remainedWidth);\n\n if (column.width) {\n maxWidth = Math.min(maxWidth, column.width);\n }\n\n remainedWidth -= maxWidth;\n column.width = maxWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n zrUtil.each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n zrUtil.each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}", "function calRadialBar(barSeries, api) {\n // Columns info on each category axis. Key is polar name\n var columnsMap = {};\n zrUtil.each(barSeries, function (seriesModel, idx) {\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisExtent = baseAxis.getExtent();\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n var columnsOnAxis = columnsMap[getAxisKey(baseAxis)] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: '20%',\n gap: '30%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[getAxisKey(baseAxis)] = columnsOnAxis;\n var stackId = getSeriesStackId(seriesModel);\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n };\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n\n if (barWidth && !stacks[stackId].width) {\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n stacks[stackId].width = barWidth;\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n barGap != null && (columnsOnAxis.gap = barGap);\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n zrUtil.each(stacks, function (column, stack) {\n var maxWidth = column.maxWidth;\n\n if (maxWidth && maxWidth < autoWidth) {\n maxWidth = Math.min(maxWidth, remainedWidth);\n\n if (column.width) {\n maxWidth = Math.min(maxWidth, column.width);\n }\n\n remainedWidth -= maxWidth;\n column.width = maxWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n zrUtil.each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n zrUtil.each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}", "calcBarWidth(max_bars)\n{\n return this.plotWidth/(max_bars*1.5);\n}", "_calcBarWidths() {\n this._workerTotals.forEach(totals => {\n totals.barWidth = this._calcBarWidth(totals.duration);\n let sumBarWidth = 0;\n totals.targetDurations.forEach((targetDuration, target) => {\n const isLast = totals.targetBarWidths.size === totals.targetDurations.size - 1;\n const targetBarWidth = isLast ? totals.barWidth - sumBarWidth : this._calcBarWidth(targetDuration);\n totals.targetBarWidths.set(target, targetBarWidth);\n sumBarWidth += targetBarWidth;\n });\n });\n }", "function barLength(whichbar, rating) {\n if (whichbar == \"crowdedness\") {\n switch (rating) {\n case 0.5:\n $(\".bar-5\").width(\"10%\");\n break;\n case 1:\n $(\".bar-5\").width(\"20%\");\n break;\n case 1.5:\n $(\".bar-5\").width(\"30%\");\n break;\n case 2:\n $(\".bar-5\").width(\"40%\");\n break;\n case 2.5:\n $(\".bar-5\").width(\"50%\");\n break;\n case 3:\n $(\".bar-5\").width(\"60%\");\n break;\n case 3.5:\n $(\".bar-5\").width(\"70%\");\n break;\n case 4:\n $(\".bar-5\").width(\"80%\");\n break;\n case 4.5:\n $(\".bar-5\").width(\"90%\");\n break;\n case 5:\n $(\".bar-5\").width(\"100%\");\n break;\n default:\n break;\n }\n } else if (whichbar == \"bathroom\") {\n switch (rating) {\n case 0.5:\n $(\".bar-4\").width(\"10%\");\n break;\n case 1:\n $(\".bar-4\").width(\"20%\");\n break;\n case 1.5:\n $(\".bar-4\").width(\"30%\");\n break;\n case 2:\n $(\".bar-4\").width(\"40%\");\n break;\n case 2.5:\n $(\".bar-4\").width(\"50%\");\n break;\n case 3:\n $(\".bar-4\").width(\"60%\");\n break;\n case 3.5:\n $(\".bar-4\").width(\"70%\");\n break;\n case 4:\n $(\".bar-4\").width(\"80%\");\n break;\n case 4.5:\n $(\".bar-4\").width(\"90%\");\n break;\n case 5:\n $(\".bar-4\").width(\"100%\");\n break;\n default:\n break;\n }\n } else if (whichbar == \"cleaness\") {\n switch (rating) {\n case 0.5:\n $(\".bar-3\").width(\"10%\");\n break;\n case 1:\n $(\".bar-3\").width(\"20%\");\n break;\n case 1.5:\n $(\".bar-3\").width(\"30%\");\n break;\n case 2:\n $(\".bar-3\").width(\"40%\");\n break;\n case 2.5:\n $(\".bar-3\").width(\"50%\");\n break;\n case 3:\n $(\".bar-3\").width(\"60%\");\n break;\n case 3.5:\n $(\".bar-3\").width(\"70%\");\n break;\n case 4:\n $(\".bar-3\").width(\"80%\");\n break;\n case 4.5:\n $(\".bar-3\").width(\"90%\");\n break;\n case 5:\n $(\".bar-3\").width(\"100%\");\n break;\n default:\n break;\n }\n } else if (whichbar == \"parking\") {\n switch (rating) {\n case 0.5:\n $(\".bar-2\").width(\"10%\");\n break;\n case 1:\n $(\".bar-2\").width(\"20%\");\n break;\n case 1.5:\n $(\".bar-2\").width(\"30%\");\n break;\n case 2:\n $(\".bar-2\").width(\"40%\");\n break;\n case 2.5:\n $(\".bar-2\").width(\"50%\");\n break;\n case 3:\n $(\".bar-2\").width(\"60%\");\n break;\n case 3.5:\n $(\".bar-2\").width(\"70%\");\n break;\n case 4:\n $(\".bar-2\").width(\"80%\");\n break;\n case 4.5:\n $(\".bar-2\").width(\"90%\");\n break;\n case 5:\n $(\".bar-2\").width(\"100%\");\n break;\n default:\n break;\n }\n }\n}", "function computeBarPixelThickness(positionBinding, datasets, plotPositionDimensionLength) {\n var barPixelThickness;\n var positionScale = positionBinding.scale;\n if (positionScale instanceof Scales.Category) {\n barPixelThickness = positionScale.rangeBand();\n }\n else {\n var positionAccessor_1 = positionBinding.accessor;\n var numberBarAccessorData = d3.set(Utils.Array.flatten(datasets.map(function (dataset) {\n return dataset.data().map(function (d, i) { return positionAccessor_1(d, i, dataset); })\n .filter(function (d) { return d != null; })\n .map(function (d) { return d.valueOf(); });\n }))).values().map(function (value) { return +value; });\n numberBarAccessorData.sort(function (a, b) { return a - b; });\n var scaledData = numberBarAccessorData.map(function (datum) { return positionScale.scale(datum); });\n var barAccessorDataPairs = d3.pairs(scaledData);\n barPixelThickness = Utils.Math.min(barAccessorDataPairs, function (pair, i) {\n return Math.abs(pair[1] - pair[0]);\n }, plotPositionDimensionLength * Bar._SINGLE_BAR_DIMENSION_RATIO);\n barPixelThickness *= Bar._BAR_THICKNESS_RATIO;\n }\n return barPixelThickness;\n}", "function calRadialBar(barSeries, api) {\n\t // Columns info on each category axis. Key is polar name\n\t var columnsMap = {};\n\n\t zrUtil.each(barSeries, function (seriesModel, idx) {\n\t var data = seriesModel.getData();\n\t var polar = seriesModel.coordinateSystem;\n\n\t var baseAxis = polar.getBaseAxis();\n\n\t var axisExtent = baseAxis.getExtent();\n\t var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n\n\t var columnsOnAxis = columnsMap[getAxisKey(baseAxis)] || {\n\t bandWidth: bandWidth,\n\t remainedWidth: bandWidth,\n\t autoWidthCount: 0,\n\t categoryGap: '20%',\n\t gap: '30%',\n\t stacks: {}\n\t };\n\t var stacks = columnsOnAxis.stacks;\n\t columnsMap[getAxisKey(baseAxis)] = columnsOnAxis;\n\n\t var stackId = getSeriesStackId(seriesModel);\n\n\t if (!stacks[stackId]) {\n\t columnsOnAxis.autoWidthCount++;\n\t }\n\t stacks[stackId] = stacks[stackId] || {\n\t width: 0,\n\t maxWidth: 0\n\t };\n\n\t var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n\t var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n\t var barGap = seriesModel.get('barGap');\n\t var barCategoryGap = seriesModel.get('barCategoryGap');\n\n\t if (barWidth && !stacks[stackId].width) {\n\t barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n\t stacks[stackId].width = barWidth;\n\t columnsOnAxis.remainedWidth -= barWidth;\n\t }\n\n\t barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n\t barGap != null && (columnsOnAxis.gap = barGap);\n\t barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n\t });\n\n\t var result = {};\n\n\t zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n\n\t result[coordSysName] = {};\n\n\t var stacks = columnsOnAxis.stacks;\n\t var bandWidth = columnsOnAxis.bandWidth;\n\t var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n\t var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n\n\t var remainedWidth = columnsOnAxis.remainedWidth;\n\t var autoWidthCount = columnsOnAxis.autoWidthCount;\n\t var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n\t autoWidth = Math.max(autoWidth, 0);\n\n\t // Find if any auto calculated bar exceeded maxBarWidth\n\t zrUtil.each(stacks, function (column, stack) {\n\t var maxWidth = column.maxWidth;\n\t if (maxWidth && maxWidth < autoWidth) {\n\t maxWidth = Math.min(maxWidth, remainedWidth);\n\t if (column.width) {\n\t maxWidth = Math.min(maxWidth, column.width);\n\t }\n\t remainedWidth -= maxWidth;\n\t column.width = maxWidth;\n\t autoWidthCount--;\n\t }\n\t });\n\n\t // Recalculate width again\n\t autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n\t autoWidth = Math.max(autoWidth, 0);\n\n\t var widthSum = 0;\n\t var lastColumn;\n\t zrUtil.each(stacks, function (column, idx) {\n\t if (!column.width) {\n\t column.width = autoWidth;\n\t }\n\t lastColumn = column;\n\t widthSum += column.width * (1 + barGapPercent);\n\t });\n\t if (lastColumn) {\n\t widthSum -= lastColumn.width * barGapPercent;\n\t }\n\n\t var offset = -widthSum / 2;\n\t zrUtil.each(stacks, function (column, stackId) {\n\t result[coordSysName][stackId] = result[coordSysName][stackId] || {\n\t offset: offset,\n\t width: column.width\n\t };\n\n\t offset += column.width * (1 + barGapPercent);\n\t });\n\t });\n\n\t return result;\n\t}", "getXoffset() {\n return labelWidth + this.getFullwidth() + barHeight * 2 + 19\n }", "function adjustWidth() {\n width += 0.0166666666666667;\n bar.style.width = width + \"%\";\n bar.innerHTML = width.toFixed(1) + \"%\";\n\n // set width value to a var\n barWidth = width;\n }", "function buildPercBars() {\n\n\treturn [\n\t {value: .45, index: .5, init:0},\n\t\t{value: .23, index: .4, init:0},\n\t];\n\t\n}", "function updatebar(){\r\n \tif (width > 168){\r\n \t\tif (width < 220){\r\n \t\t\ttakeoff = 21\r\n \t\t\twidth = width - takeoff\r\n }else if (width < 350){\r\n takeoff = 42\r\n width = width - takeoff\r\n }else if (width < 400){\r\n \ttakeoff = 80\r\n \twidth = width - takeoff\r\n }else if (width < 500){\r\n \ttakeoff = 140\r\n \twidth = width - takeoff\r\n \r\n }\r\n document.getElementById('barcum').style.width = width + 'px'\r\n \t}else if (width < 168){\r\n \t\twidth = 168\r\n \t\tdocument.getElementById('barcum').style.width = width + 'px'\r\n \t\r\n\r\n }}", "function updateBars() {\n const chartBars = document.querySelectorAll(\"#chart-bars g\");\n // Wykonanie na duzych slupkach\n for (let i = 0; i < chartBars.length; i++) {\n const bar = chartBars[i].children;\n // Wykonanie na malych slupkach w duzym slupku\n let yStartingPoint = 79.834364;\n let separation = 0; // Pierwszy odstep jest rowny 0, pozniej 1.1\n for (let rect = 0; rect < bar.length; rect++) {\n const e = bar[rect];\n const numOf = Number(e.getAttribute(\"data-value\")); // Odczytanie ilosci, np. numOfNumbers = 5\n const smallBarHeight = (gridMaxHeight / highestYLable) * numOf; // Wyliczenie jaka powinien miec maly slupek wysokosc\n yStartingPoint -= smallBarHeight; // Dostosowanie poczatkowego punktu w odniesieniu do wysokosci\n const x = parseFloat(e.getAttribute(\"x\"));\n e.setAttribute(\"x\", x + 26); // Przesuiecie starego slupka (o jeden w prawo)\n e.setAttribute(\n \"height\",\n smallBarHeight === 0 ? 0 : smallBarHeight - separation\n );\n e.setAttribute(\"y\", yStartingPoint);\n separation = numOf === 0 && separation === 0 ? 0 : 1.1;\n }\n }\n}", "function setBar (value) {\n return fill.style.width = `${(value/max)*100}%`\n }", "function barposition(bl1) {\n\t // find the min. difference between any points\n\t // in any traces in bl1\n\t var pvals = [];\n\t bl1.forEach(function(i) {\n\t gd.calcdata[i].forEach(function(v) { pvals.push(v.p); });\n\t });\n\t var dv = Lib.distinctVals(pvals),\n\t pv2 = dv.vals,\n\t barDiff = dv.minDiff;\n\t\n\t // check if all the traces have only independent positions\n\t // if so, let them have full width even if mode is group\n\t var overlap = false,\n\t comparelist = [];\n\t\n\t if(fullLayout.barmode === 'group') {\n\t bl1.forEach(function(i) {\n\t if(overlap) return;\n\t gd.calcdata[i].forEach(function(v) {\n\t if(overlap) return;\n\t comparelist.forEach(function(cp) {\n\t if(Math.abs(v.p - cp) < barDiff) overlap = true;\n\t });\n\t });\n\t if(overlap) return;\n\t gd.calcdata[i].forEach(function(v) {\n\t comparelist.push(v.p);\n\t });\n\t });\n\t }\n\t\n\t // check forced minimum dtick\n\t Axes.minDtick(pa, barDiff, pv2[0], overlap);\n\t\n\t // position axis autorange - always tight fitting\n\t Axes.expand(pa, pv2, {vpad: barDiff / 2});\n\t\n\t // bar widths and position offsets\n\t barDiff *= 1 - fullLayout.bargap;\n\t if(overlap) barDiff /= bl.length;\n\t\n\t var barCenter;\n\t function setBarCenter(v) { v[pLetter] = v.p + barCenter; }\n\t\n\t for(var i = 0; i < bl1.length; i++) {\n\t var t = gd.calcdata[bl1[i]][0].t;\n\t t.barwidth = barDiff * (1 - fullLayout.bargroupgap);\n\t t.poffset = ((overlap ? (2 * i + 1 - bl1.length) * barDiff : 0) -\n\t t.barwidth) / 2;\n\t t.dbar = dv.minDiff;\n\t\n\t // store the bar center in each calcdata item\n\t barCenter = t.poffset + t.barwidth / 2;\n\t gd.calcdata[bl1[i]].forEach(setBarCenter);\n\t }\n\t }", "function bar(renderOpts) {\n // create object to hold chart updating function\n // as well as current data\n var\n self = {data : start_data},\n container = d3.select(renderOpts.renderTo),\n race = projections.raceAbbr(renderOpts.race),\n margin = self.margin = { top: 50, right: 40, bottom: 40, left: 65 },\n // chart h/w vs full svg h/w\n width = 300 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom,\n full_width = self.width = width + margin.left + margin.right,\n full_height = self.height = height + margin.top + margin.bottom,\n total = 0;\n\n // get population number for age, year, race\n function value(a){\n return self.data[a][0][race];\n }\n\n // generate percentage stat for bar width\n function pop_percent(a) {\n return value(a) / total;\n }\n\n ages.map(function(a) { total += value(a); });\n total = total || 1; // to avoid division by 0\n\n var max = 0.15;\n\n // scale for bar width\n var x = d3.scale.linear()\n .domain([0, max])\n .range([0, width]);\n\n // ordinal scale to space y axis\n var y = d3.scale.ordinal()\n .rangeRoundBands([height, 0], 0.1)\n .domain(ages.map(bucket).reverse());\n\n // create y axis using calculated age buckets\n var yAxis = d3.svg.axis()\n .scale(y)\n .outerTickSize(0)\n .orient(\"left\");\n\n // create y axis using calculated percentage scale\n var xAxis = d3.svg.axis()\n .scale(x)\n .tickFormat(d3.format('%'))\n .outerTickSize(0)\n .ticks(3)\n .orient(\"bottom\");\n\n // space between bars, and bar dimension\n var buffer = 6;\n var barHeight = height / ages.length;\n\n\n // container svg, dynamically sized\n container.classed('chart-svg-container', true)\n\n var svg = self.svg = container.append('svg')\n .attr({\n \"preserveAspectRatio\" : \"xMinYMin meet\",\n \"viewBox\" : \"0 0 \" + full_width + \" \" + full_height,\n \"class\" : \"chart-svg\"\n })\n .append('g')\n .attr(\n 'transform',\n 'translate(' + margin.left + ',' + margin.top + ')'\n );\n\n // title text for bar chart\n svg.append('text')\n .attr({\n \"class\" : \"bar-title\",\n \"y\" : -15\n }).text(capitalize(renderOpts.race));\n\n // y grid lines\n var gridAxis = d3.svg.axis().scale(x)\n .orient(\"bottom\")\n .tickSize(-height, 0, 0)\n .ticks(4)\n .tickFormat(\"\");\n\n var grid_lines = svg.append('g')\n .attr('class', 'y grid')\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(gridAxis);\n\n // bar chart rectangles\n var bar_container = svg.append('g')\n .selectAll('g')\n .data(ages)\n .enter().append('g')\n .attr(\"transform\", function(d, i) {\n return \"translate(0,\"+(i * barHeight + buffer/2)+\")\";\n })\n .attr(\"id\" , function(d) { return race + \",\" + bucket(d); })\n .attr('width', width)\n .attr('height', barHeight + buffer/2);\n\n var bars = bar_container.append('rect')\n .attr({\n \"class\" : function(d) { return 'pyramid bar ' + bucket(d); },\n \"width\" : function(d) { return x(pop_percent(d)); },\n \"height\" : barHeight - buffer / 2,\n });\n\n // render y axis\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n\n // render x axis\n var x_axis_g = svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n\n var p = d3.format(\".1%\");\n var datalabels = bar_container.append('text')\n .text(function(d) {return p(pop_percent(d));})\n .attr({\n class : function(d) { return 'datalabel ' + bucket(d); },\n x : function(d) { return 5 + x(pop_percent(d)); },\n y : buffer + barHeight / 2\n }).style('opacity', 0);\n\n // highlight all same y-value\n bar_container\n .on('mouseover', function(){\n var selected = this.id.split(\",\")[1];\n d3.selectAll('.pyramid.bar')\n .classed('highlight', function(){\n return d3.select(this).classed(selected);\n });\n d3.selectAll('.datalabel')\n .style('opacity', function() {\n // boolean to number\n return +d3.select(this).classed(selected);\n });\n })\n .on('mouseout', function(){\n d3.selectAll('.pyramid.bar').classed('highlight', false);\n d3.selectAll('.datalabel').style('opacity', 0);\n });\n\n\n // data update\n self.update = function(new_data, maximum) {\n\n var dur = 300;\n\n // bounce back if already loading something\n if (projections.loading_indicator) return self;\n\n // store new data\n self.data = prepData(new_data);\n\n // get population number for age, year, race\n var year = settings.pyramid_abbr();\n var value = function(a){\n return parseFloat(self.data[a][year][race]);\n };\n\n // calculate total for this group\n var total = 0;\n ages.map(function(a) { total += value(a); });\n total = total || 1; // prevent divsion by 0\n\n // generate percentage stat for bar width\n var pop_percent = function(a) {\n return value(a) / total;\n };\n\n maximum = maximum || 0.15;\n\n x.domain([0, maximum]);\n\n bars\n .transition()\n .duration(dur)\n .attr(\"width\" , function(d) {\n return x(pop_percent(d));\n });\n\n x_axis_g\n .transition()\n .duration(dur)\n .call(xAxis);\n\n grid_lines\n .transition()\n .duration(dur)\n .call(gridAxis);\n\n datalabels\n .text(function(d){ return p(pop_percent(d)); })\n .attr(\"x\", function(d){ return 5 + x(pop_percent(d)); } );\n\n return self;\n };\n\n return self;\n }", "function prepareBarLength(itemModel, symbolRepeat, layout, opt, output) {\n\t var valueDim = opt.valueDim;\n\t var symbolBoundingData = itemModel.get('symbolBoundingData');\n\t var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\n\t var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\n\t var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\n\t var boundingLength;\n\n\t if (zrUtil.isArray(symbolBoundingData)) {\n\t var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx];\n\t symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse();\n\t boundingLength = symbolBoundingExtent[pxSignIdx];\n\t } else if (symbolBoundingData != null) {\n\t boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\n\t } else if (symbolRepeat) {\n\t boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\n\t } else {\n\t boundingLength = layout[valueDim.wh];\n\t }\n\n\t output.boundingLength = boundingLength;\n\n\t if (symbolRepeat) {\n\t output.repeatCutLength = layout[valueDim.wh];\n\t }\n\n\t output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;\n\t}", "function updateVariables () {\n dataset = filterData();\n numBars = calcNumBars();\n barWidth = ( (chartWidth ) / numBars) - barPadding; \n}", "function makeRadialBar(wins, losses){\n\n var winRate = wins/(wins+losses);\n var width = 300,\n height = 300;\n\n var p = 2 * Math.PI;\n\n // An arc function with all values bound except the endAngle. So, to compute an\n // SVG path string for a given angle, we pass an object with an endAngle\n // property to the `arc` function, and it will return the corresponding string.\n var arc = d3.svg.arc()\n .innerRadius(90)\n .outerRadius(120)\n .startAngle(0);\n\n // Create the SVG container, and apply a transform such that the origin is the\n // center of the canvas. This way, we don't need to position arcs individually.\n var svg = d3.select(\"body\").select(\".radial_win\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + width/2 + \",\" + height/2 + \")\")\n .on(\"mouseover\", function(d) {\n d3.select(this).select(\"text\").text(wins + \" - \" + losses).attr(\"x\", -30);\n })\n .on(\"mouseout\", function(d) {\n d3.select(this).select(\"text\").text(pWin(winRate)).attr(\"x\", -16);\n });\n\n var pWin = d3.format(\"%\");\n\n d3.select(\"body\").select(\".radial_win\").select(\"g\").selectAll(\"text\").remove();\n d3.select(\"body\").select(\".radial_win\").select(\"g\")\n .append(\"text\")\n .attr(\"x\", -16)\n .attr(\"y\", -10)\n .text(pWin(winRate))\n .style(\"font-size\", \"22px\")\n .style({'stroke': 'black', 'stroke-width': 1.5});\n\n d3.select(\"body\").select(\".radial_win\").select(\"g\")\n .append(\"text\")\n .attr(\"x\", -40)\n .attr(\"y\", 15)\n .text(\"Win Rate\")\n .style(\"font-size\", \"22px\")\n .style({'stroke': 'black', 'stroke-width': 1.5});\n\n // Add the background arc, from 0 to 100% (τ).\n var background = svg.append(\"path\")\n .datum({endAngle: p})\n .style(\"fill\", \"#ddd\")\n .attr(\"d\", arc);\n\n // Add the foreground arc in green\n var foreground = svg.append(\"path\")\n .datum({endAngle: .127 * p})\n .style(\"fill\", \"green\")\n .attr(\"d\", arc);\n\n // Every so often, start a transition to a new random angle. Use transition.call\n // (identical to selection.call) so that we can encapsulate the logic for\n // tweening the arc in a separate function below.\n foreground.transition()\n .duration(750)\n .call(arcTween, winRate * p);\n\n // Creates a tween on the specified transition's \"d\" attribute, transitioning\n // any selected arcs from their current angle to the specified new angle.\n function arcTween(transition, newAngle) {\n\n transition.attrTween(\"d\", function(d) {\n\n var interpolate = d3.interpolate(d.endAngle, newAngle);\n\n\n return function(t) {\n\n d.endAngle = interpolate(t);\n\n return arc(d);\n };\n });\n }\n}", "function barChartSettings(skillArr) {\n\t\t//console.log(\"setting the barchart....\");\n\t\t//svgcMargin = 40;\n\t\t//svgcSpace = 100;\n\t\tsvgcMargin = 60;\n\t\tsvgcSpace = 40;\t\t\n\t\t//svgcHeight = svg.height.baseVal.value - 2 * svgcMargin - svgcSpace;\n\t\tsvgcHeight = svg.height.baseVal.value - 2 * svgcMargin - svgcSpace;\n\t\tsvgcWidth = svg.width.baseVal.value - 2 * svgcMargin - svgcSpace;\n\t\tsvgcMarginSpace = svgcMargin + svgcSpace;\n\t\tsvgcMarginHeight = svgcMargin + svgcHeight;\n\t\t\n\t\t//console.log(\"svgcHeight = \"+svgcHeight);\n\t\t//console.log(\"svgcWidth = \"+svgcWidth);\n\t\t//console.log(\"svgcMarginSpace = \"+svgcMarginSpace);\n\t\t//console.log(\"svgcMarginHeight = \"+svgcMarginHeight);\n\t\t//The Bar Properties\n\t\tbcMargin = 6;\n\t\ttotalChartBars = skillArr.length;\n\t\tbcWidth = (svgcWidth / totalChartBars) - bcMargin;\n\t\t//console.log(\"bcWidth = \"+bcWidth);\n\t\t//Maximum value to plot on chart\n\t\tmaximumDataValue = 0;\n\t\tfor (var i = 0; i < totalChartBars; i++) {\n\t\t var arrVal = skillArr[i].split(\",\");\n\t\t var barVal = parseInt(arrVal[1]);\n\t\t if (parseInt(barVal) > parseInt(maximumDataValue))\n\t\t maximumDataValue = barVal;\n\t\t}\n\t\ttotalLabelOnYAxis = 4;\t\t\n\t}", "function create_bars()\n{\n // Make the array empty\n arr=[];\n // Make the visible bars empty\n bar.innerHTML=\"\";\n // Take the no of bars from range\n var no_of_bar=arr_size.value;\n var arr_width_size =(500/no_of_bar);\n \n // Set the height\n // we will sort the bars on the basis of height\n for(var i=0;i<no_of_bar;i++)\n arr.push(Math.floor(Math.random()*100));\n\n\n //Set the height and width of visible bars \n for(var i=0;i<no_of_bar;i++)\n {\n \n var div = document.createElement(\"DIV\");\n var margin_size=0.1;\n div.classList.add(\"special\");\n div.style=\"margin:0%\" + margin_size + \"%; width:\" + (100/no_of_bar-(2*margin_size)) + \"%;\";\n var height = (arr[i]*5+10).toString();\n height = height+'px';\n div.style.height=height;\n bar.appendChild(div);\n }\n}", "function barPositionCSS(n, speed, ease) {\nvar barCSS;\nif (Settings.positionUsing === 'translate3d') {\nbarCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' };\n} else if (Settings.positionUsing === 'translate') {\nbarCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' };\n} else {\nbarCSS = { 'margin-left': toBarPerc(n)+'%' };\n}\nbarCSS.transition = 'all '+speed+'ms '+ease;\nreturn barCSS;\n}", "function barGeometry(d, i) {\n d = config.accessor(d);\n var x, y, width, height;\n var myScale = scale ? scale : scales[i];\n if(config.orientation === 'horizontal') {\n x = i * config.transform.x;\n y = i * config.transform.y;\n\n width = 0;\n if(!isNaN(d)) {\n width = Math.abs(myScale(d));\n }\n\n if(d < 0)\n x -= width;\n\n height = config.barWidth;\n } else {\n x = i * config.transform.x;\n\n // console.log(myScale)\n height = Math.abs(myScale(0) - myScale(d));\n // console.log(d, height);\n width = config.barWidth;\n\n y = myScale(0);\n if(d > 0)\n y -= height;\n \n y += i * config.transform.y;\n }\n\n d3.select(this)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height);\n }", "function bar50(){\n self.svg.append(\"rect\")\n .attr(\"x\", (self.svgWidth * 0.5) + 35)\n .attr(\"y\", 30)\n .attr(\"width\", 3)\n .attr(\"height\", 46)\n .attr(\"class\", \"middlePoint\");\n }", "function prepareBarLength(itemModel, symbolRepeat, layout, opt, output) {\n var valueDim = opt.valueDim;\n var symbolBoundingData = itemModel.get('symbolBoundingData');\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\n\n var boundingLength = output.boundingLength = symbolBoundingData != null\n ? valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.scale.parse(symbolBoundingData))) - zeroPx\n : symbolRepeat\n ? opt.coordSysExtent[valueDim.index][1 - +(layout[valueDim.wh] <= 0)] - zeroPx\n : layout[valueDim.wh];\n\n if (symbolRepeat) {\n output.repeatCutLength = layout[valueDim.wh];\n }\n\n output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;\n }", "function drawBarVis(type) {\r\n const BINS = canvas.width / 3;\r\n const BAR_WIDTH = canvas.width / BINS;\r\n const HALF_CANVAS_HEIGHT = canvas.height / 2;\r\n\r\n let x_coord = 0;\r\n\r\n // Draw bars\r\n for (var i = 0; i < BINS; i++) {\r\n let barLength = Math.pow(frequencyData[i + Math.ceil(i / 90)], 3) / Math.pow(255, 3);\r\n\r\n switch(type) {\r\n // === Spaced Mirrored Bars ===\r\n case \"spacedMirrored\":\r\n canvasContext.beginPath();\r\n canvasContext.moveTo(0, HALF_CANVAS_HEIGHT);\r\n canvasContext.lineTo(canvas.width, HALF_CANVAS_HEIGHT);\r\n canvasContext.stroke();\r\n // Top Half\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT * (1 - barLength * SPACING),\r\n BAR_WIDTH,\r\n -HALF_CANVAS_HEIGHT * barLength * SPACE_MIRR_SIZE\r\n );\r\n // Bottom Half\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT * (1 + barLength * SPACING),\r\n BAR_WIDTH,\r\n HALF_CANVAS_HEIGHT * barLength * SPACE_MIRR_SIZE\r\n );\r\n break; \r\n // === Full Bars === \r\n case \"full\":\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT,\r\n BAR_WIDTH,\r\n -HALF_CANVAS_HEIGHT * barLength\r\n );\r\n break;\r\n // === Mirrored Bars ===\r\n default:\r\n canvasContext.beginPath();\r\n canvasContext.moveTo(0, HALF_CANVAS_HEIGHT);\r\n canvasContext.lineTo(canvas.width, HALF_CANVAS_HEIGHT);\r\n canvasContext.stroke();\r\n canvasContext.fillRect(\r\n x_coord,\r\n HALF_CANVAS_HEIGHT * (1 - barLength * MIRR_SIZE),\r\n BAR_WIDTH,\r\n canvas.height * barLength * MIRR_SIZE\r\n ); \r\n }\r\n //Set new starting x-coordinate for next bar\r\n x_coord += BAR_WIDTH + 1;\r\n }\r\n }", "function bar(d) {\r\n\t\t var bar = svg.insert(\"svg:g\", \".y.barHierAxis\")\r\n\t\t .attr(\"class\", \"enter\")\r\n\t\t .attr(\"transform\",function(){if($.browser.msie){\t\t \t \t\t\t\t\t\t\t\t\t\r\n\t\t \t \t\t\t\t\t\t\t\tif(d.children.length * y*1.6 < h){\r\n\t\t \t \t\t\t\t\t\t\t\t\treturn \"translate(-10,5)\";\r\n\t\t \t \t\t\t\t\t\t\t\t}\r\n\t\t \t \t\t\t\t\t\t\t\telse{\r\n\t\t \t \t\t\t\t\t\t\t\t\t//show scroll, need re-adjust the position in IE9\r\n\t\t \t \t\t\t\t\t\t\t\t\treturn \"translate(-2,5)\";\r\n\t\t \t \t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t else{\r\n\t\t\t\t\t\t\t\t\t\t\t return \"translate(0,5)\"; \r\n\t\t\t\t\t\t\t\t\t\t }})\r\n\t\t .selectAll(\"g\")\r\n\t\t .data(d.children)\r\n\t\t .enter().append(\"svg:g\")\r\n\t\t .style(\"cursor\", function(d) { return !d.children ? null : \"pointer\"; })\t\t \r\n\t\t .on(\"click\", showDetail);\r\n\t\r\n\t\t bar.append(\"svg:text\")\r\n\t\t .attr(\"x\", -6)\r\n\t\t .attr(\"y\", y/2+1)\r\n\t\t .attr(\"dy\", \".35em\")\r\n\t\t .attr(\"text-anchor\", \"end\")\r\n\t\t .text(function(d) { \r\n\t\t \t \t /*for current font size and the whole txt width, the max character number is 20*/\r\n\t\t\t \t if(d.Name.length > 20){\r\n\t\t\t \t\t return d.Name.substr(0,18) + \"...\";\r\n\t\t\t \t }\r\n\t\t\t \t else{\r\n\t\t\t \t\t return d.Name; \r\n\t\t\t \t }\r\n\t\t \t\t});\r\n\t\r\n\t\t bar.append(\"svg:rect\")\r\n\t\t .attr(\"width\", function(d) { return x(value(d)); })\r\n\t\t .style(\"fill\", function(d) { return rs.view.getColorByVariancePercentage(d.VariancePercentage,d.Total); })\r\n\t\t .attr(\"height\", y);\r\n\r\n\t\t \t\r\n\t\t return bar;\r\n\t\t}", "function findWidth() {\n if (noteStack == \"stack_bar_top\") {\n return \"100%\";\n }\n if (noteStack == \"stack_bar_bottom\") {\n return \"70%\";\n } else {\n return \"290px\";\n }\n }", "function toBarPerc(n) {\nreturn (-1 + n) * 100;\n}", "drawWidth(ctx,data,radius,color){\n\t\tctx.save();\n let barWidth = 3;\n let barHeight = 6;\n\t\tlet previousPoint = {};\n\t\tlet point = {};\n\t\tlet angle = this.startingAngle;\n\t\tctx.translate(ctx.canvas.width/2, ctx.canvas.height/2);\n\t\tctx.strokeStyle = \"rgb(\" + color[0] + \",\" + color[1] + \",\" + color[2] + \",\" + color[3] + \")\";\n\t\tctx.lineWidth = 3;\n\t\tctx.beginPath();\n for (let i = 0; i < data.length; i++) {\n\t\t\tpoint.x = Math.cos(angle)*(radius + this.spacing);\n\t\t\tpoint.y = Math.sin(angle)*(radius + this.spacing);\n\t\t\tangle += (Math.PI * 2/data.length);\n if(i == 0)\n\t\t\t{\n\t\t\t\tpreviousPoint.x = point.x;\n\t\t\t\tpreviousPoint.y = point.y;\n\t\t\t\tctx.moveTo(point.x,point.y)\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tctx.lineTo(point.x,point.y);\n\t\t\t\tctx.lineWidth = data[i]*0.2;\n\t\t\t\tctx.stroke();\n\t\t\t\t\n\t\t\t}\n\t\t\tpreviousPoint.x = point.x;\n\t\t\tpreviousPoint.y = point.y;\n }\n\t\tctx.closePath();\n\t\tctx.stroke();\n\t\tctx.restore();\n\t}", "percentageBar (score) {\n var styles = {\n height: '5px',\n backgroundColor: 'black',\n borderRadius: '15px'\n };\n styles.width = (score / 5 * 100) + '%';\n return styles;\n }", "function BarDrawUtil() {\n var me = this;\n /****Constants****/\n var BAR_COLOR = /*\"#4A87F8\"*/\"#178FB7\";\n //Layout\n var MAX_BAR_WIDTH = 24;\n var NICE_BAR_WIDTH = 12;\n var MIN_BAR_WIDTH = 2;\n var BEST_PAD_BETWEEN_BARS = 1;\n\n /****Externally set****/\n //Data\n var dataList;\n //Utils\n var yAxis;\n var xAxis;\n //Structure\n var barGroup;\n var concealerGroup;\n //Layout\n var bottomExtraPadding;\n\n /**Internally Set**/\n //Data\n var barCount;\n //Layout\n var barWidth;\n\n\n /**Public Functions***/\n this.setLayoutParams = function (bottomExtraPaddingInput) {\n bottomExtraPadding = bottomExtraPaddingInput;\n };\n\n this.setData = function (dataListInput, xAxisInput, yAxisInput) {\n dataList = dataListInput;\n xAxis = xAxisInput;\n yAxis = yAxisInput;\n };\n\n this.setPapaGroups = function (barGroupInput, concealerGroupInput) {\n barGroup = barGroupInput;\n concealerGroup = concealerGroupInput;\n };\n\n this.drawComponent = function () {\n createAllBars();\n };\n\n /**Construct***/\n function createAllBars() {\n calculateBarWidth();\n for (var i = 0; i < dataList.length; i++) {\n createBar(i);\n }\n }\n\n function createBar(index) {\n var dataPoint = dataList[index];\n var value = dataPoint.close;\n var x = xAxis.scale(index) - barWidth / 2;\n var baseY = yAxis.scale(0);\n var y = yAxis.scale(value);\n var height;\n\n\n\n if (value > 0) {\n height = baseY - y;\n } else {\n height = y - baseY;\n y = baseY;\n }\n\n x = trimToTwoDecimalDigits(x);\n height = trimToTwoDecimalDigits(height);\n y = trimToTwoDecimalDigits(y);\n var bar = barGroup.append(\"rect\")\n .attr({\n x: x,\n y: y,\n height: height,\n width: barWidth\n })\n .style({\n fill: BAR_COLOR\n });\n }\n\n /**Calculate***/\n function calculateBarWidth() {\n var barWithPadWidth = xAxis.scale(1) - xAxis.scale(0);\n barWidth = barWithPadWidth * 0.9;\n barCount = dataList.length;\n\n\n barWidth = trimToTwoDecimalDigits(barWidth);\n }\n}", "setInitialBarSizes (bars) {\n const barDomainExtent = d3.extent(this.getInnerXScale().domain())\n\n const colorCategoryScale = this.props.colors\n ? this.props.colors.length === 2\n ? d3\n .scaleLinear()\n .domain(barDomainExtent)\n .range(this.props.colors)\n : d3.scaleOrdinal(this.props.colors)\n : d3.scaleOrdinal(d3.schemeCategory10)\n\n bars\n .attr('x', (d, i) => this.getInnerXScale()(i))\n .attr('y', d => this.height)\n .attr('width', this.getInnerXScale().bandwidth())\n .attr('height', 0)\n .attr('fill', (d, i) => d.color || colorCategoryScale(i))\n }", "function updateHealthbar() {\n let redPos = redBar.components.position;\n redPos.width = (health - currHealth) / health * redPos.height * 4;\n\n let greenPos = greenBar.components.position;\n greenPos.width = greenPos.height * 4 - redPos.width;\n }", "calculateRadius() {\r\n let radius = 50;\r\n if (this.progressWidth || this.backgroundWidth) {\r\n const maxVal = (this.progressWidth > this.backgroundWidth) ? this.progressWidth : this.backgroundWidth;\r\n radius = radius - (maxVal / 2);\r\n }\r\n else {\r\n radius = radius - 2;\r\n }\r\n return radius;\r\n }", "function getBarSpeed() {\n if (level > 3) {\n barSpeed = timer[3];\n } else {\n barSpeed = timer[level];\n }\n return barSpeed;\n }", "function barheight(){\n\t\t\t//.bar height\n\t\t\t$(\".bar\").each( \n\t\t\t\tfunction( i ){\n\t\t\t\t\tvar boxesheight = $(this).next(\".boxes\").innerHeight();\n\t\t\t\t\t$(this).height( boxesheight - 6 );\n\t\t\t\t\t// $(this).ellipsis( options={ellipsis:\"\"} );\n\t\t\t\t}\n\t\t\t);\n\t\t}", "function xBar(dir, // direction, 'ltr', 'rtl', 'ttb', or 'btt'\r\n conStyle, barStyle) // container and bar style class names\r\n{\r\n //// Public Properties\r\n\r\n this.value = 0; // current value, read-only\r\n\r\n //// Public Methods\r\n\r\n // Update current value\r\n this.update = function(v)\r\n {\r\n if (v < 0) v = 0;\r\n else if (v > this.inMax) v = this.inMax;\r\n this.con.title = this.bar.title = this.value = v;\r\n switch(this.dir) {\r\n case 'ltr': // left to right\r\n v = this.scale(v, this.w);\r\n xLeft(this.bar, v - this.w);\r\n break;\r\n case 'rtl': // right to left\r\n v = this.scale(v, this.w);\r\n xLeft(this.bar, this.w - v);\r\n break;\r\n case 'btt': // bottom to top\r\n v = this.scale(v, this.h);\r\n xTop(this.bar, this.h - v);\r\n break;\r\n case 'ttb': // top to bottom\r\n v = this.scale(v, this.h);\r\n xTop(this.bar, v - this.h);\r\n break;\r\n }\r\n };\r\n\r\n // Change position and/or size\r\n this.paint = function(x, y, // container position\r\n w, h) // container size\r\n {\r\n if (xNum(x)) this.x = x;\r\n if (xNum(y)) this.y = y;\r\n if (xNum(w)) this.w = w;\r\n if (xNum(h)) this.h = h;\r\n xResizeTo(this.con, this.w, this.h);\r\n xMoveTo(this.con, this.x, this.y);\r\n xResizeTo(this.bar, this.w, this.h);\r\n xMoveTo(this.bar, 0, 0);\r\n };\r\n\r\n // Change scale and/or start value\r\n this.reset = function(max, start) // non-scaled values\r\n {\r\n if (xNum(max)) this.inMax = max;\r\n if (xNum(start)) this.start = start;\r\n this.update(this.start);\r\n };\r\n\r\n //// Private Methods\r\n \r\n this.scale = function(v, outMax)\r\n {\r\n return Math.round(xLinearScale(v, 0, this.inMax, 0, outMax));\r\n };\r\n\r\n //// Private Properties\r\n\r\n this.dir = dir;\r\n this.x = 0;\r\n this.y = 0;\r\n this.w = 100;\r\n this.h = 100;\r\n this.inMax = 100;\r\n this.start = 0;\r\n this.conStyle = conStyle;\r\n this.barStyle = barStyle;\r\n\r\n //// Constructor\r\n\r\n // Create container\r\n this.con = document.createElement('DIV');\r\n this.con.className = this.conStyle;\r\n // Create bar\r\n this.bar = document.createElement('DIV');\r\n this.bar.className = this.barStyle;\r\n // Insert in object tree\r\n this.con.appendChild(this.bar);\r\n document.body.appendChild(this.con);\r\n\r\n} // end xBar", "function resizeBarChart(){\n let barChart = document.getElementById('bar-chart');\n let bars = document.getElementsByClassName(\"single-bar\");\n let arraySize = $('#arraySize').val();\n let newBarWidth = ((barChart.clientWidth - 20 - ((bars.length )*2))/(arraySize));\n for(let bar of bars){\n bar.style.width = newBarWidth + \"px\";\n }\n}", "function barUtil () {\n\n var decorate = noop,\n barWidth = fractionalBarWidth(0.75),\n orient = 'vertical',\n pathGenerator = bar();\n\n var base = xyBase().xValue(function (d, i) {\n return orient === 'vertical' ? d.x : d.y;\n }).yValue(function (d, i) {\n return orient === 'vertical' ? d.y : d.x;\n });\n\n var dataJoin$$ = dataJoin().selector('g.bar').element('g');\n\n function containerTranslation(d, i) {\n if (orient === 'vertical') {\n return 'translate(' + base.x1(d, i) + ', ' + base.y0(d, i) + ')';\n } else {\n return 'translate(' + base.x0(d, i) + ', ' + base.y1(d, i) + ')';\n }\n }\n\n function barHeight(d, i) {\n if (orient === 'vertical') {\n return base.y1(d, i) - base.y0(d, i);\n } else {\n return base.x1(d, i) - base.x0(d, i);\n }\n }\n\n function valueAxisDimension(generator) {\n if (orient === 'vertical') {\n return generator.height;\n } else {\n return generator.width;\n }\n }\n\n function crossAxisDimension(generator) {\n if (orient === 'vertical') {\n return generator.width;\n } else {\n return generator.height;\n }\n }\n\n function crossAxisValueFunction() {\n return orient === 'vertical' ? base.x : base.y;\n }\n\n var bar$$ = function bar$$(selection) {\n selection.each(function (data, index) {\n\n if (orient !== 'vertical' && orient !== 'horizontal') {\n throw new Error('The bar series does not support an orientation of ' + orient);\n }\n\n dataJoin$$.attr('class', 'bar ' + orient);\n\n var filteredData = data.filter(base.defined);\n\n pathGenerator.x(0).y(0).width(0).height(0);\n\n if (orient === 'vertical') {\n pathGenerator.verticalAlign('top');\n } else {\n pathGenerator.horizontalAlign('right');\n }\n\n // set the width of the bars\n var width = barWidth(filteredData.map(crossAxisValueFunction()));\n crossAxisDimension(pathGenerator)(width);\n\n var g = dataJoin$$(this, filteredData);\n\n // within the enter selection the pathGenerator creates a zero\n // height bar. As a result, when used with a transition the bar grows\n // from y0 to y1 (y)\n g.enter().attr('transform', containerTranslation).append('path').attr('d', function (d) {\n return pathGenerator([d]);\n });\n\n // set the bar to its correct height\n valueAxisDimension(pathGenerator)(barHeight);\n\n g.attr('transform', containerTranslation).select('path').attr('d', function (d) {\n return pathGenerator([d]);\n });\n\n decorate(g, filteredData, index);\n });\n };\n\n bar$$.decorate = function (x) {\n if (!arguments.length) {\n return decorate;\n }\n decorate = x;\n return bar$$;\n };\n bar$$.barWidth = function (x) {\n if (!arguments.length) {\n return barWidth;\n }\n barWidth = d3.functor(x);\n return bar$$;\n };\n bar$$.orient = function (x) {\n if (!arguments.length) {\n return orient;\n }\n orient = x;\n return bar$$;\n };\n\n d3.rebind(bar$$, base, 'xScale', 'xValue', 'x1Value', 'x0Value', 'yScale', 'yValue', 'y1Value', 'y0Value');\n d3.rebind(bar$$, dataJoin$$, 'key');\n\n return bar$$;\n }", "function numberOfBars(numTrials){\n //returns dataset with desired bars (4/8)\n}", "function getBars(props, moreProps) {\n\tvar baseAt = props.baseAt,\n\t fill = props.fill,\n\t stroke = props.stroke,\n\t yAccessor = props.yAccessor;\n\tvar xScale = moreProps.xScale,\n\t xAccessor = moreProps.xAccessor,\n\t plotData = moreProps.plotData,\n\t yScale = moreProps.chartConfig.yScale;\n\n\n\tvar getFill = (0, _utils.functor)(fill);\n\tvar getBase = (0, _utils.functor)(baseAt);\n\n\tvar widthFunctor = (0, _utils.functor)(props.width);\n\n\tvar width = widthFunctor(props, {\n\t\txScale: xScale,\n\t\txAccessor: xAccessor,\n\t\tplotData: plotData\n\t});\n\n\t/*\n const barWidth = Math.round(width);\n const offset = Math.round(barWidth === 1 ? 0 : 0.5 * barWidth);\n */\n\tvar offset = Math.floor(0.5 * width);\n\n\tvar bars = plotData.map(function (d) {\n\t\tvar yValue = yAccessor(d);\n\t\tvar y = yScale(yValue);\n\n\t\tvar x = Math.round(xScale(xAccessor(d))) - offset;\n\t\tvar h = getBase(xScale, yScale, d) - yScale(yValue);\n\n\t\tif (h < 0) {\n\t\t\ty = y + h;\n\t\t\th = -h;\n\t\t}\n\n\t\treturn {\n\t\t\t// type: \"line\"\n\t\t\tx: x,\n\t\t\ty: Math.round(y),\n\t\t\theight: Math.round(h),\n\t\t\twidth: offset * 2,\n\t\t\tfill: getFill(d, 0),\n\t\t\tstroke: stroke ? getFill(d, 0) : \"none\"\n\t\t};\n\t});\n\n\treturn bars;\n}", "function barPositionCSS(n, speed, ease) {\n\t var barCSS;\n\t\n\t if (Settings.positionUsing === 'translate3d') {\n\t barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' };\n\t } else if (Settings.positionUsing === 'translate') {\n\t barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' };\n\t } else {\n\t barCSS = { 'margin-left': toBarPerc(n)+'%' };\n\t }\n\t\n\t barCSS.transition = 'all '+speed+'ms '+ease;\n\t\n\t return barCSS;\n\t }", "function barPositionCSS(n, speed, ease) {\n\t var barCSS;\n\n\t if (Settings.positionUsing === 'translate3d') {\n\t barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' };\n\t } else if (Settings.positionUsing === 'translate') {\n\t barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' };\n\t } else {\n\t barCSS = { 'margin-left': toBarPerc(n)+'%' };\n\t }\n\n\t barCSS.transition = 'all '+speed+'ms '+ease;\n\n\t return barCSS;\n\t }", "function barPositionCSS(n, speed, ease) {\n\t var barCSS;\n\n\t if (Settings.positionUsing === 'translate3d') {\n\t barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' };\n\t } else if (Settings.positionUsing === 'translate') {\n\t barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' };\n\t } else {\n\t barCSS = { 'margin-left': toBarPerc(n)+'%' };\n\t }\n\n\t barCSS.transition = 'all '+speed+'ms '+ease;\n\n\t return barCSS;\n\t }", "function toBarPerc(n) {\n\t return (-1 + n) * 100;\n\t }", "function toBarPerc(n) {\n\t return (-1 + n) * 100;\n\t }", "function toBarPerc(n) {\n\t return (-1 + n) * 100;\n\t }", "function toBarPerc(n) {\n\t return (-1 + n) * 100;\n\t }", "function renderBarChart() {\n drawAxisCalibrations();\n var i, j, p, a, x, y, w, h, len;\n\n if (opts.orient === \"horiz\") {\n rotate();\n }\n\n drawAxis();\n\n ctx.lineWidth = opts.stroke || 1;\n ctx.lineJoin = \"miter\";\n\n len = sets[0].length;\n\n // TODO fix right pad\n for (i = 0; i < sets.length; i++) {\n for (j = 0; j < len; j++) {\n p = 1;\n a = rotated ? height : width;\n w = ((a / len) / sets.length) - ((p / sets.length) * i) - 1;\n x = (p / 2) + getXForIndex(j, len + 1) + (w * i) + 1;\n y = getYForValue(sets[i][j]);\n h = y - getYForValue(0) || !isNaN(opts.mapZeroValueTo) && +opts.mapZeroValueTo || 0;\n\n if (isStacked()) {\n // TODO account for negative and positive values in same stack\n w = (a / len) - 2;\n x = getXForIndex(j, len + 1);\n //y = getYForValue(sumY(sets.slice(0, i + 1), j));\n \n // Accounting for negative and positive values in same stack\n y = getYForValue(sumYSigned(sets, i, j));\n }\n\n drawRect(colorOf(i), x, y, w, h);\n }\n }\n }", "getCurrentSliderPercentage_() {\n const {left: barLeft} =\n this.bar_./*OK*/getBoundingClientRect();\n const {left: boxLeft, width: boxWidth} = this.getLayoutBox();\n return (barLeft - boxLeft) / boxWidth;\n }", "function createBars(vals) {\n var barLeft;\n if (that.model.get(\"columnShift\")) {\n barLeft = \" style=left:\" + that.model.get(\"columnShift\") + \"px\";\n }\n var html = [\"<div class='bars'\" + barLeft + \">\"];\n for (var i = 0; i < vals.length; i++) {\n html.push(\"<div class='bar bar\" + (i + 1) + \"' style='height:\" + Math.round(100 * vals[i]) + \"%'></div>\");\n }\n html.push(\"</div>\");\n return html.join(\"\");\n }", "function bar_height(d, i, roll) {\n var val = roll[1][i], chart_height = hist.chart_height();\n if(val === 0) return 0;\n val = y_scale(val);\n return chart_height-val;\n return Math.max(chart_height - val, min_bar_height);\n }", "function prepare_bar (i, bar) {\n // more principled approach: map each parameter to a specific thing\n // \n // map heart rate to volume\n // map speed to rhythm\n // map altitude to number of instruments\n return function (time) {\n let rider = rider_data[i];\n\n const hr = rider['heartrate'];\n const pr = rider['watts'];\n const vel = rider['velocity'];\n const altitude = rider['altitude'];\n const distance = rider['distance'];\n\n const max_hr = hr !== undefined ? max_without_zeros(hr) : 150;\n const min_hr = hr !== undefined ? min_without_zeros(hr) : 149;\n\n const max_alt = max_without_zeros(altitude);\n const min_alt = min_without_zeros(altitude);\n\n const max_vel = max_without_zeros(vel);\n const min_vel = min_without_zeros(vel);\n \n const section = Math.floor((bar) / (bars / 4));\n \n notes = note_choices[section];\n\n // 1. figure out the volume:\n const hr_avg = hr !== undefined ? avg_in_bar(hr, bar) : 149.5;\n const pwr_avg = avg_in_bar(pr, bar);\n const vel_avg = avg_in_bar(vel, bar);\n\n // how do we map to volume? maybe -10 to + 10 or -20 to +10?\n // what we actually want is the block max and min, not overall max and min\n let volume = 20 * (hr_avg - min_hr) / (max_hr - min_hr) - 10;\n volume = isNaN(volume) ? 0 : volume;\n\n // maybe this shouldn't affect the master volume?\n if (i == 0) {\n Tone.Master.volume.linearRampToValueAtTime(volume, time + Tone.Time(bar.toString() + ':0:0'));\n }\n\n // 2. number of instruments\n const altitude_avg = avg_in_bar(altitude, bar);\n\n // instr_count is essentially the percentage of the way from our min altitude to our max altitude\n const instr_count = (altitude_avg - min_alt) / (max_alt - min_alt);\n\n // pick a note for each rider\n const note = notes[i % notes.length];\n\n // these are all pretty arbitrary instrument choices, and any creative decisions can go here\n ///\n /// WARNING: CREATIVITY REQUIRED\n ///\n if (instr_count >= 0) {\n clarinet.triggerAttackRelease(note + \"3\", \"2n\", time);\n clarinet.triggerAttackRelease(note + \"3\", \"2n\", time + Tone.Time(\"0:2:0\"));\n clarinet.triggerAttackRelease(note + \"3\", \"2n\", time + Tone.Time(\"0:4:0\"));\n clarinet.triggerAttackRelease(note + \"3\", \"2n\", time + Tone.Time(\"0:6:0\"));\n }\n if (instr_count >= 0.01 && bar > 2) {\n for (let i = 0; i < 8; i++) {\n piano.triggerAttackRelease(notes[0] + \"3\", \"4n\", Tone.TimeBase({\"4n\": i}) + time);\n }\n }\n if (instr_count >= 0.2) {\n bass.triggerAttackRelease(notes[0] + \"2\", \"1n\", time);\n }\n if (instr_count >= 0.3) {\n xylo.triggerAttackRelease(note + \"4\", \"8n\", time);\n xylo.triggerAttackRelease(note + \"4\", \"8n\", time + Tone.Time(\"0:1:0\"));\n xylo.triggerAttackRelease(note + \"4\", \"8n\", time + Tone.Time(\"0:6:0\"));\n xylo.triggerAttackRelease(note + \"4\", \"8n\", time + Tone.Time(\"0:7:0\"));\n }\n if (instr_count >= 0.5) {\n sax.triggerAttackRelease(note + \"3\", \"2n\", time);\n sax.triggerAttackRelease(note + \"3\", \"2n\", time + Tone.Time(\"0:2:0\"));\n sax.triggerAttackRelease(note + \"3\", \"2n\", time + Tone.Time(\"0:6:0\"));\n }\n if (instr_count >= 0.7) {\n flute.triggerAttackRelease(note + \"3\", \"2n\", time);\n flute.triggerAttackRelease(note + \"3\", \"2n\", time + Tone.Time(\"0:6:0\"));\n }\n\n\n // if we're over 300W, we'll bring in a snare drum part... this is completely arbitrary and will\n // need changing if this is made into a proper thing\n // only show the power data for de gendt\n // if (pwr_avg > 300 && i == 0) {\n // snare.triggerAttackRelease(\"E5\", \"8n\", time);\n\n // // again, hard coded values for now, but we'll improve this another time.\n // snare.volume.linearRampToValueAtTime((pwr_avg - 500) / 20, time); \n // }\n\n const vel_range = (vel_avg - min_vel) / (max_vel - min_vel);\n\n if (bar >= 3) {\n if (vel_range <= 0.1) {\n for (let i = 0; i < 8; i++) {\n snare.triggerAttackRelease(\"E5\", \"16n\", Tone.TimeBase({\"4n\": i}) + time);\n }\n } else if (vel_range <= 0.33) {\n for (let i = 0; i < 2; i++) {\n snare.triggerAttackRelease(\"E5\", \"16n\", Tone.TimeBase({\"4n\": i}) + time);\n }\n for (let i = 0; i < 4; i++) {\n snare.triggerAttackRelease(\"E5\", \"32n\", Tone.TimeBase({\"4n\": 2}) + Tone.TimeBase({\"8n\": i}) + time);\n }\n }\n else {\n for (let i = 0; i < 2; i++) {\n snare.triggerAttackRelease(\"E5\", \"16n\", Tone.TimeBase({\"4n\": i}) + time);\n }\n for (let i = 0; i < 2; i++) {\n snare.triggerAttackRelease(\"E5\", \"32n\", Tone.TimeBase({\"4n\": 2}) + Tone.TimeBase({\"8n\": i}) + time);\n }\n for (let i = 0; i < 4; i++) {\n snare.triggerAttackRelease(\"E5\", \"64n\", Tone.TimeBase({\"4n\": 3}) + Tone.TimeBase({\"8n\": i}) + time);\n }\n }\n }\n\n ///\n /// NOTE: END OF CREATIVITY\n ///\n }\n}", "function barPositionCSS(n, speed, ease) {\n\t var barCSS;\n\n\t if (Settings.positionUsing === 'translate3d') {\n\t barCSS = { transform: 'translate3d(' + toBarPerc(n) + '%,0,0)' };\n\t } else if (Settings.positionUsing === 'translate') {\n\t barCSS = { transform: 'translate(' + toBarPerc(n) + '%,0)' };\n\t } else {\n\t barCSS = { 'margin-left': toBarPerc(n) + '%' };\n\t }\n\n\t barCSS.transition = 'all ' + speed + 'ms ' + ease;\n\n\t return barCSS;\n\t }", "function getBarExtent(){\n \t\tvar repExtent = getExtent(\"Representatives\"),\n \t\t\telectoralExtent = getExtent(\"Electoral Votes\");\n \t\treturn [d3.min([repExtent[0],electoralExtent[0]]), d3.max([repExtent[1],electoralExtent[1]])];\n\t\t}", "function drawBarGraph() {\n var mapped;\n for(i = 0; i < gradPercentages.length; i++) {\n console.log(gradPercentages);\n console.log(yRange);\n //I'm not yet sure why I have to have the second start value as 0\n // mapped = map(yTickLabels[i], 0, yRange[0], margin, height - margin * 2);\n /*** TEMP TEST ***/\n mapped = map(gradPercentages[i], 0, yRange[0], 0, height - margin * 2);\n console.log(mapped);\n mappedHeights.push(mapped);\n }\n}", "function drawBar(data){\nvar svg = d3.select(\"#chart2\").append(\"svg\")\n\t\t\t.attr(\"width\", width)\n\t\t\t.attr(\"height\", height)\n\t\t\t.attr(\"transform\", \"translate(0,0)\"),\n margin = {top: 20, right: 20, bottom: 30, left: 40},\n width = +svg.attr(\"width\") - margin.left - margin.right,\n height = +svg.attr(\"height\") - margin.top - margin.bottom,\n g = svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\nvar x0 = d3.scaleBand()\n .rangeRound([0, width])\n .paddingInner(0.1);\n\nvar x1 = d3.scaleBand()\n .padding(0.05);\n\nvar y = d3.scaleLinear()\n .rangeRound([height, 0]);\n\nvar z = d3.scaleOrdinal(d3.schemeCategory10);\ndata.forEach(function(d, i){\n\n x0.domain(d.value.race.keys());\n x1.domain(d.value.race.keys()).rangeRound([0, x0.bandwidth()]);\n y.domain([0, 10]).nice();\n\n g.append(\"g\")\n .selectAll(\"g\")\n .data(data)\n .enter().append(\"g\")\n .attr(\"transform\", function(d) { \n\t \n\t return \"translate(\" + x0(d.State) + \",0)\"; })\n .selectAll(\"s3_rect\")\n .data(function(d) { return 10;})\n .enter().append(\"s3_rect\")\n .attr(\"x\", function(d) { return x1(d.key); })\n .attr(\"y\", function(d) { return y(d.value); })\n .attr(\"width\", x1.bandwidth())\n .attr(\"height\", function(d) { return height - y(d.value); })\n .attr(\"fill\", function(d) { return z(d.key); });\n\n g.append(\"g\")\n .attr(\"class\", \"s3_axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x0));\n\n g.append(\"g\")\n .attr(\"class\", \"s3_axis\")\n .call(d3.axisLeft(y).ticks(null, \"s\"))\n .append(\"text\")\n .attr(\"x\", 2)\n .attr(\"y\", y(y.ticks().pop()) + 0.5)\n .attr(\"dy\", \"0.32em\")\n .attr(\"fill\", \"#000\")\n .attr(\"font-weight\", \"bold\")\n .attr(\"text-anchor\", \"start\")\n .text(\"Population\");\n\n var legend = g.append(\"g\")\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", 10)\n .attr(\"text-anchor\", \"end\")\n .selectAll(\"g\")\n .data(d.value.race.keys())\n .enter().append(\"g\")\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; });\n\n legend.append(\"rect\")\n .attr(\"x\", width - 19)\n .attr(\"width\", 19)\n .attr(\"height\", 19)\n .attr(\"fill\", z);\n\n legend.append(\"text\")\n .attr(\"x\", width - 24)\n .attr(\"y\", 9.5)\n .attr(\"dy\", \"0.32em\")\n .text(function(d) { return d; });\n});\n}", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }", "function toBarPerc(n) {\n return (-1 + n) * 100;\n }" ]
[ "0.6897167", "0.68837523", "0.67884", "0.6748104", "0.6733237", "0.6733237", "0.6733237", "0.6733237", "0.6513658", "0.64330727", "0.63705564", "0.63193226", "0.6267019", "0.6200514", "0.61871135", "0.60821056", "0.60558355", "0.6031888", "0.6010426", "0.599754", "0.59904987", "0.5981917", "0.5931968", "0.59314454", "0.58948374", "0.58773714", "0.5864514", "0.5858532", "0.5853847", "0.584804", "0.58231807", "0.58084315", "0.57881194", "0.5780383", "0.57667464", "0.5744797", "0.57393736", "0.5730484", "0.5722835", "0.57175285", "0.5714758", "0.5712097", "0.5695181", "0.5695103", "0.5670132", "0.5666271", "0.56438404", "0.56167084", "0.5583417", "0.5583417", "0.55765307", "0.55765307", "0.55765307", "0.55765307", "0.5562078", "0.5558125", "0.55316585", "0.55278105", "0.5525429", "0.5507758", "0.54912204", "0.54897803", "0.54897547", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179", "0.5489179" ]
0.6655762
9
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(ecModel) { ecModel.eachSeriesByType('radar', function (seriesModel) { var data = seriesModel.getData(); var points = []; var coordSys = seriesModel.coordinateSystem; if (!coordSys) { return; } var axes = coordSys.getIndicatorAxes(); zrUtil.each(axes, function (axis, axisIndex) { data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) { points[dataIndex] = points[dataIndex] || []; var point = coordSys.dataToPoint(val, axisIndex); points[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys); }); }); // Close polygon data.each(function (idx) { // TODO // Is it appropriate to connect to the next data when some data is missing? // Or, should trade it like `connectNull` in line chart? var firstPoint = zrUtil.find(points[idx], function (point) { return isValidPoint(point); }) || getValueMissingPoint(coordSys); // Copy the first actual point to the end of the array points[idx].push(firstPoint.slice()); data.setItemLayout(idx, points[idx]); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1
This action will be throttled.
function dispatchAction(api, batch) { api.dispatchAction({ type: 'dataZoom', batch: batch }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "throttle () {\n return _.throttle.apply(_, arguments);\n }", "function throttle (method. context) {\n clearTimeout(method.tld);\n method.tld = setTimeout(function () {\n method.call(context);\n }, 100);\n}", "set throttle(t) {\n this.system.throttle = t;\n }", "function throttledRequest(...args) {\n limiter.removeTokens(1, () => {\n util.request.apply(null, args);\n });\n}", "function _throttle(fn) {\n\t\tvar prev = Date.now();\n\t\treturn function (e) {\n\t\t\tif((Date.now() - prev) < THROTTLE_THRESHOLD) return;\n\t\t\tfn.call(this, e);\n\t\t\tprev = Date.now();\n\t\t};\n\t}", "_throttle (callback, limit) {\n let inThrottle = false;\n return function() {\n const args = arguments;\n const context = this;\n if (!inThrottle) {\n callback.apply(context, args);\n inThrottle = true;\n setTimeout(() => inThrottle = false, limit);\n }\n }\n }", "_configureThrottling() {\n if (this.options.maxTPS && this.options.maxTPS > 0) {\n const minTime = parseInt(1000 / this.options.maxTPS);\n if (minTime > 0) {\n this.rate_limiter = new Bottleneck({ minTime });\n this._processMatchedSqsMessage = this.rate_limiter.wrap(this._processMatchedSqsMessage);\n }\n }\n }", "_recomputeThrottled() {\n\n if (!this._recomputeRun) {\n this._recompute();\n this._recomputeRun = true;\n }\n\n this._clearRecomputeDebounced();\n }", "_throttledRequestHandler() {\n if (!this._requests) {\n Strophe.debug('_throttledRequestHandler called with ' + 'undefined requests');\n } else {\n Strophe.debug('_throttledRequestHandler called with ' + this._requests.length + ' requests');\n }\n\n if (!this._requests || this._requests.length === 0) {\n return;\n }\n\n if (this._requests.length > 0) {\n this._processRequest(0);\n }\n\n if (this._requests.length > 1 && Math.abs(this._requests[0].rid - this._requests[1].rid) < this.window) {\n this._processRequest(1);\n }\n }", "function ActionThrottle(action, minPeriod_ms) {\n\n var blocked = false;\n var queued = false;\n\n function enqueue() {\n if (!blocked) {\n blockAndExecute();\n } else {\n queued = true;\n }\n }\n\n function dequeue() {\n queued = false;\n }\n\n function blockAndExecute() {\n blocked = true;\n setTimeout(unblock, minPeriod_ms);\n action();\n }\n\n function unblock() {\n if (queued) {\n dequeue();\n blockAndExecute();\n } else {\n blocked = false;\n }\n }\n\n return {\n enqueue: enqueue,\n dequeue: dequeue\n }\n }", "static async rateLimiting() {\n await new Promise(resolve => setTimeout(resolve, 250))\n }", "function throttle( data, done ) {\n\n if ( state != STATE_THROTTLE ) {\n cacheRquest();\n }\n\n switch( state )\n {\n case STATE_READY :\n start();\n break;\n\n case STATE_START:\n break;\n\n // Proxy throttle call to custom, user-defined throttle handler\n case STATE_THROTTLE:\n invokeThrottleHandler(data, done);\n break;\n\n case STATE_END :\n restart();\n break;\n }\n\n // **********************************************************\n // Internal Methods\n // **********************************************************\n\n /**\n * Cache for later submission to 'throttle()'\n */\n function cacheRquest() {\n pendingActions.push({ data:data, done:done });\n }\n\n /**\n * Delegate to the custom throttle function...\n * When CTF reports complete, then proceed to the `end` state\n *\n * @param data Data to be delegated to the throttle function\n * @param done Callback when all throttle actions have completed\n */\n function invokeThrottleHandler(data, done) {\n\n if ( angular.isFunction(phases.throttle) ) {\n done = done || angular.noop;\n\n try {\n\n phases.throttle.apply( null, [data, function(response) {\n done.apply( null, [response] );\n end();\n }]);\n\n } catch( error ) {\n // Report error... and end()\n\n otherwise(error);\n end();\n }\n\n } else {\n end();\n }\n }\n }", "function throttledScrollEvents() {\n\n }", "throttle(msg, timeout = 1000, method = \"log\") {\n const key = method + (msg.message || msg);\n if (_throttle[key]) {\n clearTimeout(_throttle[key]);\n } else {\n this[method](msg);\n }\n const self = this;\n _throttle[key] = setTimeout(\n function() {\n self[this.method](\n Object.assign(this.msg, {\n suffix: \"Throttled - \" + self._getLastLine()\n })\n );\n delete _throttle[this.key];\n }.bind({\n key,\n method: method,\n msg: typeof msg === \"string\" ? { message: msg } : msg\n }),\n timeout\n );\n return this;\n }", "throttle(fn, delay) {\n let timer;\n return function () {\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n fn.apply(this, arguments);\n }, delay);\n }\n };\n }", "get time_limit_action() { return this._time_limit_action; }", "function setUpThrottle(req, res) {\n var speed = req.params.speed;\n rtorrentcontroller.setUpThrottle(speed, function(status) {\n res.send(status);\n });\n}", "function setThrottle(throttle){\n\t\t\t\t_this.throttle = throttle\n\t\t\t}", "function setThrottle(throttle){\n\t\t\t\t_this.throttle = throttle\n\t\t\t}", "@throttle(1000)\n decorated() {\n // call the spy\n spy()\n }", "function invokeThrottleHandler(data, done) {\n\n if ( angular.isFunction(phases.throttle) ) {\n done = done || angular.noop;\n\n try {\n\n phases.throttle.apply( null, [data, function(response) {\n done.apply( null, [response] );\n end();\n }]);\n\n } catch( error ) {\n // Report error... and end()\n\n otherwise(error);\n end();\n }\n\n } else {\n end();\n }\n }", "_throttler(callback) {\n // setTimeout doesn't complete while user scrolls on touchscreen (or trackpad) on Chrome, so we track the time of the last\n // request and allow the request to refire if it was too long ago\n if (!this.properties.throttler.timeout ||\n Date.now() - this.properties.throttler.lastCall > this._throttlerTimeout) {\n\n clearTimeout(this.properties.throttler.timeout);\n this.properties.throttler.lastCall = Date.now();\n this.properties.throttler.callWaiting = false;\n\n callback();\n\n this.properties.throttler.timeout = setTimeout(() => {\n this.properties.throttler.timeout = null;\n if (this.properties.throttler.callWaiting) {\n callback();\n this.properties.throttler.lastCall = Date.now();\n this.properties.throttler.callWaiting = false;\n }\n }, this._throttlerTimeout);\n } else {\n this.properties.throttler.callWaiting = true;\n }\n }", "function feedPendingActions( response ) {\n logResponse(response);\n\n state = STATE_THROTTLE;\n\n angular.forEach(pendingActions, function (it) {\n throttle( it.data, function(response) {\n logResponse(response);\n\n if ( angular.isFunction(it.done) ) {\n it.done(response);\n }\n });\n });\n\n pendingActions = [ ];\n }", "function throttledEpic(socket, types) {\n return action$ => \n action$.ofType(...types)\n .throttleTime(100, undefined, {leading: true, trailing: true})\n .do(action => socket.emit('message', action))\n .ignoreElements()\n}", "function ThrottlingSettings() {}", "function getThrottle(){\n\t\t\t\treturn _this.throttle;\n\t\t\t}", "function getThrottle(){\n\t\t\t\treturn _this.throttle;\n\t\t\t}", "hurryTick() {\n this.requestedDelay -= this.options.delay;\n }", "_send() {\n clearTimeout(this._conn._idleTimeout);\n this._throttledRequestHandler();\n this._conn._idleTimeout = setTimeout(() => this._conn._onIdle(), 100);\n }", "function throttle (callback, delay) {\n var previousCall = new Date().getTime();\n return function () {\n var time = new Date().getTime();\n\n if (time - previousCall >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n let previousCall = new Date().getTime();\n return function () {\n let time = new Date().getTime();\n\n if (time - previousCall >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttled(fn, delay) {\n let lastCall = 0;\n return function() {\n const now = new Date().getTime();\n if (now - lastCall < delay) {\n return;\n }\n lastCall = now;\n return fn.apply(this, arguments);\n };\n}", "function throttle() {\n var fn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;\n var interval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;\n\n var last = 0;\n\n return function () {\n var context = this;\n var now = Date.now();\n\n if (now - last > interval) {\n last = now;\n fn.apply(context, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if (time - previousCall >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttleUpdates(t,e){function u(){function e(){n=+new Date,t.apply(u,d)}var u=this,a=+new Date-n,d=arguments;i&&clearTimeout(i),a>r?e():i=setTimeout(e,r-a)}var i,n=0,r=50;return jQuery.guid&&(u.guid=t.guid=t.guid||jQuery.guid++),u}", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(fn, delay) {\n let lastCall = 0;\n\n return (...args) => {\n\n let context = this;\n\n let current = new Date().getTime();\n\n if(current - lastCall < delay) {\n return\n }\n lastCall = current;\n return fn.apply(context, ...args)\n }\n}", "function throttle(callback, delay) {\n\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function shouldAcceptThrottling() {\n return !options.forcePrefetchRatio || Math.random() > options.forcePrefetchRatio;\n}", "function throttledResizeEvents() {\n\n }", "function throttleDecorator(method) {\n return function() {\n var ctx = this;\n var args = Array.prototype.slice.call(arguments);\n var currentRetry = 0;\n\n if (\n typeof args[args.length - 1] === 'object' &&\n args[args.length - 1].currentRetry\n ) {\n currentRetry = args[args.length - 1].currentRetry;\n }\n\n return method.apply(this, args).catch(function(err) {\n if (err.status == 429 && ctx.throttleRetries) {\n debug('Handling throttle...')\n var sleepSeconds = parseInt(err.headers['x-throttle-wait-seconds'], 10);\n args.push({ currentRetry: ++currentRetry });\n\n debug('throttle', { sleepSeconds: sleepSeconds })\n return sleep(sleepSeconds * 1000).then(function() {\n debug('throttle run retry', currentRetry);\n return method.apply(ctx, args);\n });\n }\n throw err;\n });\n }\n}", "get throttleRate() {\n const { canary, binaryType, assert, referrer, expected } = this.opts;\n let throttleRate = 1;\n\n // Throttle errors from Stable.\n if (!canary && !['control', 'rc', 'nightly'].includes(binaryType)) {\n throttleRate /= 10;\n }\n\n // Throttle user errors.\n if (assert) {\n throttleRate /= 10;\n }\n\n // Throttle errors on origin pages; they may not be valid AMP docs.\n if (!CDN_REGEX.test(referrer)) {\n throttleRate /= 20;\n }\n\n if (expected) {\n throttleRate /= 10;\n }\n\n return throttleRate;\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function () {\n var time = new Date().getTime();\n\n if (time - previousCall >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n}", "function throttle(callback, delay) {\n var last;\n var timer;\n return function () {\n var context = this;\n var now = +new Date();\n var args = arguments;\n if (last && now < last + delay) {\n // le délai n'est pas écoulé on reset le timer\n clearTimeout(timer);\n timer = setTimeout(function () {\n last = now;\n callback.apply(context, args);\n }, delay);\n } else {\n last = now;\n callback.apply(context, args);\n }\n };\n }", "function throttledEvents() {\n\n // Use a delay to give the browser a chance to repaint before\n // getting transform properties\n setTimeout(function() {\n self.canvas.getTransformProperties();\n\n /**\n * Snap to the currently active step\n *\n * Assume the canvas is laid out in a 2 x 2 grid, the Sequence\n * element has a height of 100%, and the user is viewing the second\n * row of steps -- when the user resizes the window, the second row\n * of steps will no longer be positioned perfectly in the window.\n * This event will immediately snap the canvas back into place.\n */\n if (self.propertySupport.transitions === true) {\n self.canvas.move(self.currentStepId, false);\n }\n }, 500);\n\n // Callback\n self.throttledResize(self);\n }", "function throttledEvents() {\n\n // Use a delay to give the browser a chance to repaint before\n // getting transform properties\n setTimeout(function() {\n self.canvas.getTransformProperties();\n\n /**\n * Snap to the currently active step\n *\n * Assume the canvas is laid out in a 2 x 2 grid, the Sequence\n * element has a height of 100%, and the user is viewing the second\n * row of steps -- when the user resizes the window, the second row\n * of steps will no longer be positioned perfectly in the window.\n * This event will immediately snap the canvas back into place.\n */\n if (self.propertySupport.transitions === true) {\n self.canvas.move(self.currentStepId, false);\n }\n }, 500);\n\n // Callback\n self.throttledResize(self);\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function () {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n}", "function throttle(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n requestAnimationFrame(function () {\n scheduled = false;\n fn();\n });\n }\n };\n}", "function throttle(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n requestAnimationFrame(function () {\n scheduled = false;\n fn();\n });\n }\n };\n}", "get rateLimit() { return 2; }", "_sendRestart() {\n this._throttledRequestHandler();\n clearTimeout(this._conn._idleTimeout);\n }", "watch() {\n this._createDelayedRequest(0);\n }", "function throttle(f, delay){\n var timer = null;\n return function(){\n var context = this, args = arguments;\n clearTimeout(timer);\n timer = window.setTimeout(function(){\n f.apply(context, args);\n },\n delay || 500);\n };\n}", "function throttle(callback, delay) {\n let previousCall = new Date().getTime();\n return (...args) => {\n const time = new Date().getTime();\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback(...args);\n }\n };\n}", "function throttle(fn, ms){\n let isCoolDown = false;\n let prevArg, prevThis;\n return function bounced(){\n if (isCoolDown){\n prevArg = arguments;\n prevThis = this\n return;\n }\n fn.apply(this, arguments);\n isCoolDown = true;\n setTimeout(() => {\n isCoolDown = false;\n if (prevArg) {\n bounced.apply(prevThis, prevArg);\n prevArg = prevThis = null;\n }\n }, ms);\n }\n}", "function throttle(fn, limit) {\n let timer = null;\n let lastCall = null;\n return function() {\n let context = this;\n if (!lastCall) {\n fn.apply(context, [...arguments]);\n lastCall = Date.now();\n } else {\n clearTimeout(timer);\n timer = setTimeout(() => {\n fn.apply(context, [...arguments]);\n lastCall = Date.now();\n }, limit - (Date.now() - lastCall));\n }\n }\n}", "function setDownThrottle(req, res) {\n var speed = req.params.speed;\n rtorrentcontroller.setDownThrottle(speed, function(status) {\n res.send(status);\n });\n}", "function throttle(delay, callback) {\n let timeout;\n let lastExec = 0;\n return function (...args) {\n const self = this;\n const elapsed = performance.now() - lastExec;\n function exec() {\n timeout = undefined;\n lastExec = performance.now();\n callback.apply(self, args);\n }\n if (timeout)\n clearTimeout(timeout);\n if (elapsed > delay)\n exec();\n else\n timeout = setTimeout(exec, delay - elapsed);\n };\n }", "function throttle(delay, callback) {\n let timeout;\n let lastExec = 0;\n return function (...args) {\n const self = this;\n const elapsed = performance.now() - lastExec;\n function exec() {\n timeout = undefined;\n lastExec = performance.now();\n callback.apply(self, args);\n }\n if (timeout)\n clearTimeout(timeout);\n if (elapsed > delay)\n exec();\n else\n timeout = setTimeout(exec, delay - elapsed);\n };\n }", "function throttle (callback, limit) {\n\t\tvar wait = false; // Initially, we're not waiting\n\t\treturn function () { // We return a throttled function\n\t\t\tif (!wait) { // If we're not waiting\n\t\t\t\tcallback.call(); // Execute users function\n\t\t\t\twait = true; // Prevent future invocations\n\t\t\t\tsetTimeout(function () { // After a period of time\n\t\t\t\t\twait = false; // And allow future invocations\n\t\t\t\t}, limit);\n\t\t\t}\n\t\t}\n\t}", "function throttleRequest() {\n if (remaining !== null && remaining < chokePoint) {\n return new Promise(function (resolve, reject) {\n queue(resolve);\n debug(\"Request queued because remaining (%s) is less than choke-point (%s). Queue-length: %s \", remaining, chokePoint, requestQueue.length);\n });\n }\n debug(\"Not throttling requests because choke-point (%s) not hit yet (%s)\", chokePoint, remaining);\n return Promise.resolve();\n}", "function Recvq_Unthrottle() {\n\tthis.throttled = false;\n\tthis.num_sent = 3;\n\tthis.time_marker = system.timer;\n\tjs.setImmediate(Process_Recvq, this);\n}", "function throttleAdvance(fn, limit) {\n var trottleFn;\n var lastRunTime;\n return function() {\n var context = this,\n args = arguments;\n if (!lastRunTime) {\n fn.apply(context, args);\n lastRunTime = Date.now();\n } else {\n clearTimeout(trottleFn);\n trottleFn = setTimeout(() => {\n if (Date.now() - lastRunTime >= limit) {\n fn.apply(context, args);\n lastRunTime = Date.now();\n }\n }, limit - (Date.now() - lastRunTime));\n }\n };\n}", "function Throttle(callsPerPeriod, periodDuration) {\n\t\n\tvar self = this;\n\n\tthis.maxCalls = callsPerPeriod;\n\tthis.period = periodDuration;\n\t\n\tthis.callCount = 0;\n\t\n\tthis.delayQueue = [];\n\t\n\tthis.updateStatus = function() {\n\t\t$('#waitOnQueue').html(\"Queued Requests: \" + self.delayQueue.length + \" | Available Requests: \" + (self.maxCalls-self.callCount));\n\t};\n\n\t//function polled by the delay timer\n\tthis.delayPoll = function() {\n\t\tif(self.delayQueue.length>0) {\n\t\t\tvar deferred = self.delayQueue.shift();\n\t\t\tdeferred.resolve();\n\t\t\tsetTimeout(self.delayPoll, self.period);\n\t\t}\n\t\telse {\n\t\t\tself.callCount--;\n\t\t}\n\t\t\n\t\tself.updateStatus();\n\n\t};\n\t\n\t// queues future calls to delay until the specified timeout (in milliseconds) has passed.\n\t// used to prevent flooding GGG's servers with too many stash requests in a short time. \n\tthis.queue = function() {\n\n\t\tvar deferred = $.Deferred();\n\t\t\n\t\tif( this.callCount < this.maxCalls ) {\n\t\t\t// no need to queue, we have not hit the throttle yet.\n\t\t\tdeferred.resolve();\n\t\t\tthis.callCount++;\n\t\t\tsetTimeout(this.delayPoll, this.period);\n\t\t} else {\n\t\t\t// too many calls.\n\t\t\t// queue up the deferred so it can be processed when a slot becomes available\n\t\t\t// and simply return.\n\t\t\tthis.delayQueue.push(deferred);\n\t\t}\n\t\t\n\t\tself.updateStatus();\n\n\t\treturn deferred.promise();\n\n\t};\n\n\tself.updateStatus();\n\n}", "function throttle (callback, limit) {\n var wait = false; // Initially, we're not waiting\n return function () { // We return a throttled function\n if (!wait) { // If we're not waiting\n callback.call(); // Execute users function\n wait = true; // Prevent future invocations\n setTimeout(function () { // After a period of time\n wait = false; // And allow future invocations\n }, limit);\n }\n }\n }", "async applyAction(action){\n this._dispatchAction(action) \n }", "function snooze(action) {\n setTimeout(function() {\n action();\n }, 0);\n}", "componentWillMount() {\n this.delayedHandleChange = debounce(this.handleChange, 125);\n }", "function exec() {\n this._throttle[methodID] = {\n previous: (new Date()).getTime()\n };\n func.apply(this, arguments);\n }", "function throttle(func, ms) {\n\n let isThrottled = false,\n savedArgs,\n savedThis;\n\n function wrapper() {\n\n if (isThrottled) { // (2)\n savedArgs = arguments;\n savedThis = this;\n return;\n }\n\n func.apply(this, arguments); // (1)\n\n isThrottled = true;\n\n setTimeout(function() {\n isThrottled = false; // (3)\n if (savedArgs) {\n wrapper.apply(savedThis, savedArgs);\n savedArgs = savedThis = null;\n }\n }, ms);\n }\n\n return wrapper;\n}", "function throttle(func, ms) {\n let isThrottled = false;\n let savedArgs;\n let savedThis;\n\n function wrapper() {\n if (isThrottled) {\n // If is currently throttled, store the context / args\n savedArgs = arguments;\n savedThis = this;\n return;\n }\n\n func.apply(this, arguments); // First call\n\n isThrottled = true;\n\n setTimeout(function() {\n isThrottled = false; // No longer throttled\n if (savedArgs) {\n wrapper.apply(savedThis, savedArgs); // Call the wrapper with the saved context / args\n savedArgs = null;\n savedThis = null;\n }\n }, ms);\n }\n\n return wrapper;\n}", "onTimeOut() {\n if(this.exhausted) {\n this.stop();\n return;\n }\n \n this.roll();\n }", "async throttle(pinCodesArr) {\n let counter = 0;\n const batch = 60;\n const self = this;\n return async function () {\n return new Promise((resolve, reject) => {\n const interval = setInterval(async () => {\n await self.requestBatch(pinCodesArr.slice(counter, counter + batch));\n counter += batch;\n if (counter >= pinCodesArr.length) {\n clearInterval(interval);\n // console.log(\"clearing interval\");\n resolve(self.finalCsvRows);\n } else console.log(\"sleeping for 1 secs\");\n }, 1000);\n });\n };\n }", "async attack (action_) { _attack (action_); }", "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 }", "function throttle(cb) {\n\tvar queued = false;\n\n\treturn function () {for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}\n\t\tif (queued) return;\n\n\t\tqueued = true;\n\t\trequestAnimationFrame(function (_) {\n\t\t\tqueued = false;\n\t\t\tcb.apply(undefined, args);\n\t\t});\n\t};\n}", "function halfThrottle(percent){\n\tvar speed = 50 + (25 * percent);\n\treturn speed;\n}", "function throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last,\n deferTimer;\n return function () {\n var context = scope || this;\n\n var now = +new Date,\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n }", "asPostParamter() {\n return this.limiter({\n path: '/user-details-multi/',\n method: 'post',\n lookup: ['body.id' , 'connection.remoteAddress'],\n total: 5,\n expire: 1000 * 60 * 60,\n onRateLimited: function (request, response, next) {\n response.status(429).json('You are not welcome here, Rate limit exceeded');\n }\n });\n }", "static throttle(func, delay) {\r\n let isWaiting = false;\r\n return (...args) => {\r\n if (!isWaiting) {\r\n isWaiting = true;\r\n setTimeout(() => { func(...args); isWaiting = false; }, delay);\r\n }\r\n };\r\n }", "throttle (callback, wait) {\n var time,\n go = true;\n return function() {\n if(go) {\n go = false;\n time = setTimeout(function(){\n time = null;\n go = true;\n callback.call();\n }, wait);\n }\n }\n }", "function ipThrottler() {\n return throttler({\n idFunction(ctx) {\n return ctx.ip;\n },\n procureThrottlerFunction: procureThrottler,\n });\n}", "hit () {\n this.hitTime = 0;\n }", "componentDidMount() {\n this.handleClick = _.debounce(this.handleClick.bind(this), 150);\n }", "function function_throttle(fn, delay) {\n var timer = null;\n if (!delay) delay = 750; // default to 750 millisecs\n return function () {\n var context = this, args = arguments;\n clearTimeout(timer);\n timer = setTimeout(function(){\n fn.apply(context, args);\n }, delay);\n };\n}", "function RateLimit(fn, delay, context) {\n let latestCall = null;\n let timer = null;\n\n function processLatestCall() {\n if (latestCall) {\n fn.apply(latestCall.context, latestCall.arguments);\n clearInterval(timer);\n timer = null;\n }\n }\n\n return function limited(...args) {\n latestCall = {\n context: context || this,\n arguments: [].slice.call(args),\n };\n if (timer) {\n clearInterval(timer);\n }\n timer = setInterval(processLatestCall, delay);\n };\n}", "function throttle(fn, timespan) {\n\tvar timeout = 0;\n\tvar nextTrig = 0;\n\tvar _this, _args;\n\n\tfunction timeoutCallback() {\n\t\ttimeout = 0;\n\t\tcall.apply(_this, _args);\n\t}\n\n\tfunction call() {\n\t\tvar now = +new Date();\n\t\tif (now >= nextTrig) {\n\t\t\tnextTrig = now + timespan;\n\t\t\tfn.apply(this, arguments);\n\t\t} else {\n\t\t\t_this = this;\n\t\t\t_args = arguments;\n\t\t\tif (!timeout) timeout = setTimeout(timeoutCallback, nextTrig - now);\n\t\t}\n\t}\n\n\treturn call;\n}", "_debounceRender(cb,asyncModule){super._debounceRender(()=>this._accessIronListAPI(cb),asyncModule)}", "function throttle(fn, delay) {\n let queued = false,\n current;\n return val => {\n current = val;\n if(queued) return;\n queued = true;\n setTimeout(() => {\n queued = false;\n fn(current);\n }, delay);\n }\n}", "_createScale() {\n this.debounce('_createScale', function() {\n this._createScaleDebounced();\n }, 10);\n }", "function throttle(f, interval) {\n\tvar timer\n\t\n\treturn function() {\n\t\tlet context = this\n\t\tlet args = arguments\n\t\t\n\t\tif (timer) return;\n\t\t\n\t\ttimer = setTimeout( ()=>{\n\t\t\tclearTimeout(timer)\n\t\t\ttimer = null\n\t\t\tf.apply(context, args)\n\t\t}, interval )\n\n\t}\n}", "function throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 100);\n var last,\n deferTimer;\n return function () {\n var context = scope || this;\n\n var now = +new Date,\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n }\n else {\n last = now;\n fn.apply(context, args);\n }\n };\n}", "function throttleCarousel() {\n\t\t\t$('.ss-carousel .pag li a').fastTabFix();\n\t\t}", "function trigger (retryAfter) {\n requestsMade = limitNo\n since = (Date.now() + retryAfter * 1000)\n }" ]
[ "0.6899684", "0.6878536", "0.66055375", "0.65668017", "0.6566585", "0.64832175", "0.6468493", "0.6352173", "0.6343378", "0.6342932", "0.63019234", "0.6262077", "0.62402064", "0.6228161", "0.617086", "0.60943234", "0.6088599", "0.6071916", "0.6071916", "0.6071447", "0.60616916", "0.6054052", "0.5979788", "0.5973564", "0.59729505", "0.59676176", "0.59676176", "0.5965153", "0.5942582", "0.59206307", "0.5908516", "0.5904686", "0.58709383", "0.5870872", "0.58690876", "0.5868904", "0.5868904", "0.5868904", "0.5868904", "0.5868904", "0.5868904", "0.5868904", "0.5856563", "0.58089864", "0.5800457", "0.5761679", "0.57440406", "0.5740402", "0.57330334", "0.5720315", "0.57115895", "0.5705727", "0.5705727", "0.5692958", "0.565514", "0.565514", "0.56524026", "0.56516266", "0.5637764", "0.5618618", "0.5616524", "0.5616325", "0.56135654", "0.56095505", "0.5609327", "0.5609327", "0.55860287", "0.5581992", "0.55752516", "0.55628026", "0.55448526", "0.5512643", "0.5505415", "0.54545724", "0.54541343", "0.54439163", "0.54377466", "0.5436758", "0.5420326", "0.542024", "0.5413817", "0.5405071", "0.54031825", "0.53935033", "0.5365521", "0.5349654", "0.5323144", "0.5322657", "0.53165984", "0.5304515", "0.5303354", "0.5301872", "0.5285251", "0.5283261", "0.5274073", "0.52714705", "0.5264023", "0.5252874", "0.52456903", "0.52377176", "0.52139735" ]
0.0
-1
Merge roamController settings when multiple dataZooms share one roamController.
function mergeControllerParams(dataZoomInfos) { var controlType; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated // as string, it is probably revert to reserved word by compress tool. See #7411. var prefix = 'type_'; var typePriority = { 'type_true': 2, 'type_move': 1, 'type_false': 0, 'type_undefined': -1 }; var preventDefaultMouseMove = true; zrUtil.each(dataZoomInfos, function (dataZoomInfo) { var dataZoomModel = dataZoomInfo.dataZoomModel; var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true; if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) { controlType = oneType; } // Prevent default move event by default. If one false, do not prevent. Otherwise // users may be confused why it does not work when multiple insideZooms exist. preventDefaultMouseMove &= dataZoomModel.get('preventDefaultMouseMove', true); }); return { controlType: controlType, opt: { // RoamController will enable all of these functionalities, // and the final behavior is determined by its event listener // provided by each inside zoom. zoomOnMouseWheel: true, moveOnMouseMove: true, moveOnMouseWheel: true, preventDefaultMouseMove: !!preventDefaultMouseMove } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeControllerParams(dataZoomInfoMap) {\n var controlType; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\n // as string, it is probably revert to reserved word by compress tool. See #7411.\n\n var prefix = 'type_';\n var typePriority = {\n 'type_true': 2,\n 'type_move': 1,\n 'type_false': 0,\n 'type_undefined': -1\n };\n var preventDefaultMouseMove = true;\n dataZoomInfoMap.each(function (dataZoomInfo) {\n var dataZoomModel = dataZoomInfo.model;\n var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true;\n\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\n controlType = oneType;\n } // Prevent default move event by default. If one false, do not prevent. Otherwise\n // users may be confused why it does not work when multiple insideZooms exist.\n\n\n preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', true);\n });\n return {\n controlType: controlType,\n opt: {\n // RoamController will enable all of these functionalities,\n // and the final behavior is determined by its event listener\n // provided by each inside zoom.\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n moveOnMouseWheel: true,\n preventDefaultMouseMove: !!preventDefaultMouseMove\n }\n };\n}", "function mergeControllerParams(dataZoomInfoMap) {\n\t var controlType; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\n\t // as string, it is probably revert to reserved word by compress tool. See #7411.\n\t\n\t var prefix = 'type_';\n\t var typePriority = {\n\t 'type_true': 2,\n\t 'type_move': 1,\n\t 'type_false': 0,\n\t 'type_undefined': -1\n\t };\n\t var preventDefaultMouseMove = true;\n\t dataZoomInfoMap.each(function (dataZoomInfo) {\n\t var dataZoomModel = dataZoomInfo.model;\n\t var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true;\n\t\n\t if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\n\t controlType = oneType;\n\t } // Prevent default move event by default. If one false, do not prevent. Otherwise\n\t // users may be confused why it does not work when multiple insideZooms exist.\n\t\n\t\n\t preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', true);\n\t });\n\t return {\n\t controlType: controlType,\n\t opt: {\n\t // RoamController will enable all of these functionalities,\n\t // and the final behavior is determined by its event listener\n\t // provided by each inside zoom.\n\t zoomOnMouseWheel: true,\n\t moveOnMouseMove: true,\n\t moveOnMouseWheel: true,\n\t preventDefaultMouseMove: !!preventDefaultMouseMove\n\t }\n\t };\n\t }", "function mergeControllerParams(dataZoomInfos) {\n var controlType;\n var opt = {};\n var typePriority = {\n 'true': 2,\n 'move': 1,\n 'false': 0,\n 'undefined': -1\n };\n zrUtil.each(dataZoomInfos, function (dataZoomInfo) {\n var oneType = dataZoomInfo.disabled ? false : dataZoomInfo.zoomLock ? 'move' : true;\n typePriority[oneType] > typePriority[controlType] && (controlType = oneType); // Do not support that different 'shift'/'ctrl'/'alt' setting used in one coord sys.\n\n zrUtil.extend(opt, dataZoomInfo.roamControllerOpt);\n });\n return {\n controlType: controlType,\n opt: opt\n };\n}", "function mergeControllerParams(dataZoomInfos) {\n var controlType;\n var opt = {};\n var typePriority = {\n 'true': 2,\n 'move': 1,\n 'false': 0,\n 'undefined': -1\n };\n zrUtil.each(dataZoomInfos, function (dataZoomInfo) {\n var oneType = dataZoomInfo.disabled ? false : dataZoomInfo.zoomLock ? 'move' : true;\n typePriority[oneType] > typePriority[controlType] && (controlType = oneType); // Do not support that different 'shift'/'ctrl'/'alt' setting used in one coord sys.\n\n zrUtil.extend(opt, dataZoomInfo.roamControllerOpt);\n });\n return {\n controlType: controlType,\n opt: opt\n };\n}", "function mergeControllerParams(dataZoomInfos) {\n var controlType;\n var opt = {};\n var typePriority = {\n 'true': 2,\n 'move': 1,\n 'false': 0,\n 'undefined': -1\n };\n zrUtil.each(dataZoomInfos, function (dataZoomInfo) {\n var oneType = dataZoomInfo.disabled ? false : dataZoomInfo.zoomLock ? 'move' : true;\n typePriority[oneType] > typePriority[controlType] && (controlType = oneType); // Do not support that different 'shift'/'ctrl'/'alt' setting used in one coord sys.\n\n zrUtil.extend(opt, dataZoomInfo.roamControllerOpt);\n });\n return {\n controlType: controlType,\n opt: opt\n };\n}", "function mergeControllerParams(dataZoomInfos) {\n\t var controlType;\n\t var opt = {};\n\t var typePriority = {\n\t 'true': 2,\n\t 'move': 1,\n\t 'false': 0,\n\t 'undefined': -1\n\t };\n\t zrUtil.each(dataZoomInfos, function (dataZoomInfo) {\n\t var oneType = dataZoomInfo.disabled ? false : dataZoomInfo.zoomLock ? 'move' : true;\n\t typePriority[oneType] > typePriority[controlType] && (controlType = oneType);\n\t // Do not support that different 'shift'/'ctrl'/'alt' setting used in one coord sys.\n\t zrUtil.extend(opt, dataZoomInfo.roamControllerOpt);\n\t });\n\n\t return {\n\t controlType: controlType,\n\t opt: opt\n\t };\n\t}", "function mergeControllerParams(dataZoomInfos) {\n var controlType;\n var opt = {}; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\n // as string, it is probably revert to reserved word by compress tool. See #7411.\n\n var prefix = 'type_';\n var typePriority = {\n 'type_true': 2,\n 'type_move': 1,\n 'type_false': 0,\n 'type_undefined': -1\n };\n zrUtil.each(dataZoomInfos, function (dataZoomInfo) {\n var oneType = dataZoomInfo.disabled ? false : dataZoomInfo.zoomLock ? 'move' : true;\n\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\n controlType = oneType;\n } // Do not support that different 'shift'/'ctrl'/'alt' setting used in one coord sys.\n\n\n zrUtil.extend(opt, dataZoomInfo.roamControllerOpt);\n });\n return {\n controlType: controlType,\n opt: opt\n };\n}", "_synchronizeMaps(baseMap) {\n var targetMaps = this._maps.filter(function (m, i) { return m !== baseMap; });\n this._detachMapMoveHandlers();\n var cam = baseMap.getCamera();\n targetMaps.forEach(function (targetMap) {\n targetMap.setCamera({\n center: cam.center,\n zoom: cam.zoom,\n bearing: cam.bearing,\n pitch: cam.pitch,\n type: 'jump'\n });\n });\n this._attachMapMoveHandlers();\n }", "function calculateInitialMapNavigatorSettings(){\n\t\tvar mnwMap = $('mnwMap');\n\t\tvar mnwCurrentView = $('mnwCurrentView');\n\t\t//calculate scale\n\t\tvar widthScale = MAP_WIDTH / 300;\n\t\tvar heightScale = MAP_HEIGHT / 300;\n\t\tif (widthScale < heightScale){\n\t\t\tmnwScale = widthScale;\n\t\t}else{\n\t\t\tmnwScale = heightScale;\n\t\t}\n\t\t//calculate mnwMap dimensions\n\t\tmnwMapWidth = Math.floor(MAP_WIDTH / mnwScale);\n\t\tmnwMapHeight = Math.floor(MAP_HEIGHT / mnwScale);\n\t\tmnwMap.style.width = mnwMapWidth + \"px\";\n\t\tmnwMap.style.height = mnwMapHeight + \"px\";\n\t\t//mnwMap.style.marginLeft = \"-\" + Math.floor(mnwMapWidth/2) + \"px\";\n\t\t//mnwMap.style.marginTop = \"-\" + Math.floor(mnwMapHeight/2) + \"px\";\n\t\t//calculate mnvCurrentView dimensions\n\t\tmnwCurrentViewWidth = Math.floor(VIEWPORT_WIDTH / mnwScale);\n\t\tmnwCurrentViewHeight = Math.floor(VIEWPORT_HEIGHT / mnwScale);\n\t\tif (mnwCurrentViewHeight < 2){ mnwCurrentViewHeight = 2 }\n\t\tif (mnwCurrentViewWidth < 2){ mnwCurrentViewWidth = 2 }\n\t\tmnwCurrentView.style.width = mnwCurrentViewWidth + \"px\";\n\t\tmnwCurrentView.style.height = mnwCurrentViewHeight + \"px\";\n\t\tmnwCurrentView.style.left = Math.floor(MAP_MARGIN_LEFT*(-1)/mnwScale) + \"px\";\n\t\tmnwCurrentView.style.top = Math.floor(MAP_MARGIN_TOP*(-1)/mnwScale) + \"px\";\n\t}", "function adjustToMyScale() {\n// GET MAP\nvar thisMap = getMap(_menuContentPane.id);\nvar thisMapScale = getMapScale(thisMap);\ndojo.forEach(_maps, function (otherMap) {\n if (otherMap.id !== thisMap.id) {\n\tvar otherMapLevel = getMapLevelByScale(otherMap, thisMapScale);\n\tif (otherMapLevel) {\n\t otherMap.setLevel(otherMapLevel);\n\t}\n }\n});\n}", "function clearAndSetViewportByController() {\r\n viewportBounds = new google.maps.LatLngBounds();\r\n setViewportByController();\r\n map.fitBounds(viewportBounds);\r\n}", "mergeDefaultConfigs() {\n\t\tthis.controlOptions = deepmerge( config.defaults, this.controlOptions, {\n\t\t\tarrayMerge: ( destination, source ) => source\n\t\t} );\n\n\t\tthis.baseConfig = $.extend( true, {}, this.controlOptions );\n\n\t\tthis.options.target = null;\n\t\tthis.controlOptions = deepmerge( this.controlOptions, this.options, {\n\t\t\tarrayMerge: ( destination, source ) => source\n\t\t} );\n\t}", "recenterView(zoom) {\n const { sidePanelOpen, siteDetail } = this.props;\n const { siteCenterChange } = this.state;\n\n if (sidePanelOpen && siteDetail && siteCenterChange) {\n const siteLatlng = [siteDetail.geometry.coordinates[1], siteDetail.geometry.coordinates[0]];\n\n this.map.setView(siteLatlng, zoom);\n this.setState({ siteCenterChange: false });\n }\n }", "function redrawMap(slider) {\r\n var lateYear = $(\".lateYear\").first().val();\r\n var earlyYear = $(\".earlyYear\").first().val();\r\n if (slider === 'late' || slider === 'both') {\r\n ['map', 'flickerMap', 'map2'].forEach(function (key) {\r\n var lateLayer = getDataTileLyr(lateYear);\r\n lateLayer.addTo(lyrGroups[key].data);\r\n });\r\n }\r\n if (slider === 'early' || slider === 'both') {\r\n ['flickerMap', 'map1'].forEach(function (key) {\r\n var earlyLayer = getDataTileLyr(earlyYear);\r\n earlyLayer.addTo(lyrGroups[key].data);\r\n });\r\n }\r\n\r\n ['map3'].forEach(function (key) {\r\n var earlyLayer = getDataTileLyr(earlyYear);\r\n var lateLayer = getDataTileLyr(lateYear);\r\n earlyLayer.addTo(lyrGroups[key].data);\r\n lateLayer.addTo(lyrGroups[key].data);\r\n });\r\n\r\n removeOldTiles();\r\n updateOpacity();\r\n\r\n var dataLayers = lyrGroups.map3.data.getLayers();\r\n var leftSwipe = dataLayers[0];\r\n var rightSwipe = dataLayers[1];\r\n sideBySide.setLeftLayers(leftSwipe);\r\n sideBySide.setRightLayers(rightSwipe);\r\n}", "function initializeMapViews() {\n // Webmap\n app.webmap = new Webmap({\n portalItem: {\n id: app.webmapId\n }\n });\n // 2D - MapView\n app.mapView = new MapView({\n container: app.mapDiv,\n map: app.webmap,\n zoom: app.zoom,\n center: app.lonlat,\n padding: app.padding,\n ui: app.uiPadding,\n popup: new Popup(app.popupOptions),\n visible: true\n });\n // Set active view\n app.activeView = app.mapView;\n // 3D - SceneView\n app.sceneView = new SceneView({\n container: app.sceneDiv,\n map: app.webmap,\n zoom: app.zoom,\n center: app.lonlat,\n padding: app.padding,\n ui: app.uiPadding,\n popup: new Popup(app.popupOptions),\n visible: false\n });\n\n // Listen for view breakpoint changes and update control location\n app.mapView.watch(\"widthBreakpoint\", function(newVal, oldVal) {\n function setPadding(newVal, oldVal) {\n if (!app.panelSettings) {\n return;\n }\n if (newVal === \"small\" && oldVal === \"medium\") {\n app.panelSettings.setPadding(app.panelSettings.activeLayout.viewPaddingSmallScreen, app.panelSettings.activeLayout.uiPadding);\n } else if (newVal === \"medium\" && oldVal === \"small\") {\n app.panelSettings.setPadding(app.panelSettings.activeLayout.viewPadding, app.panelSettings.activeLayout.uiPadding);\n }\n }\n // Set padding for navs that change height\n if (app.panelSettings.activeLayout.viewPaddingSmallScreen) {\n setPadding(newVal, oldVal);\n }\n });\n}", "function reformatOnSize() {\n if (window.matchMedia(\"(min-width: 680px)\").matches) { // for \"big\" screen\n mapShift = {\n right: 0.08,\n up: 0.04\n };\n scrollAdjustment = 0;\n map.setZoom(12);\n $('#map').removeClass(\"fixed\");\n } else if (window.matchMedia(\"(orientation: portrait)\").matches) { // small screen portrait\n mapShift = {\n right: -0.01,\n up: 0.01\n };\n scrollAdjustment = 260;\n map.setZoom(11);\n }\n else { // small screen landscape\n mapShift = {\n right: 0.09,\n up: 0\n };\n scrollAdjustment = 0;\n map.setZoom(11);\n $('#map').removeClass(\"fixed\");\n }\n}", "setMultiProportions()\n {\n var horizontalDock = this._selectedDock == this._focusBottomDockDiv;\n\n if (horizontalDock)\n {\n this._focusDiv.style.display = \"none\";\n this._selectedDock.style.display = \"flex\";\n this._selectedDock.style.width = \"100%\";\n }\n else\n {\n this._focusDiv.style.display = \"flex\";\n this._selectedDock.style.display = \"block\";\n this._focusDiv.style.width = \"70%\";\n this._selectedDock.style.width = \"30%\";\n }\n this._gridDiv.style.display = \"none\";\n\n for (let primary of this._focusDiv.children)\n {\n primary.children[0].stretch = true;\n primary.children[0].contextMenuNone.displayEntry(\"Focus Video\", false);\n primary.children[0].contextMenuNone.displayEntry(\"Horizontal Multiview\", true);\n primary.children[0].contextMenuNone.displayEntry(\"Reset Multiview\", true);\n primary.children[0].gridRows = 1;\n primary.children[0].style.gridColumn = null;\n primary.children[0].style.gridRow = null;\n }\n\n for (let docked of this._selectedDock.children)\n {\n docked.children[0].stretch = true;\n docked.children[0].contextMenuNone.displayEntry(\"Focus Video\", true);\n docked.children[0].contextMenuNone.displayEntry(\"Horizontal Multiview\", true);\n docked.children[0].contextMenuNone.displayEntry(\"Reset Multiview\", true);\n docked.children[0].style.gridColumn = null;\n docked.children[0].style.gridRow = null;\n\n if (horizontalDock)\n {\n docked.children[0].gridRows = 1;\n }\n else\n {\n docked.children[0].gridRows = this._selectedDock.children.length;\n }\n }\n\n // Wait for reassignments to calculate resize event.\n setTimeout(() => {\n window.dispatchEvent(new Event('resize'));\n }, 250);\n }", "_combineOptions() {\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"combineLatest\"])([this._options, this._center, this._zoom])\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])(([options, center, zoom]) => {\n const combinedOptions = Object.assign(Object.assign({}, options), { \n // It's important that we set **some** kind of `center`, otherwise\n // Google Maps will render a blank rectangle which looks broken.\n center: center || options.center || DEFAULT_OPTIONS.center, zoom: zoom !== undefined ? zoom : options.zoom, mapTypeId: this.mapTypeId });\n return combinedOptions;\n }));\n }", "resetZoom() {\n this.simcirWorkspace.zoom(false, 1);\n }", "function adjustToMyScaleAndLocation() {\n// GET MAP\nvar thisMap = getMap(_menuContentPane.id);\nvar thisMapScale = getMapScale(thisMap);\ndojo.forEach(_maps, function (otherMap) {\n if (otherMap.id !== thisMap.id) {\n\tvar otherMapLevel = getMapLevelByScale(otherMap, thisMapScale);\n\tif (otherMapLevel) {\n\t getCenter(thisMap, otherMap, function (otherCenter) {\n\t\totherMap.centerAndZoom(otherCenter, otherMapLevel);\n\t });\n\t}\n }\n});\n}", "function optimizeZoom(){\n\t\t\tif(controller.mapData && controller.mapData.mapBounds){\n\t\t\t\t// fit map to given bounds\n\t\t\t\tvar bounds = controller.mapData.mapBounds;\n\t\t\t\tvar corr = 0.001;\n\t\t\t\tvar nw = new nokia.maps.geo.Coordinate(bounds.maxLatitude + corr, bounds.minLongitude -corr);\n\t\t\t\tvar se = new nokia.maps.geo.Coordinate(bounds.minLatitude - corr, bounds.maxLongitude + corr);\n\t\t\t\tscope.map.zoomTo(new nokia.maps.geo.BoundingBox(nw, se), false);\n\t\t\t\tscope.map.update();\n\t\t\t}\n\t\t}", "setBoundaries() {\n if(window.innerWidth >= window.innerHeight) {\n // landscape\n this.boundaries = {\n max: -1 * this.options.element.clientWidth + window.innerWidth,\n min: 0,\n sliderSize: this.options.element.clientWidth,\n referentSize: window.innerWidth,\n };\n\n // set our slider direction\n this.direction = 0;\n }\n else {\n // portrait\n this.boundaries = {\n max: -1 * this.options.element.clientHeight + window.innerHeight,\n min: 0,\n sliderSize: this.options.element.clientHeight,\n referentSize: window.innerHeight,\n };\n\n // set our slider direction\n this.direction = 1;\n }\n }", "function onResize(){\n\twindowFullWidth = window.innerWidth;\n\twindowFullHeight = window.innerHeight;\n\twindowHalfWidth = windowFullWidth / 2;\n\twindowHalfHeight = windowFullHeight / 2;\n\t\n\tratioSiteWidth = Math.min(windowFullWidth, 1180);\n\tratioSiteHeight = Math.min(windowFullHeight, 1080);\n\t\n\t// ONLY GET RATIO FROM WIDTH\n\tratioPercentage = Math.min((ratioSiteWidth/1180));\n\tratioPercentageHeight = Math.min((ratioSiteHeight/1080));\n\t\n\tminSiteWidth = Math.max(windowFullWidth, 1180);\n\tminSiteHeight = Math.max(windowFullHeight, 1080);\n\t\n\trenderer.resize( windowFullWidth, windowFullHeight );\n\tvizGroup.width = minSiteWidth;\n\tvizGroup.position.y = windowFullHeight;\n\tvizGroup.scale.x = vizGroup.scale.y = ratioPercentage;\n\t\n\tvizGroupCenter.width = minSiteWidth;\n\tvizGroupCenter.position.y = windowHalfHeight;\n\tvizGroupCenter.scale.x = vizGroupCenter.scale.y = ratioPercentage;\n\t\n\tcoverupGroup.width = minSiteWidth;\n\tcoverupGroup.position.y = windowFullHeight;\n\tcoverupGroup.scale.x = coverupGroup.scale.y = ratioPercentage;\n\t\n\tredrawMasks();\n\t\n\twindowFullWidthDifference = windowFullWidth * (windowFullWidth / (windowFullWidth * ratioPercentage));\n\twindowFullHeightDifference = windowFullHeight * (windowFullHeight / (windowFullHeight * ratioPercentage));\n\tvar upscalePercentageX = Math.max((Math.max(windowFullWidth, 1920)/1920));\n\tvar upscalePercentageY = Math.max((Math.max(windowFullHeight, 1080)/1080));\n\tvar rainRatio = Math.max(upscalePercentageX, upscalePercentageY);\n\tvar upscaleBackgroundY = Math.max((Math.max(windowFullHeightDifference, 1080)/1080));\n\t\n\tif (scene0Loaded) {\n\t\tscene0Car.position.x = minSiteWidth/2;\n\t\tscene0Swipe.position.x = minSiteWidth/2;\n\t\tscene0Water.tilePosition.x = minSiteWidth/2;\n\t\tscene0CoverRight.position.x = windowFullWidth - 250;\n\t\t// POSITION THE RIGHT LAND MASS\n\t\tif (ratioPercentage < 1) {\n\t\t\tscene0CoverRight.position.x = windowFullWidthDifference - 275;\n\t\t}\n\t\tvar scene0ScaleFactor = Math.min((Math.min(windowFullHeight, 800)/800));\n\t\tif ($html.hasClass(\"touch\")) scene0ScaleFactor = .70;\n\t\tscene0Car.scale.x = scene0Car.scale.y = scene0ScaleFactor;\n\t}\n\t\n\tif (scene1Loaded) scenes[1].car.position.x = minSiteWidth/2;\n\tif (scene2Loaded) {\n\t\tscene2Car.position.x = minSiteWidth/2;\n\t\tscene2Bg.scale.x = scene2Bg.scale.y = upscaleBackgroundY;\n\t}\n\tif (scene3Loaded) scenes[3].car.position.x = minSiteWidth/2;\n\tif (scene4Loaded) {\n\t\tscene4SidewalkTop.position.y = -((minSiteHeight - 1080) / 2);\n\t\tscene4SidewalkBottom.position.y = 1080 + ((minSiteHeight - 1080) / 2);\n\t\tscene4Car.position.x = minSiteWidth/2;\n\t}\n\tif (scene5Loaded) {\n\t\tscenes[5].car.position.x = minSiteWidth/2;\n\t\tscene5GlowNight.position.x = minSiteWidth/2;\n\t}\n\tif (scene6Loaded) {\n\t\tscene6Car.position.x = minSiteWidth/2;\n\t\tscene6Glow.position.x = minSiteWidth/2;\n\t\tscene6Bg.scale.x = scene6Bg.scale.y = upscaleBackgroundY;\n\t}\n\tif (scene7Loaded) {\n\t\tscenes[7].car.position.x = minSiteWidth/2;\n\t\tscene7Glow.position.x = minSiteWidth/2;\n\t}\n\tif (scene8Loaded) {\n\t\tscene8Car.position.x = minSiteWidth/2;\n\t\tscene8Dots.width = minSiteWidth/2;\n\t}\n\tif (scene9Loaded) {\n\t\tscenes[9].car.position.x = minSiteWidth/2;\n\t\tscene9Glow.position.x = minSiteWidth/2;\n\t\t// scenes[9].rain.scale.x = scenes[9].rain.scale.y = assetRatio * 2;\n\t\t// scenes[9].rain.position.x = minSiteWidth / 2;\n\t\t// scenes[9].rain.position.y = minSiteHeight;\n\t}\n\tif (scene10Loaded) {\n\t\tscene10Puddles.position.x = minSiteWidth/2;\n\t\tscene10Puddles.position.y = -((minSiteHeight - 1080) / 2);\n\t\tscene10Car.position.x = minSiteWidth/2;\n\t\tscene10Car.position.y = -((minSiteHeight - 1080) / 2);\n\t\tscene10CarLight.position.x = minSiteWidth/2;\n\t\tscene10CarLight.position.y = -((minSiteHeight - 1080) / 2);\n\t\tscene10Glow.position.x = minSiteWidth/2;\n\t\tscene10Glow.position.y = -((minSiteHeight - 1080) / 2);\n\t}\n\tif (scene11Loaded) {\n\t\tscenes[11].car.position.x = minSiteWidth/2;\n\t\tscene11Glow.position.x = minSiteWidth/2;\n\t}\n\tif (safeAreaMarker){\n\t\tsafeAreaMarker.position.x = minSiteWidth/2;\n\t\tsafeAreaMarker.position.y = minSiteHeight;\n\t}\n}", "function setViewportByController() {\r\n setViewportBounds(webController.getLastViewport());\r\n}", "function updateCameraView() {\n\texmaple.autoAdjustCamera();\n}", "initViews() {\n let viewsId = []; //array used for interface cameras dropdown\n\n for (var key in this.graph.views) {\n if (this.graph.views.hasOwnProperty(key)) {\n var view = this.graph.views[key];\n\n if (view.type === \"ortho\") {\n let v = new CGFcameraOrtho(\n view.left, view.right, view.bottom, view.top,\n view.near, view.far,\n vec3.fromValues(...Object.values(view.from)),\n vec3.fromValues(...Object.values(view.to)),\n vec3.fromValues(...Object.values(view.up))\n );\n this.views[key] = v;\n } else if (view.type === \"perspective\") {\n let v = new CGFcamera(\n view.angle * DEGREE_TO_RAD, view.near,\n view.far, vec3.fromValues(...Object.values(view.from)),\n vec3.fromValues(...Object.values(view.to))\n );\n this.views[key] = v;\n }\n\n viewsId.push(key);\n }\n }\n\n //change to the default view defined\n this.selectedView = this.graph.defaultViewId;\n //this.camera = this.views[this.selectedView];\n // this.interface.setActiveCamera(this.camera);\n\n //add the views dropdown to the interface\n this.interface.viewsDropDown(viewsId);\n\n if (!this.menuMode) {\n // Already playing (not in menu mode), change player camera to the defined default\n this.setCurrentCamera(this.graph.defaultViewId); \n }\n else {\n this.interface.setActiveCamera(null);\n }\n\n this.game_camera = this.camera;\n }", "function resetCamera() {\n zoom = 45;\n dolly = 325;\n}", "function agentmapController() {\n //Set the tick display box to display the number of the current tick.\n // ticks_display.textContent = agentmap.state.ticks;\n\n //Check if any of the options have been changed in the interface and update the Agentmap accordingly.\n if (agentmap.animation_interval !== Number(animation_interval_map[5])) {\n agentmap.setAnimationInterval(animation_interval_map[5]);\n }\n}", "handleResize() {\n const iosState = { ...Store.getState().iosState }\n const slideModeOld = iosState.slideMode\n const slideModeNew = VXApp.isSlideMode()\n if (slideModeNew !== slideModeOld) {\n OLog.debug(`ux.js handleResize *changed* slideModeOld=${slideModeOld} slideModeNew=${slideModeNew}`)\n UX.mutatePanelMap(iosState, Util.routePath(), \"LEFT\")\n const slidePair = UX.findComponentById(\"vx-slide-pair\")\n if (slidePair) {\n UX.setAnimation(\"vx-slide-pair\", null)\n }\n iosState.slideMode = slideModeNew\n Store.dispatch(setIosState(iosState))\n }\n const gridCollapsedOld = iosState.gridCollapsed\n const gridCollapsedNew = VXApp.isGridCollapsed()\n if (gridCollapsedNew !== gridCollapsedOld) {\n OLog.debug(`ux.js handleResize *changed* gridCollapsedOld=${gridCollapsedOld} gridCollapsedNew=${gridCollapsedNew}`)\n iosState.gridCollapsed = gridCollapsedNew\n Store.dispatch(setIosState(iosState))\n }\n }", "function resetCameras() {\n\tvar view = views[0];\n\tcamera_MotherShip.position.x = view.eye[ 0 ];\n\tcamera_MotherShip.position.y = view.eye[ 1 ];\n\tcamera_MotherShip.position.z = view.eye[ 2 ];\n\tcamera_MotherShip.up.x = view.up[ 0 ];\n\tcamera_MotherShip.up.y = view.up[ 1 ];\n\tcamera_MotherShip.up.z = view.up[ 2 ];\n\tcamera_MotherShip.lookAt( scene.position );\n\tview.camera = camera_MotherShip;\n\n\n\tvar view = views[1];\n\tcamera_ScoutShip.position.x = view.eye[ 0 ];\n\tcamera_ScoutShip.position.y = view.eye[ 1 ];\n\tcamera_ScoutShip.position.z = view.eye[ 2 ];\n\tcamera_ScoutShip.up.x = view.up[ 0 ];\n\tcamera_ScoutShip.up.y = view.up[ 1 ];\n\tcamera_ScoutShip.up.z = view.up[ 2 ];\n\tcamera_ScoutShip.lookAt( scene.position );\n\tview.camera = camera_ScoutShip;\n}", "function resetMap() {\r\n var windowWidth = window.innerWidth;\r\n if (windowWidth <= 1080) {\r\n map.setZoom(5);\r\n map.setCenter(mapOptions.center);\r\n } else if (windowWidth > 1080) {\r\n map.setZoom(5);\r\n map.setCenter(mapOptions.center);\r\n }\r\n }", "initCameras(addDrop = true) {\n\n this.cameras = [];\n\n var views = this.graphs[this.currGraph].views;\n var def = views.default;\n var i = 0;\n\n this.cameraList = {};\n\n for (var key in views.array) {\n var el = views.array[key];\n if (el.type == \"ortho\") {\n this.cameras.push(new CGFcameraOrtho(el.left, el.right, el.bottom, el.top, el.near, el.far, vec3.fromValues(el.from.x, el.from.y, el.from.z), vec3.fromValues(el.to.x, el.to.y, el.to.z), vec3.fromValues(0.0, 1.0, 0.0)));\n } else {\n this.cameras.push(new CGFcamera(el.angle, el.near, el.far, vec3.fromValues(el.from.x, el.from.y, el.from.z), vec3.fromValues(el.to.x, el.to.y, el.to.z)));\n }\n\n if (key == def) {\n this.camera = this.cameras[this.cameras.length - 1];\n this.currCamera = i;\n }\n\n this.cameraList[key] = i++;\n\n }\n \n this.interface.setActiveCamera(this.camera);\n if(addDrop)\n this.interface.addCameraDrop();\n }", "setMapWidth() {\n\t\tlet windowWidth = window.innerWidth;\n\t\tswitch(true) {\n\t\t\tcase windowWidth >= 1200:\n\t\t\t\tthis.mapWidth = 950;\n\t\t\t\tthis.scale = 950;\n\t\t\t\treturn;\n\t\t\tcase windowWidth >= 992:\n\t\t\t\tthis.mapWidth = 850;\n\t\t\t\tthis.scale = 850;\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\tthis.mapWidth = 670;\n\t\t\t\tthis.scale = 670;\n\t\t\t\treturn;\n\t\t}\n\t}", "function changeMapSize() {\n console.log('changeMapSize')\n\n let zoomScrollBar = document.getElementById('zoom')\n zoomScrollBar.style.display = 'block'\n zoomScrollBar.value = '6'\n\n if (mapSetting != mapSize) {\n mapSize = mapSetting\n let areaDiv = document.getElementById('area')\n $('.grid-piece').remove();\n if (mapSize == 'large') {\n gridDown = 180\n gridUp = -180\n numberOfDivs = 180 * 110\n $('#area').css( \"grid-template-columns\", \"repeat(180, 6px)\" );\n $('#area').css( \"grid-template-rows\", \"repeat(110, 6px)\" );\n addDivs(110 * 180);\n } else if (mapSize == 'medium') {\n gridDown = 130\n gridUp = -130\n numberOfDivs = 105 * 130\n $('#area').css( \"grid-template-columns\", \"repeat(130, 6px)\" );\n $('#area').css( \"grid-template-rows\", \"repeat(105, 6px)\" );\n addDivs(105 * 130);\n } else {\n gridDown = 100\n gridUp = -100\n numberOfDivs = 100 * 100\n $('#area').css( \"grid-template-columns\", \"repeat(100, 6px)\" );\n $('#area').css( \"grid-template-rows\", \"repeat(100, 6px)\" );\n addDivs(100 * 100);\n }\n mapSize = mapSetting\n }\n}", "updateSensorView() {\n window.controller.allSensorsData = this.allSensorsData;\n this.dataMap.updateSensor(this.allSensorsData)\n }", "updateView () {\n return _.debounce(function () {\n if (this.config.bounds) {\n this.setBounds(this.config.bounds)\n }\n if (this.config.center) {\n this.setView(this.config.center, this.config.zoom)\n }\n }, 10)\n }", "function resetGestures() {\n cy.zoomingEnabled(lastZoomingEnabled)\n .panningEnabled(lastPanningEnabled)\n .boxSelectionEnabled(lastBoxSelectionEnabled);\n }", "function toogleorientation(match) {\n if (isMobile) {\n $('.help-zone').removeClass('goDown');\n $('.help-zone').removeClass('goUp');\n $('.help-zone').removeClass('goLeft');\n $('.help-zone').removeClass('goRight');\n\n $('.zone').hide();\n if (landType == 'landscape-primary') {\n lanscapeOrientation = true;\n $('.pane').css({top: '0', height: '100vh'});\n $('#g2').animate({width: '33%', left: '17%'}, 200, function () {\n $(this).css({zIndex: '15'});\n });\n $('#g4').animate({width: '33%', left: '50%'}, 200, function () {\n $(this).css({zIndex: '15'});\n });\n $('#g3').animate({width: '33%', left: '-16%'}, 200, function () {\n $(this).css({zIndex: '15'});\n });\n $('#g5').animate({width: '43%', left: '83%'}, 200);\n $('.center-content').hide();\n ;\n } else {\n lanscapeOrientation = false;\n $('.pane').css({height: '33', width: '100%', left: '0'});\n\n $('#g2').animate({height: '33%', top: '17%'}, 200, function () {\n $(this).css({zIndex: '15'});\n });\n $('#g4').animate({height: '33%', top: '50%'}, 200, function () {\n $(this).css({zIndex: '15'});\n });\n $('#g3').animate({height: '33%', top: '-16%'}, 200, function () {\n $(this).css({zIndex: '5'});\n });\n $('#g5').animate({height: '43%', top: '83%'}, 200, function () {\n $(this).css({zIndex: '15'});\n });\n }\n }\n }", "updateAmbisonicSettings() {\n\t\tif (this.renderer) {\n\t\t\tif (this.renderer.setChannelMap) {\n\t\t\t\tconst channelMap = this.data.channelMap.slice(0);\n\n\t\t\t\t// fill in any missing channel map values in case they're left out\n\t\t\t\tconst channels = channelCount(this.data.order);\n\t\t\t\tfor (let i = channelMap.length; i < channels; i++) {\n\t\t\t\t\tchannelMap[i] = i;\n\t\t\t\t}\n\t\t\t\tchannelMap.length = channels;\n\n\t\t\t\t/*\n\t\t\t\tPer various documents on the internet, Safari messes up the\n\t\t\t\torder of the channels, but that does not seem to be the case.\n\t\t\t\tMaybe it's been fixed in a recent version, so this is disabled\n\t\t\t\tfor now.\n\t\t\t\t*/\n\t\t\t\tthis.renderer.setChannelMap(\n\t\t\t\t\tchannelMap.length === 4 && isSafari ?\n\t\t\t\t\t\tsafariChannelMap(channelMap) :\n\t\t\t\t\t\tchannelMap\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Mobile Safari cannot decode all the audio channels from a media element\n\t\t\tconst { order, mode } = this.data;\n\t\t\tconst validOrder = order >= MIN_ORDER && order <= MAX_ORDER;\n\t\t\tconst renderingMode = (isIOS || !validOrder) && mode === 'ambisonic' ?\n\t\t\t\t'bypass' :\n\t\t\t\tthis.data.mode;\n\t\t\tthis.renderer.setRenderingMode(renderingMode);\n\t\t}\n\t}", "function onMove() {\t\t\t\n\t\tWGL.mcontroller.zoommove(map.getZoom(), getTopLeftTC(), WGL.filterByExt);\n}", "function onMove() {\t\t\t\n\t\tWGL.mcontroller.zoommove(map.getZoom(), getTopLeftTC(), WGL.filterByExt);\n}", "applySettings(settings, {\n dragging = false\n } = {}) {\n this.clipViewport = settings.clipToWindow\n this.scaleViewport = settings.scalingMode === 'scale'\n this.resizeSession = settings.scalingMode === 'remote'\n this.qualityLevel = settings.quality\n this.compressionLevel = settings.compression\n this.showDotCursor = settings.dotCursor\n this.viewOnly = settings = settings.viewOnly\n this.dragViewport = !this.clipViewport && this.dragViewport\n ? false\n : dragging\n }", "function switchView() {\n var active = _activeCameraToolpath;\n if (active == 'camera') {\n _activeCameraToolpath = 'toolpath';\n //Place code here to change in application\n } else {\n _activeCameraToolpath = 'camera';\n //Place code here to change in application\n }\n component.forceUpdate();\n }", "function zoomBoard() {\r\n\tvar lbounds = paper.project.activeLayer.bounds;\r\n\tvar vbounds = {\r\n\t\twidth: canvas.width,\r\n\t\theight: canvas.height\r\n\t};\r\n\r\n\tvar zoomFactorW = (vbounds.width * 0.9) / 480;\r\n\tvar zoomFactorH = (vbounds.height * 0.9) / 320;\r\n\r\n\tzoomFactorW <= zoomFactorH ? paper.view.zoom = zoomFactorW : paper.view.zoom = zoomFactorH;\r\n\t\r\n\t//lbounds.width <= lbounds.height ? (vbounds.width * 0.9) / 480 : (vbounds.height * 0.9) / 320;\r\n\t//paper.view.zoom = zoomFactor;\r\n}", "function updateCurrentConfig() {\n var configs = [],\n features = _.clone(deviceVars.features),\n isRotating = $.inArray('portrait', deviceVars.features) !== -1 &&\n $.inArray('landscape', deviceVars.features) !== -1,\n a = 'a' + siteVars.id,\n m = 'm' + currentMasterCategory,\n c = 'c' + currentCategory,\n i = 'i' + currentInteraction,\n object,\n /**\n * for use with jQuery.map()\n * @param {String} value the complete override string.\n * @param {Number} index (not used).\n * @return {String|Null} original value upon match, else null.\n */\n isFeatureMatch = function(value, index) {\n // overrides are made up of mandatory sets\n var sets = value.split('+'),\n s, sLength = sets.length,\n options, o, oLength,\n isSetPresent,\n isOptionPresent;\n\n for (s = 0; s < sLength; s++) {\n options = sets[s].split('|');\n oLength = options.length;\n isSetPresent = true;\n isOptionPresent = false;\n\n if (sets[s].indexOf('|') !== -1) {\n // set contains multiple options (at least one must match)\n for (o = 0; o < oLength; o++) {\n if ($.inArray(options[o], features) !== -1) {\n isOptionPresent = true;\n break;\n }\n }\n if (!isOptionPresent) {\n isSetPresent = false;\n }\n } else if ($.inArray(sets[s], features) === -1) {\n // set is simply a single condition\n isSetPresent = false;\n }\n if (!isSetPresent) {\n // part of the override did not match, exit early\n return null;\n }\n }\n // the entire override matches current features\n return value;\n },\n /**\n * @param {Array} override names of configuration sections.\n * @return {Number} weight for Underscore.sortBy().\n */\n sortOverrides = function(override) {\n if (!override || typeof override !== 'string' ||\n override.indexOf('+') === -1) {\n return 0;\n }\n return override.match(/\\+/g).length;\n },\n /**\n * for use with jQuery.each()\n * @param {Number} index 0-based position of value (not used).\n * @param {String} value name of the particular override section.\n */\n pushConfig = function(index, value) {\n configs.push(object[value]);\n };\n\n // TODO: need to fold orientation-specific config into this somewhere\n log('updateCurrentConfig(): ' + a + ' ' + m + ' ' + c + ' ' + i);\n currentConfig = {};\n configs.push(currentConfig);\n // setting current orientation\n if (isRotating) {\n features = _.without(features, 'portrait', 'landscape');\n features.push(MyAnswers.orientation);\n }\n // populate the stack with configs we need to consider\n $.each([a, m, c, i], function(index, id) {\n var overrides,\n isSimple;\n\n object = siteVars.config[id];\n if (!object || !$.isObject(object)) {\n return;\n }\n overrides = _.keys(object);\n isSimple = overrides.length === 1 && overrides[0] === 'pertinent';\n if (isSimple) {\n configs.push(object.pertinent);\n } else {\n configs.push(object.pertinent);\n overrides = $.map(overrides, isFeatureMatch);\n overrides = _.sortBy(overrides, sortOverrides);\n $.each(overrides, pushConfig);\n }\n });\n // flatten the stack\n $.extend.apply(this, configs);\n\n if(currentConfig.logoBanner) {\n currentConfig.logoBanner = siteVars.cdnu.getURL(currentConfig.logoBanner);\n }\n if(currentConfig.splashImage) {\n currentConfig.splashImage = siteVars.cdnu.getURL(currentConfig.splashImage);\n }\n if(currentConfig.icon) {\n currentConfig.icon = siteVars.cdnu.getURL(currentConfig.icon);\n }\n\n // perform inherited changes\n MyAnswers.dispatch.add(function() {\n var $banner = $('#bannerBox'),\n $image = $banner.find('img'),\n imageSrc = currentConfig.logoBanner;\n if (typeof currentConfig.logoBanner === 'string') {\n if (imageSrc !== $image.attr('src')) {\n $image.attr('src', imageSrc);\n }\n $banner.show();\n } else {\n $image.removeAttr('src');\n $banner.hide();\n }\n });\n // fix footer\n MyAnswers.dispatch.add(function() {\n if (MyAnswers.$footer.html() !== currentConfig.footer) {\n MyAnswers.$footer.html(currentConfig.footer);\n }\n if (currentConfig.footerPosition === 'screen-bottom') {\n MyAnswers.$footer.css({\n position: 'fixed',\n bottom: '0px',\n 'z-index': 1\n });\n } else {\n MyAnswers.$footer.removeAttr('style');\n }\n });\n // fix styles\n MyAnswers.dispatch.add(function() {\n var style = '',\n $style = $('style[data-setting=\"styleSheet\"]');\n style += currentConfig.styleSheet || '';\n style += currentConfig.interfaceStyle ? 'body { ' + currentConfig.interfaceStyle + ' }\\n' : '';\n style += currentConfig.backgroundStyle ? '.box { ' + currentConfig.backgroundStyle + ' }\\n' : '';\n style += currentConfig.inputPromptStyle ? '#argsBox { ' + currentConfig.inputPromptStyle + ' }\\n' : '';\n style += currentConfig.evenRowStyle ? 'ul.box > li:nth-child(even), tr.even { ' + currentConfig.evenRowStyle + ' }\\n' : '';\n style += currentConfig.oddRowStyle ? 'ul.box > li:nth-child(odd), tr.odd { ' + currentConfig.oddRowStyle + ' }\\n' : '';\n style += currentConfig.headerStyle ? 'body > header { ' + currentConfig.headerStyle + ' }\\n' : '';\n style += currentConfig.footerStyle ? 'body > footer { ' + currentConfig.footerStyle + ' }\\n' : '';\n style += currentConfig.masterCategoriesStyle ? '#masterCategoriesBox > .masterCategory { ' + currentConfig.masterCategoriesStyle + ' }\\n' : '';\n style += currentConfig.categoriesStyle ? '#categoriesBox > .category { ' + currentConfig.categoriesStyle + ' }\\n' : '';\n style += currentConfig.interactionsStyle ? '#keywordBox > .interaction, #keywordList > .interaction { ' + currentConfig.interactionsStyle + ' }\\n' : '';\n if (!$style.length) {\n return;\n }\n if ($style[0].styleSheet) {\n // Internet Explorer 8\n if (style !== $style[0].styleSheet.cssText) {\n $style[0].styleSheet.cssText = style;\n }\n } else {\n // other browsers\n if (style !== $style.text()) {\n $style.text(style);\n }\n }\n });\n MyAnswers.dispatch.add(function() {\n var $view = $('.view:visible').last(),\n level;\n try {\n if ($view.hasClass('listing')) {\n switch ($view.attr('id')) {\n case 'masterCategoriesView':\n level = 'masterCategories';\n break;\n case 'categoriesView':\n level = 'categories';\n break;\n default:\n level = 'interactions';\n }\n MyAnswers.populateItemListing(level, $view);\n }\n } catch (error) {\n error('Error in updateCurrentConfig...');\n }\n });\n}", "onWindowResize() {\n //Das Div in dem der VisualizationsCanvas liegt wird var wrapper zugewiesen\n let wrapper = $('#visualizationsCanvasDiv');\n //die Hoehe des divs wird entsprechend dem verhältnis der vorhandenenn hoehe und dem canvas div zu vorhandenen Hoehe angepasst\n wrapper.height((window.innerHeight * (wrapper.width() / window.innerWidth)));\n //Aspect = Hoehen zu Breiten Verhaeltnis\n var aspect = $(\"#visualizationsCanvasDiv\").width() / $(\"#visualizationsCanvasDiv\").height();\n //Wenn Kamera links starten soll(linke Ecke des Canvas = 0) sonst startet Kamera in der Mitte\n if (this.startLeft) {\n this.camera.left = 0;\n this.camera.right = this.frustumSize * aspect;\n } else {\n this.camera.left = this.frustumSize * aspect / -2;\n this.camera.right = this.frustumSize * aspect / 2;\n }\n //Oberes und unteres Ende der Kamera wird gesetzt \n this.camera.top = this.frustumSize / 2;\n this.camera.bottom = this.frustumSize / -2;\n //Kamera wird aktualisiert\n this.camera.updateProjectionMatrix();\n this.camera.updateMatrixWorld();\n //Renderer Groesse wird neu gesetzt\n this.renderer.setSize(wrapper.width(), wrapper.height());\n if (window.actionDrivenRender)\n this.render();\n }", "function setupUI() {\n const gui = new dat.GUI();\n f1 = gui.addFolder(\"View\");\n f2 = gui.addFolder(\"Animation\");\n controllers = [];\n\n // view Folder\n f1.add(params, \"ArcBallView\")\n .onChange(function(value) {\n if (value == true) {\n params.TopView = false;\n params.TrainView = false;\n myWorld.controls.reset();\n myWorld.camera.up.set(0, 1, 0);\n myWorld.controls.target = new THREE.Vector3(0, 0, 0);\n myWorld.controls.noRotate = false;\n myWorld.camera.position.x = 200;\n myWorld.camera.position.z = 0;\n myWorld.camera.position.y = 400;\n }\n })\n .listen()\n .onFinishChange();\n f1.add(params, \"TopView\")\n .onChange(function(value) {\n if (value == true) {\n params.ArcBallView = false;\n params.TrainView = false;\n myWorld.controls.target = new THREE.Vector3(0, 0, 0);\n myWorld.camera.up.set(0, 1, 0);\n myWorld.controls.reset();\n myWorld.controls.noRotate = true;\n myWorld.camera.position.x = 0;\n }\n })\n .listen()\n .onFinishChange();\n f1.add(params, \"TrainView\")\n .onChange(function(value) {\n if (value == true) {\n params.TopView = false;\n params.ArcBallView = false;\n }\n })\n .listen()\n .onFinishChange();\n\n // Animation folder\n f2.add(params, \"ArcLength\");\n f2.add(params, \"Speed\", 10, 30);\n f2.add(params, \"Run\");\n f2.add(params, \"CurveSegments\", 10, 40);\n controllers[0] = f2\n .add(params, \"Bspline\")\n .listen()\n .onFinishChange();\n controllers[1] = f2\n .add(params, \"realTime\")\n .listen()\n .onFinishChange();\n //set realTime and B spline to false when initialized\n //params[\"realTime\"] = false;\n params[\"Bspline\"] = false;\n f2.add(params, \"addFog\").name(\"add fog effect\");\n f2.add(params, \"addPoint\").name(\"add a Point\");\n f2.add(params, \"removePoint\").name(\"remove a Point\");\n f2.add(params, \"addCar\").name(\"add a Car\");\n f2.add(params, \"removeCar\").name(\"remove a Car\");\n f2.add(params, \"loadPoints\").name(\"Load Point File\");\n}", "function resetZoom() {\n window.gsc = 0.9;\n window.desired_gsc = 0.9;\n }", "refreshMap() {\n\t\tif (typeof this.map_ptr.doors !== 'undefined') {\n\t\t\tthis.map_ptr.doors.forEach((element, index, array) => {\n\t\t\t\tif (SaveState.doorsOpened.indexOf(element.id) > -1) {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.BRICK;\n\t\t\t\t} else {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.DOOR;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (typeof this.map_ptr.chests !== 'undefined') {\n\t\t\tthis.map_ptr.chests.forEach((element, index, array) => {\n\t\t\t\tif (SaveState.chestsOpened.indexOf(element.id) > -1) {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.BRICK;\n\t\t\t\t} else {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.CHEST;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function synchronizeMap(){\n map.on(\"zoom-start\",function(){\n console.log(\"Graphic drawing suspended\");\n map.graphics.suspend();\n })\n\n map.on(\"zoom-end\",function(){\n console.log(\"Graphic drawing resumed\");\n map.graphics.resume();\n })\n }", "function update() {\n //Update all projectile views\n group.projViews.forEach(function(projView){\n projView.update();\n });\n group.components.forEach(function (view, i) {\n if (i !== 0) {\n view.update();\n }\n else {\n view.set({ left: 0, top: 0 })\n }\n });\n }", "function setCameras() {\n\n for ( var i = 0; i < 4; i ++ ) {\n\n cameras[ i ].position.copy( camera.position );\n cameras[ i ].rotation.copy( camera.rotation );\n cameras[ i ].updateProjectionMatrix();\n renderers[ i ].setSize( window.innerWidth / 2, window.innerHeight / 2 );\n\n }\n\n}", "function switchParamsSides() {\n // switch user define parameters\n var tmp = userParams[\"top\"];\n userParams[\"top\"] = userParams[\"bottom\"];\n userParams[\"bottom\"] = tmp;\n var handlers = {\"top\":{},\"bottom\":{}};\n \n clearParamObjects = false;\n \n // clear top side\n $(\"#simulator-parameters-top\").find(\".sim-clear\").click();\n \n // clear bottom side\n $(\"#simulator-parameters-bottom\").find(\".sim-clear\").click();\n \n clearParamObjects = true;\n \n // load top params to bottom side\n $.each(topParams, function(index,value){\n if ($(\"#simulator-parameters-bottom\").find(\"input.\"+index).length > 0) {\n switch (index) {\n case \"FORMATION\":\n case \"KREPOST\":\n case \"RELEF\":\n case \"BONUS_KONE\":\n case \"BONUS_PEHOTA\":\n case \"BONUS_STRELCI\":\n case \"BONUS_WALLS\":\n $(\"#simulator-parameters-bottom\").find(\"input.\"+index).parents(\".custom-select\").find(\"a[rel='\"+value+\"']\").click();\n break;\n case \"PREM\":\n case \"CAPITOL\":\n case \"VID_KREPOST\":\n if (value==true || value==1) {\n $(\"#simulator-parameters-bottom\").find(\"input.\"+index).prev().click();\n }\n break;\n default:\n $(\"#simulator-parameters-bottom\").find(\"input.\"+index).val(value);\n break;\n }\n \n // if the field exists\n if ($(\"#simulator-parameters-top\").find(\"input.\"+index).length > 0) {\n // if we have events\n if (typeof $(\"#simulator-parameters-top\").find(\"input.\"+index).data().events != \"undefined\") {\n if (typeof $(\"#simulator-parameters-top\").find(\"input.\"+index).data().events.mouseenter != \"undefined\") {\n // store bottom tooltips to object\n handlers[\"bottom\"][index] = $(\"#simulator-parameters-top\").find(\"input.\"+index).data().events.mouseenter[0].handler;\n }\n }\n }\n }\n });\n \n // load bottom params to top side\n $.each(bottomParams, function(index,value){\n if ($(\"#simulator-parameters-top\").find(\"input.\"+index).length > 0) {\n switch (index) {\n case \"FORMATION\":\n case \"BONUS_KONE\":\n case \"BONUS_PEHOTA\":\n case \"BONUS_STRELCI\":\n $(\"#simulator-parameters-top\").find(\"input.\"+index).parents(\".custom-select\").find(\"a[rel='\"+value+\"']\").click();\n break;\n case \"PREM\":\n if (value) {\n $(\"#simulator-parameters-top\").find(\"input.\"+index).prev().click();\n }\n break;\n default:\n $(\"#simulator-parameters-top\").find(\"input.\"+index).val(value);\n break;\n }\n \n if ($(\"#simulator-parameters-bottom\").find(\"input.\"+index).length > 0) {\n // if we have events\n if (typeof $(\"#simulator-parameters-bottom\").find(\"input.\"+index).data().events != \"undefined\") {\n if (typeof $(\"#simulator-parameters-bottom\").find(\"input.\"+index).data().events.mouseenter != \"undefined\") {\n // store bottom tooltips to object\n handlers[\"top\"][index] = $(\"#simulator-parameters-bottom\").find(\"input.\"+index).data().events.mouseenter[0].handler;\n }\n }\n }\n }\n });\n \n // assing tooltips to appropriate sides\n $.each(handlers, function(side,obj){\n // remove all input tooltips for the appropriate side\n $(\"#simulator-parameters-\"+side).find(\"input\").unbind(\"mouseenter\");\n $.each(obj, function(index,handler){\n $(\"#simulator-parameters-\"+side).find(\"input.\"+index).mouseenter(handler);\n });\n });\n \n var tmpParams = topParams;\n topParams = bottomParams;\n bottomParams = tmpParams;\n}", "resetChannelMap() {\n for (let c = 0; c < NUM_TACTORS; c++) {\n this.channelData[c].source = c + 1;\n this.channelData[c].gain = 63;\n this.channelData[c].enabled = true;\n }\n this.channelUIUpdate();\n this.requestSetChannelMap();\n }", "function zoomToNextExtent() {\n if (map.graphics)\n navToolbar.zoomToNextExtent();\n}", "function setProjectionFromUnion( camera, cameraL, cameraR ) {\n\n\t\t\tcameraLPos.setFromMatrixPosition( cameraL.matrixWorld );\n\t\t\tcameraRPos.setFromMatrixPosition( cameraR.matrixWorld );\n\n\t\t\tconst ipd = cameraLPos.distanceTo( cameraRPos );\n\n\t\t\tconst projL = cameraL.projectionMatrix.elements;\n\t\t\tconst projR = cameraR.projectionMatrix.elements;\n\n\t\t\t// VR systems will have identical far and near planes, and\n\t\t\t// most likely identical top and bottom frustum extents.\n\t\t\t// Use the left camera for these values.\n\t\t\tconst near = projL[ 14 ] / ( projL[ 10 ] - 1 );\n\t\t\tconst far = projL[ 14 ] / ( projL[ 10 ] + 1 );\n\t\t\tconst topFov = ( projL[ 9 ] + 1 ) / projL[ 5 ];\n\t\t\tconst bottomFov = ( projL[ 9 ] - 1 ) / projL[ 5 ];\n\n\t\t\tconst leftFov = ( projL[ 8 ] - 1 ) / projL[ 0 ];\n\t\t\tconst rightFov = ( projR[ 8 ] + 1 ) / projR[ 0 ];\n\t\t\tconst left = near * leftFov;\n\t\t\tconst right = near * rightFov;\n\n\t\t\t// Calculate the new camera's position offset from the\n\t\t\t// left camera. xOffset should be roughly half `ipd`.\n\t\t\tconst zOffset = ipd / ( - leftFov + rightFov );\n\t\t\tconst xOffset = zOffset * - leftFov;\n\n\t\t\t// TODO: Better way to apply this offset?\n\t\t\tcameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.translateX( xOffset );\n\t\t\tcamera.translateZ( zOffset );\n\t\t\tcamera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t\t// Find the union of the frustum values of the cameras and scale\n\t\t\t// the values so that the near plane's position does not change in world space,\n\t\t\t// although must now be relative to the new union camera.\n\t\t\tconst near2 = near + zOffset;\n\t\t\tconst far2 = far + zOffset;\n\t\t\tconst left2 = left - xOffset;\n\t\t\tconst right2 = right + ( ipd - xOffset );\n\t\t\tconst top2 = topFov * far / far2 * near2;\n\t\t\tconst bottom2 = bottomFov * far / far2 * near2;\n\n\t\t\tcamera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );\n\n\t\t}", "function setProjectionFromUnion( camera, cameraL, cameraR ) {\n\n\t\t\tcameraLPos.setFromMatrixPosition( cameraL.matrixWorld );\n\t\t\tcameraRPos.setFromMatrixPosition( cameraR.matrixWorld );\n\n\t\t\tconst ipd = cameraLPos.distanceTo( cameraRPos );\n\n\t\t\tconst projL = cameraL.projectionMatrix.elements;\n\t\t\tconst projR = cameraR.projectionMatrix.elements;\n\n\t\t\t// VR systems will have identical far and near planes, and\n\t\t\t// most likely identical top and bottom frustum extents.\n\t\t\t// Use the left camera for these values.\n\t\t\tconst near = projL[ 14 ] / ( projL[ 10 ] - 1 );\n\t\t\tconst far = projL[ 14 ] / ( projL[ 10 ] + 1 );\n\t\t\tconst topFov = ( projL[ 9 ] + 1 ) / projL[ 5 ];\n\t\t\tconst bottomFov = ( projL[ 9 ] - 1 ) / projL[ 5 ];\n\n\t\t\tconst leftFov = ( projL[ 8 ] - 1 ) / projL[ 0 ];\n\t\t\tconst rightFov = ( projR[ 8 ] + 1 ) / projR[ 0 ];\n\t\t\tconst left = near * leftFov;\n\t\t\tconst right = near * rightFov;\n\n\t\t\t// Calculate the new camera's position offset from the\n\t\t\t// left camera. xOffset should be roughly half `ipd`.\n\t\t\tconst zOffset = ipd / ( - leftFov + rightFov );\n\t\t\tconst xOffset = zOffset * - leftFov;\n\n\t\t\t// TODO: Better way to apply this offset?\n\t\t\tcameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.translateX( xOffset );\n\t\t\tcamera.translateZ( zOffset );\n\t\t\tcamera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t\t// Find the union of the frustum values of the cameras and scale\n\t\t\t// the values so that the near plane's position does not change in world space,\n\t\t\t// although must now be relative to the new union camera.\n\t\t\tconst near2 = near + zOffset;\n\t\t\tconst far2 = far + zOffset;\n\t\t\tconst left2 = left - xOffset;\n\t\t\tconst right2 = right + ( ipd - xOffset );\n\t\t\tconst top2 = topFov * far / far2 * near2;\n\t\t\tconst bottom2 = bottomFov * far / far2 * near2;\n\n\t\t\tcamera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );\n\t\t\tcamera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();\n\n\t\t}", "afterMapCreation() {\n this.moveBackgroundMap(\n this.currentModel.get('longitude'),\n this.currentModel.get('latitude'),\n this.currentModel.get('preferredZoom')\n );\n }", "function updateAllCameras(overwriteLookAt) {\n\tcamera_MotherShip.up.x = motherUp[ 0 ];\n\tcamera_MotherShip.up.y = motherUp[ 1 ];\n\tcamera_MotherShip.up.z = motherUp[ 2 ];\n\tcamera_ScoutShip.up.x = scoutUp[ 0 ];\n\tcamera_ScoutShip.up.y = scoutUp[ 1 ];\n\tcamera_ScoutShip.up.z = scoutUp[ 2 ];\n\tif (overwriteLookAt) {\n\t\tcamera_MotherShip.lookAt( motherLookAt );\n\t\tcamera_ScoutShip.lookAt( scoutLootAt );\n\t}\t\n}", "_setZoom() {\n\t\tif(this.getActiveMarkers().length == 1) {\n\t\t\treturn this.map.setZoom(16);\n\t\t}\n\n\t\tif(this.getActiveMarkers().length == 0) {\n\t\t\treturn this._reset();\n\t\t}\n\n\t\treturn this.map.setZoom(10);\n\t}", "function AdjustZoomLevel() {\n\tcurrentZoomLevel = map.getZoom();\n}", "function setProjectionFromUnion( camera, cameraL, cameraR ) {\n\n\t\t\t\tcameraLPos.setFromMatrixPosition( cameraL.matrixWorld );\n\t\t\t\tcameraRPos.setFromMatrixPosition( cameraR.matrixWorld );\n\n\t\t\t\tconst ipd = cameraLPos.distanceTo( cameraRPos );\n\n\t\t\t\tconst projL = cameraL.projectionMatrix.elements;\n\t\t\t\tconst projR = cameraR.projectionMatrix.elements;\n\n\t\t\t\t// VR systems will have identical far and near planes, and\n\t\t\t\t// most likely identical top and bottom frustum extents.\n\t\t\t\t// Use the left camera for these values.\n\t\t\t\tconst near = projL[ 14 ] / ( projL[ 10 ] - 1 );\n\t\t\t\tconst far = projL[ 14 ] / ( projL[ 10 ] + 1 );\n\t\t\t\tconst topFov = ( projL[ 9 ] + 1 ) / projL[ 5 ];\n\t\t\t\tconst bottomFov = ( projL[ 9 ] - 1 ) / projL[ 5 ];\n\n\t\t\t\tconst leftFov = ( projL[ 8 ] - 1 ) / projL[ 0 ];\n\t\t\t\tconst rightFov = ( projR[ 8 ] + 1 ) / projR[ 0 ];\n\t\t\t\tconst left = near * leftFov;\n\t\t\t\tconst right = near * rightFov;\n\n\t\t\t\t// Calculate the new camera's position offset from the\n\t\t\t\t// left camera. xOffset should be roughly half `ipd`.\n\t\t\t\tconst zOffset = ipd / ( - leftFov + rightFov );\n\t\t\t\tconst xOffset = zOffset * - leftFov;\n\n\t\t\t\t// TODO: Better way to apply this offset?\n\t\t\t\tcameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\t\tcamera.translateX( xOffset );\n\t\t\t\tcamera.translateZ( zOffset );\n\t\t\t\tcamera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );\n\t\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t\t\t// Find the union of the frustum values of the cameras and scale\n\t\t\t\t// the values so that the near plane's position does not change in world space,\n\t\t\t\t// although must now be relative to the new union camera.\n\t\t\t\tconst near2 = near + zOffset;\n\t\t\t\tconst far2 = far + zOffset;\n\t\t\t\tconst left2 = left - xOffset;\n\t\t\t\tconst right2 = right + ( ipd - xOffset );\n\t\t\t\tconst top2 = topFov * far / far2 * near2;\n\t\t\t\tconst bottom2 = bottomFov * far / far2 * near2;\n\n\t\t\t\tcamera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );\n\t\t\t\tcamera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();\n\n\t\t\t}", "function applyFilterRestriction(restrictions){\n\tView.controllers.get('abCbRptMyLoc').printableRestriction = restrictions.printableRestriction;\n\t\n\tView.panels.get('abCbRptMyLocSiteTree').addParameter('blRestriction', restrictions.blRestriction);\n\tView.panels.get('abCbRptMyLocSiteTree').addParameter(\"flRestriction\", restrictions.flRestriction);\n\tView.panels.get('abCbRptMyLocSiteTree').addParameter(\"rmRestriction\", restrictions.rmRestriction);\n\t\n\tView.panels.get('abCbRptMyLocSiteTree').refresh();\n\tView.panels.get('abCbRptMyLocBlDetail').show(false);\n\tView.panels.get('abCbRptMyLocFlDetail').show(false);\n\tView.panels.get('abCbRptMyLocRmDetail').show(false);\n}", "loadSettings() {\n if (!localStorage.getItem(this.localStorageKey)) {\n return;\n }\n const data = JSON.parse(localStorage.getItem(this.localStorageKey));\n\n for (let i = 0; i < data.length; i++) {\n for (let n = 0; n < this.layers.length; n++) {\n if (this.layers[n].element.id == data[i].id) {\n this.layers[n].targetPoints = clonePoints(data[i].targetPoints);\n this.layers[n].sourcePoints = clonePoints(data[i].sourcePoints);\n }\n }\n }\n this.updateTransform();\n }", "function changeCamera(axis, isIncrease) {\n\tswitch (axis) {\n\t\tcase \"x\":\n\t\t\tif (isIncrease) {\n\t\t\t\t(isMothership)? camera_MotherShip.position.x += stepSize:camera_ScoutShip.position.x += stepSize;\n\t\t\t\t(isMothership)? motherEye[0] += stepSize : scoutEye[0] += stepSize;\n\t\t\t} else {\n\t\t\t\t(isMothership)? camera_MotherShip.position.x += -stepSize:camera_ScoutShip.position.x += -stepSize;\n\t\t\t\t(isMothership)? motherEye[0] += -stepSize : scoutEye[0] += -stepSize;\n\t\t\t}\n\t\tbreak;\n\t\tcase \"y\":\n\t\t\tif (isIncrease) {\n\t\t\t\t(isMothership)? camera_MotherShip.position.y += stepSize:camera_ScoutShip.position.y += stepSize;\n\t\t\t\t(isMothership)? motherEye[1] += stepSize : scoutEye[1] += stepSize;\n\t\t\t} else {\n\t\t\t\t(isMothership)? camera_MotherShip.position.y += -stepSize:camera_ScoutShip.position.y += -stepSize;\n\t\t\t\t(isMothership)? motherEye[1] += -stepSize : scoutEye[1] += -stepSize;\n\t\t\t}\n\t\tbreak;\n\t\tcase \"z\":\n\t\t\tif (isIncrease) {\n\t\t\t\t(isMothership)? camera_MotherShip.position.z += stepSize:camera_ScoutShip.position.z += stepSize;\n\t\t\t\t(isMothership)? motherEye[2] += stepSize : scoutEye[2] += stepSize;\n\t\t\t} else {\n\t\t\t\t(isMothership)? camera_MotherShip.position.z += -stepSize:camera_ScoutShip.position.z += -stepSize;\n\t\t\t\t(isMothership)? motherEye[2] += -stepSize : scoutEye[2] += -stepSize;\n\t\t\t}\n\t\tbreak;\n\t}\n\tupdateShipData(true);\n}", "workspaceDidChangeConfiguration(params) {\n lodash_1.merge(this.settings, params.settings);\n }", "updateCameraFilter() {\n\t\t// Main camera should ignore all UI elements as we render them on a different camera\n\t\tthis.gameCam.ignore(window.game.ui.getAllUIElements());\n\t\tthis.gameCam.ignore(helpers.getObjectSprites());\n\t\tthis.gameCam.ignore(helpers.getFarmFieldSprites());\n\n\t\t// Camera 2 is the UI camera, so it should ignore everything else\n\t\tthis.uiCam.ignore(window.game.map.getLayers());\n\t\tthis.uiCam.ignore(window.game.map.lightingDummy);\n\t\tthis.uiCam.ignore(window.game.map.mapSprites);\n\n\t\t// Set the main camera to render to the HSL shader pipeline\n\t\tthis.gameCam.setRenderToTexture(this.hsl);\n\n\t\t// Set the UI cameras' bounds and start following the player just as the main camera does\n\t\tthis.uiCam.setBounds(0, 0, window.game.map.tileMap.widthInPixels * CONSTANTS.GAME_SCALE, window.game.map.tileMap.heightInPixels * CONSTANTS.GAME_SCALE);\n\t\tthis.uiCam.startFollow(window.game.player.playerSprite, true, 0.09, 0.09);\n\t}", "_drawerOrTabsLayout () {\n if (window.innerWidth > this.maxDrawerWidth) {\n this.drawerMode = false\n } else {\n this.drawerMode = true\n }\n }", "function initMap() {\n const sharedOptions = {\n center: {\n lat: 47.609414458375674,\n lng: -122.33897030353548\n },\n zoom: 17,\n disableDefaultUI: true,\n gestureHandling: \"none\"\n };\n new google.maps.Map(document.getElementById(\"left\"), {\n ...sharedOptions,\n mapId: \"ed1309c122a3dfcb\",\n useStaticMap: false\n });\n new google.maps.Map(document.getElementById(\"right\"), {\n ...sharedOptions,\n mapId: \"ed1309c122a3dfcb\",\n useStaticMap: true\n });\n }", "function updateFieldsFromRange() {\n return;\n if (settings.mode !== 'FDM' || !api.view.is_slice() || !settings.process.ranges) {\n let okeys = Object.keys(overrides);\n if (okeys.length) {\n api.conf.update_fields(overrides);\n overrides = {};\n }\n return;\n }\n let match = 0;\n let values = {};\n let restores = Object.clone(overrides);\n let { layer_lo, layer_hi } = api.var;\n for (let range of getOverlappingRanges(api.var.layer_lo, api.var.layer_hi)) {\n for (let key of Object.keys(range.fields)) {\n values[key] = range.fields[key];\n overrides[key] = settings.process[key];\n delete restores[key];\n match++;\n }\n }\n if (match) {\n api.conf.update_fields(values);\n }\n let rkeys = Object.keys(restores);\n if (rkeys.length) {\n api.conf.update_fields(restores);\n for (let key of rkeys) {\n delete overrides[key];\n }\n }\n api.uc.refresh();\n}", "static modifyGizmoControls ({ position, rotation, scale }) {\n // exit if in placing mode\n if (this.isPlacing) return\n\n this.gizmoManager.positionGizmoEnabled = !!position\n this.gizmoManager.rotationGizmoEnabled = !!rotation\n this.gizmoManager.scaleGizmoEnabled = !!scale\n }", "function applyMapFilter() {\n\t\tvar selectedMode = $('#mapFilterModes').data('value'),\n\t\t\tselectedSize = $('#mapFilterSize').data('value'),\n\t\t\tselectedCamo = $('#mapFilterCamo').data('value'),\n\t\t\tselectedLevel = $('#mapFilterLevel').data('value'),\n\t\t\tisAllSelected = true;\n\t\t\tmyMapsFiltered = myMapsContainer.find('.mappreview');\n\t\t\tmyMapsUnfiltered = myMapsFiltered;\n\t\tif (selectedMode != 'all') {\n\t\t\tmyMapsFiltered = myMapsFiltered.filter('.mapmode' + selectedMode);\n\t\t\tisAllSelected = false;\n\t\t}\n\t\tif (selectedSize != 'all') {\n\t\t\tmyMapsFiltered = myMapsFiltered.filter('[data-size=\"' + selectedSize + '\"]');\n\t\t\tisAllSelected = false;\n\t\t}\n\t\tif (selectedCamo != 'all') {\n\t\t\tmyMapsFiltered = myMapsFiltered.filter('.mapcamo' + selectedCamo);\n\t\t\tisAllSelected = false;\n\t\t}\n\t\tif (selectedLevel != 'all') {\n\t\t\tselectedLevel = selectedLevel * 1;\n\t\t\tmyMapsFiltered = myMapsFiltered.filter(function(index, element) {\n\t\t\t\tvar myElement = $(element),\n\t\t\t\t\tminLevel = myElement.data('minlevel') * 1,\n\t\t\t\t\tmaxLevel = myElement.data('maxlevel') * 1;\n\t\t\t\treturn (selectedLevel >= minLevel && selectedLevel <= maxLevel);\n\t\t\t});\n\t\t\tisAllSelected = false;\n\t\t}\n\t\tif (isAllSelected) {\n\t\t\tmyMapsFiltered.removeClass('hidden');\n\t\t} else {\n\t\t\tmyMapsUnfiltered.addClass('hidden');\n\t\t\tmyMapsFiltered.removeClass('hidden');\n\t\t}\n\t\tapplyMapsDividers();\n\t}", "function resize() {\n var ww = $(window).width();\n var wh = $(window).height();\n var wp = ww / wh;\n\n s = ww / exportWidth;\n\n var h = originalHeight * exportRatio * s;\n var top = (wh - h) / 2;\n var left = 0;\n\n if (top > 0) {\n top = 0;\n s = wh / (originalHeight * exportRatio);\n left = (ww - (originalWidth * exportRatio * s)) / 2;\n }\n\n $(\".menu\").attr(\"data-0\", \"transform:translate3d(0,0px,0)\");\n var menuHeight = $(\".menu\").height();\n var menuThreshold = wh - menuHeight;\n $(\".menu\").attr(\"data-top\", \"transform:translate3d(0,\" + (-menuThreshold) + \"px,0)\");\n\n\n $(\".parallax\").each(function () {\n if ($(this).data(\"height\") != null) {\n $(this).css({\n height: $(this).data(\"height\") * exportRatio * s\n })\n }\n })\n $(\".parallax .layers\").css({\n left: left\n })\n $(\".garden .layers\").css({\n top: 0\n })\n $(\".garden\").css({\n height: wh\n });\n\n\n var scrollTo = 0;\n if (skrollrInstance != null) {\n scrollTo = skrollrInstance.getScrollTop();\n skrollrInstance.destroy();\n skrollrInstance = null;\n }\n if (ww < mobileThreshold) {\n $(\".menu\").css({\n lineHeight: wh + \"px\"\n });\n } else {\n $(\".menu\").css({\n lineHeight: \"70px\"\n });\n }\n\n var vh = $(\".viewport\").height() - wh;\n var keyframes = $(\".viewport\").data(\"parallax-keyframes\");\n if (keyframes != null) {\n $(\".viewport\").attr(\"data-\" + keyframes, null);\n }\n $(\".viewport\").attr(\"data-\" + vh, \"transform:translate3d(0,\" + (-vh) + \"px,0)\");\n $(\".viewport\").data(\"parallax-keyframes\", vh);\n\n $(\".layer\").each(function () {\n var cur = $(this);\n var onlyTouch = typeof (cur.attr(\"data-only-touch\")) != \"undefined\";\n var noTouch = typeof (cur.attr(\"data-no-touch\")) != \"undefined\";\n\n if (!mobileCheck() && ((!touchCheck() && !onlyTouch) || (touchCheck() && (!noTouch || onlyTouch)))) {\n var keyframes = cur.data(\"parallax-keyframes\")\n if (keyframes != null) {\n for (var i = 0; i < keyframes.length; i++) {\n cur.attr(\"data-\" + keyframes[i], null);\n }\n cur.data(\"parallax-keyframes\", null);\n }\n\n var y = cur.data(\"pos-y\");\n var x = cur.data(\"pos-x\");\n var parallax = cur.data(\"parallax\");\n var scale = cur.data(\"scale\");\n if (x != null) {\n cur.css({\n left: x * exportRatio * s\n })\n // console.log(x*exportRatio*s)\n } else {\n x = 0;\n }\n if (y != null) {\n cur.css({\n top: y * exportRatio * s\n })\n } else {\n y = 0;\n }\n cur.css({\n transform: \"translate3d(0,0,0)\"\n });\n\n\n if (parallax != null) {\n var start = 0;\n\n start = cur.parent().offset().top;\n var offset = cur.parent().data(\"parallax-offset\");\n if (offset == null) {\n offset = 0;\n }\n var strength = 0.5;\n if (cur.parent().data(\"parallax-strength\") != null) {\n strength = cur.parent().data(\"parallax-strength\");\n }\n var parallaxSize = 700;\n var max = (parallaxSize - (parallaxSize * parallax)) * strength;\n start += h * offset;\n keyStart = start - wh;\n keyEnd = start + wh;\n var startScale = \"\";\n var endScale = \"\";\n if (scale == true) {\n var scaleDeviation = 1 * strength;\n startScale = \" scale(1,\" + (1 + scaleDeviation) + \")\";\n endScale = \" scale(1,\" + (1 - scaleDeviation) + \")\";\n }\n var endPos = max;\n if (keyEnd > vh) {\n var excess = keyEnd - vh;\n excess = excess / parallaxSize;\n endPos = max - (max * excess);\n if (scale) {\n endScale = \" scale(1,\" + (1 - (scaleDeviation - (scaleDeviation * excess))) + \")\";\n }\n\n keyEnd = vh;\n }\n\n cur.css({\n transformOrigin: ((ww / 2) - (x * exportRatio * s)) + \"px \" + ((wh * 0.9) - (y * exportRatio * s)) + \"px\"\n })\n\n\n cur.attr(\"data-\" + keyStart, \"transform:translate3d(0,\" + (-max) + \"px,0)\" + startScale);\n cur.attr(\"data-\" + keyEnd, \"transform:translate3d(0,\" + endPos + \"px,0)\" + endScale);\n\n cur.data(\"parallax-keyframes\", [keyStart, keyEnd]);\n }\n\n\n drawImage(cur);\n }\n\n });\n\n $(\".garden .layers\").css({\n top: top\n })\n $(\".layer img\").css({\n position: \"absolute\",\n transform: touchCheck() ? \"\" : \"translate3d(0,0,0)\"\n })\n $(\".layer.layer-scale>*\").css({\n position: \"absolute\",\n transformOrigin: \"0 0\",\n transform: \"scale(\" + s + \",\" + s + \")\" + (touchCheck() ? \"\" : \" translate3d(0,0,0)\")\n });\n $(\".layer-no-scale>*\").css({\n position: \"absolute\",\n transformOrigin: \"0 0\",\n transform: (touchCheck() ? \"\" : \" translate3d(0,0,0)\")\n });\n\n if (!touchCheck()) {\n skrollrInstance = skrollr.init({\n smoothScrolling: false,\n smoothScrollingDuration: 350,\n mobileDeceleration: 0.005\n });\n skrollrInstance.setScrollTop(scrollTo, true);\n } else {\n $(\".viewport\").css({\n position: \"relative\"\n })\n\n }\n\n }", "processConfig() {\n /** merge type for arrays */\n const action = actions.importConfig(this.config);\n this.store.dispatch(action);\n const { config: storedConfig } = this.store.getState();\n\n storedConfig.windows.forEach((miradorWindow, layoutOrder) => {\n const windowId = `window-${uuid()}`;\n const manifestId = miradorWindow.manifestId || miradorWindow.loadedManifest;\n\n this.store.dispatch(actions.addWindow({\n // these are default values ...\n id: windowId,\n layoutOrder,\n manifestId,\n thumbnailNavigationPosition: storedConfig.thumbnailNavigation.defaultPosition,\n // ... overridden by values from the window configuration ...\n ...miradorWindow,\n }));\n });\n }", "function _mapZoomed() {\n _setAllIcons();\n}", "function layersControl () {\r\n if (maptype == \"artmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"geomap\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />': mapnik,\r\n 'Mapquest open <img src=\"./lib/images/external.png\" />': mapquestopen,\r\n 'Mapquest aerial <img src=\"./lib/images/external.png\" />': mapquest\r\n }; \r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />': maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />': boundaries,\r\n 'Radwege <img src=\"./lib/images/external.png\" />': cycling\r\n };\r\n }\r\n \r\n else if (maptype == \"gpxmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"monmap\") {\r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik, \r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Denkmäler <img src=\"./lib/images/wv-logo-12.png\" />' : monuments\r\n };\r\n }\r\n\r\n else if (maptype == \"poimap2\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik,\r\n 'Mapnik s/w <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnikbw,\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapquest Aerial <img src=\"./lib/images/external.png\" />' : mapquest,\r\n 'Verkehrsliniennetz <img src=\"./lib/images/external.png\" />' : transport,\r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />' : maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />' : boundaries,\r\n 'Schummerung <img src=\"./lib/images/wmf-logo-12.png\" />' : hill,\r\n 'Radwege <img src=\"./lib/images/external.png\" />' : cycling,\r\n 'Wanderwege <img src=\"./lib/images/external.png\" />' : hiking,\r\n 'Sehenswürdigkeiten <img src=\"./lib/images/wv-logo-12.png\" />' : markers,\r\n 'Reiseziele <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles,\r\n 'GPX Spuren / Kartenmaske <img src=\"./lib/images/wv-logo-12.png\" />' : tracks\r\n };\r\n }\r\n}", "function zoomer() {\n if ($('#update_workspace_button').data('locked') == false) {\n //document.getElementsByClassName('hasSVG')[1].style.transformOrigin = 'center top';\n //d3svg.style(\"background-color\", \"green\");\n if (global_zoomstart_yes == false) {\n global_zoomstart_yes = true;\n console.log(\"Penguins are good.\");\n // d3.event.transform.k = global_graph_scale;\n };\n // Find the center of the on-screen SVG, which should be the focus of our zoom\n var crect = d3svg.node().parentNode.getBoundingClientRect();\n var pt = d3svg.node().createSVGPoint();\n pt.x = crect.x + (crect.width / 2);\n pt.y = crect.y + (crect.height / 2);\n var svgpt = pt.matrixTransform(d3svg.node().getScreenCTM().inverse())\n // debug\n // d3svg.append('circle').attr('cx', svgpt.x).attr('cy', svgpt.y).attr('r', 3).attr('fill', 'red');\n\n // // Hint taken from https://stackoverflow.com/questions/6711610/\n var sf = slider.property(\"value\");\n // // var matrix = [sf, 0, 0, sf, svgpt.x - (sf * svgpt.x), svgpt.y - (sf * svgpt.y)];\n // // var transform = 'matrix(' + matrix.join(\" \") + ')';\n // var transform = 'translate(-' + svgpt.x + ', -' + svgpt.y + ')';\n // transform += ' scale(' + slider.property(\"value\") + ') ';\n // transform += 'translate(' + svgpt.x + ', ' + svgpt.y + ')';\n // d3svg.attr('transform', transform);\n // // d3svg.attr('transform-origin', svgpt.x + \" \" + svgpt.y);\n d3svg.attr('transform', 'scale(' + sf + ')');\n\n var coords = [svgpt.x, svgpt.y];\n // This next bit grabs the coordinates relative to the container, which are used to \"neaten up\" the final pan.\n var coords2 = [pt.x, pt.y];\n percLR = coords2[0]\n percUD = coords2[1]\n //global_zoomstart_yes\n if (text_direction == 'BI') {\n // Locked pan to centre of X Axis\n var gwit = svg_root_element.getBoundingClientRect().width;\n crect.scrollTo({\n left: (gwit - crect.width) / 2\n });\n // Panning zoom in Y Axis\n console.log(\"Mouse coords at \" + coords[1]);\n var ghighA = svg_root_element.getBoundingClientRect().height; // Real height\n var ghighB = svg_root_element.getBBox().height; // Internal height\n var yval = coords[1] //This gives us INTERNAL Y coord\n var percy = yval / ghighB //This gives us the % of the way along the Y axis\n var realy = percy * ghighA\n console.log(\"True graph height is \" + ghighA + \", internal height is \" + ghighB);\n console.log(\"Internal Y is \" + yval + \", percent is \" + percy + \", real point to scroll to is \" + realy);\n $(\"div #svgenlargement\").scrollTop(realy - percUD);\n } else {\n // Panning zoom in X Axis, no need to change Y axis\n // Get the scale factor of the internal width vs. DOM with of the SVG\n var scrollScale = svg_root.getBoundingClientRect().width / svg_root.getBBox().width;\n // Apply this factor to the SVG center point, offsetting half the width of the box\n svg_root.parentNode.scrollTo({\n left: (svgpt.x * scrollScale) - (crect.width / 2)\n })\n }\n\n }\n}", "function setMapOnAll(map) {\n for (let i = 0; i < originMarkersArray.length; i++) {\n originMarkersArray[i].setMap(map);\n }\n for (let i = 0; i < currentMarkersArray.length; i++) {\n currentMarkersArray[i].setMap(map);\n }\n for (var i = 0; i < destinationMarkersArray.length; i++) {\n destinationMarkersArray[i].setMap(map);\n }\n }", "function setProjectionFromUnion(camera, cameraL, cameraR) {\n cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);\n cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);\n var ipd = cameraLPos.distanceTo(cameraRPos);\n var projL = cameraL.projectionMatrix.elements;\n var projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and\n // most likely identical top and bottom frustum extents.\n // Use the left camera for these values.\n\n var near = projL[14] / (projL[10] - 1);\n var far = projL[14] / (projL[10] + 1);\n var topFov = (projL[9] + 1) / projL[5];\n var bottomFov = (projL[9] - 1) / projL[5];\n var leftFov = (projL[8] - 1) / projL[0];\n var rightFov = (projR[8] + 1) / projR[0];\n var left = near * leftFov;\n var right = near * rightFov; // Calculate the new camera's position offset from the\n // left camera. xOffset should be roughly half `ipd`.\n\n var zOffset = ipd / (-leftFov + rightFov);\n var xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?\n\n cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);\n camera.translateX(xOffset);\n camera.translateZ(zOffset);\n camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);\n camera.matrixWorldInverse.getInverse(camera.matrixWorld); // Find the union of the frustum values of the cameras and scale\n // the values so that the near plane's position does not change in world space,\n // although must now be relative to the new union camera.\n\n var near2 = near + zOffset;\n var far2 = far + zOffset;\n var left2 = left - xOffset;\n var right2 = right + (ipd - xOffset);\n var top2 = topFov * far / far2 * near2;\n var bottom2 = bottomFov * far / far2 * near2;\n camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);\n}", "function setProjectionFromUnion(camera, cameraL, cameraR) {\n cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);\n cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);\n var ipd = cameraLPos.distanceTo(cameraRPos);\n var projL = cameraL.projectionMatrix.elements;\n var projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and\n // most likely identical top and bottom frustum extents.\n // Use the left camera for these values.\n\n var near = projL[14] / (projL[10] - 1);\n var far = projL[14] / (projL[10] + 1);\n var topFov = (projL[9] + 1) / projL[5];\n var bottomFov = (projL[9] - 1) / projL[5];\n var leftFov = (projL[8] - 1) / projL[0];\n var rightFov = (projR[8] + 1) / projR[0];\n var left = near * leftFov;\n var right = near * rightFov; // Calculate the new camera's position offset from the\n // left camera. xOffset should be roughly half `ipd`.\n\n var zOffset = ipd / (-leftFov + rightFov);\n var xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?\n\n cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);\n camera.translateX(xOffset);\n camera.translateZ(zOffset);\n camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);\n camera.matrixWorldInverse.getInverse(camera.matrixWorld); // Find the union of the frustum values of the cameras and scale\n // the values so that the near plane's position does not change in world space,\n // although must now be relative to the new union camera.\n\n var near2 = near + zOffset;\n var far2 = far + zOffset;\n var left2 = left - xOffset;\n var right2 = right + (ipd - xOffset);\n var top2 = topFov * far / far2 * near2;\n var bottom2 = bottomFov * far / far2 * near2;\n camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);\n}", "function zoomTo(boundsSet){\n \n // calculate key bounds information\n var bounds = [ (boundsSet[0]) , (boundsSet[1]) ],\n dx = bounds[1][0] - bounds[0][0], \n dy = bounds[1][1] - bounds[0][1], \n x = (bounds[0][0] + bounds[1][0])/2, \n y = (bounds[0][1] + bounds[1][1])/2, \n scale = .1/Math.max(dx/width, dy/tjb.height),\n translate = [(width*0.333)-scale*x, (tjb.height*0.66)-scale*y]; \n \n // modify vis.width of svg coastline\n parentG\n .transition()\n .duration(4000)\n .style(\"stroke-width\", \"0.5px\")\n .attr(\"transform\", \"translate(\" + translate + \")scale(\" + scale + \")\");\n\n boundariesG\n .transition()\n .duration(4000)\n .style(\"stroke-width\", \"0.5px\")\n .attr(\"transform\", \"translate(\" + translate + \")scale(\" + scale + \")\");\n\n platesG\n .transition()\n .duration(4000)\n .style(\"stroke-width\", \"0.5px\")\n .attr(\"transform\", \"translate(\" + translate + \")scale(\" + scale + \")\");\n \n g.append(\"rect\")\n .attr(\"class\" , \"masks horizontal\")\n .attr(\"x\", 0) \n .attr(\"y\", 0)\n .attr(\"width\", d3.select(\"#mainSVG\").attr(\"width\") )\n .attr(\"height\", d3.select( \"#mainSVG\" ).attr( \"height\" )*0.5)\n .style(\"fill\",\"#000000\")\n .style(\"fill-opacity\", 0.925); \n \n g.append( \"rect\" )\n .attr( \"class\" , \"masks vertical\" )\n .attr( \"x\", d3.select( \"#mainSVG\" ).attr( \"width\" )*0.75 ) \n .attr( \"y\", 0 )\n .attr( \"width\" , d3.select( \"#mainSVG\" ).attr( \"width\" )*0.25 )\n .attr( \"height\" , d3.select( \"#mainSVG\" ).attr( \"height\" ) )\n .style( \"fill\" , \"#000000\" )\n .style( \"fill-opacity\", 1.0 );\n\n updateEventInformation();\n \n var sel = d3.selectAll( \".scroll\" );\n sel.moveToFront();\n var sel = d3.selectAll( \".barcode.g\" );\n sel.moveToFront();\n var sel = d3.selectAll( \".depth.axis\" );\n sel.moveToFront();\n var sel = d3.selectAll( \".magnitudeLegend\" );\n sel.moveToFront();\n var sel = d3.selectAll( \".depthLegend\" );\n sel.moveToFront();\n var sel = d3.selectAll( \".highlight.highlight-g\" );\n sel.moveToFront();\n var sel = d3.selectAll( \".highlightEpicentre\" );\n sel.moveToFront();\n var sel = d3.selectAll( \".eventInfo.furtherDetails\" );\n sel.moveToFront();\n\n return;\n \n }// end function zoomTo()", "function configureSettings() {\n this.show.config = !this.show.config;\n //if saving an open config\n if (!this.show.config) {\n $ionicScrollDelegate.scrollTop(true);\n this.score.saveObj({config: this.score.data.config});\n } else {\n $ionicScrollDelegate.scrollBottom(true);\n }\n }", "function setComponents() {\n if (_options.mapDivId) {\n var map = _config.getMap();\n if (map) {\n // Register listener for maximum and minimum zoom levels.\n map.events.on({\n zoomend : zoomEndListener\n });\n // Render map to its position.\n map.render(_options.mapDivId);\n var layers = _config.getLayers();\n if (layers) {\n setLayers(map, layers);\n // Create legend and controller asynchronously to make sure\n // proper information is used immediately after layers are\n // included into map above.\n setTimeout(function() {\n // Set legend synchronously before creating controller below.\n // Then, controller can be created with proper width.\n setLegend();\n // Notice, slider controller needs to be created before\n // animation layers trigger events. Then, layer event callbacks\n // have always target elements in controller. Controller is\n // created asynchronously here with zero timeout. Layers are\n // included into the map below synchronously but animation\n // triggers events asynchronously. Therefore, asynchronously\n // started synchronous operations for legend and controller\n // are finished before layer events are triggered.\n createController();\n // Set listeners to update legend according to animation layer events.\n setAnimationLegendEventListener(layers);\n setupSwitcher(map, _options.layerSwitcherDivId, _options.maximizeSwitcher);\n }, 0);\n }\n // Zoom the map after layers have been inserted.\n // Map center refresh value is used if it is available.\n var mapCenter = _refreshDefaultCenter || map.getCenter();\n if (!mapCenter) {\n // Map may not have center available even if it has been defined in config.\n // Then, calculate center from the maximum extent to make sure map can be shown.\n mapCenter = map.getMaxExtent().getCenterLonLat();\n }\n map.setCenter(mapCenter, undefined === _refreshDefaultZoomLevel ? _config.getDefaultZoomLevel() : _refreshDefaultZoomLevel);\n }\n }\n }", "function advancedMergeLayersAndAutoFill()\n{\n\tvar idmergeAlignedLayers = stringIDToTypeID( \"mergeAlignedLayers\" );\n\tvar desc4 = new ActionDescriptor();\n\tvar idAply = charIDToTypeID( \"Aply\" );\n\tvar idautoBlendType = stringIDToTypeID( \"autoBlendType\" );\n\tvar idpanorama = stringIDToTypeID( \"panorama\" );\n\tdesc4.putEnumerated( idAply, idautoBlendType, idpanorama );\n\tvar idClrC = charIDToTypeID( \"ClrC\" );\n\tdesc4.putBoolean( idClrC, true );\n\tvar idautoTransparencyFill = stringIDToTypeID( \"autoTransparencyFill\" );\n\tdesc4.putBoolean( idautoTransparencyFill, true );\n\texecuteAction( idmergeAlignedLayers, desc4, DialogModes.NO );\n}", "_setSnappingMarkers(event, tabHeader) {\n const that = this,\n target = JQX.Utilities.Core.isMobile ? document.elementFromPoint(event.pageX - window.pageXOffset, event.pageY - window.pageYOffset) : event.originalEvent.target,\n isInsideLayout = target.closest && target.closest('jqx-docking-layout');\n\n if (that.snapMode === 'advanced') {\n if (event.ctrlKey) {\n return;\n }\n\n that._dragDetails.hoveredItem = target.closest('.jqx-docking-layout-snap') ? target :\n (that._dragDetails.hoveredItem && that._dragDetails.hoveredItem.getElementsByTagName('jqx-splitter').length > 0 ? undefined : that._dragDetails.hoveredItem);\n that._dragDetails.hoveredTabArea = tabHeader ? (target.closest('.jqx-tab-label-container') || tabHeader) : that._dragDetails.hoveredTabArea;\n that._handleSnapping();\n return;\n }\n\n if (!isInsideLayout || isInsideLayout !== that) {\n that._handleSnapping();\n return;\n }\n\n if (!that._dragDetails.hoveredTabsWindow || (that._dragDetails.windowFeedback !== that.$.tabsWindowFeedback &&\n that._dragDetails.hoveredTabsWindow === that._dragDetails.selectedTabsWindow)) {\n that._dragDetails.hoveredItem = target.closest('.jqx-docking-layout-snap') ? target :\n (that._dragDetails.hoveredItem && that._dragDetails.hoveredItem.getElementsByTagName('jqx-splitter').length > 0 ? undefined : that._dragDetails.hoveredItem);\n that._handleSnapping();\n return;\n }\n\n let hoveredTabOffset = {};\n\n if (that._dragDetails.hoveredItem) {\n const hoveredItemRect = that._dragDetails.hoveredItem.getBoundingClientRect(),\n mainSplitterRect = that.$.itemsContainer.getBoundingClientRect();\n\n hoveredTabOffset.left = that._dragDetails.hoveredItem ? hoveredItemRect.left - mainSplitterRect.left : 0;\n hoveredTabOffset.top = that._dragDetails.hoveredItem ? hoveredItemRect.top - mainSplitterRect.top : 0;\n }\n else {\n hoveredTabOffset.left = hoveredTabOffset.top = 0;\n }\n\n const layoutRect = that.getBoundingClientRect(),\n itemsContainerRect = that.$.itemsContainer.getBoundingClientRect(),\n left = Math.max(0, event.pageX - window.pageXOffset - layoutRect.left - (itemsContainerRect.left - layoutRect.left)),\n top = Math.max(0, event.pageY - window.pageYOffset - layoutRect.top - (itemsContainerRect.top - layoutRect.top));\n\n if (that._dragDetails.hoveredTabArea === tabHeader) {\n that._dragDetails.hoveredTabArea = target.closest('.jqx-tab-label-container');\n that._handleSnapping('header');\n }\n else if (that._dragDetails.hoveredItem && !that._dragDetails.hoveredTabsWindow.autoHide) {\n if (left < that.$.itemsContainer.offsetWidth * 0.05 && left < that._dragDetails.hoveredItem.offsetWidth * 0.15) {\n that._handleSnapping('layout-left', event);\n }\n else if (left > that.$.itemsContainer.offsetWidth * 0.95 && left > that._dragDetails.hoveredItem.offsetWidth * 0.85 + that._dragDetails.hoveredItem.offsetLeft) {\n that._handleSnapping('layout-right');\n }\n else if (top < that.$.itemsContainer.offsetHeight * 0.05) {\n that._handleSnapping('layout-top');\n }\n else if (top > that.$.itemsContainer.offsetHeight * 0.95) {\n that._handleSnapping('layout-bottom');\n }\n else if (target.closest('.jqx-tabs-content-section')) {\n const orientation = that._dragDetails.hoveredItem.closest('jqx-splitter').orientation;\n\n if (left < hoveredTabOffset.left + that._dragDetails.hoveredTabArea.offsetWidth * 0.3) {\n that._handleSnapping(orientation === 'horizontal' ? 'inside-left' : 'left');\n }\n else if (left > hoveredTabOffset.left + that._dragDetails.hoveredTabArea.offsetWidth * 0.7) {\n that._handleSnapping(orientation === 'horizontal' ? 'inside-right' : 'right');\n }\n else if (top < hoveredTabOffset.top + that._dragDetails.hoveredTabArea.offsetTop + that._dragDetails.hoveredTabArea.offsetHeight * 0.5 +\n that._dragDetails.hoveredTabsWindow.$.headerSection.offsetHeight) {\n that._handleSnapping(orientation === 'vertical' ? 'inside-top' : 'top');\n }\n else {\n that._handleSnapping(orientation === 'vertical' ? 'inside-bottom' : 'bottom');\n }\n }\n else {\n that._handleSnapping();\n }\n }\n else {\n that._handleSnapping();\n }\n }", "_updateSettings() {\n\t\tthis.settings.media = this.settings.media || {};\n\t\tthis.settings.media[ this.getSelectedDevice() ] = this.getSettings();\n\t\tthis.settings.css = this._consolidateMediaCss( this.settings );\n\n\t\tthis._updateRelationshipStatus( this.settings );\n\t}", "_saveMergedDefaults() {\n\t\tthis.configDefaults = this._convertDefault(\n\t\t\t[ ...this.baseConfig.defaults, ...this.controlOptions.defaults ]\n\t\t);\n\t}", "function load_global() {\n global_activated = true;\n zoom_2D_global = get_global_zoom();\n if (current_html == \"index.html\") {\n document.getElementsByClassName(\"box-container\")[0].style.background = gradient_white;\n document.getElementsByClassName(\"box box-3-global\")[0].style.display = \"flex\";\n document.getElementsByClassName(\"box box-2-global\")[0].style.display = \"flex\"\n document.getElementsByClassName(\"box box-1-global\")[0].style.display = \"flex\";\n document.getElementsByClassName(\"box box-3\")[0].style.display = \"none\";\n document.getElementsByClassName(\"box box-3\")[1].style.display = \"none\";\n document.getElementsByClassName(\"info-button\")[0].style.display = \"none\";\n document.getElementsByClassName(\"switch-proj\")[0].style.display = \"none\";\n document.getElementsByClassName(\"parent-button-div\")[0].style.display = \"none\";\n document.getElementsByClassName(\"box box-1\")[0].style.visibility = \"collapse\";\n document.getElementsByClassName(\"box box-2\")[0].style.display = \"none\";\n } else {\n location.href='index.html';\n return false;\n }\n}", "_setupGestureMap() {\n this.recognizableGestures = new Map();\n this.recognizableGestures.set(\"HAMMER1\", new GestureHammer1LeapMotion(\"HAMMER1\", 0.7, \"/assets/data/gestures-illustrations/hammer.gif\"));\n this.recognizableGestures.set(\"HAMMER3\", new GestureHammer3LeapMotion(\"HAMMER3\", 1.5, \"/assets/data/gestures-illustrations/hammer3.gif\"));\n this.recognizableGestures.set(\"GRAB\", new GrabGestureLeapMotion(\"GRAB\", 0.7, \"/assets/data/gestures-illustrations/grab.gif\"));\n this.recognizableGestures.set(\"UNGRAB\", new ReleaseGestureLeapMotion(\"UNGRAB\", 0.7, \"/assets/data/gestures-illustrations/ungrab.gif\"));\n this.recognizableGestures.set(\"ROTATION\", new RotationGestureLeapMotion(\"ROTATION\", 1.5, \"/assets/data/gestures-illustrations/rotation.gif\"));\n this.recognizableGestures.set(\"REVERSED_ROTATION\", new ReversedRotationGestureLeapMotion(\"REVERSED_ROTATION\", 1.5, \"/assets/data/gestures-illustrations/reversed-rotation.gif\"));\n this.recognizableGestures.set(\"STAIRS\", new GestureStairsLeapMotion(\"STAIRS\", 2.8, \"/assets/data/gestures-illustrations/stairs.gif\"));\n this.recognizableGestures.set(\"SCRATCH\", new GestureScratchLeapMotion(\"SCRATCH\", 1.5, \"/assets/data/gestures-illustrations/scratch.gif\"));\n this.recognizableGestures.set(\"PINCH1\", new Pinch1GestureLeapMotion(\"PINCH1\", 1, \"/assets/data/gestures-illustrations/pinch1.gif\"));\n this.recognizableGestures.set(\"PINCH3\", new Pinch3GestureLeapMotion(\"PINCH3\", 2.5, \"/assets/data/gestures-illustrations/pinch3.gif\"));\n }", "recenterMap() {\n const map = this.map;\n let curr = this.props.currentLocation;\n\n const google = this.props.google;\n const maps = google.maps;\n const zoom = this.props.zoom;\n\n if (map) {\n let center = new maps.LatLng(curr.lat, curr.lng);\n map.panTo(center);\n map.setZoom(zoom)\n }\n }", "function syncViewports(layers, activeLayer) {\n // If we intend to keep the viewport's scale, translation and rotation in sync,\n // loop through the layers\n layers.forEach(function (layer) {\n // Don't do anything to the active layer\n // Don't do anything if this layer has no viewport\n if (layer === activeLayer || !layer.viewport || !activeLayer.viewport) {\n return;\n }\n\n if (!layer.syncProps) {\n updateLayerSyncProps(layer);\n }\n\n var viewportRatio = getViewportRatio(activeLayer, layer);\n\n // Update the layer's translation and scale to keep them in sync with the first image\n // based on the ratios between the images\n layer.viewport.scale = activeLayer.viewport.scale * viewportRatio;\n layer.viewport.rotation = activeLayer.viewport.rotation;\n layer.viewport.translation = {\n x: activeLayer.viewport.translation.x / viewportRatio,\n y: activeLayer.viewport.translation.y / viewportRatio\n };\n layer.viewport.hflip = activeLayer.viewport.hflip;\n layer.viewport.vflip = activeLayer.viewport.vflip;\n });\n}", "function setParameters(){\n // magins and dimensions of the svg\n \n var paneDimensions= d3.select('.left.paneContent').node().getBoundingClientRect();\n margin = {top: 20, right: 40, bottom: 40, left: 40};\n width = paneDimensions.width - margin.left - margin.right;\n height = paneDimensions.height- 42 - margin.top - margin.bottom;\n\n // Adds the svg canvas\n svg = d3.select(element[0])\n .append(\"div\")\n .classed(\"svg-container\", true) //container class to make it responsive\n .append(\"svg\")\n .attr(\"viewBox\", \"0 0 \"+ (width + margin.left + margin.right)+\n ' '+ (height + margin.top + margin.bottom))\n .classed(\"svg-content-responsive\", true)\n .append(\"g\")\n .classed('dominationGraph',true)\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\")\n .style(\"pointer-events\", \"all\");\n // .call(zoom);\n\n // creates graph backdrop\n svg\n .append(\"rect\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr('fill','#ddd')\n .attr('stroke','black')\n .attr('class','domGraph');\n\n svg.append('g')\n .style(\"pointer-events\", \"all\");\n\n // creates the clipping rectangle\n svg.append(\"clipPath\")\n .attr(\"id\", \"clip3\")\n .append(\"rect\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n \n var force = d3.layout.force()\n .charge(-120)\n .linkDistance(10)\n .size([width, height])\n .gravity(1);\n\n\n $http.get(\"getGraph\")\n \t.success(function(graph) {\n\t var linkg = svg.append(\"g\")\n\t .attr('class','links');\n\t \n\t var link = linkg.selectAll(\".link\")\n\t .data(graph.links)\n\t .enter().append(\"line\")\n\t .attr(\"class\", function(d){return \"link source\" +d.source+\" target\"+d.target;})\n\t .style(\"stroke-width\", function(d) { \n\t return 1;//Math.sqrt(d.value);\n\t });\n\t\n\t // console.log(link);\n\t\n\t var nodeg = svg.append(\"g\")\n\t .attr('class','nodes');\n\t\n\t var nodes = nodeg.selectAll(\".node\")\n\t .data(graph.nodes)\n\t .enter().append(\"circle\")\n\t .attr(\"class\", \"node\")\n\t .attr(\"r\", 3)\n\t .attr('index', function(d,i){\n\t return i;\n\t })\n\t .attr('id',function(d){ return 'did'+d.id;})\n\t .attr('clip-path','url#clip3')\n\t .on(\"mouseover\",function(d){\n\t \tconsole.log(\"highlighting\"+d.id);\n\t \t\n\t \t//gets all links with this node as a source or target\n\t var source = d3.selectAll(\".source\"+d.id);\n\t var target = d3.selectAll(\".target\"+d.id);\n\t\n\t source.each(function(element){\n\t // console.log(this);\n\t\n\t linkg.append('line')\n\t .attr(\"x1\", this.getAttribute('x1'))\n\t .attr(\"y1\", this.getAttribute('y1'))\n\t .attr(\"x2\", this.getAttribute('x2'))\n\t .attr(\"y2\", this.getAttribute('y2'))\n\t .attr(\"class\",\"link link\"+d.id+\" highlight \");\n\t });\n\t target.each(function(element){\n\t\n\t linkg.append('line')\n\t .attr(\"x1\", this.getAttribute('x1'))\n\t .attr(\"y1\", this.getAttribute('y1'))\n\t .attr(\"x2\", this.getAttribute('x2'))\n\t .attr(\"y2\", this.getAttribute('y2'))\n\t .attr(\"class\",\"link link\"+d.id+\" highlight\");\n\t });\n\t\n\t })\n\t .on(\"mouseout\",function(d){\n\t \t//removes all highlighted links\n\t d3.selectAll('.link.link'+d.id+'.highlight')\n\t .remove();\n\t });\n\t\n\t\n\t var nodeReference = {};\n\t\n\t var findNode =function(id){\n\t id = id.toString();\n\t if(nodeReference.hasOwnProperty(id)){\n\t if(nodeReference[id]==='null') return null;\n\t else return nodeReference[id];\n\t }\n\t\n\t var searchedNode =d3.select('#did'+id);\n\t // console.log(searchedNode.empty());\n\t if(searchedNode.empty()){\n\t nodeReference[id]='null';\n\t return null; \n\t } \n\t else {\n\t // console.log(\"Found ID: \" + id);\n\t var nodeIndex = Number(searchedNode.attr('index'));\n\t nodeReference[id] = nodeIndex;\n\t return nodeIndex;\n\t }\n\t };\n\t\n\t // var brokenLinks =0;\n\t // graph.links.forEach(function(d) {\n\t // if (typeof d.source == \"number\") { d.source = findNode(d.source); }\n\t // if (typeof d.target == \"number\") { d.target = findNode(d.target); }\n\t // if(d.source===null || d.target===null) brokenLinks++;\n\t // });\n\t\n\t // console.log(Object.keys(nodeReference));\n\t // console.log(Object.keys(nodeReference).filter(function(id){\n\t // return nodeReference[id.toString()] === 'null';\n\t // }));\n\t // console.log(graph.links);\n\t\n\t force\n\t .nodes(graph.nodes)\n\t .links(graph.links);\n\t\n\t // console.log(\"done adjusting graph\");\n\t\n\t $http.get(\"getGroup?groupnumber=123\")\n\t\t .success(function(groups) {\n\t\t console.log(groups);\n\t\t for( var group in groups){\n\t\t groups[group].forEach(setGroups, group);\n\t\t \n\t\t var groupg=nodeg.append('g')\n\t\t .attr('class','layer '+group);\n\t\t\n\t\t var nodeGroup = svg.selectAll('.node.'+group);\n\t\t // console.log(group);\n\t\t // console.log(nodeGroup);\n\t\t // console.log(nodeGroup.empty());\n\t\t if(!nodeGroup.empty()){\n\t\t nodeGroup.each(function(d,i){\n\t\t // console.log(d3.select(this).node());\n\t\t var removed = d3.select(this).remove();\n\t\t groupg.append(function() {\n\t\t return removed.node();\n\t\t });\n\t\t });\n\t\t }\n\t\t }\n\t\t //sort nodes in by groups\n\t\t\n\t\t // console.log(graph.nodes);\n\t\t var step = 2*Math.PI/graph.nodes.length;\n\t\t var ellipseX = function(angle){//angle is in radians\n\t\t return (width-10)/2*Math.cos(angle);\n\t\t };\n\t\t var ellipseY = function(angle){//angle is in radians\n\t\t return (height-10)/2*Math.sin(angle);\n\t\t };\n\t\t\n\t\t nodes.attr(\"cx\", function(d,i){return ellipseX(i*step)+width/2;})\n\t\t .attr(\"cy\",function(d,i){return ellipseY(i*step)+height/2;});\n\t\t\n\t\t\n\t\t\n\t\t link.each(function(d,i){\n\t\t var source = d3.select('#did'+d.source);\n\t\t var target = d3.select('#did'+d.target);\n\t\t if(i%1000===0){\n\t\t // console.log('source: #did'+d.source+' target: #did'+d.target);\n\t\t // console.log(source.node());\n\t\t // console.log(target.node());\n\t\t }\n\t\t var thisLink = d3.select(this);\n\t\t if(i%1000===0){\n\t\t // console.log(this);\n\t\t // console.log(thisLink);\n\t\t }\n\t\t thisLink\n\t\t .attr(\"x1\", function(d) { return source.attr('cx'); })\n\t\t .attr(\"y1\", function(d) { return source.attr('cy'); })\n\t\t .attr(\"x2\", function(d) { return target.attr('cx'); })\n\t\t .attr(\"y2\", function(d) { return target.attr('cy'); });\n\t\t\n\t\t if(i%1000===0){\n\t\t // console.log(this);\n\t\t // console.log(thisLink);\n\t\t }\n\t\t })\n\t\n\t // console.log(graph.links);\n\t\n\t console.log('Finished Dom Graph');\n\t\n\t // console.log(nodes);\n\t\n\t // nodes.append(\"title\")\n\t // .text(function(d) { return 'did'+d.id; });\n\t\n\t // console.log(\"start adjusting graph\");\n\t // console.log(force.links());\n\t\n\t // console.log(force.nodes());\n\t\n\t // var m=300;\n\t // console.log(m);\n\t \n\t // var n = nodes.length;\n\t // nodes.forEach(function(d, i) {\n\t // d.x = d.y = width / n * i;\n\t // });\n\t\n\t\n\t // force.start();\n\t // console.log('starting ticks');\n\t // for (var i = 0; i < m; ++i) {\n\t // if(i%10 === 0) {console.log('tick: '+i);}\n\t // force.tick();\n\t // }\n\t // force.stop();\n\t // // console.log(link); \n\t \n\t\n\t // force.on(\"tick\", function() { \n\t // link.attr(\"x1\", function(d) { return d.source.x; })\n\t // .attr(\"y1\", function(d) { return d.source.y; })\n\t // .attr(\"x2\", function(d) { return d.target.x; })\n\t // .attr(\"y2\", function(d) { return d.target.y; });\n\t\n\t // nodes.attr(\"cx\", function(d) { return d.x; })\n\t // .attr(\"cy\", function(d) { return d.y; });\n\t // });\n\t\n\t // force.on(\"tick\", function(e) {\n\t\n\t // nodes.attr(\"transform\", function(d) { \n\t // //TODO move these constants to the header section\n\t // //center the center (root) node when graph is cooling down\n\t // if(d.classed('Group2')){\n\t // damper = 0.1;\n\t // d.x = d.x + (w/2 - d.x) * (damper + 0.71) * e.alpha;\n\t // d.y = d.y + (h/2 - d.y) * (damper + 0.71) * e.alpha;\n\t // }\n\t // //start is initiated when importing nodes from XML\n\t // if(d.start === true){\n\t // d.x = w/2;\n\t // d.y = h/2;\n\t // d.start = false;\n\t // }\n\t\n\t // r = d.name.length;\n\t // //these setting are used for bounding box, see [http://blockses.appspot.com/1129492][1]\n\t // d.x = Math.max(r, Math.min(w - r, d.x));\n\t // d.y = Math.max(r, Math.min(h - r, d.y));\n\t\n\t // return \"translate(\"+d.x+\",\"+d.y+\")\"; \n\t\n\t // });\n\t // }); \n\t\n\t // nodes.attr(\"cx\", function(d) { return d.x; })\n\t // .attr(\"cy\", function(d) { return d.y; });\n\t\n\t // link.attr(\"x1\", function(d) { return d.source.x; })\n\t // .attr(\"y1\", function(d) { return d.source.y; })\n\t // .attr(\"x2\", function(d) { return d.target.x; })\n\t // .attr(\"y2\", function(d) { return d.target.y; });\n\t\n\t // console.log(force.nodes());\n\t // console.log(force.links());\n\t\n\t })\n\t .error(function(){\n\t \tconsole.log(\"Error geting groups for dom graph\")\n\t });\n\t })\n\t .error(function(){\n\t \tconsole.log(\"Error geting dom graph\")\n\t });\n\n function setGroups(gNode, index, array){\n// if(index%1000 === 0){\n// \tconsole.log(this);\n// \tconsole.log(gNode.id)}\n \tvar id = gNode.id;\n svg.select('#did'+id)\n \t.classed(this,true);\n }\n\n }", "function updateBaseMap0() {\n //alert(mapID);\n if (dom.byId(\"blayerS\" + mapID).checked) {\n roeMapGulf.setBasemap(currentObject.config.baseMap[0]);//hybrid\n } else {\n roeMapGulf.setBasemap(currentObject.config.baseMap[1]);\n }\n }", "function applyOptions(){\n\n\tvar options = viewerParams.parts.options;\n\n\tvar forGUI = [];\n\n\t//modify the minimum z to show particles at (avoid having particles up in your face)\n\tif (options.hasOwnProperty('zmin') && options.zmin != null) viewerParams.zmin = options.zmin;\n\n\t//modify the maximum z to show particles at (avoid having particles up way in the background)\n\tif (options.hasOwnProperty('zmax') && options.zmax != null) viewerParams.zmax = options.zmax;\n\n\t//initialize center\n\tif (options.hasOwnProperty('center')){\n\t\tif (options.center != null){\n\t\t\tviewerParams.center = new THREE.Vector3(options.center[0], options.center[1], options.center[2]);\n\t\t\tsetBoxSize(viewerParams.parts[viewerParams.partsKeys[0]].Coordinates_flat); } \n\t\telse options.center = [viewerParams.center.x, viewerParams.center.y, viewerParams.center.z]; } \n\telse options.center = [viewerParams.center.x, viewerParams.center.y, viewerParams.center.z];\n\n\t//change location of camera\n\tif (options.hasOwnProperty('camera') &&\n\t\toptions.camera != null) viewerParams.camera.position.set(\n\t\t\toptions.camera[0],\n\t\t\toptions.camera[1],\n\t\t\toptions.camera[2]);\n\n\t//change the rotation of the camera \n\tif (options.hasOwnProperty('cameraRotation') &&\n\t\toptions.cameraRotation != null) viewerParams.camera.rotation.set(\n\t\t\toptions.cameraRotation[0],\n\t\t\toptions.cameraRotation[1],\n\t\t\toptions.cameraRotation[2]);\n\n\t//change the up vector of the camera (required to get the rotation correct)\n\tif (options.hasOwnProperty('cameraUp') &&\n\t\toptions.cameraUp != null) viewerParams.camera.up.set(\n\t\t\toptions.cameraUp[0],\n\t\t\toptions.cameraUp[1],\n\t\t\toptions.cameraUp[2]);\n\n\t//check if we are starting in Fly controls\n\tif (options.hasOwnProperty('startFly') && options.startFly) viewerParams.useTrackball = false;\n\n\t//check if we are starting in VR controls\n\tif (options.hasOwnProperty('startVR') && options.startVR) viewerParams.allowVRControls = true;\n\n\t//check if we are starting in column density mode\n\tif (options.hasOwnProperty('startColumnDensity') && options.startColumnDensity) viewerParams.columnDensity = true;\n\n\t// flag to start in a tween loop\n\tif (options.hasOwnProperty('startTween') && options.startTween){\n\t\tviewerParams.updateTween = true\t\n\t\tsetTweenviewerParams();\n\t}\n\n\t//modify the initial friction\n\tif (options.hasOwnProperty('friction') && options.friction != null) viewerParams.friction = options.friction;\n\n\t//check if we are starting in Stereo\n\tif (options.hasOwnProperty('stereo') && options.stereo){\n\t\tviewerParams.normalRenderer = viewerParams.renderer;\n\t\tviewerParams.renderer = viewerParams.effect;\n\t\tviewerParams.useStereo = true;\n\t\tif (viewerParams.haveUI){\n\t\t\tvar evalString = 'elm = document.getElementById(\"StereoCheckBox\"); elm.checked = true; elm.value = true;'\n\t\t\tforGUI.push({'evalCommand':[evalString]})\n\t} \t}\n\n\t//modify the initial stereo separation\n\tif (options.hasOwnProperty('stereoSep') && options.stereoSep != null){\n\t\t\tviewerParams.stereoSep = options.stereoSep;\n\t\t\tviewerParams.effect.setEyeSeparation(viewerParams.stereoSep);\n\t}\n\n\t//modify the initial decimation\n\tif (options.hasOwnProperty('decimate') && options.decimate != null) viewerParams.decimate = options.decimate;\n\t\n\t//maximum range in calculating the length the velocity vectors\n\tif (options.hasOwnProperty(\"maxVrange\") && options.maxVrange != null){\n\t\tviewerParams.maxVrange = options.maxVrange; //maximum dynamic range for length of velocity vectors\n\t\tfor (var i=0; i<viewerParams.partsKeys.length; i++){\n\t\t\tvar p = viewerParams.partsKeys[i];\n\t\t\tif (viewerParams.parts[p].Velocities_flat != null){\n\t\t\t\tcalcVelVals(viewerParams.parts[p]); \n\t} \t} \t}\n\n\t//modify the minimum point scale factor\n\tif (options.hasOwnProperty('minPointScale') && options.minPointScale != null) viewerParams.minPointScale = options.minPointScale;\n\n\t//modify the maximum point scale factor\n\tif (options.hasOwnProperty('maxPointScale') && options.maxPointScale != null) viewerParams.maxPointScale = options.maxPointScale;\n\n // add an annotation to the top if necessary\n\tif (options.hasOwnProperty('annotation') && options.annotation != null){\n\t\telm = document.getElementById('annotate_container');\n\t\telm.innerHTML=options.annotation;\n\t\telm.style.display='block';\n }\n\n\t// flag to show fps in top right corner\n\tif (options.hasOwnProperty('showFPS') && options.showFPS != null) viewerParams.showFPS = options.showFPS;\n\n\t// flag to show memory usage in top right corner\n\tif (options.hasOwnProperty('showMemoryUsage') && options.showMemoryUsage != null) viewerParams.showMemoryUsage = options.showMemoryUsage;\n\n\t// change the memory limit for octrees, in bytes\n\tif (options.hasOwnProperty('memoryLimit') && options.memoryLimit != null) viewerParams.memoryLimit = options.memoryLimit;\n\t// flag to launch the app in a tween loop\n\tif (viewerParams.parts.options.hasOwnProperty('start_tween')){\n\t\tif (viewerParams.parts.options.start_tween){\n\t\t\tviewerParams.updateTween = true\t\n\t\t\tsetTweenviewerParams();\n\t\t}\n\t}\n\n\t// --------- column density options ----------- \n\n\t// flag to launch the app with the column density projection mode enabled\n\tif (viewerParams.parts.options.hasOwnProperty(viewerParams.CDkey)){\n\t\tif (viewerParams.parts.options.columnDensity != null){\n\t\t\tviewerParams.columnDensity = viewerParams.parts.options.columnDensity;\n\t\t}\n\t}\n\n\t// flag to renormalize column densities in logspace\n\tif (viewerParams.parts.options.hasOwnProperty('CDlognorm')){\n\t\tif (viewerParams.parts.options.CDlognorm != null){\n\t\t\tviewerParams.CDlognorm = viewerParams.parts.options.CDlognorm;\n\t\t}\n\t}\n\n\t// bottom of the column density renormalization\n\tif (viewerParams.parts.options.hasOwnProperty('CDmin')){\n\t\tif (viewerParams.parts.options.CDmin != null){\n\t\t\tviewerParams.CDmin = viewerParams.parts.options.CDmin;\n\t\t}\n\t}\n\n\t// top of the column density renormalization\n\tif (viewerParams.parts.options.hasOwnProperty('CDmax')){\n\t\tif (viewerParams.parts.options.CDmax != null){\n\t\t\tviewerParams.CDmax = viewerParams.parts.options.CDmax;\n\t\t}\n\t}\t\n\n\t// disable GUI elements\n\tif (viewerParams.parts.options.hasOwnProperty('GUIExcludeList')){\n\t\tif (viewerParams.parts.options.GUIExcludeList != null){\n\t\t\tviewerParams.GUIExcludeList = viewerParams.parts.options.GUIExcludeList;\n\t\t}\n\t}\n\n\tif (viewerParams.parts.options.hasOwnProperty('collapseGUIAtStart')){\n\t\tif (viewerParams.parts.options.collapseGUIAtStart != null){\n\t\t\tviewerParams.collapseGUIAtStart = viewerParams.parts.options.collapseGUIAtStart;\n\t\t}\n\t}\n\n\t//particle specific options\n\tvar options_keys = Object.keys(viewerParams.parts.options.showParts);\n\tfor (var i=0; i<viewerParams.partsKeys.length; i++){\n\t\tvar viewer_p = viewerParams.partsKeys[i];\n\t\tvar p;\n\t\tfor (j=0;j<options_keys.length;j++){\n\t\t\tif (removeSpecialChars(options_keys[j]) == viewer_p){\n\t\t\t\tp = options_keys[j];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//on/off\n\t\tif (options.hasOwnProperty(\"showParts\") && \n\t\t\toptions.showParts != null && \n\t\t\toptions.showParts.hasOwnProperty(p) && \n\t\t\toptions.showParts[p] != null) viewerParams.showParts[viewer_p] = options.showParts[p];\n\n\t\t//size\n\t\tif (options.hasOwnProperty(\"sizeMult\") && \n\t\t\toptions.sizeMult != null && \n\t\t\toptions.sizeMult.hasOwnProperty(p) && \n\t\t\toptions.sizeMult[p] != null) viewerParams.PsizeMult[viewer_p] = options.sizeMult[p];\n\n\t\t//color\n\t\tif (options.hasOwnProperty(\"color\") &&\n\t\t\toptions.color != null &&\n\t\t\toptions.color.hasOwnProperty(p) && \n\t\t\toptions.color[p] != null) viewerParams.Pcolors[viewer_p] = options.color[p];\n\n\t\t//maximum number of particles to plot\n\t\tif (options.hasOwnProperty(\"plotNmax\") &&\n\t\t\toptions.plotNmax != null &&\n\t\t\toptions.plotNmax.hasOwnProperty(p) &&\n\t\t\toptions.plotNmax[p] != null) viewerParams.plotNmax[viewer_p] = options.plotNmax[p];\n\n\t\t//start plotting the velocity vectors\n\t\tif (options.hasOwnProperty(\"showVel\") && \n\t\t\toptions.showVel != null &&\n\t\t\toptions.showVel.hasOwnProperty(p) &&\n\t\t\toptions.showVel[p]){\n\n\t\t\tviewerParams.showVel[viewer_p] = true;\n\t\t\tif (viewerParams.haveUI){\n\t\t\t\tvar evalString = 'elm = document.getElementById(\"'+p+'velCheckBox\"); elm.checked = true; elm.value = true;'\n\t\t\t\tforGUI.push({'evalCommand':[evalString]})\n\t\t} \t}\n\n\t\t//type of velocity vectors\n\t\tif (options.hasOwnProperty(\"velType\") &&\n\t\t\toptions.velType != null &&\n\t\t\toptions.velType.hasOwnProperty(p) && \n\t\t\toptions.velType[p] != null){\n\t\t\t// type guard the velocity lines, only allow valid values\n\t\t\tif (options.velType[p] == 'line' || options.velType[p] == 'arrow' || options.velType[p] == 'triangle'){\n\t\t\t\tviewerParams.velType[viewer_p] = options.velType[p];\n\t\t} \t}\n\n\t\t//velocity vector width\n\t\tif (options.hasOwnProperty(\"velVectorWidth\") &&\n\t\t\toptions.velVectorWidth != null &&\n\t\t\toptions.velVectorWidth.hasOwnProperty(p) &&\n\t\t\toptions.velVectorWidth[p] != null) viewerParams.velVectorWidth[viewer_p] = options.velVectorWidth[p]; \n\n\t\t//velocity vector gradient\n\t\tif (options.hasOwnProperty(\"velGradient\") && \n\t\t\toptions.velGradient != null && \n\t\t\toptions.velGradient.hasOwnProperty(p) &&\n\t\t\toptions.velGradient[p] != null) viewerParams.velGradient[viewer_p] = +options.velGradient[p]; //convert from bool to int\n\n\t\t//start showing the velocity animation\n\t\tif (options.hasOwnProperty(\"animateVel\") && \n\t\t\toptions.animateVel != null &&\n\t\t\toptions.animateVel.hasOwnProperty(p) &&\n\t\t\toptions.animateVel[p] != null){\n\n\t\t\tviewerParams.animateVel[viewer_p] = true;\n\t\t\tif (viewerParams.haveUI){\n\t\t\t\tvar evalString = 'elm = document.getElementById(\"'+p+'velAnimateCheckBox\"); elm.checked = true; elm.value = true;'\n\t\t\t\tforGUI.push({'evalCommand':[evalString]})\n\t\t} \t}\n\n\t\t//animate velocity dt\n\t\tif (options.hasOwnProperty(\"animateVelDt\") &&\n\t\t\toptions.animateVelDt != null &&\n\t\t\toptions.animateVelDt.hasOwnProperty(p) &&\n\t\t\toptions.animateVelDt[p] != null) viewerParams.animateVelDt[viewer_p] = options.animateVelDt[p];\n\n\t\t//animate velocity tmax\n\t\tif (options.hasOwnProperty(\"animateVelTmax\") &&\n\t\t\toptions.animateVelTmax != null &&\n\t\t\toptions.animateVelTmax.hasOwnProperty(p) &&\n\t\t\toptions.animateVelTmax[p] != null) viewerParams.animateVelTmax[viewer_p] = options.animateVelTmax[p];\n\n\t\t//filter limits\n\t\tif (options.hasOwnProperty(\"filterLims\") &&\n\t\t\toptions.filterLims != null &&\n\t\t\toptions.filterLims.hasOwnProperty(p) &&\n\t\t\toptions.filterLims[p] != null){\n\t\t\tviewerParams.updateFilter[viewer_p] = true\n\n\t\t\tfor (k=0; k<viewerParams.fkeys[viewer_p].length; k++){\n\t\t\t\tvar fkey = viewerParams.fkeys[viewer_p][k]\n\t\t\t\tif (options.filterLims[p].hasOwnProperty(fkey)){\n\t\t\t\t\tif (options.filterLims[p][fkey] != null){\n\t\t\t\t\t\tviewerParams.filterLims[viewer_p][fkey] = []\n\t\t\t\t\t\tviewerParams.filterLims[viewer_p][fkey].push(options.filterLims[p][fkey][0]);\n\t\t\t\t\t\tviewerParams.filterLims[viewer_p][fkey].push(options.filterLims[p][fkey][1]);\n\t\t} \t} \t} \t}\n\n\t\t//filter values\n\t\tif (options.hasOwnProperty(\"filterVals\") &&\n\t\t\toptions.filterVals != null &&\n\t\t\toptions.filterVals.hasOwnProperty(p) &&\n\t\t\toptions.filterVals[p] != null){\n\t\t\tviewerParams.updateFilter[viewer_p] = true\n\n\t\t\tfor (k=0; k<viewerParams.fkeys[viewer_p].length; k++){\n\t\t\t\tvar fkey = viewerParams.fkeys[viewer_p][k]\n\t\t\t\tif (options.filterVals[p].hasOwnProperty(fkey)){\n\t\t\t\t\tif (options.filterVals[p][fkey] != null){\n\t\t\t\t\t\tviewerParams.filterVals[viewer_p][fkey] = []\n\t\t\t\t\t\tviewerParams.filterVals[viewer_p][fkey].push(options.filterVals[p][fkey][0]);\n\t\t\t\t\t\tviewerParams.filterVals[viewer_p][fkey].push(options.filterVals[p][fkey][1]);\n\t\t} \t} \t} \t}\n\n\t\t//filter invert\n\t\tif (options.hasOwnProperty(\"invertFilter\") &&\n\t\t\toptions.invertFilter != null &&\n\t\t\toptions.invertFilter.hasOwnProperty(p) &&\n\t\t\toptions.invertFilter[p] != null){\n\t\t\tfor (k=0; k<viewerParams.fkeys[viewer_p].length; k++){\n\t\t\t\tvar fkey = viewerParams.fkeys[viewer_p][k]\n\t\t\t\tif (options.invertFilter[p].hasOwnProperty(fkey)){\n\t\t\t\t\tif (options.invertFilter[p][fkey] != null){\n\t\t\t\t\t\tviewerParams.invertFilter[viewer_p][fkey] = options.invertFilter[p][fkey];\n\t\t} \t}\t } \t}\n\n\t\t//colormap limits\n\t\tif (options.hasOwnProperty(\"colormapLims\") &&\n\t\t\toptions.colormapLims != null && \n\t\t\toptions.colormapLims.hasOwnProperty(p) && \n\t\t\toptions.colormapLims[p] != null){\n\t\t\tfor (k=0; k<viewerParams.ckeys[viewer_p].length; k++){\n\t\t\t\tvar ckey = viewerParams.ckeys[viewer_p][k]\n\t\t\t\tif (options.colormapLims[p].hasOwnProperty(ckey)){\n\t\t\t\t\tif (options.colormapLims[p][ckey] != null){\n\t\t\t\t\t\tviewerParams.colormapLims[viewer_p][ckey] = []\n\t\t\t\t\t\tviewerParams.colormapLims[viewer_p][ckey].push(options.colormapLims[p][ckey][0]);\n\t\t\t\t\t\tviewerParams.colormapLims[viewer_p][ckey].push(options.colormapLims[p][ckey][1]);\n\t\t} \t} \t} \t}\n\n\t\t//colormap values\n\t\tif (options.hasOwnProperty(\"colormapVals\") &&\n\t\t\toptions.colormapVals != null &&\n\t\t\toptions.colormapVals.hasOwnProperty(p) &&\n\t\t\toptions.colormapVals[p] != null){\n\n\t\t\tfor (k=0; k<viewerParams.ckeys[viewer_p].length; k++){\n\t\t\t\tvar ckey = viewerParams.ckeys[viewer_p][k]\n\t\t\t\tif (options.colormapVals[p].hasOwnProperty(ckey)){\n\t\t\t\t\tif (options.colormapVals[p][ckey] != null){\n\t\t\t\t\t\tviewerParams.colormapVals[viewer_p][ckey] = []\n\t\t\t\t\t\tviewerParams.colormapVals[viewer_p][ckey].push(options.colormapVals[p][ckey][0]);\n\t\t\t\t\t\tviewerParams.colormapVals[viewer_p][ckey].push(options.colormapVals[p][ckey][1]);\n\t\t} \t} \t} \t}\n\n\t\t//start plotting with a colormap\n\t\tif (options.hasOwnProperty(\"showColormap\") &&\n\t\t\toptions.showColormap != null &&\n\t\t\toptions.showColormap.hasOwnProperty(p) &&\n\t\t\toptions.showColormap[p] == true){\n\t\t\tviewerParams.showColormap[viewer_p] = true;\n\t\t\tif (viewerParams.haveUI){\n\t\t\t\tconsole.log(p+'colorCheckBox')\n\t\t\t\tvar evalString = 'elm = document.getElementById(\"'+p+'colorCheckBox\"); elm.checked = true; elm.value = true;'\n\t\t\t\tforGUI.push({'evalCommand':[evalString]})\n\t\t} \t}\n\n\t\t//choose which colormap to use\n\t\tif (options.hasOwnProperty(\"colormap\") && \n\t\t\toptions.colormap != null &&\n\t\t\toptions.colormap.hasOwnProperty(p) && \n\t\t\toptions.colormap[p] != null) viewerParams.colormap[viewer_p] = copyValue(options.colormap[p]);\n\n\t\t//select the colormap variable to color by\n\t\tif (options.hasOwnProperty(\"colormapVariable\") && \n\t\t\toptions.colormapVariable != null &&\n\t\t\toptions.colormapVariable.hasOwnProperty(p) && \n\t\t\toptions.colormapVariable[p] != null) viewerParams.colormapVariable[viewer_p] = copyValue(options.colormapVariable[p]);\n\n\t\t//select the radius variable to scale by\n\t\tif (options.hasOwnProperty(\"radiusVariable\") && \n\t\t\toptions.radiusVariable != null &&\n\t\t\toptions.radiusVariable.hasOwnProperty(p) && \n\t\t\toptions.radiusVariable[p] != null) viewerParams.radiusVariable[viewer_p] = copyValue(options.radiusVariable[p]);\n\n\t\tif (options.hasOwnProperty(\"blendingMode\") && \n\t\t\toptions.blendingMode != null &&\n\t\t\toptions.blendingMode.hasOwnProperty(p) && \n\t\t\toptions.blendingMode[p] != null) viewerParams.blendingMode[viewer_p] = copyValue(options.blendingMode[p]);\n\t\t\t\n\t\tif (options.hasOwnProperty(\"depthTest\") && \n\t\t\toptions.depthTest != null &&\n\t\t\toptions.depthTest.hasOwnProperty(p) && \n\t\t\toptions.depthTest[p] != null){\n\t\t\t\tviewerParams.depthTest[viewer_p] = copyValue(options.depthTest[p]);\n\t\t\t\tviewerParams.depthWrite[viewer_p] = copyValue(options.depthTest[p]);\n\t\t\t\t/*\n\t\t\t\tvar evalString =( 'elm = document.getElementById(' + p + '_depthCheckBox);'+\n\t\t\t\t\t'elm.checked = ' + options.depthTest[p] + ';'+\n\t\t\t\t\t'elm.value = ' + options.depthTest[p]+';')\n\t\t\t\tforGUI.push({'evalCommand':evalString});\n\t\t\t\t*/\n\t\t\t}\n\t\t\t\n\t}// particle specific options\n\n\t// initialize all the colormap stuff that columnDensity will need. Because it's\n\t// not a real particle group it won't get set in the loop above\n\t// do it here so it happens in the presets too and load settings, etc...\n\tviewerParams.showParts[viewerParams.CDkey] = viewerParams.partsKeys.some(\n\t\tfunction (key){return viewerParams.showParts[key]});\n\tviewerParams.colormap[viewerParams.CDkey] = 4/256\n\tviewerParams.ckeys[viewerParams.CDkey] = [viewerParams.CDckey]\n\tviewerParams.colormapLims[viewerParams.CDkey] = {}\n\tviewerParams.colormapLims[viewerParams.CDkey][viewerParams.ckeys[viewerParams.CDkey][0]] = [viewerParams.CDmin,viewerParams.CDmax]\n\tviewerParams.colormapVals[viewerParams.CDkey] = {}\n\tviewerParams.colormapVals[viewerParams.CDkey][viewerParams.ckeys[viewerParams.CDkey][0]] = [viewerParams.CDmin,viewerParams.CDmax]\n\tviewerParams.colormapVariable[viewerParams.CDkey] = 0;\n\tviewerParams.showColormap[viewerParams.CDkey] = false;\n\tviewerParams.updateColormapVariable[viewerParams.CDkey] = false;\n\n\tsendToGUI(forGUI);\n}", "function controles() {\n checkboxCapa = document.getElementById(\"controles\");\n if (checkboxCapa.checked) {\n var misOpciones = {\n disableDefaultUI: false,\n mapTypeControl: true\n };\n map.setOptions(misOpciones); \n\n }\n else {\n var misOpciones = {\n disableDefaultUI: true,\n mapTypeControl: false\n };\n map.setOptions(misOpciones); \n }\n}", "function adjustToMyLocation() {\n// GET MAP\nvar thisMap = getMap(_menuContentPane.id);\n// ADJUST LOCATIONS\nsyncMapLocations(thisMap);\n}", "function zoomed_2D_global() {\n g_global.attr(\"transform\", d3.event.transform);\n}", "function win_resize() {\n var win_resized_width = getViewport()[0];\n var win_resized_height = getViewport()[1];\n\n if (win_resized_width < 810) {\n $('.nav-level-2-menu').css('width',win_resized_width);\n if ($('#nav-mask').length < 1 ){\n $('body').append('<div id=\"nav-mask\"/>')\n }\n }\n}" ]
[ "0.68844336", "0.683665", "0.6807137", "0.6807137", "0.6807137", "0.66090053", "0.6491149", "0.536376", "0.4962876", "0.49064708", "0.48554066", "0.47996208", "0.4716626", "0.4716621", "0.4697131", "0.46848083", "0.46733788", "0.46705052", "0.46656418", "0.4617166", "0.46155423", "0.46060127", "0.4588343", "0.45495307", "0.45462087", "0.4536121", "0.4531954", "0.4528716", "0.45222345", "0.45193207", "0.45116755", "0.44842252", "0.44806927", "0.44780955", "0.44727558", "0.44705838", "0.4458561", "0.4451974", "0.44432622", "0.44418696", "0.44418696", "0.44415516", "0.44281045", "0.43993908", "0.43964785", "0.43783903", "0.43770835", "0.43751734", "0.43747008", "0.43735892", "0.43706605", "0.43692407", "0.4350628", "0.43491673", "0.43484628", "0.43466073", "0.43466073", "0.43441105", "0.4339421", "0.43389535", "0.43322724", "0.4331975", "0.43241957", "0.43202385", "0.4319901", "0.43190932", "0.43178436", "0.4317483", "0.43170494", "0.43163985", "0.43157604", "0.43138394", "0.43132257", "0.43115416", "0.4311181", "0.43109813", "0.4308023", "0.43070456", "0.43059555", "0.43059555", "0.4304283", "0.4300756", "0.42982075", "0.42938855", "0.4285667", "0.42818314", "0.42803833", "0.42775294", "0.42613584", "0.42609832", "0.42521715", "0.42504463", "0.42490575", "0.42484337", "0.42483604", "0.42462808", "0.4244844", "0.423993" ]
0.6634023
7
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(ecModel) { ecModel.eachSeriesByType('graph', function (seriesModel) { if (seriesModel.get('layout') === 'circular') { circularLayout(seriesModel, 'symbolSize'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "started () {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "function SigV4Utils() { }", "started() {\r\n\r\n\t}", "static get NOT_READY () {return 0}", "initialize() {\n\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "heartbeat () {\n }", "static final private internal function m106() {}", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53504926", "0.4896905", "0.48514667", "0.48116106", "0.4775166", "0.4743932", "0.47342455", "0.47035336", "0.4694186", "0.4694186", "0.46744877", "0.46453032", "0.46394095", "0.4629355", "0.46211302", "0.45832416", "0.45812932", "0.45752546", "0.45698234", "0.45625272", "0.4557475", "0.4549714", "0.45494938", "0.4545794", "0.45383474", "0.4523037", "0.45180768", "0.45005357", "0.4496748", "0.4486438", "0.447462", "0.44716924", "0.4468301", "0.44601226", "0.4456266", "0.4455926", "0.44557476", "0.4445067", "0.44378054", "0.44258687", "0.44258553", "0.4424118", "0.44097725", "0.4406038", "0.4404498", "0.4404498", "0.4404498", "0.43926418", "0.43781474", "0.43708664", "0.43657827", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43526813", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4349645", "0.43450522", "0.43440443", "0.43390423", "0.43347356", "0.43347356", "0.43332103", "0.43318707" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. TODO Parse shadow style TODO Only shallow path support
function _default(properties) { // Normalize for (var i = 0; i < properties.length; i++) { if (!properties[i][1]) { properties[i][1] = properties[i][0]; } } return function (model, excludes, includes) { var style = {}; for (var i = 0; i < properties.length; i++) { var propName = properties[i][1]; if (excludes && zrUtil.indexOf(excludes, propName) >= 0 || includes && zrUtil.indexOf(includes, propName) < 0) { continue; } var val = model.getShallow(propName); if (val != null) { style[properties[i][0]] = val; } } return style; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get path()\t\t{ return this.match[7] || \"\" }", "_getDirectMatchProps() {\n return ['file'];\n }", "function PathMapper() {\n\t}", "function PathMapper() {\n\t}", "resolveAsPath() { }", "get fullpath()\t{ return \"\" + this.prefix + this.path }", "function segment(WrappedComponent, mapping) {\n // pathMatch;\n return class extends Component {\n constructor(props) {\n super(props);\n\n this.state = {};\n }\n\n render() {\n const {\n path,\n currentPath,\n isRelative = true,\n basePath,\n exact = false,\n ...rest\n } = this.props;\n\n // currentPath /bbb/aaa/123/ccc/ddd\n // currentPath /bbb/aaa/123/ccc\n\n // base /bbb\n // path /aaa/{id}/ccc\n // path aaa/{id}/ccc\n\n // to /bbb/aaa/{id}/ccc\n\n // last '/' to ''\n // console.log(currentPath, path, isRelative, basePath);\n if (isRelative) {\n const result = relativeMatch(currentPath, basePath, path, exact);\n if (result) {\n return (\n <WrappedComponent\n currentPath={currentPath}\n // basePath={xxx} // this is in result\n {...result}\n {...rest}\n />\n );\n }\n return null;\n }\n const result = pathMatch(currentPath, path);\n if (result) {\n return (\n <WrappedComponent\n currentPath={currentPath}\n basePath={basePath}\n {...result}\n {...rest}\n />\n );\n }\n return null;\n }\n };\n}", "function PathSearchResultCollector() {\n\n}", "function parsePath(scope, path, origPath) {\n trace('parsePath: ' + path);\n var m = path.match(/^([$a-zA-Z][a-zA-Z0-9_-]*)\\.(.*)$/);\n if (m) {\n var namespace = m[1];\n var rest = m[2];\n\n trace('parsePath: ' + namespace + ', ' + rest);\n return parsePath(scope[namespace], rest, origPath);\n } else {\n return parseLeaf(scope, path, origPath);\n }\n }", "function PathContestProvider() {\n\n}", "get(path){\n if (typeof path === 'string') {\n let array = path.split('.');\n return this.get(array);\n }\n let data = this.data;\n let len = path ? path.length : 0;\n let i;\n for (i = 0; data && i < len; i++) {\n let segment = path[i];\n data = data[segment];\n }\n return i === len ? data : null;\n }", "node(depth) {\n return this.path[this.resolveDepth(depth) * 3];\n }", "function splitPath(p) {\n if (typeof p === 'string') {\n return splitPath({'path' : p});\n }\n\n var a = p.path.split(\"/\");\n p.name = a.pop();\n // console.log(a);\n p.cpath = a.join(\"/\");\n // a.shift();\n // console.log(a);\n p.topname = a.shift(); // get the name of the top dir\n // console.log(a);\n a.unshift(\"\");\n // console.log(a);\n p.cpath1 = a.join(\"/\"); // remove the topdir\n\n var e = p.name.split(\".\");\n if (e.length < 2) {\n p.ext = \"\";\n p.bname = p.name;\n } else {\n p.ext = e.pop();\n p.bname = e.join(\".\");\n }\n return p;\n}", "get path() {\n return parse(this).pathname\n }", "get(name){\n var result=this.getPath(name);\n return result!=undefined?result[1]:undefined;\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}", "constructor(path: string) {\n this.path = path;\n this.absolutePath = null;\n }", "get path() {}", "collectMetadata(stack) {\n const output = {};\n visit(stack);\n // add app-level metadata under \".\"\n if (this.metadata.length > 0) {\n output[construct_1.PATH_SEP] = this.metadata;\n }\n return output;\n function visit(node) {\n if (node.metadata.length > 0) {\n // Make the path absolute\n output[construct_1.PATH_SEP + node.path] = node.metadata.map(md => tokens_1.resolve(md));\n }\n for (const child of node.children) {\n visit(child);\n }\n }\n }", "resolveProp(obj, path) {\n return path.split('.').reduce((prev, curr) => {\n return prev ? prev[curr] : null;\n }, obj);\n }", "build_paths() {\n return {\n items: {\n list: { // Returns a list of items\n method: \"GET\",\n path: \"items\", \n }, \n item: { // Returns a single item with ID %%\n method: \"GET\",\n path: \"items/%%\"\n }, \n item_metadata: { // Returns metadata for item %%\n method: \"GET\",\n path: \"items/%%/metadata\", \n }, \n item_bitstreams: { // Returns available bitstreams for item %%\n method: \"GET\",\n path: \"items/%%/bitstreams\" \n },\n find_by_metadata: { // Returns items based on specified metadata value\n method: \"POST\",\n path: \"items/find-by-metadata-field\"\n } \n },\n query: { \n filtered_items: { // Returns items based on chosen filters\n method: \"GET\",\n path: \"filtered-items\", \n }, \n filtered_collections: { // Returns collections based on chosen filters\n method: \"GET\",\n path: \"filtered-collections\",\n }, \n collection: { // Returns collection with ID %%\n method: \"GET\",\n path: \"filtered-collections/%%\",\n } \n },\n bitstreams: { \n list: { // Returns all bitstreams in DSpace\n method: \"GET\",\n path: \"bitsreams\"\n },\n item: { // Returns an item with bitstream ID %%\n method: \"GET\",\n path: \"bitstreams/{%%}\"\n },\n item_policy: { // Returns the policy for a bitstream with ID %%\n method: \"GET\",\n path: \"bitstreams/%%/policy\"\n },\n content: { // Retrieve content for a bitstream with ID %%\n method: \"GET\",\n path: \"bitstreams/%%/retrieve\"\n }\n },\n schemas: {\n list: { // Returns a list of all schemas\n method: \"GET\",\n path: \"registries/schema\"\n },\n item: { // Returns a metadata schema with schema prefix %%\n method: \"GET\",\n path: \"registries/schema/%%\"\n },\n field: { // Returns a metadata schema with field ID %%\n method: \"GET\",\n path: \"registries/metadata-fields/%%\"\n }\n }\n };\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]);}", "static GetAtPath() {}", "function ParsedSoak(path) {\n var pathComponents;\n\n if (_.isString(path)) {\n pathComponents = path.split('.');\n } else {\n pathComponents = path;\n }\n\n this.nodes = pathComponents.map(makeSoakNode);\n}", "_resolveObjectPath(path, obj) {\n return path.split(\".\").reduce(function(prev, curr) {\n return prev ? prev[curr] : null;\n }, obj || self);\n }", "_resolveReactStyleFile(parsedName) {\n const originalName = parsedName.fullNameWithoutType;\n\n // Convert the compnent name while preserving namespaces\n const parts = originalName.split('/');\n parts[parts.length - 1] = Ember.String.classify(parts[parts.length - 1]);\n const newName = parts.join('/');\n\n const parsedNameWithPascalCase = Object.assign({}, parsedName, {\n fullNameWithoutType: newName,\n });\n const result = this.resolveOther(parsedNameWithPascalCase);\n return result;\n }", "function GetNormalizedPath() {\n}", "function Path(absolute_path) {\n absolute_path = typeof absolute_path !== 'undefined' ? absolute_path : \"/\";\n\n this.root = new PathNode(\"\", null);\n\n // Initialise to path provided in argument\n var path_parts = absolute_path.split('/');\n for(var i = 0; i < path_parts.length; i++) {\n if(path_parts[i] == \"\") {\n continue;\n }\n\n this.append(path_parts[i]);\n }\n\n this.append = function(name) {\n switch(name) {\n case '..':\n this.truncate();\n return;\n case '.':\n return; // Do nothing\n default:\n var last = this.last();\n last.child = new PathNode(name, last);\n } \n }\n\n // Chop off the last element of the path. Usually used to handle '..'\n this.truncate = function() {\n this.last().parent.child = null;\n }\n\n this.last = function() {\n var cursor = this.root;\n\n while(cursor.child != null) {\n cursor = cursor.child;\n }\n\n return cursor;\n }\n\n this.getIterator = function() {\n return new PathIterator(this);\n }\n\n function PathNode(name, parent, child) {\n child = typeof child !== 'undefined' ? child : null;\n\n this.name = name;\n this.child = child;\n this.parent = parent;\n }\n\n function PathIterator(path) {\n this.next = path.root;\n\n this.getNext = function() {\n if(this.hasNext()) {\n var next = this.next;\n this.next = next.child;\n return next;\n } else {\n return null;\n }\n }\n\n this.hasNext = function() {\n return (this.next != null)\n }\n }\n}", "function fromDotSeparatedString(path){var found=path.search(RESERVED);if(found>=0){throw new index_esm_FirestoreError(Code.INVALID_ARGUMENT,\"Invalid field path (\"+path+\"). Paths must not contain \"+\"'~', '*', '/', '[', or ']'\");}try{return new(FieldPath$1.bind.apply(FieldPath$1,[void 0].concat(path.split('.'))))();}catch(e){throw new index_esm_FirestoreError(Code.INVALID_ARGUMENT,\"Invalid field path (\"+path+\"). Paths must not be empty, \"+\"begin with '.', end with '.', or contain '..'\");}}", "function parse(fileName) {\n\n var baseDir = path.dirname(fileName);\n\n var jsonData = parseFile(fileName);\n if (!jsonData) {\n return null;\n }\n\n jsonData = replace(baseDir, jsonData, 'segment');\n if (!jsonData) {\n return null;\n }\n\n\n if (jsonData.hasOwnProperty('segment')) {\n if (!Array.isArray(jsonData.segment)) {\n console.error('segment must be array');\n return null;\n }\n for (var i = 0; i < jsonData.segment.length; i++) {\n\n var segment = jsonData.segment[i];\n segment = replace(baseDir, segment, 'host');\n if (!segment) {\n return null;\n }\n segment = replace(baseDir, segment, 'gateway');\n if (!segment) {\n return null;\n }\n jsonData.segment[i] = segment;\n }\n }\n\n jsonData = replace(baseDir, jsonData, 'event');\n\n //console.log(JSON.stringify(jsonData));\n return jsonData;\n}", "FindPropertyRelative() {}", "static _materializePath(path) {\n let parts = path.split('.');\n let leaf = parts.slice(-1);\n //dereference the parent path so that its materialized.\n let parent_path = ApplicationState._dereferencePath(parts.slice(0, -1).join('.'));\n return parent_path + '.' + leaf;\n }", "function parse(src) {\n return new recast.types.NodePath(recast.parse(stringify(src)).program);\n}", "function parsePath (path) {\n var hit = pathCache[path];\n if (!hit) {\n hit = parse(path);\n if (hit) {\n pathCache[path] = hit;\n }\n }\n return hit || []\n}", "function absoluteLocationPath(stream, a) {\n var op = stream.peek();\n if ('/' === op || '//' === op) {\n var lhs = a.node('Root');\n return relativeLocationPath(lhs, stream, a, true);\n } else {\n return null;\n }\n }", "function absoluteLocationPath(stream, a) {\n var op = stream.peek();\n if ('/' === op || '//' === op) {\n var lhs = a.node('Root');\n return relativeLocationPath(lhs, stream, a, true);\n } else {\n return null;\n }\n }", "function R(t,e){var r=e.split(/\\.(\\d+)\\.|\\.(\\d+)$/).filter(Boolean);if(r.length<2)return t.paths.hasOwnProperty(r[0])?t.paths[r[0]]:\"adhocOrUndefined\";var n=t.path(r[0]),o=!1;if(!n)return\"adhocOrUndefined\";for(var i=r.length-1,s=1;s<r.length;++s){o=!1;var a=r[s];if(s===i&&n&&!/\\D/.test(a)){n=n.$isMongooseDocumentArray?n.$embeddedSchemaType:n instanceof u.Array?n.caster:void 0;break}if(/\\D/.test(a)){if(!n||!n.schema){n=void 0;break}o=\"nested\"===n.schema.pathType(a),n=n.schema.path(a)}else n instanceof u.Array&&s!==i&&(n=n.caster)}return t.subpaths[e]=n,n?\"real\":o?\"nested\":\"adhocOrUndefined\"}", "function parseLine(line) {\n const groups = line.match(RE_LINE);\n if (groups === null) {\n return undefined;\n }\n const name = groups[21];\n if (name === \".\" || name === \"..\") { // Ignore parent directory links\n return undefined;\n }\n const file = new FileInfo_1.FileInfo(name);\n file.size = parseInt(groups[18], 10);\n file.user = groups[16];\n file.group = groups[17];\n file.hardLinkCount = parseInt(groups[15], 10);\n file.rawModifiedAt = groups[19] + \" \" + groups[20];\n file.permissions = {\n user: parseMode(groups[4], groups[5], groups[6]),\n group: parseMode(groups[8], groups[9], groups[10]),\n world: parseMode(groups[12], groups[13], groups[14]),\n };\n // Set file type\n switch (groups[1].charAt(0)) {\n case \"d\":\n file.type = FileInfo_1.FileType.Directory;\n break;\n case \"e\": // NET-39 => z/OS external link\n file.type = FileInfo_1.FileType.SymbolicLink;\n break;\n case \"l\":\n file.type = FileInfo_1.FileType.SymbolicLink;\n break;\n case \"b\":\n case \"c\":\n file.type = FileInfo_1.FileType.File; // TODO change this if DEVICE_TYPE implemented\n break;\n case \"f\":\n case \"-\":\n file.type = FileInfo_1.FileType.File;\n break;\n default:\n // A 'whiteout' file is an ARTIFICIAL entry in any of several types of\n // 'translucent' filesystems, of which a 'union' filesystem is one.\n file.type = FileInfo_1.FileType.Unknown;\n }\n // Separate out the link name for symbolic links\n if (file.isSymbolicLink) {\n const end = name.indexOf(\" -> \");\n if (end !== -1) {\n file.name = name.substring(0, end);\n file.link = name.substring(end + 4);\n }\n }\n return file;\n}", "constructor( aPath ) {\n this.fullpath = aPath;\n }", "set path(value) {}", "normalize(...variants) {\n\n if (variants.length <= 0)\n return null;\n if (variants.length > 0\n && !Object.usable(variants[0]))\n return null;\n if (variants.length > 1\n && !Object.usable(variants[1]))\n return null;\n\n if (variants.length > 1\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid root: \" + typeof variants[0]);\n let root = \"#\";\n if (variants.length > 1) {\n root = variants[0];\n try {root = Path.normalize(root);\n } catch (error) {\n root = (root || \"\").trim();\n throw new TypeError(`Invalid root${root ? \": \" + root : \"\"}`);\n }\n }\n\n if (variants.length > 1\n && typeof variants[1] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[1]);\n if (variants.length > 0\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[0]);\n let path = \"\";\n if (variants.length === 1)\n path = variants[0];\n if (variants.length === 1\n && path.match(PATTERN_URL))\n path = path.replace(PATTERN_URL, \"$1\");\n else if (variants.length > 1)\n path = variants[1];\n path = (path || \"\").trim();\n\n if (!path.match(PATTERN_PATH))\n throw new TypeError(`Invalid path${String(path).trim() ? \": \" + path : \"\"}`);\n\n path = path.replace(/([^#])#$/, \"$1\");\n path = path.replace(/^([^#])/, \"#$1\");\n\n // Functional paths are detected.\n if (path.match(PATTERN_PATH_FUNCTIONAL))\n return \"###\";\n\n path = root + path;\n path = path.toLowerCase();\n\n // Path will be balanced\n const pattern = /#[^#]+#{2}/;\n while (path.match(pattern))\n path = path.replace(pattern, \"#\");\n path = \"#\" + path.replace(/(^#+)|(#+)$/g, \"\");\n\n return path;\n }", "function extraSrc(src){\r\n if(!path.isAbsolute(src)){\r\n src = path.join(__dirname, src);\r\n }\r\n let basename = path.basename(src);\r\n let basedir = path.dirname(src);\r\n if(!fs.existsSync(basedir)){\r\n throw new Error('path not exists');\r\n }\r\n\r\n if(hasMatchOP(basename)){\r\n return {\r\n fullPath: true,\r\n baseDir: basedir,\r\n matcher: getMatcher(basename),\r\n };\r\n }else {\r\n let stats = fs.lstatSync(src);\r\n if(stats.isDirectory()){\r\n return {\r\n fullPath: false,\r\n baseDir: src,\r\n matcher: /.*/,\r\n }\r\n }else{\r\n return {\r\n fullPath: false,\r\n baseDir: basedir,\r\n matcher: getMatcher(basename),\r\n };\r\n }\r\n }\r\n\r\n function hasMatchOP(s) {\r\n return s.indexOf(\"*\") > -1;\r\n }\r\n \r\n function getMatcher(s) {\r\n let reg = s.replace(/\\./g, \"\\.\").replace(/\\*/g, \".\") + \"$\";\r\n return new RegExp(reg);\r\n }\r\n}", "getFileSystemEntries(path) {\n const ret = { files: [], directories: [] };\n let node = this.rootNode;\n const components = path.split(\"/\").filter(c => c);\n if (components.length !== 1 || components[0]) {\n for (const component of components) {\n const n = node.children.get(component);\n if (!n) {\n return ret;\n }\n node = n;\n }\n }\n node.children.forEach((value, name) => {\n if (value.file) {\n ret.files.push(name);\n }\n else {\n ret.directories.push(name);\n }\n });\n return ret;\n }", "forPathString(path) {\n const pathArray = this.pathUtilService.toPathArray(path);\n return this.forPathArray(pathArray);\n }", "function parsePath (pathstr, fileScope) {\n if (!pathstr)\n return [ [ ] ];\n var pathMatch;\n var path = [];\n var offset = 0;\n while (\n offset < pathstr.length\n && (pathMatch = Patterns.word.exec (pathstr.slice (offset)))\n ) {\n if (!pathMatch[0]) {\n if (!pathMatch.length)\n path.push ([]);\n break;\n }\n offset += pathMatch[0].length;\n\n var fragName = pathMatch[2];\n if (fragName[0] == '`') {\n path.push ([\n pathMatch[1],\n fragName\n .slice (1, -1)\n .replace (/([^\\\\](?:\\\\\\\\)*)\\\\`/g, function (substr, group) {\n return group.replace ('\\\\\\\\', '\\\\') + '`';\n })\n ]);\n continue;\n }\n if (fragName[0] != '[') {\n var delimit = pathMatch[1];\n if (delimit == ':')\n delimit = '/';\n path.push ([ delimit, fragName ]);\n continue;\n }\n\n // Symbol\n path.push ((function parseSymbol (symbolName) {\n var symbolPath = [];\n var symbolMatch;\n var symbolRegex = new RegExp (Patterns.word);\n var symbolOffset = 0;\n while (\n symbolOffset < symbolName.length\n && (symbolMatch = symbolRegex.exec (symbolName.slice (symbolOffset)))\n ) {\n if (!symbolMatch[0])\n break;\n symbolOffset += symbolMatch[0].length;\n var symbolFrag = symbolMatch[2];\n\n if (symbolFrag[0] == '[') {\n // recurse!\n var innerLevel = parseSymbol (symbolFrag.slice (1, -1));\n if (innerLevel[0] === undefined)\n innerLevel[0] = '.';\n symbolPath.push (innerLevel);\n continue;\n }\n if (symbolFrag[0] == '`')\n symbolFrag = symbolFrag\n .slice (1, -1)\n .replace (/([^\\\\](?:\\\\\\\\)*)`/g, function (substr, group) {\n return group.replace ('\\\\\\\\', '\\\\') + '`';\n })\n ;\n var delimit = symbolMatch[1];\n if (delimit == ':')\n delimit = '/';\n symbolPath.push ([ delimit, symbolFrag ]);\n }\n\n if (!symbolPath.length)\n symbolPath.push ([ '.', undefined ]);\n else if (symbolPath[0][0] === undefined)\n symbolPath[0][0] = '.';\n else\n symbolPath = fileScope.concat (symbolPath);\n // symbolPath = concatPaths (fileScope, symbolPath);\n\n var fullPathName = symbolPath\n .map (function (item) { return item[0] + item[1]; })\n .join ('')\n ;\n\n var delimit = pathMatch[1];\n if (delimit == ':')\n delimit = '/';\n return [ delimit, '['+fullPathName.slice (1)+']', symbolPath ];\n }) (fragName.slice (1, -1)));\n }\n if (!path.length)\n path.push ([]);\n return path;\n}", "function R(t,e){var r=e.split(/\\.(\\d+)\\.|\\.(\\d+)$/).filter(Boolean);if(r.length<2)return t.paths.hasOwnProperty(r[0])?t.paths[r[0]]:\"adhocOrUndefined\";var n=t.path(r[0]),i=!1;if(!n)return\"adhocOrUndefined\";for(var o=r.length-1,s=1;s<r.length;++s){i=!1;var a=r[s];if(s===o&&n&&!/\\D/.test(a)){n=n.$isMongooseDocumentArray?n.$embeddedSchemaType:n instanceof $.Array?n.caster:void 0;break}if(/\\D/.test(a)){if(!n||!n.schema){n=void 0;break}i=\"nested\"===n.schema.pathType(a),n=n.schema.path(a)}else n instanceof $.Array&&s!==o&&(n=n.caster)}return t.subpaths[e]=n,n?\"real\":i?\"nested\":\"adhocOrUndefined\"}", "normalizePath() {\n const {path} = options;\n switch (typeof path) {\n case 'function': return path(this.props);\n case 'string': return [path];\n default: return path;\n }\n }", "function nestData(paths, pageFileCache, start = ['']) {\n // output = {\n // type: 'folder',\n // id: '',\n // path: 'fullpath',\n // matter: {frontmatter YAML}\n // files: [\n // {\n // type: 'file',\n // path: 'fullpath'\n // id: 'slug/id'\n // matter: ...\n // },\n // {\n // type: 'file',\n // ...\n // },\n // {\n // type: 'folder',\n // ...\n // files: [\n // ...\n // ],\n // },\n // ]\n // }\n let files = [];\n let startPath = pageFileCache[start.join('/')];\n\n // Remove the element start by compairing ID array\n paths = paths.filter((p) => {\n return (\n Array.isArray(p) ||\n !(\n p.params.id.length === start.length &&\n p.params.id.every((value, index) => value === start[index])\n )\n );\n });\n\n for (let path of paths) {\n if (!Array.isArray(path)) {\n let id = path.params.id.join('/');\n let fullPath = pageFileCache[id];\n\n // Use gray-matter to parse the post metadata section\n const fileContents = fs.readFileSync(fullPath, 'utf8');\n const matterResult = matter(fileContents);\n\n files.push({\n type: 'file',\n id: id,\n path: pageFileCache[id],\n matter: matterResult.data,\n });\n } else {\n // New start will have smallest id length\n let newStart = path.reduce((str, p) => {\n if (!Array.isArray(p)) {\n if (Array.isArray(str)) {\n return p;\n }\n return str.params.id.length < p.params.id.length ? str : p;\n }\n return str;\n }).params.id;\n\n files.push(nestData(path, pageFileCache, newStart));\n }\n }\n\n // Use gray-matter to parse the post metadata section\n const fileContents = fs.readFileSync(startPath, 'utf8');\n const matterResult = matter(fileContents);\n\n return {\n type: 'folder',\n id: start.join('/'),\n path: startPath,\n matter: matterResult.data,\n files: files,\n };\n}", "static mount(path) {\n if (path.startsWith(\"/\")) {\n const i = path.indexOf(\"/\", 1);\n if (i >= 0) {\n return path.substring(1, i).toLowerCase();\n } else {\n return path.substring(1).toLowerCase();\n }\n } else {\n return \"\";\n }\n }", "static _resolvePath(path, object) {\n if (typeof path !== 'string') throw Error(\"Requires a string, got an \" + typeof path + \" that \" + Array.isArray(path) ? \"is\" : \"isn't\" + \" an array\");\n\n object = object || ApplicationState._state;\n const nodes = ApplicationState.walk(path);\n\n for (let index = 0; index < nodes.length; index++) {\n const node = nodes[index];\n object = object[node.name];\n if (typeof object === 'undefined') return undefined;\n if (object === null) return null;\n }\n\n return object;\n }", "function createInspector(path) {\n return () => `[object JXAReference => ${dereference(path+'.toString')}]`;\n}", "constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {\n this.#fs = fsFromOption(fs);\n if (cwd instanceof URL || cwd.startsWith('file://')) {\n cwd = (0, url_1.fileURLToPath)(cwd);\n }\n // resolve and split root, and then add to the store.\n // this is the only time we call path.resolve()\n const cwdPath = pathImpl.resolve(cwd);\n this.roots = Object.create(null);\n this.rootPath = this.parseRootPath(cwdPath);\n this.#resolveCache = new ResolveCache();\n this.#resolvePosixCache = new ResolveCache();\n this.#children = new ChildrenCache(childrenCacheSize);\n const split = cwdPath.substring(this.rootPath.length).split(sep);\n // resolve('/') leaves '', splits to [''], we don't want that.\n if (split.length === 1 && !split[0]) {\n split.pop();\n }\n /* c8 ignore start */\n if (nocase === undefined) {\n throw new TypeError('must provide nocase setting to PathScurryBase ctor');\n }\n /* c8 ignore stop */\n this.nocase = nocase;\n this.root = this.newRoot(this.#fs);\n this.roots[this.rootPath] = this.root;\n let prev = this.root;\n let len = split.length - 1;\n const joinSep = pathImpl.sep;\n let abs = this.rootPath;\n let sawFirst = false;\n for (const part of split) {\n const l = len--;\n prev = prev.child(part, {\n relative: new Array(l).fill('..').join(joinSep),\n relativePosix: new Array(l).fill('..').join('/'),\n fullpath: (abs += (sawFirst ? '' : joinSep) + part),\n });\n sawFirst = true;\n }\n this.cwd = prev;\n }", "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 refFromPath(ref, path) {\n if (ref instanceof StorageService) {\n var service = ref;\n if (service._bucket == null) {\n throw noDefaultBucket();\n }\n var reference = new Reference(service, service._bucket);\n if (path != null) {\n return refFromPath(reference, path);\n }\n else {\n return reference;\n }\n }\n else {\n // ref is a Reference\n if (path !== undefined) {\n if (path.includes('..')) {\n throw invalidArgument('`path` param cannot contain \"..\"');\n }\n return _getChild(ref, path);\n }\n else {\n return ref;\n }\n }\n}", "function refFromPath(ref, path) {\n if (ref instanceof StorageService) {\n var service = ref;\n if (service._bucket == null) {\n throw noDefaultBucket();\n }\n var reference = new Reference(service, service._bucket);\n if (path != null) {\n return refFromPath(reference, path);\n }\n else {\n return reference;\n }\n }\n else {\n // ref is a Reference\n if (path !== undefined) {\n if (path.includes('..')) {\n throw invalidArgument('`path` param cannot contain \"..\"');\n }\n return _getChild(ref, path);\n }\n else {\n return ref;\n }\n }\n}", "function refFromPath(ref, path) {\n if (ref instanceof StorageService) {\n var service = ref;\n if (service._bucket == null) {\n throw noDefaultBucket();\n }\n var reference = new Reference(service, service._bucket);\n if (path != null) {\n return refFromPath(reference, path);\n }\n else {\n return reference;\n }\n }\n else {\n // ref is a Reference\n if (path !== undefined) {\n if (path.includes('..')) {\n throw invalidArgument('`path` param cannot contain \"..\"');\n }\n return _getChild(ref, path);\n }\n else {\n return ref;\n }\n }\n}", "function UriUtils() {}", "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 }", "match(path,pathname) {\n let keys=[];\n if(path instanceof RegExp){\n let match = pathname.match(path);\n return !match ? null : {\n token:match,\n keys:[]\n }\n } else {\n let token = pathToRegexp(path,keys).exec(pathname);\n return token == null ? null: {\n token:token,\n keys:keys\n }\n }\n }", "beforeMount() {\n // Parse l'URL actuelle\n this.parseURL();\n }", "static _dereferencePath(path) {\n if (!ApplicationState._symlinks)\n return path;\n\n const nodes = ApplicationState.walk(path);\n\n for (let index = 0; index < nodes.length; index++) {\n const node = nodes[index];\n if (ApplicationState._symlinks[node.path]) {\n path = path.replace(node.path, ApplicationState._symlinks[node.path]);\n return ApplicationState._dereferencePath(path);\n }\n }\n\n return path;\n }", "getPath() {\n return this.props.path;\n }", "function splitPath(path)\n{\n var parts = path.split(\"/\");\n var idx = -1;\n for (var i = parts.length - 2; i >= 0; --i)\n {\n var lcpath = parts[i].toLowerCase();\n if (lcpath.endsWith(\".zip\") ||\n lcpath.endsWith(\".tgz\"))\n {\n idx = i;\n break;\n }\n }\n \n if (idx != -1)\n {\n var outerPath = parts.slice(0, idx + 1).join(\"/\");\n var innerPath = parts.slice(idx + 1).join(\"/\");\n //console.log(\"vfs.splitPath: \" + path + \" -> \" + outerPath + \"#\" + innerPath);\n return [outerPath, innerPath];\n }\n else\n {\n return [\"\", \"\"];\n }\n}", "getDepth(obj, path) {\n return path.split('.').reduce((value, tag) => {\n return value[tag];\n }, obj);\n }", "function createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem", "function createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem", "function createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem", "function createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem", "get _readAttributeGroupPathProps() {\n if (this._readAttributeGroupPathProps_cached === undefined) {\n var allOutBounds = this.activeList.allOutBounds;\n this._readAttributeGroupPathProps_cached = this._location.computeERMrestCompactPath(allOutBounds.map(function (ao) {\n return ao.sourceObject;\n }));\n }\n return this._readAttributeGroupPathProps_cached;\n }", "remap(accessPath) {\n if (!this.$nspEnabled) {\n return accessPath;\n }\n return new mona_dish_1.Es2019Array(...accessPath).map(key => (0, Const_1.$nsp)(key));\n }", "function resolveObjectFromPath(object, path) {\n path = path.replace(/\\[(\\w+)\\]/g, '.$1'); // convert indexes to properties\n path = path.replace(/^\\./, ''); // strip a leading dot\n var a = path.split('.');\n while (a.length) {\n var n = a.shift();\n if (n in object) {\n object = object[n];\n } else {\n return;\n }\n }\n return object;\n }", "traverse(obj, path) {\n if (path == null) return undefined;\n let pelems = path.split('.');\n let res = obj;\n pelems.forEach(function (item) {\n res = item === 'this' ? obj : res[item];\n });\n return res;\n }", "constructor(inputPath /*: string */) {\n this._inputPath = inputPath;\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 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 _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}", "build_paths() {\n return {\n items: {\n list: { // Returns a list of items\n method: \"GET\",\n path: \"[path]\", \n }, \n item: { // Returns a single item with ID %%\n method: \"GET\",\n path: \"[path]/%%\"\n }, \n item_metadata: { // Returns metadata for item %%\n method: \"GET\",\n path: \"[path]/%%/[key]\", \n }, \n find_by_metadata: { // Returns items based on specified metadata value\n method: \"POST\",\n path: \"[path]\"\n } \n },\n query: { \n filtered_items: { // Returns items based on chosen filters\n method: \"GET\",\n path: \"[path]\", \n }, \n filtered_collections: { // Returns collections based on chosen filters\n method: \"GET\",\n path: \"[path]\",\n }, \n collection: { // Returns collection with ID %%\n method: \"GET\",\n path: \"[path]/%%\",\n } \n }\n };\n }", "getParsedAttribute(input) {\n return input.substring(input.indexOf(\"{\") + 1, input.indexOf(\"/\"));\n }", "get pathLength() {\n return 0;\n }", "_getFullyQualifiedNameFromPath(absolutePath) {\n const sourceName = (0, source_names_1.replaceBackslashes)(path.relative(this._artifactsPath, path.dirname(absolutePath)));\n const contractName = path.basename(absolutePath).replace(\".json\", \"\");\n return (0, contract_names_1.getFullyQualifiedName)(sourceName, contractName);\n }", "rel (relativePath) {\n return nodePath.normalize(relativePath);\n }", "get path () {\n return __dirname\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}", "resolve(prefix) {\n var _a, _b;\n let uri = this.topNS[prefix];\n if (uri !== undefined) {\n return uri;\n }\n const { tags } = this;\n for (let index = tags.length - 1; index >= 0; index--) {\n uri = tags[index].ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n }\n uri = this.ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n return (_b = (_a = this.opt).resolvePrefix) === null || _b === void 0 ? void 0 : _b.call(_a, prefix);\n }", "get propertyPath() {}", "toString() {\n this.path\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}", "_$memberof() {\n super._$memberof();\n this._value.memberof = this._pathResolver.filePath;\n }", "function PathBuffer() {\n var buffer = \"\";\n var match_id = 1;\n\n this.toMatch = function (params, useSeparator) {\n useSeparator = (useSeparator === false) ? false : true;\n var b = buffer;\n this.flush();\n if (b[0] == \":\") {\n params[b.substring(1)] = match_id++;\n return useSeparator ? \"([^/;.]+)\" : \"(.+)\";\n } else {\n return b;\n }\n }\n\n this.append = function (str) {\n buffer += str;\n }\n\n this.flush = function () {\n buffer = \"\";\n }\n}", "_removeDotSegments(iri) {\n // Don't modify the IRI if it does not contain any dot segments\n if (!/(^|\\/)\\.\\.?($|[/#?])/.test(iri)) return iri; // Start with an imaginary slash before the IRI in order to resolve trailing './' and '../'\n\n var result = '',\n length = iri.length,\n i = -1,\n pathStart = -1,\n segmentStart = 0,\n next = '/';\n\n while (i < length) {\n switch (next) {\n // The path starts with the first slash after the authority\n case ':':\n if (pathStart < 0) {\n // Skip two slashes before the authority\n if (iri[++i] === '/' && iri[++i] === '/') // Skip to slash after the authority\n while ((pathStart = i + 1) < length && iri[pathStart] !== '/') i = pathStart;\n }\n\n break;\n // Don't modify a query string or fragment\n\n case '?':\n case '#':\n i = length;\n break;\n // Handle '/.' or '/..' path segments\n\n case '/':\n if (iri[i + 1] === '.') {\n next = iri[++i + 1];\n\n switch (next) {\n // Remove a '/.' segment\n case '/':\n result += iri.substring(segmentStart, i - 1);\n segmentStart = i + 1;\n break;\n // Remove a trailing '/.' segment\n\n case undefined:\n case '?':\n case '#':\n return result + iri.substring(segmentStart, i) + iri.substr(i + 1);\n // Remove a '/..' segment\n\n case '.':\n next = iri[++i + 1];\n\n if (next === undefined || next === '/' || next === '?' || next === '#') {\n result += iri.substring(segmentStart, i - 2); // Try to remove the parent path from result\n\n if ((segmentStart = result.lastIndexOf('/')) >= pathStart) result = result.substr(0, segmentStart); // Remove a trailing '/..' segment\n\n if (next !== '/') return result + '/' + iri.substr(i + 1);\n segmentStart = i + 1;\n }\n\n }\n }\n\n }\n\n next = iri[++i];\n }\n\n return result + iri.substring(segmentStart);\n }", "function lookup(connection, path, callback) {\n\tpath = paths.resolve(path);\n\tvar comps = paths.resolve(path).split('/');\n\twhile (comps[0] === '') comps.shift();\n\tvar currentNode = fileTree[\"/\"];\n\twhile (currentName = comps.shift()) {\n\t\tcurrentNode = currentNode.children[currentName];\n\t}\n\tconsole.log(currentNode);\n\treturn callback(currentNode);\n\tif (comps.length === 0) {\n\t\treturn callback({ \"type\":\"folder\", \"id\":0, \"name\":'/' });\n\t}\n\tgfi({'id':0,'type':'folder'}, comps, callback);\n}", "function fastpathRead(obj, name) {\n if (name === 'toString') { fail(\"internal: Can't fastpath .toString\"); }\n obj[name + '_canRead___'] = obj;\n }", "function parse (path: Path): ?Array<string> {\n const keys: Array<string> = []\n let index: number = -1\n let mode: number = BEFORE_PATH\n let subPathDepth: number = 0\n let c: ?string\n let key: any\n let newChar: any\n let type: string\n let transition: number\n let action: Function\n let typeMap: any\n const actions: Array<Function> = []\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key)\n key = undefined\n }\n }\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar\n } else {\n key += newChar\n }\n }\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]()\n subPathDepth++\n }\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--\n mode = IN_SUB_PATH\n actions[APPEND]()\n } else {\n subPathDepth = 0\n if (key === undefined) { return false }\n key = formatSubPath(key)\n if (key === false) {\n return false\n } else {\n actions[PUSH]()\n }\n }\n }\n\n function maybeUnescapeQuote (): ?boolean {\n const nextChar: string = path[index + 1]\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++\n newChar = '\\\\' + nextChar\n actions[APPEND]()\n return true\n }\n }\n\n while (mode !== null) {\n index++\n c = path[index]\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c)\n typeMap = pathStateMachine[mode]\n transition = typeMap[type] || typeMap['else'] || ERROR\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0]\n action = actions[transition[1]]\n if (action) {\n newChar = transition[2]\n newChar = newChar === undefined\n ? c\n : newChar\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}\n\nexport type PathValue = PathValueObject | PathValueArray | Function | string | number | boolean | null\nexport type PathValueObject = { [key: string]: PathValue }\nexport type PathValueArray = Array<PathValue>\n\nexport default class I18nPath {\n _cache: Object\n\n constructor () {\n this._cache = Object.create(null)\n }\n\n /**\n * External parse that check for a cache hit first\n */\n parsePath (path: Path): Array<string> {\n let hit: ?Array<string> = this._cache[path]\n if (!hit) {\n hit = parse(path)\n if (hit) {\n this._cache[path] = hit\n }\n }\n return hit || []\n }\n\n /**\n * Get path value from path string\n */\n getPathValue (obj: mixed, path: Path): PathValue {\n if (!isObject(obj)) { return null }\n\n const paths: Array<string> = this.parsePath(path)\n if (paths.length === 0) {\n return null\n } else {\n const length: number = paths.length\n let last: any = obj\n let i: number = 0\n while (i < length) {\n const value: any = last[paths[i]]\n if (value === undefined || value === null) {\n return null\n }\n last = value\n i++\n }\n\n return last\n }\n }\n}", "function processPath(path) {\n var query;\n if (path && path.pop && path.length) {\n if (typeof path[path.length-1] === 'object') {\n path.query = path.pop();\n }\n return path;\n } else if (typeof path === \"object\") { // options\n var empty = [];\n empty.query = path;\n return empty;\n } else if (path) { // string\n return [path];\n } else {\n return [];\n }\n}", "function getPathValue(path, ctx) {\n\t\t'use strict';\n\n\t\tif (path.length === 1 && path[0].length !== 0) {\n\t\t\treturn ctx.get(path[0]);\n\t\t}\n\t\t// anchor = false;\n\t\tif (path[0].length === 0) {\n\t\t\treturn ctx.getPath(true, path.slice(1));\n\t\t}\n\t\treturn ctx.getPath(false, path);\n\t}", "function parseLoaderSetPathCall(node, output) {\n // Example: `Ext.Loader.setPath('Ext.ux', 'lib/extjs-ux/src');`\n var classPrefixArg = node.expression.arguments[0];\n var pathArg = node.expression.arguments[1];\n if (classPrefixArg && pathArg) {\n addResolvePath(classPrefixArg.value, pathArg.value, output);\n }\n }" ]
[ "0.53262603", "0.5297441", "0.5290855", "0.5290855", "0.52720904", "0.51392984", "0.50177807", "0.50107986", "0.49552584", "0.49144223", "0.49073443", "0.49059615", "0.48887694", "0.4885875", "0.48386818", "0.4826161", "0.4825986", "0.4801901", "0.47598985", "0.4757453", "0.475593", "0.4720494", "0.47160175", "0.47016796", "0.46878067", "0.46834376", "0.46818912", "0.46760103", "0.46754584", "0.46745837", "0.46494418", "0.46289375", "0.46067262", "0.46031", "0.45909837", "0.45909837", "0.4586376", "0.45847252", "0.45821524", "0.4578536", "0.45701224", "0.45700034", "0.4565612", "0.45498723", "0.45426658", "0.45363492", "0.4535044", "0.45305294", "0.4519061", "0.45177332", "0.4516492", "0.45091978", "0.44936523", "0.44892547", "0.44892547", "0.44892547", "0.44799295", "0.4477236", "0.44769877", "0.44765392", "0.44731453", "0.44719893", "0.44691575", "0.4467834", "0.44666407", "0.44666407", "0.44666407", "0.44666407", "0.44615027", "0.4461084", "0.44513723", "0.44491148", "0.44435754", "0.44423294", "0.4437224", "0.4434711", "0.44328508", "0.4428841", "0.4427141", "0.4416087", "0.4414143", "0.4408837", "0.44082183", "0.44082183", "0.44082183", "0.44082183", "0.44081396", "0.4407077", "0.43975213", "0.43952063", "0.43952063", "0.43952063", "0.43920642", "0.43812668", "0.43798378", "0.4375652", "0.4375086", "0.43738282", "0.43735716", "0.4370051", "0.43682173" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(ecModel, api) { ecModel.eachSeriesByType('graph', function (seriesModel) { var layout = seriesModel.get('layout'); var coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type !== 'view') { var data = seriesModel.getData(); var dimensions = []; each(coordSys.dimensions, function (coordDim) { dimensions = dimensions.concat(data.mapDimension(coordDim, true)); }); for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) { var value = []; var hasValue = false; for (var i = 0; i < dimensions.length; i++) { var val = data.get(dimensions[i], dataIndex); if (!isNaN(val)) { hasValue = true; } value.push(val); } if (hasValue) { data.setItemLayout(dataIndex, coordSys.dataToPoint(value)); } else { // Also {Array.<number>}, not undefined to avoid if...else... statement data.setItemLayout(dataIndex, [NaN, NaN]); } } simpleLayoutEdge(data.graph, seriesModel); } else if (!layout || layout === 'none') { simpleLayout(seriesModel); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1
Use timsort because in most case elements are partially sorted
function shapeCompareFunc(a, b) { if (a.zlevel === b.zlevel) { if (a.z === b.z) { // if (a.z2 === b.z2) { // // FIXME Slow has renderidx compare // // http://stackoverflow.com/questions/20883421/sorting-in-javascript-should-every-compare-function-have-a-return-0-statement // // https://github.com/v8/v8/blob/47cce544a31ed5577ffe2963f67acb4144ee0232/src/js/array.js#L1012 // return a.__renderidx - b.__renderidx; // } return a.z2 - b.z2; } return a.z - b.z; } return a.zlevel - b.zlevel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timSort(){\n console.log(\"WORK IN PROGRESS\");\n let run = 32;\n\n for(let i = 0; i < values.length; i += run) {\n insertionSort(i, Math.min((i+31), (values.length-1)));\n }\n\n for(let size = run; size < values.length; size = 2 * size) {\n for(let left = 0; left < values.length; left += 2 * size) {\n let mid = left + size -1;\n let right = Math.min((left + 2 * size - 1), (values.length - 1));\n merge(values, left, mid, right)\n }\n }\n}", "function slow_sort(arr) {\n\tamb(test_arr, permutations(arr));\n\tconsole.log(\"this is test_arr \" + test_arr);\n\tassert(sorted(test_arr));\n\treturn test_arr;\n}", "bubbleSort(arr){\n var starttime = process.hrtime();\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr.length; j++) {\n if(arr[j]>arr[j+1]){\n var temp;\n temp=arr[j];\n arr[j]=arr[j+1];\n arr[j+1]=temp;\n }\n }\n }\n var endtime = process.hrtime();\n var et = this.elapsedTime(starttime, endtime);\n console.log('Elapsed time for bubble sort is : '+et, 'milisecod');\n \n return arr;\n }", "sort() {\n let a = this.array;\n const step = 1;\n let compares = 0;\n for (let i = 0; i < a.length; i++) {\n let tmp = a[i];\n for (var j = i; j >= step; j -= step) {\n this.store(step, i, j, tmp, compares);\n compares++;\n if (a[j - step] > tmp) {\n a[j] = a[j - step];\n this.store(step, i, j, tmp, compares);\n } else {\n break;\n }\n }\n a[j] = tmp;\n this.store(step, i, j, tmp, compares);\n }\n this.array = a;\n }", "timSort(arr, n) {\n // Sort individual subarrays of size RUN \n for (let i = 0; i < n; i += this.RUN)\n this.insertionSort(arr, i,((i + 31)-(n-1)) > 0 ? (n-1): (i + 31) );\n // start merging from size RUN (or 32). It will merge \n // to form size 64, then 128, 256 and so on .... \n for (let size = this.RUN; size < n; size = 2 * size) {\n // pick starting point of left sub array. We \n // are going to merge arr[left..left+size-1] \n // and arr[left+size, left+2*size-1] \n // After every merge, we increase left by 2*size \n for (let left = 0; left < n; left += 2 * size) {\n // find ending point of left sub array \n // mid+1 is starting point of right sub array \n let mid = left + size - 1;\n let right = ((left + 2 * size - 1)- (n - 1)) > 0 ? (n - 1) : (left + 2 * size - 1);\n\n // merge sub array arr[left.....mid] & \n // arr[mid+1....right] \n this.merge(arr, left, mid, right);\n }\n }\n }", "sortFunction(input) {\n input.sort((a, b) => {\n if (a.timestamp === b.timestamp) {\n return input.indexOf(a) - input.indexOf(b);\n } else {\n return b.timestamp - a.timestamp;\n }\n });\n }", "function insertion_sort(arr) {\r\n var start_time = performance.now();\r\n sorted = arr;\r\n\r\n for(var i = 1;i<sorted.length;i++){\r\n for(var y = 0; y<i; y++){\r\n if(sorted[i] < sorted[y]){\r\n temp = sorted[y];\r\n sorted[y] = arr[i];\r\n arr[i] = temp;\r\n }\r\n }\r\n }\r\n var finish_time = performance.now();\r\n var execution_time = finish_time - start_time;\r\n document.getElementById(\"time_spent\").innerHTML = execution_time;\r\n return sorted;\r\n}", "function inssort2(A) {\n var temp;\n for (var i = 1; i < A.length; i++) // Insert i'th record\n for (var j = i; (j > 0) && (A[j] < A[j - 1]); j--) {\n temp = A[j]; A[j] = A[j - 1]; A[j - 1] = temp;\n }\n}", "function sortByDateTime\n(\n arr\n)\n{\n return arr.sort(function(a,b)\n {\n var secondDate = new Date(b.dt);\n var currentDate = new Date();\n return currentDate - secondDate ; \n });\n}", "function bubbleSort(a) {\n let timeStart = Date.now();\n let swapp;\n let n = a.length - 1;\n let x = a;\n do {\n swapp = false;\n for (var i = 0; i < n; i++) {\n if (x[i] > x[i + 1]) {\n var temp = x[i];\n x[i] = x[i + 1];\n x[i + 1] = temp;\n swapp = true;\n }\n }\n n--;\n } while (swapp);\n\n let timeEnd = Date.now();\n return { text: `bubble sort time ${timeEnd - timeStart}`, result: a };\n}", "function timestampSort(a, b) {\n return (a.startTime - b.startTime);\n }", "function Sort() {}", "function sortViaQuickSort(items) {\n console.time('quickSort');\n\n quickSort(items, 0, items.length - 1);\n\n console.timeEnd('quickSort');\n return items;\n}", "insertionSort(arr){\n \n var starttime = process.hrtime();\n\n for (let i = 1; i < arr.length; i++) {\n var key = arr[i];\n var j = i-1;\n while(j>=0 && arr[j]>key){\n arr[j+1] = arr[j];\n j--;\n }\n arr[j+1]= key;\n }\n var endtime = process.hrtime();\n var et = this.elapsedTime(starttime, endtime);\n console.log('Elapsed time for Insertion sort is : '+et, 'milisecod');\n return arr;\n }", "function sortAsc(arr) {\n let t = arr.length;\n var temp;\n\n for (var i = 0; i <= t; i++) {\n for (var j = 0; j < t; j++) {\n // compara se o elemento atual é maior que o seguinte\n if (arr[j] > arr[j+1]) {\n // armazena o elemento atual\n temp = arr[j];\n // substitui o elemento atual pelo seguinte\n arr[j] = arr[j+1];\n // recupera o valor atual e substitui no seguinte\n arr[j+1] = temp;\n }\n }\n }\n return arr;\n}", "function sortAlmostSorted(arr, k) {\n\n}", "function properSort(a, b) {\n if (a.times > b.times) {\n return -1;\n }\n if (b.times > a.times) {\n return 1;\n }\n return 0;\n }", "StopwatchSearchAndSort(arr) {\n\n //binary search\n\n var start = this.stopwatchmill()\n var temp = this.sortarrayInt(arr)\n var stop = this.stopwatchmill()\n var totaltime1 = stop - start;\n console.log(\"Binary Search take \" + totaltime1 + \" millsecond to exicute the code\");\n console.log();\n\n\n //bubble Sort\n var start = this.stopwatchmill()\n var temp = this.bubbleSortInt(arr)\n var stop = this.stopwatchmill()\n var totaltime2 = stop - start;\n console.log(\"Bubble Sort take \" + totaltime2 + \" millsecond to exicute the code\");\n console.log();\n\n\n\n\n //insertion sort\n\n var start = this.stopwatchmill()\n var temp = this.insertionSortInt(arr)\n var stop = this.stopwatchmill()\n var totaltime3 = stop - start;\n console.log(\"Insertion Sort take \" + totaltime3 + \" millsecond to exicutethe code\");\n\n\n\n\n}", "function sortFunc(a, b) {\n var aDate = new Date(a.time);\n var bDate = new Date(b.time);\n\n if (aDate > bDate) {\n return -1;\n } else if (aDate < bDate) {\n return 1;\n } else {\n return 0;\n }\n }", "function sortQuick(index1, index2){\r\n if(index2 - index1 > 1){\r\n\tvar pivotIndex = index1;\r\n\tfor(var i=index1+1;i<index2;i++){\r\n\t if(arr[pivotIndex].val >= arr[i].val){\r\n\t\tvar holder = arr[i];\r\n\t\tfor(var j=i;j>pivotIndex;j--){\r\n\t\t arr[j] = arr[j-1];\r\n\t\t}\r\n\t\tarr[pivotIndex] = holder;\r\n\t\tpivotIndex++;\r\n\t }\r\n\t}\r\n\tcallWith_.push([index1, pivotIndex]);\r\n\tcallWith_.push([pivotIndex+1, index2]);\r\n }\r\n}", "function sortByPriority(arr) {\n clock = 0;\n arr.sort((a, b) =>{\n return b.priority - a.priority\n })\n}", "function _UltraGrid_Sort_Rows_Time(a, b)\n\t{\n\t\t//retrieve values\n\t\tvar valueA = Parse_Time(a.Value, 0xffffffff);\n\t\tvar valueB = Parse_Time(b.Value, 0xffffffff);\n\t\t//return direct comparison\n\t\treturn valueA < valueB ? -1 : 1;\n\t}", "async function TopologicalSort(){}", "function makeArrayOfPossTimes (bigArray) {\n\tbigArray.forEach(function(item){\n\t\tif (uniqueTimesArray.indexOf(item) === -1) {\n\t\t\tuniqueTimesArray.push(item);\n\t\t}\n\t});\n \t// console.log(\"times array\", uniqueTimesArray);\n\tsortTimes(uniqueTimesArray);\n}", "function asorter(a, b) {\n return getTime(a.start_time) - getTime(b.start_time);\n}", "function sortArr2(arr) {\n console.table(arr.sort((a, b) => a - b)\n );\n}", "static sort(arr) {\n const n = arr.length;\n \n for (let i = 1; i < n; i++) {\n for (let j = i; j > 0 && less(arr[j], arr[j - 1]); j--) {\n swap(arr, j, j - 1);\n }\n }\n }", "function testArray(sortFunc) {\n var test = [];\n for(var i = 0; i < 1000000; i++) {\n test.push(Math.floor(Math.random()*100));\n }\n var before = new Date()\n sortFunc(test);\n var after = new Date()\n if(isSorted(test)) {\n console.log(\"Sort worked!\", after-before);\n } else {\n console.log(\"Sort failed...\", test);\n }\n}", "function testArray(sortFunc) {\n var test = [];\n for(var i = 0; i < 1000000; i++) {\n test.push(Math.floor(Math.random()*1000000));\n }\n var before = new Date()\n sortFunc(test);\n var after = new Date()\n if(isSorted(test)) {\n console.log(\"Sort worked!\", after-before);\n } else {\n console.log(\"Sort failed...\", test);\n }\n}", "function testArray(sortFunc) {\n var test = [];\n for(var i = 0; i < 1000000; i++) {\n test.push(Math.floor(Math.random()*1000000));\n }\n var before = new Date()\n sortFunc(test);\n var after = new Date()\n if(isSorted(test)) {\n console.log(\"Sort worked!\", after-before);\n } else {\n console.log(\"Sort failed...\", test);\n }\n}", "function sortArrByTime(pArr, pFormat) {\n\n function customeSort(pFirstValue, pSecondValue) {\n var parseTime = d3.timeParse(pFormat);\n var fD = parseTime(pFirstValue.x);\n var sD = parseTime(pSecondValue.x);\n return new Date(fD).getTime() - new Date(sD).getTime();\n }\n\n try {\n return pArr.sort(customeSort);\n }\n catch (e) {\n apex.debug.error({\n \"fct\": util.featureDetails.name + \" - \" + \"drawChart\",\n \"msg\": \"Error while try sort JSON Array by Time Value\",\n \"err\": e,\n \"featureDetails\": util.featureDetails\n });\n }\n }", "function subSort(arr) {\n // didnt get this one. try again\n}", "visualizeMergeSort() {\n console.log(\"Merge Sort\");\n const array = this.state.array;\n array.forEach((element) => {\n element.visited = false; // if already sorted and clicked the sort function again... we just need to reset the visited flags\n });\n var start = performance.now();\n this.mergeSort(array, 0, array.length - 1);\n console.log(performance.now() - start);\n }", "sort() {\n\t}", "sort() {\n\t}", "function sort(){\n var toSort = S('#sched-list').children;\n toSort = Array.prototype.slice.call(toSort, 0);\n\n toSort.sort(function(a, b) {\n var a_ord = +a.id.split('e')[1]; //id tags of the schedule items are timeINT the INT = the numeric time\n var b_ord = +b.id.split('e')[1]; //splitting at 'e' and getting the element at index 1 gives use the numeric time\n\n return (a_ord > b_ord) ? 1 : -1;\n });\n\n var parent = S('#sched-list');\n parent.innerHTML = \"\";\n\n for(var i = 0, l = toSort.length; i < l; i++) {\n parent.appendChild(toSort[i]);\n }\n }", "function sortByTime() {\n for (let i = 0; i < sortedData.length; i++) {\n var x = sortedData[i].time;\n \n if (x < 12) {\n sortedByTime.push(sortedData[i]);\n \n } \n }\n }", "function sortArrByTime( pArr, pFormat ) {\n\n function customeSort( pFirstValue, pSecondValue ) {\n const parseTime = d3JS.timeParse( pFormat ),\n fD = parseTime( pFirstValue.x ),\n sD = parseTime( pSecondValue.x );\n return new Date( fD ).getTime() - new Date( sD ).getTime();\n }\n\n try {\n return pArr.sort( customeSort );\n }\n catch ( e ) {\n apex.debug.error( {\n \"fct\": `${util.featureDetails.name} - drawChart`,\n \"msg\": \"Error while try sort JSON Array by Time Value\",\n \"err\": e,\n \"featureDetails\": util.featureDetails\n } );\n }\n }", "function cocktailShakerSort(array, delay){\n var data = array.slice();\n var swaps = 0;\n //Main loop\n for(var i = 0; i < data.length/2; i++){\n var swapped = false;\n \n //Sorts next, unsorted largest-value\n for(var j = i; j < data.length - i - 1; j++){\n if(data[j] > data[j+1]){\n var tmp = data[j];\n data[j] = data[j+1];\n data[j+1] = tmp;\n swapped = true;\n \n timeouts.push(setTimeout(swap, delay*swaps, j, j+1));\n swaps++;\n }\n }\n \n //Sorts next, unsorted smallest-value\n for(var j = data.length - 2 - i; j > i; j--){\n if(data[j] < data[j-1]){\n var tmp = data[j];\n data[j] = data[j-1];\n data[j-1] = tmp;\n swapped = true;\n \n timeouts.push(setTimeout(swap, delay*swaps, j, j-1));\n swaps++;\n }\n }\n \n if(!swapped) break; //If finished sorting\n }\n \n return data;\n}", "function sortByTime(a, b) {\r\n\tvar x = a[0].substr(0, 2) + a[0].substr(3, 2) + a[0].substr(6, 2);\r\n\tvar y = b[0].substr(0, 2) + b[0].substr(3, 2) + b[0].substr(6, 2);\r\n\r\n\treturn ((x < y) ? SortDirection * (-1) : ((x > y) ? SortDirection : 0));\r\n}", "function quickSort() {}", "function sort_stamps(temp) {\n\t\ttemp.sort(function (a, b) {\n\t\t\tvar entryA = a.instrument + a.state;\n\t\t\tvar entryB = b.instrument + b.state;\n\t\t\tif (entryA < entryB) return -1;\n\t\t\tif (entryA > entryB) return 1;\n\t\t\treturn 0;\n\t\t});\n return temp;\n\t}", "function sort(array) {\n var buf;\n\n for (var j = 0; j < array.length-1; j++)\n for (var i = 0; i < array.length-j; i++) {\n if (array[i] > array[i+1]) {\n buf = array[i];\n array[i] = array[i+1];\n array[i+1] = buf;\n }\n }\n\n return array;\n }", "mergeTime(arr1,arr2) {\n let results = [];\n let i=0;\n let j=0;\n while(i < arr1.length && j < arr2.length) {\n if (arr1[i] < arr2[j]) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++\n }\n\n }\n while(i < arr1.length) {\n results.push(arr1[i]);\n i++;\n }\n while(j < arr2.length) {\n results.push(arr2[j]);\n j++;\n }\n return results;\n }", "function sortUnique(a) {\n const n = a.length;\n if (n <= 1) return a;\n // do a shell sort\n let k = 1;\n const hi = (n / 3) | 0;\n let i;\n let j;\n let tmp;\n while (k < hi) k = k * 3 + 1;\n while (k > 0) {\n for (i = k; i < n; i++) {\n for (j = i; j >= k && a[j] < a[j - k]; j -= k) {\n tmp = a[j];\n a[j] = a[j - k];\n a[j - k] = tmp;\n }\n }\n k = (k / 3) | 0;\n }\n\n let last = a[0];\n let x;\n for (i = 1, j = 1; i < n; i++) {\n x = a[i];\n if (x === last) continue;\n // eslint-disable-next-line no-multi-assign\n last = a[j++] = a[i];\n }\n a.length = j;\n return a.length === j ? a : copyArray(a, j); // Typed Array length property only has a getter\n}", "function sortByArrival(arr){\n clock = 0;\n arr.sort((a, b) =>{\n return a.arrival - b.arrival\n })\n}", "function sort(arr) {\n if (arr.length === 1) return arr;\n let n, a;\n for (n = 0, a = 1; a < arr.length; a = 2 * a, n += 1);\n for (let i = 0, j = 1; i <= n; i++ , j = 2 * j) {\n for (let k = 0; k + j < arr.length; k += 2 * j) {\n const a = [];\n let iLo = 0, iHi = k + j;\n for (let l = k; l < k + 2 * j && l < arr.length; l++) {\n let loval = iLo >= a.length ? arr[l][0] : a[iLo][0];\n if (iHi > l) {\n if (iHi >= k + (2 * j) || iHi >= arr.length || loval <= arr[iHi][0]) {\n if (iLo >= a.length) continue;\n a.push(arr[l]);\n arr[l] = a[iLo];\n iLo += 1;\n continue\n }\n }\n a.push(arr[l]);\n arr[l] = arr[iHi];\n iHi += 1;\n }\n }\n }\n return arr;\n }", "function thugSort(arr) {\n const max = arr.max(); // O(n)\n const sorted = arrayFromMax(max); // O(m)\n const set = new Set(arr); // O(n)\n return sorted.filter(ele => set.has(ele)); // O(m)\n}", "function mySort(list) {\n var listLength = list.length, currentlyCompared, indUnsort, indSort;\n\tfor(indUnsort = 1; indUnsort < listLength; indUnsort++) { // O(n)\n\t\tcurrentlyCompared = list[indUnsort]; // save current value as it can be shift later\n\t\tindSort = indUnsort - 1;\n\t // Whenever the value in the sorted section is greater than the value\n\t // in the unsorted section, shift all items in the sorted section over\n\t // by one. This creates space in which to insert the value.\n\t\twhile (indSort >= 0 && list[indSort] > currentlyCompared) { // O(n)\n\t\t\tlist[indSort + 1] = list[indSort];\n\t\t\tindSort--;\n\t\t}\n\t\tlist[indSort + 1] = currentlyCompared;\n\t}\n\treturn list;\n}", "function sortData(data)\n\t{\n\t\tfor (let i = 0; i < data.length; i++)\n \t{\n\t \tfor (let j = 0; j < data.length - i - 1; j++)\n\t \t{\n\t \t\tif (+data[j].subCount < +data[j + 1].subCount)\n\t \t\t{\n\t \t\t\tlet tmp = data[j];\n\t \t\t\tdata[j] = data[j + 1];\n\t \t\t\tdata[j + 1] = tmp;\n\t \t\t}\n\t \t}\n \t}\n \treturn data;\n\t}", "function sortVersionArray(arr) {\n return arr.map( a => a.replace(/\\d+/g, n => +n+100000 ) ).sort()\n .map( a => a.replace(/\\d+/g, n => +n-100000 ) );\n}", "function quickSort (ary) {\n doQuickSort(ary, compare, 0, ary.length - 1);\n }", "function sortByFrequencyUseArr(arr){\n const frequency = {};\n \n arr.forEach(item => {\n frequency[item] = (frequency[item] || 0) + 1;\n });\n //console.log(frequency)\n\n let sortable = arr.map(item => [item, frequency[item]]);\n //console.log(sortable);\n\n sortable.sort((a, b) => {\n if (a[1] === b[1]) {\n return b[0] - a[0]\n } \n return a[1] - b[1]\n });\n //console.log(sortable);\n\n return sortable.map(s => s[0]);\n}", "function insertSort(arr) {\n console.time('insertSort');\n for(let i = 1; i < arr.length; i++) {\n let temp = arr[i];\n\n let j = i;\n for(j = i; j > 0; j--) {\n if(arr[j - 1] < temp) {\n break;\n } else {\n arr[j] = arr[j - 1];\n }\n }\n arr[j] = temp;\n \n\n // while ( (j > 0) && (arr[j - 1] > temp) ) {\n // arr[j] = arr[j - 1];\n // j--;\n // c++;\n //\n // }\n\n // arr[j] = temp;\n\n }\n\n console.timeEnd('insertSort');\n return arr;\n}", "function sortByDate(tid) {\n kiddos = []\n var t = document.getElementById(\"thread_\" + tid)\n var h = document.getElementById(\"helper_\" + tid)\n if (t) {\n // fetch all elements called 'thread*' inside t\n traverseThread(t, 'thread')\n \n // sort the node array:\n // forward\n if (prefs.sortOrder == 'forward') {\n kiddos.sort(function(a, b) {\n return parseInt(b.getAttribute('epoch') - a.getAttribute('epoch'));\n })\n // backward\n } else {\n kiddos.sort(function(a, b) {\n return parseInt(a.getAttribute('epoch') - b.getAttribute('epoch'));\n })\n }\n \n // do some DOM magic, repositioning according to sort order\n for (var i in kiddos) {\n t.insertBefore(kiddos[i], t.firstChild)\n }\n }\n}", "sort(){\n\n }", "function quickSort(arr) {\n return arr.sort((a,b) => a-b);\n}", "function quickersort(a){\n var left = []\n , right = []\n , pivot = a[0]\n if(a.length == 0){\n return []\n }\n for(var i = 1; i < a.length; i++){\n a[i] < pivot ? left.push(a[i]) : right.push(a[i])\n }\n return quickersort(left).concat(pivot, quickersort(right))\n}", "function sort(results){\r\n var swap=0;\r\n var view = new Array();\r\n for(var i=0; i<results.length; i++){\r\n view.push(data[results[i]].views);\r\n }\r\n for(var i=results.length-1; i>0; i--){\r\n for(var j=0; j<i; j++){\r\n if(view[j]<view[j+1]){\r\n var temp = results[j];\r\n results[j] = results[j+1];\r\n results[j+1] = temp;\r\n temp = view[j];\r\n view[j] = view[j+1];\r\n view[j+1]=temp;\r\n swap = 1; \r\n }\r\n }\r\n if(swap == 0){break;}\r\n } \r\n}", "sort() {\n const a = this.dict;\n const n = a.length;\n\n if( n < 2 ) { // eslint-disable-line \n } else if( n < 100 ) {\n // insertion sort\n for( let i = 1; i < n; i += 1 ) {\n const item = a[ i ];\n let j = i - 1;\n while( j >= 0 && item[ 0 ] < a[ j ][ 0 ] ) {\n a[ j + 1 ] = a[ j ];\n j -= 1;\n }\n a[ j + 1 ] = item;\n }\n } else {\n /**\n * Bottom-up iterative merge sort\n */\n for( let c = 1; c <= n - 1; c = 2 * c ) {\n for( let l = 0; l < n - 1; l += 2 * c ) {\n const m = l + c - 1;\n const r = Math.min( l + 2 * c - 1, n - 1 );\n if( m > r ) continue;\n merge( a, l, m, r );\n }\n }\n }\n }", "function sortByBurst(arr) {\n clock = 0;\n arr.sort((a, b) =>{\n return a.burst - b.burst\n })\n}", "function isort(array, start, end) {\n var a, b, t, kt;\n for(a = start; a < end; a += 1) {\n t = array[a];\n kt = keyFunction(t);\n for(b = a; b > start &&\n kt < keyFunction(array[b-1]); b -=1 ) {\n array[b] = array[b - 1];\n }\n array[b] = t;\n }\n }", "function sortFunction ( a, b ) { \n\t\t if (a[0] - b[0] != 0) {\n\t\t return (a[0] - b[0]);\n\t\t } else if (a[1] - b[1] != 0) { \n\t\t return (a[1] - b[1]);\n\t\t } else { \n\t\t return (a[2] - b[2]);\n\t\t }\n\t\t }", "function sort_array_x(array){\n\tend = array.length - 1;\n\tfor(start = 0; start < array.length - 1; start++){\n\t\tstart_x = array[start].x;\n\t\tend_x = array[end].x;\n\t\tif(end_x < start_x){\n\t\t\tswap_start = array[start];\n\t\t\tarray[start] = array[end];\n\t\t\tarray[end] = swap_start;\n\t\t}\n\t}\n}", "function selectSort(arr){\r\n const len = arr.length;\r\n // define a variable to store the minimum index of current interval\r\n let minIndex;\r\n // i is the start point of current interval\r\n for(let i = 0; i < len - 1; i++){\r\n // init minIndex \r\n minIndex = i;\r\n // j is current interval's right limit\r\n for(let j = i; j < len; j++){\r\n // find the smallest data and update index of minIndex \r\n if(arr[j] < arr[minIndex]){\r\n minIndex = j;\r\n }\r\n }\r\n // if minIndex is not current head index, swap them\r\n if(minIndex !== i){\r\n [arr[i], arr[minIndex]] = [arr[minIndex], arr[i]];\r\n }\r\n }\r\n return arr;\r\n}", "function dd(a){a=a.ob();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].Lf;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(ed);b.sort(ed);return[c,b]}", "function sortArray(a) {\n var done;\n do {\n done = false;\n for(var i = 0;i < a.length-1;i++) {\n if(a[i] < a[i+1]) {\n var tempDist = a[i];\n a[i] = a[i+1];\n a[i+1] = tempDist;\n done = true;\n }\n }\n } while(done);\n }", "function sort(theArray){\n\n}", "testSortingAlgorithms() {\n for (let i = 0; i < 100; i++) {\n const array = [];\n const length = randomIntBetween(1, 1000);\n for (let i = 0; i < length; i++) {\n array.push(randomIntBetween(-1000, 1000));\n }\n const javaScriptSortedArray = array.slice().sort((a, b) => a - b);\n const ourSortedArray = heapSortAnimations(array.slice(), 0, array.length - 1);\n const equal = arraysAreEqual(javaScriptSortedArray, ourSortedArray);\n console.log(equal);\n // if(equal === true) {\n // console.log(equal);\n // }\n // else {\n // console.log(javaScriptSortedArray, ourSortedArray);\n // }\n }\n }", "function smartSort(a, b) {\n switch (typeof(a)) {\n case \"string\": return d3.ascending(a, b);\n case \"number\": return a - b; //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n default: return d3.ascending(a, b);\n }\n }", "function mergesort2(){\n console.log(\"mergesort - implement me !\");\n let a = new Array({dist:59},{dist:57},{dist:52},{dist:50},{dist:58},{dist:55},{dist:1},{dist:25},{dist:18},{dist:20})\n let profondeur = 1;\n ms2(csvData,profondeur,false); \n console.log(csvData);\n setupDisplay();\n //console.log(a);\n}", "quickSortMain(first, last, animations) {\r\n if (first >= last) return;\r\n let bubbleIndex = first;\r\n let pivotValue = array[last];\r\n for (let i = first; i < last; i++) {\r\n if (array[i] < pivotValue) {\r\n animations.push([i, i])\r\n animations.push([i, i])\r\n swap(array, i, bubbleIndex); \r\n animations.push([bubbleIndex++, i])\r\n }\r\n }\r\n this.swapPivot(bubbleIndex, first, last, animations);\r\n }", "function sortArr(a, b){\n return a - b ;\n }", "function insertionSort(arr){\n\tvar len = arr.length;\n\tconsole.time('Insertion sort takes: ');\n\tfor(var i = 1; i < len; i++){\n\t\tvar key = arr[i]\n\t\tvar j = i - 1;\n\t\twhile(j >=0 && arr[j] > key){\n\t\t\tarr[j+1] = arr[j];\n\t\t\tj--;\n\t\t}\n\t\tarr[j+1] = key;\n\t}\n\tconsole.timeEnd('Insertion sort takes: ');\n\treturn arr\n}", "function ComparisonSort(e,t,n){this.init(e,t,n)}", "function quickSort(arr) {\n\n}", "function quickSort(arr) {\n\n}", "function sortFunction(val){\n return val.sort();\n}", "function quickSort(array) {\n \n}", "function arrangeInArrays(element,i,array){\n var day = new Date(element.time);\n var niceDate = $filter('date')(day,'MMM,dd');\n valueArray.push(element.value);\n timeArray.push(niceDate);\n }", "function fastQuickSort(arr, compareFn = (a, b) => a - b) {\n if (arr.length <= 1) {\n // No sorting needed, fixes #118\n return arr;\n }\n const stack = [];\n let entry = [\n 0,\n arr.length,\n 2 * Math.floor(Math.log(arr.length) / Math.log(2)),\n ];\n stack.push(entry);\n while (stack.length > 0) {\n entry = stack.pop();\n const start = entry[0];\n const end = entry[1];\n let depth = entry[2];\n if (depth == 0) {\n arr = shellSortBound(arr, start, end, compareFn);\n continue;\n }\n depth--;\n const pivot = Math.round((start + end) / 2);\n const pivotNewIndex = inplaceQuickSortPartition(arr, start, end, pivot, compareFn);\n if (end - pivotNewIndex > 16) {\n entry = [pivotNewIndex, end, depth];\n stack.push(entry);\n }\n if (pivotNewIndex - start > 16) {\n entry = [start, pivotNewIndex, depth];\n stack.push(entry);\n }\n }\n arr = insertionSort(arr, compareFn);\n return arr;\n}", "function sortV(x_in) {\r\n var y = []; x = x_in;\r\n var lt=x.length;\r\n for (jgo = 1; jgo < lt; jgo++) {\r\n for (igo = 1; igo < lt; igo ++) {\r\n if (x[igo] < x[igo-1]) {\r\n tmp = x[igo];\r\n x[igo] = x[igo-1];\r\n x[igo-1] = tmp;\r\n }\r\n }\r\n }\r\n y = x;\r\n return y;\r\n }", "sort() {\n for (let i = 0; i < this.values.length - 1; i++) {\n let min = i;\n for (let j = i + 1; j < this.values.length; j++) {\n if (this.values[j] < this.values[min]) min = j;\n }\n\n this.swap(i, min);\n }\n }", "function arrangeElements( array ) {\r\n\tarray = array.sort();\r\n\treturn array;\r\n}", "function solution(A) {\n // write your code in JavaScript (ECMA-262, 5th edition)\n function compareNumbers(a, b)\n {\n return a - b;\n }\n var rad = [], sorted = A.splice(0).sort(compareNumbers);\n for(var i=0; i<A.length; A++){\n \n }\n \n return 11 > 10000000 ? -1 : 11;\n}", "function partialSort(arr, k, left, right, compare) {\n \n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n partialSort(arr, k, newLeft, newRight, compare);\n }\n \n var t = arr[k];\n var i = left;\n var j = right;\n \n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n \n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n \n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n \n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n }", "function sortSecond(a,b) {\r\n\t\t\treturn b[1] - a[1];\r\n\t\t}", "function quickSort(recipes) {\n for (var i = 0; i < recipes.length(); i++) {\n for (var j = i + 1; j < recipes.length(); j++) {\n if(recipes[i].lowTime < recipes[j].lowTime) {\n var x = recipes[i] ;\n recipes[i] == recipes[j];\n recipes[j] == x;\n }\n }\n }\n}", "function Sort(arr)\n{\n\n}", "function sort() {\n elementArray.sort(function (x, y) {\n return x.elem - y.elem;\n });\n render(elementArray);\n }", "async function qwikSort(arr, low, high)\n {\n if (low < high)\n {\n \n // pi is partitioning index, arr[p]\n // is now at right place\n let pi = await partition(arr, low, high);\n \n // Separately sort elements before\n // partition and after partition\n qwikSort(arr, low, pi - 1);\n qwikSort(arr, pi + 1, high);\n }\n \n }", "function sortTimes(startTimes, endTimes, days, key) {\n for(var i = 0; i < startTimes.length - 1; i++) {\n var move = timeToInt(stringToTime(startTimes[i]));\n var where = i;\n for(var j = i + 1; j < startTimes.length; j++) {\n if((key == \"min\") ? timeToInt(stringToTime(startTimes[j])) < move : timeToInt(stringToTime(startTimes[j])) > move) {\n min = timeToInt(stringToTime(startTimes[j]));\n where = j;\n }\n }\n if(where != i) {\n var tmp = startTimes[i];\n startTimes[i] = startTimes[where];\n startTimes[where] = tmp;\n var tmp = endTimes[i];\n endTimes[i] = endTimes[where];\n endTimes[where] = tmp;\n var tmp = days[i];\n days[i] = days[where];\n days[where] = tmp;\n }\n }\n }", "function calendar_helper_sortEvents(array) {\n var x, y, holder;\n // The Bubble Sort method.\n for(x = 0; x < array.length; x++) {\n for(y = 0; y < (array.length-1); y++) {\n if(array[y].start > array[y+1].start) {\n holder = array[y+1];\n array[y+1] = array[y];\n array[y] = holder;\n }\n }\n }\n}", "function lis(a) {\n var p = a.slice();\n var result = [];\n result.push(0);\n var u;\n var v;\n for (var i = 0, il = a.length; i < il; ++i) {\n if (a[i] === -1) {\n continue;\n }\n var j = result[result.length - 1];\n if (a[j] < a[i]) {\n p[i] = j;\n result.push(i);\n continue;\n }\n u = 0;\n v = result.length - 1;\n while (u < v) {\n var c = (u + v) / 2 | 0;\n if (a[result[c]] < a[i]) {\n u = c + 1;\n } else {\n v = c;\n }\n }\n if (a[i] < a[result[u]]) {\n if (u > 0) {\n p[i] = result[u - 1];\n }\n result[u] = i;\n }\n }\n u = result.length;\n v = result[u - 1];\n while (u-- > 0) {\n result[u] = v;\n v = p[v];\n }\n return result;\n}", "function basicSort (first, second) {\r\n\treturn first - second;\r\n}", "function p(a){\n// Give preference to elements with certain criteria, so they have\n// a chance to be closer to the top.\na.sort(ya);for(var b=[],c=0;c<a.length;c++){\n// loop through subrows, starting with the topmost, until the segment\n// doesn't collide with other segments.\nfor(var d=a[c],e=0;e<b.length&&wa(d,b[e]);e++);\n// `j` now holds the desired subrow index\nb[e]?b[e].push(d):b[e]=[d]}return b}", "function sort(a, lo, hi) {\n\t var n = hi - lo,\n\t t;\n\t while (--n > 0) t = a[lo], a[lo] = a[lo + n], a[lo + n] = t, sift(a, 1, n, lo);\n\t return a;\n\t }", "function sortListsByDate() {\r\n\t\treturn getItems().sort(function(a,b){\r\n \t\t\treturn new Date(`${a.date} ${a.time}`) - new Date(`${b.date} ${b.time}`);\r\n\t\t});\r\n\t}", "function qsort2(xs) {\n sort(xs, 0, xs.length);\n return xs;\n\n // The actual sort body.\n function sort(xs, start, end) {\n if(end < start + INSERT_SORT_THRESHOLD ) {\n isort(xs, start, end);\n return;\n }\n\n let i = start - 1,\n j = end,\n u = i,\n v = j;\n const pivot = medianOfThree(xs[start],\n xs[Math.floor((start + end) / 2)],\n xs[end-1]);\n // Reorder the values, and maintain the indices so we have\n // the following:\n //\n // begin (inclusive) | end (exclusive) | description\n // start | u | == pivot\n // u | i | < pivot\n // i | v | > pivot\n // v | end | = pivot\n\n while(i < j) {\n i += 1;\n while(i < j && xs[i] < pivot) {\n i += 1;\n }\n\n j -= 1;\n while(i < j && pivot < xs[j]) {\n j -= 1;\n }\n\n if(i < j) {\n const t = xs[i];\n xs[i] = xs[j]; xs[j] = t;\n /* jshint ignore:start */\n // We are ignoring the !. Just trying to stick\n // with < for now...\n if(!(xs[i] < pivot)) {\n u += 1;\n const t = xs[i];\n xs[i] = xs[u]; xs[u] = t;\n }\n if( !(pivot < xs[j])) {\n v -= 1;\n const t = xs[j];\n xs[j] = xs[v]; xs[v] = t;\n }\n /* jshint ignore:end */\n }\n }\n\n // if(xs[i] < pivot) { throw 'invariant'; }\n\n // Now, 'flip' the sides around to bring the values equal\n // to the pivot to the middle.\n\n j = vecswap(xs, i, v, end);\n i = vecswap(xs, start, u + 1, i);\n\n // xs[i] >= pivot.\n sort(xs, start, i);\n sort(xs, j, end);\n }\n}", "function sortdisheshightolow(o) {\r\n\tvar swapped=true;\r\n\twhile (swapped==true){\r\n\t\tswapped=false;\r\n\t\tfor (var i= 0; i<o.length-1; i++){\r\n\t\t\tif (o[i].price<o[i+1].price){\r\n\t\t\t\tvar temp = o[i];\r\n\t\t\t\to[i]=o[i+1];\r\n\t\t\t\to[i+1]=temp;\r\n\t\t\t\tswapped=true;\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t}\r\n\r\n return o;\r\n}", "function sortItems(arr) {\r\n return arr.sort();\r\n}" ]
[ "0.7325162", "0.6831727", "0.66565955", "0.6642157", "0.65832806", "0.65818954", "0.65380836", "0.6420119", "0.64198995", "0.63896215", "0.63785446", "0.6361396", "0.63176745", "0.6280679", "0.627885", "0.621601", "0.6211559", "0.61778635", "0.6151861", "0.6149226", "0.6148908", "0.6138449", "0.61356664", "0.6103079", "0.6081037", "0.6071957", "0.6063427", "0.60573167", "0.60548997", "0.60548997", "0.6049198", "0.604845", "0.60464704", "0.6045945", "0.6045945", "0.60380375", "0.6027974", "0.60258824", "0.60171944", "0.60138494", "0.6013253", "0.60067207", "0.59969753", "0.5982966", "0.59720063", "0.59694755", "0.5967201", "0.59465736", "0.59287864", "0.5916245", "0.5914226", "0.5911811", "0.59091574", "0.59072125", "0.5900152", "0.58987164", "0.58911204", "0.588761", "0.5887531", "0.5852372", "0.5851655", "0.5837656", "0.5829936", "0.5822786", "0.58199394", "0.5811924", "0.5811636", "0.5806782", "0.5805998", "0.5804682", "0.5800533", "0.57906336", "0.578573", "0.57777846", "0.5765725", "0.576249", "0.576249", "0.57524824", "0.57440454", "0.573977", "0.5736655", "0.5735289", "0.57253414", "0.57226706", "0.5708156", "0.57033783", "0.57033217", "0.5702338", "0.57008106", "0.5695654", "0.5693402", "0.5690226", "0.5686656", "0.5685992", "0.56826746", "0.5680976", "0.56809103", "0.5676226", "0.56735307", "0.56702447", "0.5668132" ]
0.0
-1
And `getCoordinateSystems` and `getComponentByElement` will be injected in echarts.js
function ExtensionAPI(chartInstance) { zrUtil.each(echartsAPIList, function (name) { this[name] = zrUtil.bind(chartInstance[name], chartInstance); }, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_initializeComponent() {\n //Heade\n this.elements.header = document.createElement(\"div\");\n this.elements.title = document.createElement(\"span\");\n this.elements.range = document.createElement(\"span\");\n\n this.elements.header.className = \"chart-header\";\n this.elements.title.className = \"chart-title\";\n this.elements.range.className = \"chart-range\";\n\n this.elements.header.appendChild(this.elements.title);\n this.elements.header.appendChild(this.elements.range);\n\n //Tooltip\n this.elements.tooltip = document.createElement(\"div\");\n this.elements.date = document.createElement(\"span\");\n this.elements.values = document.createElement(\"div\");\n\n this.elements.tooltip.className = \"chart-tooltip\";\n this.elements.date.className = \"chart-tooltip-date\";\n this.elements.values.className = \"chart-tooltip-values\";\n\n this.elements.tooltip.appendChild(this.elements.date);\n this.elements.tooltip.appendChild(this.elements.values);\n\n //Render\n this.elements.render = document.createElement(\"div\");\n this.elements.chart = document.createElement(\"canvas\");\n this.elements.layout = document.createElement(\"canvas\");\n\n this.elements.render.className = \"chart-render\";\n this.elements.chart.className = \"chart-render-chart\";\n this.elements.layout.className = \"chart-render-layout\";\n\n this.elements.render.appendChild(this.elements.chart);\n this.elements.render.appendChild(this.elements.layout);\n\n //Preview\n this.elements.control = document.createElement(\"div\");\n this.elements.preview = document.createElement(\"canvas\");\n this.elements.select = document.createElement(\"div\");\n this.elements.draggerLeft = document.createElement(\"div\");\n this.elements.draggerRight = document.createElement(\"div\");\n this.elements.coverLeft = document.createElement(\"div\");\n this.elements.coverRight = document.createElement(\"div\");\n\n this.elements.control.className = \"chart-control\";\n this.elements.preview.className = \"chart-preview\";\n this.elements.select.className = \"chart-select\";\n this.elements.draggerLeft.className = \"chart-dragger chart-dragger-left\";\n this.elements.draggerRight.className = \"chart-dragger chart-dragger-right\";\n this.elements.coverLeft.className = \"chart-cover chart-cover-left\";\n this.elements.coverRight.className = \"chart-cover chart-cover-right\";\n\n this.elements.control.appendChild(this.elements.preview);\n this.elements.control.appendChild(this.elements.coverLeft);\n this.elements.control.appendChild(this.elements.select);\n this.elements.select.appendChild(this.elements.draggerLeft);\n this.elements.select.appendChild(this.elements.draggerRight);\n this.elements.control.appendChild(this.elements.coverRight);\n\n //Graph buttons container\n this.elements.graphs = document.createElement(\"div\");\n\n this.elements.graphs.className = \"chart-graphs\";\n\n //Main container\n this.elements.container.className += \" chart-container\";\n\n this.elements.container.appendChild(this.elements.header);\n this.elements.container.appendChild(this.elements.tooltip);\n this.elements.container.appendChild(this.elements.render);\n this.elements.container.appendChild(this.elements.control);\n this.elements.container.appendChild(this.elements.graphs);\n }", "GetComponentsAtPoint(x, y)\n\t{\n\t\treturn this.CanvasComponentCollection.GetComponentsAtPoint(x, y);\n\t}", "function createParallelCoordSys(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new parallel_Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = seriesModel.getReferringComponents('parallel', util_model[\"b\" /* SINGLE_REFERRING */]).models[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}", "function isAxisUsedInTheGrid(axisModel,gridModel,ecModel){return ecModel.getComponent('grid',axisModel.get('gridIndex')) === gridModel;}", "get Component() {\n return tesselComponentFactory.call(this);\n }", "function create(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = ecModel.queryComponents({\n mainType: 'parallel',\n index: seriesModel.get('parallelIndex'),\n id: seriesModel.get('parallelId')\n })[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}", "function create(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = ecModel.queryComponents({\n mainType: 'parallel',\n index: seriesModel.get('parallelIndex'),\n id: seriesModel.get('parallelId')\n })[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}", "function create(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = ecModel.queryComponents({\n mainType: 'parallel',\n index: seriesModel.get('parallelIndex'),\n id: seriesModel.get('parallelId')\n })[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}", "function create(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = ecModel.queryComponents({\n mainType: 'parallel',\n index: seriesModel.get('parallelIndex'),\n id: seriesModel.get('parallelId')\n })[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}", "function create(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = ecModel.queryComponents({\n mainType: 'parallel',\n index: seriesModel.get('parallelIndex'),\n id: seriesModel.get('parallelId')\n })[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}", "function create(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = ecModel.queryComponents({\n mainType: 'parallel',\n index: seriesModel.get('parallelIndex'),\n id: seriesModel.get('parallelId')\n })[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}", "getEl(event) {\n return this.facade(event).el();\n }", "getComponentPosition(){\n //get the actual Element\n let componentElement = this.$()[0];\n //low-level DOM api for-the-win\n let card = componentElement.getBoundingClientRect();\n //create a json object that accounts for scroll position\n let cp = {\n top: card.top + window.pageYOffset,\n left: card.left + window.pageXOffset,\n bottom: card.bottom + window.pageYOffset,\n right: card.right + window.pageXOffset,\n width: card.width,\n height: card.height\n };\n return cp;\n }", "function getComponentFromElement(element) {\n if (typeof element === 'string') {\n element = document.getElementById(element);\n\n if (!element) {\n return null;\n }\n }\n\n return element['__gia_component__'];\n}", "getComponent() {\n return this.querySelector(\"div\");\n }", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "function componentFactory(definition) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var _definition$defaultSe = definition.defaultSettings,\n defaultSettings = _definition$defaultSe === void 0 ? {} : _definition$defaultSe,\n _definition$_DO_NOT_U = definition._DO_NOT_USE_getInfo,\n _DO_NOT_USE_getInfo = _definition$_DO_NOT_U === void 0 ? function () {\n return {};\n } : _definition$_DO_NOT_U;\n\n var _chart = context.chart,\n container = context.container,\n _mediator = context.mediator,\n _registries = context.registries,\n theme = context.theme,\n renderer = context.renderer;\n var emitter = EventEmitter$1.mixin({});\n var config = context.settings || {};\n\n var _settings = extend(true, {}, defaultSettings, config);\n\n var _data = [];\n\n var _scale;\n\n var _formatter;\n\n var element;\n var size;\n\n var _style;\n\n var _resolver = settingsResolver({\n chart: _chart\n });\n\n var _isVisible = false;\n var brushArgs = {\n nodes: [],\n chart: _chart,\n config: _settings.brush || {},\n renderer: null\n };\n var brushTriggers = {\n tap: [],\n over: []\n };\n var brushStylers = [];\n var definitionContext = {};\n var instanceContext = extend({}, config); // Create a callback that calls lifecycle functions in the definition and config (if they exist).\n\n function createCallback(method) {\n var defaultMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n var canBeValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n return function cb() {\n var inDefinition = typeof definition[method] !== 'undefined';\n var inConfig = typeof config[method] !== 'undefined';\n var returnValue;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n if (inDefinition) {\n if (typeof definition[method] === 'function') {\n var _definition$method;\n\n returnValue = (_definition$method = definition[method]).call.apply(_definition$method, [definitionContext].concat(args));\n } else if (canBeValue) {\n returnValue = definition[method];\n }\n }\n\n if (inConfig) {\n if (typeof config[method] === 'function') {\n var _config$method;\n\n returnValue = (_config$method = config[method]).call.apply(_config$method, [instanceContext].concat(args));\n } else if (canBeValue) {\n returnValue = config[method];\n }\n }\n\n if (!inDefinition && !inConfig) {\n returnValue = defaultMethod.call.apply(defaultMethod, [definitionContext].concat(args));\n }\n\n return returnValue;\n };\n }\n\n var preferredSize = createCallback('preferredSize', function () {\n return 0;\n }, true);\n var resize = createCallback('resize', function (_ref2) {\n var inner = _ref2.inner;\n return inner;\n });\n var created = createCallback('created');\n var beforeMount = createCallback('beforeMount');\n var mounted = createCallback('mounted');\n var beforeUnmount = createCallback('beforeUnmount');\n var beforeUpdate = createCallback('beforeUpdate');\n var updated = createCallback('updated');\n var beforeRender = createCallback('beforeRender');\n var beforeDestroy = createCallback('beforeDestroy');\n var destroyed = createCallback('destroyed');\n var render = definition.render; // Do not allow overriding of this function\n\n var addBrushStylers = function addBrushStylers() {\n if (_settings.brush) {\n (_settings.brush.consume || []).forEach(function (b) {\n if (b.context && b.style) {\n brushStylers.push(styler(brushArgs, b));\n }\n });\n }\n };\n\n var addBrushTriggers = function addBrushTriggers() {\n if (_settings.brush) {\n (_settings.brush.trigger || []).forEach(function (t) {\n if (t.on === 'over') {\n brushTriggers.over.push(t);\n } else {\n brushTriggers.tap.push(t);\n }\n });\n }\n };\n\n Object.defineProperty(brushArgs, 'data', {\n get: function get() {\n return _data;\n }\n });\n var rendString = _settings.renderer || definition.renderer;\n var rend = rendString ? renderer || _registries.renderer(rendString)() : renderer || _registries.renderer()();\n brushArgs.renderer = rend;\n var dockConfigCallbackContext = {\n resources: _chart.logger ? {\n logger: _chart.logger()\n } : {}\n };\n\n var _dockConfig = dockConfig(createDockDefinition(_settings, preferredSize, _chart.logger()), dockConfigCallbackContext);\n\n var appendComponentMeta = function appendComponentMeta(node) {\n node.key = _settings.key;\n node.element = rend.element();\n };\n\n var fn = function fn() {};\n\n fn.dockConfig = function () {\n return _dockConfig;\n }; // Set new settings - will trigger mapping of data and creation of scale / formatter.\n\n\n fn.set = function () {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (opts.settings) {\n config = opts.settings;\n _settings = extend(true, {}, defaultSettings, opts.settings);\n _dockConfig = dockConfig(createDockDefinition(_settings, preferredSize, _chart.logger()), dockConfigCallbackContext);\n }\n\n if (_settings.scale) {\n _scale = _chart.scale(_settings.scale);\n }\n\n if (_settings.data) {\n _data = extract(_settings.data, {\n dataset: _chart.dataset,\n collection: _chart.dataCollection\n }, {\n logger: _chart.logger()\n }, _chart.dataCollection);\n } else if (_scale) {\n _data = _scale.data();\n } else {\n _data = [];\n }\n\n if (typeof _settings.formatter === 'string') {\n _formatter = _chart.formatter(_settings.formatter);\n } else if (_typeof(_settings.formatter) === 'object') {\n _formatter = _chart.formatter(_settings.formatter);\n } else if (_scale && _scale.data().fields) {\n _formatter = _scale.data().fields[0].formatter();\n }\n\n _style = theme.style(_settings.style || {});\n };\n\n fn.resize = function () {\n var inner = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var outer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var newSize = resize({\n inner: inner,\n outer: outer\n });\n\n if (newSize) {\n size = rend.size(newSize);\n } else {\n size = rend.size(inner);\n }\n\n instanceContext.rect = extend(true, {\n computedPhysical: size.computedPhysical,\n computedOuter: outer.computed || outer,\n computedInner: inner.computed || inner\n }, inner);\n size = extend(true, {\n computedOuter: outer.computed || outer,\n computedInner: inner.computed || inner\n }, size);\n };\n\n fn.getRect = function () {\n return instanceContext.rect;\n };\n\n var getRenderArgs = function getRenderArgs() {\n var renderArgs = rend.renderArgs ? rend.renderArgs.slice(0) : [];\n renderArgs.push({\n data: _data\n });\n return renderArgs;\n };\n\n fn.beforeMount = beforeMount;\n\n fn.beforeRender = function () {\n beforeRender({\n size: size\n });\n };\n\n var currentNodes;\n\n fn.render = function () {\n var nodes = brushArgs.nodes = render.call.apply(render, [definitionContext].concat(_toConsumableArray$1(getRenderArgs())));\n rend.render(nodes);\n currentNodes = nodes;\n };\n\n fn.hide = function () {\n fn.unmount();\n rend.size({\n x: 0,\n y: 0,\n width: 0,\n height: 0\n });\n rend.clear();\n };\n\n fn.beforeUpdate = function () {\n beforeUpdate({\n settings: _settings,\n data: _data\n });\n };\n\n var currentTween;\n\n fn.update = function () {\n if (currentTween) {\n currentTween.stop();\n }\n\n var nodes = brushArgs.nodes = render.call.apply(render, [definitionContext].concat(_toConsumableArray$1(getRenderArgs()))); // Reset brush stylers and triggers\n\n brushStylers.forEach(function (b) {\n return b.cleanUp();\n });\n brushStylers.length = 0;\n brushTriggers.tap = [];\n brushTriggers.over = [];\n\n if (_settings.brush) {\n addBrushStylers();\n addBrushTriggers();\n }\n\n brushStylers.forEach(function (bs) {\n if (bs.isActive()) {\n bs.update();\n }\n });\n\n if (currentNodes && _settings.animations && _settings.animations.enabled) {\n currentTween = tween({\n old: currentNodes,\n current: nodes\n }, {\n renderer: rend\n }, _settings.animations);\n currentTween.start();\n } else {\n rend.render(nodes);\n }\n\n currentNodes = nodes;\n\n if (rend.setKey && typeof config.key === 'string') {\n rend.setKey(config.key);\n }\n };\n\n fn.updated = updated;\n\n fn.destroy = function () {\n fn.unmount();\n beforeDestroy(element);\n rend.destroy();\n destroyed();\n element = null;\n };\n /**\n * Update active nodes. For now this can be used as a way update and apply brushing on nodes.\n * Ex: if a component have changed the nodes since its initial render.\n * @param {Nodes[]} nodes\n * @deprecated\n * @ignore\n */\n\n\n var updateNodes = function updateNodes(nodes) {\n brushArgs.nodes = nodes;\n brushStylers.forEach(function (bs) {\n if (bs.isActive()) {\n bs.update();\n }\n });\n rend.render(nodes);\n }; // Set contexts, note that the definition and instance need different contexts (for example if they have different 'require' props)\n\n\n prepareContext(definitionContext, definition, {\n settings: function settings() {\n return _settings;\n },\n data: function data() {\n return _data;\n },\n scale: function scale() {\n return _scale;\n },\n formatter: function formatter() {\n return _formatter;\n },\n renderer: function renderer() {\n return rend;\n },\n chart: function chart() {\n return _chart;\n },\n dockConfig: function dockConfig() {\n return _dockConfig;\n },\n mediator: function mediator() {\n return _mediator;\n },\n instance: function instance() {\n return instanceContext;\n },\n rect: function rect() {\n return instanceContext.rect;\n },\n style: function style() {\n return _style;\n },\n update: function update() {\n return updateNodes;\n },\n registries: function registries() {\n return _registries;\n },\n resolver: function resolver() {\n return _resolver;\n },\n symbol: function symbol() {\n return create$3;\n }\n });\n prepareContext(instanceContext, config, {\n settings: function settings() {\n return _settings;\n },\n data: function data() {\n return _data;\n },\n scale: function scale() {\n return _scale;\n },\n formatter: function formatter() {\n return _formatter;\n },\n renderer: function renderer() {\n return rend;\n },\n chart: function chart() {\n return _chart;\n },\n dockConfig: function dockConfig() {\n return _dockConfig;\n },\n mediator: function mediator() {\n return _mediator;\n },\n style: function style() {\n return _style;\n },\n _DO_NOT_USE_getInfo: _DO_NOT_USE_getInfo.bind(definitionContext),\n isVisible: function isVisible() {\n return _isVisible;\n }\n });\n\n fn.getBrushedShapes = function getBrushedShapes(brushCtx, mode, props) {\n var shapes = [];\n\n if (_settings.brush && _settings.brush.consume) {\n var brusher = _chart.brush(brushCtx);\n\n var sceneNodes = rend.findShapes('*');\n\n _settings.brush.consume.filter(function (t) {\n return t.context === brushCtx;\n }).forEach(function (consume) {\n for (var i = 0; i < sceneNodes.length; i++) {\n var node = sceneNodes[i];\n\n if (node.data && brusher.containsMappedData(node.data, props || consume.data, mode)) {\n appendComponentMeta(node);\n shapes.push(node);\n sceneNodes.splice(i, 1);\n i--;\n }\n }\n });\n }\n\n return shapes;\n };\n\n fn.findShapes = function (selector) {\n var shapes = rend.findShapes(selector);\n\n for (var i = 0, num = shapes.length; i < num; i++) {\n appendComponentMeta(shapes[i]);\n }\n\n return shapes;\n };\n\n fn.shapesAt = function (shape) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var items = rend.itemsAt(shape);\n var shapes;\n\n if (opts && opts.propagation === 'stop' && items.length > 0) {\n shapes = [items.pop().node];\n } else {\n shapes = items.map(function (i) {\n return i.node;\n });\n }\n\n for (var i = 0, num = shapes.length; i < num; i++) {\n appendComponentMeta(shapes[i]);\n }\n\n return shapes;\n };\n\n fn.brushFromShapes = function (shapes) {\n var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n trigger.contexts = Array.isArray(trigger.contexts) ? trigger.contexts : [];\n var action = trigger.action || 'toggle';\n brushFromSceneNodes({\n nodes: shapes,\n action: action,\n trigger: trigger,\n chart: _chart,\n data: brushArgs.data\n });\n };\n\n fn.mount = function () {\n element = rend.element && rend.element() ? element : rend.appendTo(container);\n\n if (rend.setKey && typeof config.key === 'string') {\n rend.setKey(config.key);\n }\n\n if (_settings.brush) {\n addBrushStylers();\n addBrushTriggers();\n }\n\n setUpEmitter(instanceContext, emitter, config);\n setUpEmitter(definitionContext, emitter, definition);\n _isVisible = true;\n };\n\n fn.mounted = function () {\n return mounted(element);\n };\n\n fn.unmount = function () {\n [instanceContext, definitionContext].forEach(function (ctx) {\n tearDownEmitter(ctx, emitter);\n });\n brushTriggers.tap = [];\n brushTriggers.over = [];\n brushStylers.forEach(function (bs) {\n bs.cleanUp();\n });\n brushStylers.length = 0;\n beforeUnmount();\n _isVisible = false;\n };\n\n fn.onBrushTap = function (e) {\n brushTriggers.tap.forEach(function (t) {\n if (resolveTapEvent({\n e: e,\n t: t,\n config: brushArgs\n }) && t.globalPropagation === 'stop') {\n _chart.toggleBrushing(true);\n }\n });\n };\n\n fn.onBrushOver = function (e) {\n brushTriggers.over.forEach(function (t) {\n if (resolveOverEvent({\n e: e,\n t: t,\n config: brushArgs\n }) && t.globalPropagation === 'stop') {\n _chart.toggleBrushing(true);\n }\n });\n };\n /**\n * Expose definition on instance\n * @private\n * @experimental\n */\n\n\n fn.def = definitionContext;\n /**\n * Expose instanceCtx on \"instance\"\n * @private\n * @experimental\n */\n\n fn.ctx = instanceContext;\n\n fn.renderer = function () {\n return rend;\n };\n\n fn.set({\n settings: config\n });\n created();\n return fn;\n}", "render2D(params, key) {\n throw new Error(\"User needs to provide method for component definition, look at examples\");\n }", "CreateElementContainer(area, title, coordinates) {\n const ranvierCoordinates = this.TranslateReactGridToRanvierCoordinates(coordinates)\n return (\n <div className={this.state.selectedRoom == title ? 'room Selected' : 'room'}\n id={title}\n coordinate_values={coordinates}\n key={area + title}\n onClick={this.HandleClickRoomNode}\n data-grid={{ x: coordinates.x, y: coordinates.y, w: 1, h: this.state.nodeHeight }}\n >\n <RIEInput\n value={title}\n propName={title}\n change={this.HandleChangeRoomNameEvent}\n />\n <br /> ({ranvierCoordinates.x},{ranvierCoordinates.y},{ranvierCoordinates.z})\n </div>\n )\n }", "constructor() {\n // Always call super first in constructor\n // https://github.com/mdn/web-components-examples/blob/master/life-cycle-callbacks/main.js\n super()\n\n /**\n * Element functionality written in here\n */\n this._hass = null\n this._config = null\n this.attachShadow({ mode: \"open\" })\n\n /**\n * card settings\n */\n this.card_icon = null\n this.card_title = null\n this.card_height = 240\n\n /**\n * all for chart\n */\n this.theme = \"\"\n this.themeSettings = null\n this.graphChart = null\n this.chart_type = \"bar\"\n this.chart_locale = \"de-DE\"\n this.chart_update = false\n this.ctx = null\n this.chartconfig = null\n this.graphData = {}\n\n /**\n * data providers\n */\n this.hassEntities = [] // all from hass\n this.entity_items = new Entities(null, false) // all entity data\n this.entity_options = null // all entity options\n\n /**\n * data service\n */\n this.updateTimer = -1\n this.update_interval = 60 * 1000\n this.skipRender = false\n this.lastUpdate = null\n this.ready = false\n this.updating = false\n this._initialized = false\n this.initial = true\n\n /**\n * all for the dataprovider\n */\n this.dataInfo = {\n time_start: new Date(),\n ISO_time_start: new Date().toISOString(),\n time_end: new Date(),\n ISO_time_end: new Date().toISOString(),\n entity_items: null,\n entities: \"\",\n useAlias: false,\n time: new Date().getTime(),\n loading: false,\n url: \"\",\n prev_url: \"not_set\",\n param: \"\",\n options: \"\"\n }\n\n /**\n * internal debugger and profiler\n */\n this.DEBUGMODE = 0\n this.DEBUGDATA = {\n API: {}\n }\n this.APISTART = performance.now()\n this.DEBUGDATA.API.elapsed_total = 0\n this.DEBUGDATA.PROFILER = {}\n }", "constructor() {\n // Always call super first in constructor\n // https://github.com/mdn/web-components-examples/blob/master/life-cycle-callbacks/main.js\n super()\n\n /**\n * Element functionality written in here\n */\n this._hass = null\n this._config = null\n this.attachShadow({ mode: \"open\" })\n\n /**\n * card settings\n */\n this.card_icon = null\n this.card_title = null\n this.card_height = 240\n\n /**\n * all for chart\n */\n this.theme = \"\"\n this.themeSettings = null\n this.graphChart = null\n this.chart_type = \"bar\"\n this.chart_locale = \"de-DE\"\n this.chart_update = false\n this.ctx = null\n this.chartconfig = null\n this.graphData = {}\n\n /**\n * data providers\n */\n this.hassEntities = [] // all from hass\n this.entity_items = new Entities(null, false) // all entity data\n this.entity_options = null // all entity options\n\n /**\n * data service\n */\n this.updateTimer = -1\n this.update_interval = 60 * 1000\n this.skipRender = false\n this.lastUpdate = null\n this.ready = false\n this.updating = false\n this._initialized = false\n this.initial = true\n\n /**\n * all for the dataprovider\n */\n this.dataInfo = {\n time_start: new Date(),\n ISO_time_start: new Date().toISOString(),\n time_end: new Date(),\n ISO_time_end: new Date().toISOString(),\n entity_items: null,\n entities: \"\",\n useAlias: false,\n time: new Date().getTime(),\n loading: false,\n url: \"\",\n prev_url: \"not_set\",\n param: \"\",\n options: \"\"\n }\n\n /**\n * internal debugger and profiler\n */\n this.DEBUGMODE = 0\n this.DEBUGDATA = {\n API: {}\n }\n this.APISTART = performance.now()\n this.DEBUGDATA.API.elapsed_total = 0\n this.DEBUGDATA.PROFILER = {}\n }", "pieTemplate() {\n const pieData = [\n { x: 'TypeScript', y: 13, text: 'TS 13%' },\n { x: 'React', y: 12.5, text: 'Reat 12.5%' },\n { x: 'MVC', y: 12, text: 'MVC 12%' },\n { x: 'Core', y: 12.5, text: 'Core 12.5%' },\n { x: 'Vue', y: 10, text: 'Vue 10%' },\n { x: 'Angular', y: 40, text: 'Angular 40%' }\n ];\n return (<div className=\"template\">\n <AccumulationChartComponent style={{ \"height\": \"162px\" }} tooltip={{ enable: true }}>\n <Inject services={[AccumulationTooltip]}/>\n <AccumulationSeriesCollectionDirective>\n <AccumulationSeriesDirective dataSource={pieData} xName='x' yName='y' innerRadius=\"40%\"/>\n </AccumulationSeriesCollectionDirective>\n </AccumulationChartComponent>\n </div>);\n }", "initializeComponents() {\n // Initialize Info Panel\n this.infoComponent = new InfoPanel(\"info-panel-placeholder\");\n\n // Initialize Map\n this.mapComponent = new Map(\"map-placeholder\");\n\n //Initialize city dropdown\n this.dropdown = new DropDown(\"dropdown-panel-placeholder\", {\n data: { apiService: this.api },\n events: {\n resultSelected: event => {\n this.layerPanel.resetLayerSelections();\n this.mapComponent.panToLocation();\n }\n }\n });\n\n // Initialize Layer Toggle Panel\n this.layerPanel = new LayerPanel(\"layer-panel-placeholder\", {\n data: { layer: [...this.locationPointTypes] },\n events: {\n layerToggle:\n // Toggle layer in map controller on \"layerToggle\" event\n event => {\n this.mapComponent.toggleLayer(event.detail);\n }\n }\n });\n }", "function Component() {\n return this; // this is needed in Edge !!!\n } // Component is lazily setup because it needs", "function _getComponentElementByNode(node, mtAccessCompositeInternals) {\n if (node == null) {\n return null;\n } // node can be a Node or Element but we call some Element only APIs\n // so we need to do an additional isElement check first\n\n\n var isElement = node.nodeType === 1; // for upstream or indirect dependency we will still rely components being registered on the oj namespace.\n\n var containingComposite = oj.Composite && !mtAccessCompositeInternals ? oj.Composite.getContainingComposite(node) : null;\n\n if (containingComposite) {\n // node is in or is a composite, return composite\n return containingComposite;\n } else if (isElement && node.hasAttribute('data-oj-internal')) {\n // node is an internal component\n if (node.parentNode instanceof Element && node.parentNode.hasAttribute('data-oj-surrogate-id')) {\n // internal component is a popup\n // eslint-disable-next-line no-param-reassign\n node = document.querySelector('[data-oj-popup-' + node.id + '-parent]'); // retrieves popups parent element\n\n return _getComponentElementByNode(node, mtAccessCompositeInternals);\n }\n\n return _getComponentElementByNode(node.parentNode, mtAccessCompositeInternals);\n } else if (_isComponentElement(node)) {\n // node is a component element\n return node;\n } else if (isElement && node.classList.contains('oj-component')) {\n // node is component wrapper\n // eslint-disable-next-line no-param-reassign\n node = node.querySelector('.oj-component-initnode:not([data-oj-internal])') || node;\n\n if (_isJQueryUI(node)) {\n return node;\n }\n } else if (isElement && node.hasAttribute('data-oj-containerid')) {\n // node is non-internal component popup e.g listbox\n // eslint-disable-next-line no-param-reassign\n node = document.getElementById(node.getAttribute('data-oj-containerid'));\n return _getComponentElementByNode(node, mtAccessCompositeInternals);\n }\n\n return _getComponentElementByNode(node.parentNode, mtAccessCompositeInternals);\n}", "renderComponents() {\n this.algedonodeActivators.forEach(aa => {\n aa.render(this.renderer)\n })\n this.dials.forEach(d => {\n d.render(this.renderer)\n })\n this.strips.forEach(s => {\n s.render(this.renderer)\n })\n this.rows.forEach(r => {\n r.forEach(c => {\n c.render(this.renderer)\n })\n })\n this.lights.forEach(lightPair => {\n lightPair.forEach(light => light.render(this.renderer))\n })\n }", "function zenbuHeatmapElement_elementEvent(mode, value, value2) {\n var datasourceElement = this.datasource();\n}", "GetSubIdForDomElement(displayable) {\n var axisSubId = null;\n if (displayable.isDescendantOf(this._xAxis)) {\n axisSubId = this._xAxisAutomation.GetSubIdForDomElement(displayable);\n return axisSubId ? this._convertAxisSubIdToChartSubId(axisSubId, 'xAxis') : null;\n } else if (displayable.isDescendantOf(this._yAxis)) {\n axisSubId = this._yAxisAutomation.GetSubIdForDomElement(displayable);\n return axisSubId ? this._convertAxisSubIdToChartSubId(axisSubId, 'yAxis') : null;\n } else if (displayable.isDescendantOf(this._y2Axis)) {\n axisSubId = this._y2AxisAutomation.GetSubIdForDomElement(displayable);\n return axisSubId ? this._convertAxisSubIdToChartSubId(axisSubId, 'y2Axis') : null;\n } else if (displayable.isDescendantOf(this._legend)) {\n var legendSubId = this._legendAutomation.GetSubIdForDomElement(displayable);\n return legendSubId ? this._convertLegendSubIdToChartSubId(legendSubId) : null;\n } else {\n var logicalObj = this._comp.getEventManager().GetLogicalObject(displayable);\n if (!logicalObj) return null;\n\n if (logicalObj instanceof dvt.SimpleObjPeer) {\n var type = logicalObj.getParams()['type'];\n if (type == 'pieCenterLabel') return 'pieCenterLabel';\n else if (type == 'plotArea') return 'plotArea';\n }\n\n if (logicalObj instanceof DvtChartPieSlice)\n // pie chart data items do not use ChartObjPeer and return only dataItem[seriesIndex]\n return 'dataItem[' + logicalObj.getSeriesIndex() + ']';\n\n if (logicalObj instanceof DvtChartObjPeer) {\n // Chart data items\n var seriesIndex = logicalObj.getSeriesIndex();\n var itemIndex = logicalObj.getGroupIndex(); // corresponds to data items position in its series array\n\n if (\n seriesIndex != null &&\n itemIndex >= 0 &&\n (this._options['type'] != 'funnel' || this._options['type'] != 'pyramid')\n )\n return 'dataItem[' + seriesIndex + '][' + itemIndex + ']';\n else if (\n seriesIndex != null &&\n itemIndex == DvtChartFunnelRenderer._GROUP_IDX &&\n (this._options['type'] == 'funnel' || this._options['type'] == 'pyramid')\n )\n return 'dataItem[' + seriesIndex + ']';\n // funnel or pyramid chart only returns dataItem[seriesIndex]\n else if (seriesIndex != null && (itemIndex == null || itemIndex < 0))\n // displayable represents a seriesItem e.g. line, area\n return 'series[' + seriesIndex + ']';\n } else if (logicalObj instanceof DvtChartRefObjPeer) {\n // reference objects\n var axisType = logicalObj.getAxisType();\n var refObjIndex = logicalObj.getIndex();\n return axisType && refObjIndex >= 0\n ? axisType + ':referenceObject[' + refObjIndex + ']'\n : null;\n }\n }\n return null;\n }", "pieTemplate1() {\n const pieData = [\n { 'x': 'Chrome', y: 37, text: '37%' },\n { 'x': 'UC Browser', y: 17, text: '17%' },\n { 'x': 'iPhone', y: 19, text: '19%' },\n { 'x': 'Others', y: 4, text: '4%' },\n { 'x': 'Opera', y: 11, text: '11%' },\n { 'x': 'Android', y: 12, text: '12%' }\n ];\n const dataLabel = { visible: true, position: 'Inside', name: 'text', font: { fontWeight: '600' } };\n const enableAnimation = false;\n return (<div className=\"template\">\n <AccumulationChartComponent style={{ \"height\": \"162px\" }} enableAnimation={enableAnimation} legendSettings={{ visible: false }} tooltip={{ enable: true, format: `${10} : <b>${10}%</b>` }}>\n <Inject services={[AccumulationTooltip]}/>\n <AccumulationSeriesCollectionDirective>\n <AccumulationSeriesDirective dataSource={pieData} dataLabel={dataLabel} xName='x' yName='y' radius=\"70%\" name='Browser'/>\n </AccumulationSeriesCollectionDirective>\n </AccumulationChartComponent>\n </div>);\n }", "_showChart() {\n if (this.isDestroyed || this.isDestroying) {\n return;\n }\n\n // destroy existing chart if any\n this._destroyChart();\n\n // create and show the chart\n try {\n // get chart constructor options from properties and create the chart\n // TODO: tooltip as property\n const supportedProps = ['type', 'datasets', 'series', 'overrides', 'legend', 'style'];\n const props = this.getProperties(supportedProps);\n const definition = this.getWithDefault('definition', {});\n\n // Iterate over properties\n for (let prop in props) {\n // if the value contained in the prop is not undefined\n if (props.hasOwnProperty(prop) && props[prop] !== undefined) {\n // override the definition val with the prop val\n definition[prop] = props[prop];\n }\n }\n if (Object.keys(definition).length === 0) {\n // no properties have been set\n return;\n }\n\n // create the chart and attach it to the dom\n this.chart = new Chart(this.elementId, definition);\n\n // TODO: events aren't supported yet\n // wire up event handlers\n // const supportedEvents = ['Click', 'Mouseover', 'Mouseout', 'Mousemove', 'UpdateStart', 'UpdateEnd'];\n // supportedEvents.forEach(eventName => {\n // const attrName = `on${eventName}`;\n // if (typeof this[attrName] === 'function') {\n // const cedarEventName = eventName.toLowerCase().replace('update', 'update-');\n // this.chart.on(cedarEventName, this[attrName]);\n // }\n // });\n\n // TODO: show options aren't supported yet (are they even needed?)\n // get render options from properties but use elementId from component\n // const options = this.get('options') || {};\n // options.elementId = '#' + this.elementId;\n\n // autolabels will throw an error on pie charts\n // see https://github.com/Esri/cedar/issues/173\n // if (this.chart.type === 'pie') {\n // options.autolabels = false;\n // }\n } catch (err) {\n // an error occurred while creating the cart\n this._handleErr(err);\n return;\n }\n\n // ensure cedar dependencies are loaded before rendering the chart\n this.get('cedarLoader').loadDependencies().then(() => {\n if (this.get('isDestroyed') || this.get('isDestroying')) {\n return;\n }\n // call update start action (if any)\n const onUpdateStart = this.onUpdateStart;\n if (typeof onUpdateStart === 'function') {\n this.onUpdateStart()\n }\n // query the data and show the chart\n const timeout = this.get('timeout');\n let queryPromise;\n if (timeout) {\n // reject if the query results don't return before the timeout\n const timeoutPromise = rejectAfter(timeout, this.get('timeoutErrorMessage'));\n queryPromise = Promise.race([timeoutPromise, this.chart.query()]);\n } else {\n queryPromise = this.chart.query();\n }\n return queryPromise.then(response => {\n if (this.get('isDestroyed') || this.get('isDestroying')) {\n return;\n }\n const transform = this.get('transform');\n if (typeof transform === 'function') {\n // call transform closure action on each response\n for (const datasetName in response) {\n if (response.hasOwnProperty(datasetName)) {\n const dataset = this.chart.dataset(datasetName);\n response[datasetName] = transform(response[datasetName], dataset);\n }\n }\n }\n // render the chart\n this.chart.updateData(response).render();\n // call update end action (if any)\n const onUpdateEnd = this.onUpdateEnd;\n if (typeof onUpdateEnd === 'function') {\n onUpdateEnd(this.chart);\n }\n });\n }).catch(err => {\n // an error occurred while loading dependencies\n // or fetching, transforming or rendering data\n this._handleErr(err);\n });\n }", "constructor(cells, components, events) {\n this.cells = cells;\n this.components = components;\n this.events = events;\n }", "getCoordinate(record, element, coord) {\n throw new Error('Implement in subclass');\n }", "getCoordinate(record, element, coord) {\n throw new Error('Implement in subclass');\n }", "FindComponentById(id)\n\t{\n\t\treturn this.CanvasComponentCollection.FindComponentById(id);\n\t}", "renderComps(){\n console.log('renderComps');\n\n const xparse = new DOMParser;\n const xdoc = xparse.parseFromString(this.props.thisVert.outerHTML, 'application/xml');\n const vertical = xdoc.querySelectorAll('vertical');\n // console.log('This vertical:');\n // console.log(vertical);\n const vert1 = vertical[0];\n\n // For each edX component, create a div\n const comps = Array.from(vert1.children).map(function(c, index){\n const keyid = $(c).data('key');\n return <Comp key={keyid} id={keyid} thisComp={c} />\n });\n // console.log('components:');\n // console.log(comps);\n const adderID = makeRandomID();\n const compAdder = this.props.compAdder;\n return (\n <React.Fragment>\n {comps}\n <CompAdder\n key={adderID}\n id={adderID}\n onClick={compAdder}\n />\n </React.Fragment>\n )\n }", "chartProperty(data, ev) {\n let reportComponents = null;\n let getProperty = [];\n let value = ev.target.value;\n let name = ev.target.name;\n let className = ev.target.className;\n\n if (className === 'gridLine') {\n let configName = ev.target.offsetParent.previousSibling.className;\n\n this.chartLegendPosition(configName, getProperty, value);\n }\n else if (name === 'dataFormat') {\n getProperty = (className === 'crosstabMode' ?\n [{name: 'seriesInRows', value: false}, {name: 'crosstabMode', value: true}] :\n [{name: 'seriesInRows', value: true}, {name: 'crosstabMode', value: false}]);\n }\n else {\n let param = (name === 'titleContent' ? {name: 'name', value: value} :\n {name: name, value: value});\n\n getProperty.push(param);\n }\n data.map(d=>{\n d.canvas ? (d.canvas.className === ev.target.offsetParent.previousSibling.className ?\n reportComponents = d : null) : null;\n });\n for (let x = 0; x < getProperty.length; x++) {\n reportComponents.components.properties.map(i=>{\n if (i.name === getProperty[x].name) {\n i.value = getProperty[x].value;\n reportComponents.chartData[getProperty[x].name] =\n (value === 'false' || value === 'true') ?\n JSON.parse(getProperty[x].value) : getProperty[x].value;\n }\n });\n }\n this.props.saveData(data);\n let obj = {\n option: reportComponents.type,\n node: [reportComponents.canvas],\n chartData: reportComponents.chartData\n };\n\n ChartComponent(obj);\n }", "get chartElement() { return this._chartElement; }", "getComponents(): Array<ComponentClass> {\n let foundComponents: Array<ComponentClass> = [];\n for (const type: Class<ComponentClass> of this.constructor.componentTypes) {\n for (const comp: ComponentClass of this.manager.componentInstances) {\n if (comp instanceof type) {\n foundComponents.push(comp);\n }\n }\n }\n return foundComponents;\n }\n init() {}\n draw(timeSinceLastUpdate: number) {} // eslint-disable-line\n update() {}\n}", "function calElementPos(){\n\t\tcalSize();\n\t\tcalPie();\n\t\tcalGraph();\n\t}", "constructor() {\n // Always call super first in constructor\n // https://github.com/mdn/web-components-examples/blob/master/life-cycle-callbacks/main.js\n super()\n\n // Element functionality written in here\n this._hass = null\n this._config = null\n\n this.attachShadow({ mode: \"open\" })\n\n // card settings\n this.card_icon = null\n this.card_title = null\n this.card_height = 240\n\n // all for chart\n this.theme = \"\"\n this.themeSettings = null\n this.graphChart = null\n this.chart_type = \"bar\"\n this.chart_locale = \"de-DE\"\n this.chart_update = false\n this.ctx = null\n this.chartconfig = null\n this.graphData = {}\n\n // data providers\n this.hassEntities = []\n this.entities = []\n this.entityOptions = null\n this.entity_ids = []\n this.entityData = []\n this.entityNames = []\n\n // data service\n this.data_hoursToShow = 0\n this.data_group_by = \"day\"\n this.data_aggregate = \"last\"\n this.updateTimer = -1\n this.update_interval = 60 * 1000\n this.data_ignoreZero = false\n this.data_units = \"\"\n this.skipRender = false\n this.lastUpdate = null\n this.ready = false\n this.updating = false\n this.loginfo_enabled = true\n this._initialized = false\n this.initial = true\n this.dataInfo = {\n starttime: new Date(),\n endtime: new Date(),\n entities: \"\",\n time: new Date().getTime(),\n loading: false,\n url: \"\",\n param: \"\"\n }\n }", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "getComponent(name){\n\t\t\tfor (var i = 0; i < this[componentSymbol].length; i++) {\n\t\t\t\tif (this[componentSymbol][i].name === name){\n\t\t\t\t\treturn this[componentSymbol][i].component;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function getComponent(node) {\n return node.__c;\n}", "function initialize() {\r\n if (TypeUtils.isEmptyObject(config))\r\n Functions.error('Container configuration missing');\r\n\r\n initializedModules = 0;\r\n\r\n initAxis('xAxis');\r\n initAxis('yAxis');\r\n initAxis('zAxis');\r\n initAxis('background');\r\n\r\n var plotConfig = config.modules.plot;\r\n if (!plotConfig)\r\n return;\r\n var plot = modules.plot = ignite(plotConfig.id, ctx, \"plot\");\r\n var dataHandler = new SingleChartDataHandler(data);\r\n plot.data(dataHandler.getDataAdapter());\r\n\r\n var props;\r\n if (plotConfig.configure) {\r\n props = resolveProperties(plotConfig.configure);\r\n plot.properties(props);\r\n }\r\n\r\n if (plot.dispatch) {\r\n var dis = plot.dispatch();\r\n if (dis.initialized) {\r\n initializedModules++;\r\n dis.on('initialized.xycontainer', initialized);\r\n }\r\n ;\r\n if (dis.showTooltip)\r\n dis.on('showTooltip.xycontainer', showTooltip);\r\n if (dis.hideTooltip)\r\n dis.on('hideTooltip.xycontainer', hideTooltip);\r\n }\r\n\r\n var dataLabelConfig = config.modules.dataLabel;\r\n if (TypeUtils.isExist(dataLabelConfig)\r\n && TypeUtils.isExist(plot.dataLabel)) {\r\n var dataLabel = modules.dataLabel = ignite(dataLabelConfig.id, ctx);\r\n plot.dataLabel(dataLabel);\r\n dataLabel.plot(plot);\r\n if (dataLabelConfig.configure) {\r\n props = resolveProperties(dataLabelConfig.configure);\r\n dataLabel.properties(props);\r\n }\r\n }\r\n\r\n if (modules.xAxis && !selections.xAxis)\r\n selections.xAxis = parent.append('g').attr('class', 'v-m-xAxis');\r\n if (modules.yAxis && !selections.yAxis)\r\n selections.yAxis = parent.append('g').attr('class', 'v-m-yAxis');\r\n if (modules.zAxis && !selections.zAxis)\r\n selections.zAxis = parent.append('g').attr('class', 'v-m-zAxis');\r\n if (modules.plot && !selections.plot)\r\n selections.plot = parent.append('g').attr('class', 'v-m-plot');\r\n if (modules.background && !selections.background)\r\n selections.background = parent.insert('g', ':first-child').attr(\r\n 'class', 'background');\r\n }", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}", "function addComponentConnectorElement(button, type) {\n const id = parseInt($(button).parents(\"tr\").find(\"td:nth-child(1)\").text());\n console.log(id);\n\n const name = $(button).parents(\"tr\").find(\"td:nth-child(2)\").text();\n console.log(name);\n\n const element = {\n id: id,\n name: name\n }\n\n if (type === \"component\") {\n const foundIndex = window.Diagrammer.architectureElements.components.findIndex(x => x.id === id);\n if (foundIndex < 0) {\n const fabricObj = addComponentToCanvas(element);\n element.fabricObj = fabricObj;\n window.Diagrammer.architectureElements.components.push(element);\n } else {\n window.Diagrammer.architectureElements.components[foundIndex].fabricObj.item(1).set({ text: name });\n window.Diagrammer.architectureElements.components[foundIndex].name = name;\n window.Diagrammer.stage.renderAll();\n }\n } else if (type === \"connector\") {\n const foundIndex = window.Diagrammer.architectureElements.connectors.findIndex(x => x.id === id);\n if (foundIndex < 0) {\n const fabricObj = addConnectorToCanvas(element);\n element.fabricObj = fabricObj;\n window.Diagrammer.architectureElements.connectors.push(element);\n } else {\n window.Diagrammer.architectureElements.connectors[foundIndex].fabricObj.item(1).set({ text: name });\n window.Diagrammer.architectureElements.connectors[foundIndex].name = name;\n window.Diagrammer.stage.renderAll();\n\n }\n }\n console.log(window.Diagrammer.architectureElements);\n\n}", "function initialize() {\n if ( TypeUtils.isEmptyObject(config) ) Functions.error('Container configuration missing');\n \n initializedModules = 0;\n \n initAxis('xAxis');\n initAxis('yAxis');\n initAxis('xAxis2');\n initAxis('yAxis2');\n initAxis('background');\n \n var plotConfig = config.modules.plot;\n if ( !plotConfig ) return;\n var plot = modules.plot = load(plotConfig.id);\n var dataHandler = new SingleChartDataHandler(data); \n plot.data(dataHandler.getDataAdapter());\n \n var props;\n if ( plotConfig.configure ) {\n props = resolveProperties(plotConfig.configure);\n plot.properties(props);\n }\n \n if(plot.dispatch){\n var dis = plot.dispatch();\n if(dis.initialized) { initializedModules++; dis.on('initialized.xycontainer', initialized);};\n if(dis.showTooltip) dis.on('showTooltip.xycontainer', showTooltip);\n if(dis.hideTooltip) dis.on('hideTooltip.xycontainer', hideTooltip);\n }\n \n var dataLabelConfig = config.modules.dataLabel;\n if(TypeUtils.isExist(dataLabelConfig) && TypeUtils.isExist(plot.dataLabel)){\n var dataLabel = modules.dataLabel = load(dataLabelConfig.id);\n plot.dataLabel(dataLabel);\n dataLabel.plot(plot);\n if ( dataLabelConfig.configure ) {\n props = resolveProperties(dataLabelConfig.configure);\n dataLabel.properties(props);\n }\n }\n \n if ( modules.xAxis && !selections.xAxis )\n selections.xAxis = parent.append('g').attr('class', 'xAxis');\n if ( modules.xAxis2 && !selections.xAxis2 )\n selections.xAxis2 = parent.append('g').attr('class', 'xAxis2');\n if ( modules.yAxis && !selections.yAxis ) \n selections.yAxis = parent.append('g').attr('class', 'yAxis');\n if ( modules.yAxis2 && !selections.yAxis2 ) \n selections.yAxis2 = parent.append('g').attr('class', 'yAxis2');\n if ( modules.plot && !selections.plot ) \n selections.plot = parent.append('g').attr('class', 'plot');\n if ( modules.background && !selections.background ) \n selections.background = parent.insert('g', ':first-child').attr('class', 'background'); \n }", "getComponent (name) {\n let component = this.component\n\n if (component) {\n if (typeof component === 'function') {\n this.component = component = component.call(this)\n }\n \n const res = component[name]\n\n if (res) {\n if (res.async === true) {\n const factory = res.factory\n if (!factory.loading && !factory.error) {\n return factory.resolved || null\n }\n } else {\n return res\n }\n }\n }\n return null\n }", "addComponent(components) {\n if (components == null || components == undefined) return;\n for (let i = 0; i < components.length; i++) {\n for (let j = 0; j < components[i].length; j++) {\n if (components[i][0].designation == \"Shelf\") this.generateShelf(components[i][0].slot);\n if (components[i][0].designation == \"Pole\") this.generatePole(components[i][0].slot);\n if (components[i][0].designation == \"Drawer\") this.generateDrawer(components[i][0].slot);\n if (components[i][0].designation == \"Hinged Door\") this.generateHingedDoor(components[i][0].slot);\n if (components[i][0].designation == \"Sliding Door\") this.generateSlidingDoor();\n }\n }\n }", "resolveRowRecord(elementOrEvent, xy) {\n const me = this,\n {\n scheduler\n } = me,\n event = elementOrEvent instanceof Event ? elementOrEvent : null,\n element = event ? event.target : elementOrEvent,\n coords = event ? [event.offsetX, event.offsetY] : xy,\n // Fix for FF on Linux having text nodes as event.target\n el = element.nodeType === 3 ? element.parentElement : element,\n eventElement = DomHelper.up(el, scheduler.eventSelector);\n\n if (eventElement) {\n return scheduler.resourceStore.getById(eventElement.dataset.resourceId);\n } // Need to be inside schedule at least\n\n if (!DomHelper.up(element, '.b-sch-timeaxis-cell')) {\n return null;\n }\n\n if (!coords) {\n throw new Error(`Vertical mode needs coordinates to resolve this element. Can also be called with a browser\n event instead of element to extract element and coordinates from`);\n }\n\n const index = Math.floor(coords[0] / me.resourceColumns.columnWidth);\n return scheduler.resourceStore.getAt(index);\n }", "function renderGraphics(coords) {\n // Get the selected RGB combo vis params.\n var visParams = RGB_PARAMS[rgbSelect.getValue()];\n \n // Get the clicked point and buffer it.\n var point = ee.Geometry.Point(coords);\n var aoiCircle = point.buffer(45);\n var aoiBox = point.buffer(regionWidthSlider.getValue()*1000/2);\n \n // Clear previous point from the Map.\n map.layers().forEach(function(el) {\n map.layers().remove(el);\n });\n\n // Add new point to the Map.\n map.addLayer(aoiCircle, {color: AOI_COLOR});\n map.centerObject(aoiCircle, 14);\n \n // Build annual time series collection.\n LCB_PROPS['aoi'] = aoiBox;\n LCB_PROPS['startDate'] = startDayBox.getValue();\n LCB_PROPS['endDate'] = endDayBox.getValue();\n lcb.props = lcb.setProps(LCB_PROPS);\n \n // Define annual collection year range as ee.List.\n var years = ee.List.sequence(lcb.props.startYear, lcb.props.endYear);\n var col = ee.ImageCollection.fromImages(years.map(imgColPlan));\n\n // Display the image chip time series. \n displayBrowseImg(col, aoiBox, aoiCircle);\n\n OPTIONAL_PARAMS['chartParams']['vAxis']['title'] = indexSelect.getValue();\n\n // Render the time series chart.\n rgbTs.rgbTimeSeriesChart(col, aoiCircle, indexSelect.getValue(), visParams,\n chartPanel, OPTIONAL_PARAMS);\n}", "getComponent(id) {\n const head = getHead(id);\n\n for (let component of this.elements) {\n if (head === component.id) {\n if (head === id)\n return component;\n else if (component.type = 'group')\n return component.getComponent(getTail(id));\n else\n throw new Error(`Undefined component ${id}`);\n }\n }\n\n throw new Error(`Undefined component ${id}`);\n }", "function geo_install_install(registers) {\n registers.registerCoordinateSystem('geo', geo_geoCreator);\n registers.registerComponentModel(geo_GeoModel);\n registers.registerComponentView(geo_GeoView);\n\n function makeAction(method, actionInfo) {\n actionInfo.update = 'geo:updateSelectStatus';\n registers.registerAction(actionInfo, function (payload, ecModel) {\n var selected = {};\n var allSelected = [];\n ecModel.eachComponent({\n mainType: 'geo',\n query: payload\n }, function (geoModel) {\n geoModel[method](payload.name);\n var geo = geoModel.coordinateSystem;\n Object(util[\"k\" /* each */])(geo.regions, function (region) {\n selected[region.name] = geoModel.isSelected(region.name) || false;\n }); // Notice: there might be duplicated name in different regions.\n\n var names = [];\n Object(util[\"k\" /* each */])(selected, function (v, name) {\n selected[name] && names.push(name);\n });\n allSelected.push({\n geoIndex: geoModel.componentIndex,\n // Use singular, the same naming convention as the event `selectchanged`.\n name: names\n });\n });\n return {\n selected: selected,\n allSelected: allSelected,\n name: payload.name\n };\n });\n }\n\n makeAction('toggleSelected', {\n type: 'geoToggleSelect',\n event: 'geoselectchanged'\n });\n makeAction('select', {\n type: 'geoSelect',\n event: 'geoselected'\n });\n makeAction('unSelect', {\n type: 'geoUnSelect',\n event: 'geounselected'\n });\n /**\n * @payload\n * @property {string} [componentType=series]\n * @property {number} [dx]\n * @property {number} [dy]\n * @property {number} [zoom]\n * @property {number} [originX]\n * @property {number} [originY]\n */\n\n registers.registerAction({\n type: 'geoRoam',\n event: 'geoRoam',\n update: 'updateTransform'\n }, function (payload, ecModel) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n var geo = componentModel.coordinateSystem;\n\n if (geo.type !== 'geo') {\n return;\n }\n\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'));\n componentModel.setCenter && componentModel.setCenter(res.center);\n componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system\n // So the center and zoom must be in sync. Include the series not selected by legend\n\n if (componentType === 'series') {\n Object(util[\"k\" /* each */])(componentModel.seriesGroup, function (seriesModel) {\n seriesModel.setCenter(res.center);\n seriesModel.setZoom(res.zoom);\n });\n }\n });\n });\n}", "function AbstractChartPainter() {\n\n}", "getComponent(name) {\n return (this.components.find((component) => {\n return component.name === name;\n }) || null);\n }", "function painths(id){\n//图表渲染的容器对象\n var chartContainer = document.getElementById(id);\n //加载图表\n var myChart = echarts.init(chartContainer);\n myChart.setOption(option = {\n //backgroundColor:'#f9f9f9',\n title: {\n text: ' 沪深300(sh000300)',\n textStyle:{\n fontWeight:'lighter',\n fontSize:18,\n //color:'#777'\n color:'#d48265',\n },\n // textAlign:'left',\n //subtext:'¥2942.46(-2.68%)',\n //subtextStyle:{\n // color:'#6a7985',\n // fontSize:14\n //},\n padding:30\n },\n tooltip : {\n trigger: 'axis',\n axisPointer: {\n type: 'cross',\n label: {\n backgroundColor: '#6a7985'\n }\n }\n },\n legend: {\n data:'沪深300'\n },\n // toolbox: {\n // feature: {\n // saveAsImage: {}\n // }\n // },\n grid: {\n left: '3%',\n right: '4%',\n bottom: '3%',\n containLabel: true\n },\n xAxis : [\n {\n type : 'category',\n boundaryGap : false,\n show:false,\n data : ['2017/03/06','2017/03/07','2017/03/08','2017/03/09','2017/03/13','2017/03/14','2017/03/15']\n }\n ],\n yAxis : [\n {\n type : 'value',\n splitnumber:5,\n min:2800,\n // axisTick:{\n // show:false,\n // },\n // show:false\n // gridIndex:{\n // show:false,\n // }\n axisLine:{\n lineStyle:{\n color:'#eee'\n }\n },\n axisTick:{\n show:false,\n // color:'#777'\n lineStyle:{\n color:'#eee'\n }\n },\n axisLabel:{\n //inside:true,\n show:false,\n textStyle:{\n fontSize:6\n }\n }\n }\n ],\n series : [\n\n {\n name:'沪深300',\n type:'line',\n itemStyle : {\n normal : {\n color:'#d48265',\n },\n },\n stack: '总量',\n label: {\n normal: {\n show: true,\n // position: 'top'\n }\n },\n\n //areaStyle: {normal: {}},\n data: [3234.32, 3123.33, 3012.56, 3234.24, 2993.77, 2858.89, 2942.46],\n smooth:true,\n }\n ]\n });\n}", "getDomElementForSubId(subId) {\n // First check for subIds that don't have to be parsed\n if (subId == dvt.Automation.TOOLTIP_SUBID)\n // TOOLTIP\n return this.GetTooltipElement(\n this._comp,\n DvtChartTooltipUtils.isDataCursorEnabled(this._comp) ? DvtChartDataCursor.TOOLTIP_ID : null\n );\n else if (subId == 'pieCenterLabel')\n // PIE CENTER LABEL\n return this._comp.pieChart.getCenterLabel().getElem();\n else if (subId == 'plotArea')\n // PLOT AREA\n return this._comp.getPlotArea().getElem();\n\n // CHART ELEMENTS\n var openParen1 = subId.indexOf('[');\n var closeParen1 = subId.indexOf(']');\n var openParen2, closeParen2, logicalObj;\n var colon = subId.indexOf(':');\n if ((openParen1 > 0 && closeParen1 > 0) || colon > 0) {\n var objType = colon < 0 ? subId.substring(0, openParen1) : subId.substring(0, colon);\n // GROUP AXIS LABELS\n if (objType == 'group') {\n return this._xAxisAutomation.getDomElementForSubId(subId);\n }\n // LEGEND ITEMS\n if (objType == 'series') {\n subId = this._convertToLegendSubId(subId);\n return this._legendAutomation.getDomElementForSubId(subId);\n } else if (subId.substring(0, colon) == 'legend') {\n subId = subId.substring(colon + 1);\n return this._legendAutomation.getDomElementForSubId(subId);\n }\n var seriesIndex = subId.substring(openParen1 + 1, closeParen1);\n // AXIS TITLE & REFERENCE OBJECTS\n if (objType == 'xAxis' || objType == 'yAxis' || objType == 'y2Axis') {\n var axisObjectType = subId.substring(colon + 1);\n if (axisObjectType == 'title') {\n // subId for axis title\n if (objType == 'xAxis')\n return this._xAxisAutomation.getDomElementForSubId(axisObjectType);\n else if (objType == 'yAxis')\n return this._yAxisAutomation.getDomElementForSubId(axisObjectType);\n else if (objType == 'y2Axis')\n return this._y2AxisAutomation.getDomElementForSubId(axisObjectType);\n } else {\n // subId for axis reference objects\n openParen2 = axisObjectType.indexOf('[');\n closeParen2 = axisObjectType.indexOf(']');\n if (axisObjectType.substring(0, openParen2) == 'referenceObject') {\n var index = axisObjectType.substring(openParen2 + 1, closeParen2);\n logicalObj = this._getRefObjPeer(index);\n if (logicalObj) return logicalObj.getDisplayables()[0].getElem();\n }\n }\n }\n\n // CHART DATA ITEMS\n if (this._options['type'] == 'pie') {\n var pieSlice = this._comp.pieChart.getSliceDisplayable(seriesIndex);\n if (pieSlice) return pieSlice.getElem();\n }\n // If funnel/pyramid chart set the default itemIndex, else parse it from the given subId\n var itemIndex;\n if (this._options['type'] == 'funnel') {\n itemIndex = DvtChartFunnelRenderer._GROUP_IDX;\n } else if (this._options['type'] == 'pyramid') {\n itemIndex = DvtChartPyramidRenderer._GROUP_IDX;\n } else {\n subId = subId.substring(closeParen1 + 1);\n openParen2 = subId.indexOf('[');\n closeParen2 = subId.indexOf(']');\n if (openParen2 >= 0 && closeParen2 >= 0) {\n itemIndex = subId.substring(openParen2 + 1, closeParen2);\n }\n }\n // Get the logical object and return the dom element of its associated displayable\n logicalObj = this._getChartObjPeer(seriesIndex, itemIndex);\n if (logicalObj) return logicalObj.getDisplayables()[0].getElem();\n }\n return null;\n }", "function getComponentByScopeId(id) {\n for (let component of componentList) {\n if (component.scopeId == id) {\n return component;\n }\n }\n}", "function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {\n\t return axisModel.getCoordSysModel() === gridModel;\n\t}", "getElements(Element){\n let curTableEntries = store.getState().tableEntries\n let elements = []\n let renderCategories;\n\n const arr24 = [...Array(24)] //a temporary 24-slot array for the 24 slots per category\n // create a 2D array of the edits that contains JSX elements\n renderCategories = categories.map(category => (\n arr24.map((date, i) => {\n const flattenedKey = [this.props.yr, i, category].join(\", \")\n const value = curTableEntries[flattenedKey] || ''\n return (<Element key={[this.props.yr, i, category].join(\"_\")}\n position={{i, category, year: this.props.yr}}\n clicked={this.clicked}\n content={value}/>)\n })\n ))\n // convert the renderCategories 2D array into a renderable 1D mapping array (with div wrappers)\n for(let i = 0; i < categories.length; i++){\n elements.push((\n <div className={categories[i]}>\n <TrackVisibility>\n <TableLabel label={categories[i]}/>\n </TrackVisibility>\n <div className=\"info\">\n {renderCategories[i]}\n </div>\n </div>\n ))\n }\n return elements\n }", "defineComponents() {\r\n this.components.forEach(Component => {\r\n this[Component.name] = new Component();\r\n });\r\n }", "function getRenderComponentFor(application) {\n var container = application.__container__;\n var componentLookup = container.lookup('component-lookup:main');\n\n return function renderComponent(name, attributes, element) {\n var component = componentLookup.lookupFactory(name, container);\n component.create(attributes).appendTo(element);\n };\n}", "function cm_getcomponent(_xid, _cname){\n\tvar _nid = _xid;\n\tif(typeof(_xid)=='string') _nid = stdlib.importxid(_xid);\n\n\tvar _component = false;\n\tswitch(_cname){\n\t\tcase 'jchart': _component = 'object' == typeof(jchart_list[_nid]) ? jchart_list[_nid] : false; break;\n\t\tcase 'jframe': _component = 'object' == typeof(jframe_list[_nid]) ? jframe_list[_nid] : false; break;\n\t\tcase 'jframe_frm': _component = 'object' == typeof(jframe_frm_list[_nid]) ? jframe_frm_list[_nid] : false; break;\n\t\tcase 'jmainmenu': _component = 'object' == typeof(jmainmenu_list[_nid]) ? jmainmenu_list[_nid] : false; break;\n\t\tcase 'jgauge': _component = 'object' == typeof(jgauge_list[_nid]) ? jgauge_list[_nid] : false; break;\n\t\tcase 'jmap': _component = 'object' == typeof(jmap_list[_nid]) ? jmap_list[_nid] : false; break;\n\t\tcase 'jprogress': _component = 'object' == typeof(jprogress_list[_nid]) ? jprogress_list[_nid] : false; break;\n\t\tcase 'jslider': _component = 'object' == typeof(jslider_list[_nid]) ? jslider_list[_nid] : false; break;\n\t\tcase 'jsmenu': _component = 'object' == typeof(jsmenu_list[_nid]) ? jsmenu_list[_nid] : false; break;\n\t\tcase 'jstab': _component = 'object' == typeof(jstab_list[_nid]) ? jstab_list[_nid] : false; break;\n\t\tcase 'jstab_tabs': _component = 'object' == typeof(jstab_tabs_list[_nid]) ? jstab_tabs_list[_nid] : false; break;\n\t\tcase 'jstree': _component = 'object' == typeof(jstree_list[_nid]) ? jstree_list[_nid] : false; break;\n\t\tcase 'jtable': _component = 'object' == typeof(jtable_list[_nid]) ? jtable_list[_nid] : false; break;\n\t\tcase 'ftable': _component = 'object' == typeof(ftable_list[_nid]) ? ftable_list[_nid] : false; break;\n\t\tcase 'jsched': _component = 'object' == typeof(jsched_list[_nid]) ? jsched_list[_nid] : false; break;\n\t\tcase 'jgrid': _component = 'object' == typeof(jgrid_list[_nid]) ? jgrid_list[_nid] : false; break;\n\t\tcase 'jpage': _component = 'object' == typeof(jpage_list[_nid]) ? jpage_list[_nid] : false; break;\n\t\tcase 'jwtable': _component = 'object' == typeof(jwtable_list[_nid]) ? jwtable_list[_nid] : false; break;\n\t\tcase 'uajax': _component = 'object' == typeof(uajax_list[_nid]) ? uajax_list[_nid] : false; break;\n\t\tcase 'jrpc': _component = 'object' == typeof(jrpc_list[_nid]) ? jrpc_list[_nid] : false; break;\n\t\tcase 'ubuttons': _component = 'object' == typeof(ubuttons_list[_nid]) ? ubuttons_list[_nid] : false; break;\n\t\tcase 'udialog': _component = 'object' == typeof(udialog_list[_nid]) ? udialog_list[_nid] : false; break;\n\t\tcase 'uform': _component = 'object' == typeof(uform_list[_nid]) ? uform_list[_nid] : false; break;\n\t\tcase 'uform_select': _component = 'object' == typeof(uform_select_list[_nid]) ? uform_select_list[_nid] : false; break;\n\t\tcase 'uform_input': _component = 'object' == typeof(uform_input_list[_nid]) ? uform_input_list[_nid] : false; break;\n\t\tcase 'unotify': _component = 'object' == typeof(unotify_list[_nid]) ? unotify_list[_nid] : false; break;\n\t\tcase 'wide': _component = 'object' == typeof(wide_list[_nid]) ? wide_list[_nid] : false; break;\n\t\tcase 'glib': _component = 'object' == typeof(glib_list[_nid]) ? glib_list[_nid] : false; break;\n\t\tcase 'loopback': _component = 'object' == typeof(loopback_list[_nid]) ? loopback_list[_nid] : false; break;\n\t}\n\t//if(typeof(_component)!='object') stdlib.logit(\"FAILURE ON \"+_xid+\" / \"+_cname);\n\treturn _component;\n}", "function getComponentByLocation(animal, x, y) {\n // Create a new deferred object\n var deferred = $q.defer();\n\n msApi.request('components.componentByLocation@get',\n {\n animal: animal,\n x: x,\n y: y\n },\n function (response) {\n deferredHandler(response, deferred);\n },\n function (response) {\n deferred.reject(response);\n }\n );\n\n return deferred.promise;\n }", "static get pluginConfig() {\n return {\n chain: ['getEventsToRender', 'onEventDataGenerated', 'noFeatureElementsInAxis']\n };\n }", "static get pluginConfig() {\n return {\n chain: ['getEventsToRender', 'onEventDataGenerated', 'noFeatureElementsInAxis']\n };\n }", "renderer() {\n const me = this,\n {\n scheduler\n } = me,\n {\n resourceStore\n } = scheduler,\n // Determine resource range to draw events for\n {\n firstResource,\n lastResource\n } = me.resourceRange,\n // Date at top and bottom for determining which events to include\n {\n topDate,\n bottomDate\n } = me.dateRange,\n syncConfigs = [],\n featureDomConfigs = [];\n\n if (!me.initialized || !me.scheduler.isEngineReady) {\n return;\n } // Update current time range, reflecting the change on the vertical time axis header\n\n if (!DateHelper.isEqual(topDate, me.topDate) || !DateHelper.isEqual(bottomDate, me.bottomDate)) {\n // Calculated values used by `renderResource()`\n me.topDate = topDate;\n me.bottomDate = bottomDate;\n me.topDateMS = topDate.getTime();\n me.bottomDateMS = bottomDate.getTime();\n me.timeView.range = {\n startDate: topDate,\n endDate: bottomDate\n };\n scheduler.trigger('visibleRangeChange', {\n startDate: topDate,\n endDate: bottomDate\n });\n }\n\n if (firstResource !== -1 && lastResource !== -1) {\n // Collect all events for resources in view\n for (let i = firstResource; i <= lastResource; i++) {\n syncConfigs.push.apply(syncConfigs, me.renderResource(resourceStore.getAt(i)));\n }\n }\n\n scheduler.getForegroundDomConfigs(featureDomConfigs);\n syncConfigs.push.apply(syncConfigs, featureDomConfigs);\n DomSync.sync({\n domConfig: {\n onlyChildren: true,\n children: syncConfigs\n },\n targetElement: scheduler.foregroundCanvas,\n syncIdField: 'syncId',\n\n // Called by DomHelper when it creates, releases or reuses elements\n callback({\n action,\n domConfig,\n lastDomConfig,\n targetElement\n }) {\n // If element is an event wrap, trigger appropriate events\n if (me.isEventElement(domConfig)) {\n const // Some actions are considered first a release and then a render (reusing another element).\n // This gives clients code a chance to clean up before reusing an element\n isRelease = releaseEventActions$1[action],\n isRender = renderEventActions$1[action]; // If we are reusing an element that was previously released we should not trigger again\n\n if (isRelease && me.isEventElement(lastDomConfig) && !lastDomConfig.isReleased) {\n const data = lastDomConfig.elementData.renderData,\n event = {\n renderData: data,\n assignmentRecord: data.assignmentRecord,\n eventRecord: data.eventRecord,\n resourceRecord: data.resourceRecord,\n element: targetElement\n }; // Some browsers do not blur on set to display:none, so releasing the active element\n // must *explicitly* move focus outwards to the view.\n\n if (targetElement === document.activeElement) {\n scheduler.focusElement.focus();\n } // This event is documented on Scheduler\n\n scheduler.trigger('releaseEvent', event);\n }\n\n if (isRender) {\n const data = domConfig.elementData.renderData,\n event = {\n renderData: data,\n tplData: data,\n // DEPRECATED IN 4.0\n assignmentRecord: data.assignmentRecord,\n eventRecord: data.eventRecord,\n resourceRecord: data.resourceRecord,\n element: targetElement,\n isReusingElement: action === 'reuseElement',\n isRepaint: action === 'reuseOwnElement'\n };\n event.reusingElement = action === 'reuseElement'; // This event is documented on Scheduler\n\n scheduler.trigger('renderEvent', event);\n }\n }\n }\n\n }); // Change in displayed resources?\n\n if (me.firstResource !== firstResource || me.lastResource !== lastResource) {\n // Update header to match\n me.resourceColumns.range = {\n firstResource,\n lastResource\n }; // Store which resources are currently in view\n\n me.firstResource = firstResource;\n me.lastResource = lastResource;\n } // There are multiple pathways that might lead to the first render of events. This is the first reliable\n // place were we can determine that something will be rendered\n\n syncConfigs.length && scheduler._firstRenderDone && scheduler._firstRenderDone();\n }", "FindComponent(component)\n\t{\n\t\treturn this.CanvasComponentCollection.FindComponent(component);\n\t}", "function ChartsContainer() {\n return (\n <div className=\"row\">\n <AreaChart />\n <PieChart />\n </div>\n );\n}", "createConnector(x, y) {\n const me = this,\n view = me.view;\n me.connector = DomHelper.createElement({\n parent: view.timeAxisSubGridElement,\n className: `${me.baseCls}-connector`,\n style: `left:${x}px;top:${y}px`\n });\n view.element.classList.add('b-creating-dependency');\n return me.connector;\n }", "getFromComponent(componentName, funcName, args=undefined){\n return this.#components.get(componentName)[funcName](args);\n }", "function scatterChartProvider(){\n\tvar scatterChartProviderImpl = {\n\t\t\tsvg : null,\n\t\t\taxisProvider : null,\n\t\t\tdata : [],\n\t\t\tdataX:\"\",\n\t\t\tdataY:\"\",\n\t\t\teffect : null,\n\t\t\tanimate : true,\n\t\t\tfilterIgnoreList :[\"url(#turb)\"],\n\t\t\tdraw : function(){\n\t\t\t\tconsole.log(\"Drawing Scatter chart.\");\n\t\t\t\tthis.svg.selectAll(\".circle\").remove();\n\t\t\t\tvar xScale = this.axisProvider.xScale;\n\t\t\t\tvar yScale = this.axisProvider.yScale;\n\t\t\t\tvar width = this.axisProvider.width;\n\t\t\t\tvar rangeBand = Math.ceil(width/this.data.length);\n\t\t\t\tvar dataX = this.dataX;\n\t\t\t\tvar dataY = this.dataY;\n\t\t\t\t var circles = this.svg.selectAll(\".circle\")\n\t\t\t .data(this.data)\n\t\t\t .enter()\n\t\t\t .append(\"circle\")\n\t\t\t .attr(\"class\",\"circle\")\n\t\t\t .attr(\"r\", 0)\n\t\t\t .attr(\"cx\", function(d) { return ((xScale(d[dataX])-rangeBand)+(rangeBand/2)); })\n\t\t\t .attr(\"cy\", function(d) { return yScale(d[dataY]); });\n\t\t\t\t if(isDefined(this.effect) && !isNull(this.effect)){\n\t\t\t\t \tif(this.filterIgnoreList.indexOf(getFilter(this.effect))<0){\n\t\t\t\t \t\tcircles.attr(\"filter\",getFilter(this.effect));\n\t\t\t\t \t}\n\t\t\t\t }\n\t\t\t if(this.animate){\n\t\t\t \tcircles.transition().duration(2000).ease(\"elastic\").attr(\"r\",4);\n\t\t\t }else{\n\t\t\t \tcircles.attr(\"r\",4);\n\t\t\t }\n\t\t\t},\n\t\tclear:function(){this.svg.selectAll(\".circle\").remove();}\n\t};\n\tthis.$get = function(){\n\t\treturn scatterChartProviderImpl;\n\t};\n}", "addEventListeners() {\n const { width, height, padding, offsetTop, offsetRight } = this.props;\n const $template = d3Select(this.svgEl.current);\n\n const zoom = d3Zoom()\n // .translateExtent([\n // [-Infinity, offsetTop],\n // [width - offsetRight, Infinity],\n // ])\n .scaleExtent([0.5, 20])\n .extent([\n [padding, offsetTop],\n [width - offsetRight, height - padding],\n ])\n .on('zoom', this.onZoom);\n\n $template.call(zoom);\n }", "getOptions() {\n let grids = []\n let xAxies = []\n let yAxies = []\n let series = []\n \n let sampleRate = store.getState().sampleRate\n let keysArray = Object.keys(this.state.eegData)\n // Remove deleted keys\n keysArray = keysArray.filter((key) => {\n return !this.removedAxies.includes(key);\n });\n\n // Layout configuration\n function generateGridTops(grid_height, num_grids) {\n // Returns an array of the top value for each\n // grid to be represented by keysArray\n let padding = 4\n let render_limits = [0+padding, 100-padding]\n let jump_width = (100 - 2*padding) / num_grids\n var list = [];\n for (var i = render_limits[0]; i <= render_limits[1]; i += jump_width) {\n let adjusted_top = i - (grid_height / 2) \n list.push(Math.ceil(adjusted_top));\n }\n return list\n }\n let height = 40\n let topsList = generateGridTops(height, keysArray.length)\n\n keysArray.forEach((key) => {\n let i = keysArray.indexOf(key)\n let grid_top = topsList[i] + \"%\"\n\n grids.push({\n id: key,\n left: '10%',\n right: '2%',\n top: grid_top,\n height: height + \"%\",\n show: true,\n name: key,\n tooltip: {\n show: false,\n trigger: 'axis',\n showDelay: 25\n },\n containLabel: false, // Help grids aligned by axis\n borderWidth: 0\n })\n\n xAxies.push({\n id: key,\n name: key,\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[key].length).keys()],\n type: 'category',\n gridIndex: i,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: (i == keysArray.length - 1), // Only show on last grid\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return (this.bufferStartIndex + parseInt(value)) / sampleRate\n }\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: true,\n interval: sampleRate - 1,\n },\n // Trigger event means you can click on name to register event\n triggerEvent: true,\n nameLocation: 'start',\n })\n\n // let scaleMax = new MyMaths().roundToNextDigit(Math.max(...this.state.eegData[key]))\n let scaleMax = 1\n let scaleMin = -scaleMax\n\n yAxies.push({\n id: key,\n type: 'value',\n gridIndex: i,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n // Programatically scale min/max\n min: scaleMin,\n max: scaleMax\n })\n\n // Add a line config to series object\n series.push({\n name: key,\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0.5,\n color: 'black',\n },\n gridIndex: i,\n yAxisIndex: i,\n xAxisIndex: i,\n smooth: false,\n sampling: 'lttb',\n\n data: this.state.eegData[key],\n })\n })\n\n /**\n * Configure backsplash grid for highlights and such\n * Adds a grid at backsplashGridIndex that takes full height\n * Adds an xAxis identical to the others\n * Adds a series of 0s meant to be undisplayed,\n * just for markAreas to be applied to\n */\n let timestampFormatter = (value) => {\n let secs = ((value + this.bufferStartIndex) / sampleRate) + this.time_adjustment_secs\n var date = new Date(0);\n date.setSeconds(secs);\n return date.toISOString().substr(11, 8);\n }\n\n this.backsplashGridIndex = keysArray.length\n let backsplashGridIndex = this.backsplashGridIndex\n let configureBacksplashGrid = () => {\n if (backsplashGridIndex == 0) {\n // Catch before data loads in\n return\n }\n let arbitraryKey = keysArray[0]\n\n grids.push({\n left: '10%',\n right: '4%',\n top: '0%',\n bottom: '4%',\n show: false,\n containLabel: false, // Help grids aligned by axis\n })\n yAxies.push({\n type: 'value',\n gridIndex: backsplashGridIndex,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n min: -1e-3,\n max: 1e-3,\n })\n xAxies.push({\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[arbitraryKey].length).keys()],\n type: 'category',\n gridIndex: backsplashGridIndex,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: true,\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return timestampFormatter(value)\n }\n },\n axisLine: {\n show: false,\n },\n })\n series.push({\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0,\n color: '#00000000',\n },\n gridIndex: backsplashGridIndex,\n yAxisIndex: backsplashGridIndex,\n xAxisIndex: backsplashGridIndex,\n sampling: 'lttb',\n \n name: 'backSplashSeries',\n \n data: new Array(this.state.eegData[arbitraryKey].length).fill(0),\n })\n }\n configureBacksplashGrid()\n\n /**\n * \n * The actual configuration for the chart\n * Loads in all of the previously filled grids, xAxies, yAxies, and series\n * \n */\n let options = {\n // Use the values configured above\n grid: grids,\n xAxis: xAxies,\n yAxis: yAxies,\n series: series,\n\n // Other Configuration options\n animation: false,\n\n tooltip: {\n show: false,\n },\n\n // toolbox hidden\n toolbox: {\n orient: 'vertical',\n show: false,\n },\n\n // Brush allows for selection that gets turned into markAreas\n brush: {\n toolbox: ['lineX', 'keep'],\n xAxisIndex: backsplashGridIndex\n },\n\n dataZoom: [\n {\n show: false,\n xAxisIndex: Object.keys(series),\n type: 'slider',\n bottom: '2%',\n startValue: this.dz_start,\n endValue: this.dz_end,\n preventDefaultMouseMove: true,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n },\n {\n yAxisIndex: Object.keys(series),\n type: 'slider',\n top: '45%',\n filterMode: 'none',\n show: false,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n\n id: 'eegGain',\n start: 50 - this.yZoom,\n end: 50 + this.yZoom,\n },{\n type: 'inside',\n yAxisIndex: Object.keys(series),\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n }\n ],\n }\n\n return options\n }", "get componentInstance() {\n const nativeElement = this.nativeNode;\n return nativeElement &&\n (getComponent$1(nativeElement) || getOwningComponent(nativeElement));\n }", "render() {\n return (\n <div ref='LineChartContainer'/>\n );\n }", "function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel || !coordDimensions) {\n return encode;\n }\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var ecModel = seriesModel.ecModel;\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n var baseCategoryDimIndex;\n var categoryWayValueDimStart;\n coordDimensions = coordDimensions.slice();\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* each */ \"k\"])(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n var coordDimInfo = Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ \"z\"])(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n name: coordDimInfoLoose\n };\n\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n baseCategoryDimIndex = coordDimIdx;\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n }\n\n encode[coordDimInfo.name] = [];\n });\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: categoryWayValueDimStart,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* each */ \"k\"])(coordDimensions, function (coordDimInfo, coordDimIdx) {\n var coordDimName = coordDimInfo.name;\n var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\n if (baseCategoryDimIndex == null) {\n var start = datasetRecord.valueWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when mutiple series share one dimension\n // category axis, series name should better use\n // the other dimsion name. On the other hand, use\n // both dimensions name.\n } // In category way, the first category axis.\n else if (baseCategoryDimIndex === coordDimIdx) {\n pushDim(encode[coordDimName], 0, count);\n pushDim(encodeItemName, 0, count);\n } // In category way, the other axis.\n else {\n var start = datasetRecord.categoryWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.categoryWayDim += count;\n }\n });\n\n function pushDim(dimIdxArr, idxFrom, idxCount) {\n for (var i = 0; i < idxCount; i++) {\n dimIdxArr.push(idxFrom + i);\n }\n }\n\n function getDataDimCountOnCoordDim(coordDimInfo) {\n var dimsDef = coordDimInfo.dimsDef;\n return dimsDef ? dimsDef.length : 1;\n }\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}", "function create$2(ecModel, api) {\n\t var singles = [];\n\t ecModel.eachComponent('singleAxis', function (axisModel, idx) {\n\t var single = new Single(axisModel, ecModel, api);\n\t single.name = 'single_' + idx;\n\t single.resize(axisModel, api);\n\t axisModel.coordinateSystem = single;\n\t singles.push(single);\n\t });\n\t ecModel.eachSeries(function (seriesModel) {\n\t if (seriesModel.get('coordinateSystem') === 'singleAxis') {\n\t var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n\t seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\n\t }\n\t });\n\t return singles;\n\t }", "update(elementCache, viewport, data) {\n\n let width = viewport.clientWidth;\n let height = 150;\n this.setViewPortSVGSize(elementCache.svg, width, height);\n\n let { axis: xAxis, scale: xScale } = this.createXAxis(data, width); \n this.formatAxis(elementCache.axisG, height, xAxis, xScale);\n\n this.renderElements(this.data, xScale, elementCache.chartG);\n }", "function enableComponentHighDownFeatures(el, componentModel, componentHighDownName) {\n var ecData = Object(_innerStore__WEBPACK_IMPORTED_MODULE_2__[/* getECData */ \"a\"])(el);\n ecData.componentMainType = componentModel.mainType;\n ecData.componentIndex = componentModel.componentIndex;\n ecData.componentHighDownName = componentHighDownName;\n}", "initDomEvents() {\n const me = this; // Set thisObj and element of the configured listener specs.\n\n me.scheduledBarEvents.element = me.schedulerEvents.element = me.timeAxisSubGridElement;\n me.scheduledBarEvents.thisObj = me.schedulerEvents.thisObj = me; // same listener used for different events\n\n EventHelper.on(me.scheduledBarEvents);\n EventHelper.on(me.schedulerEvents);\n }", "renderEvent(eventData) {\n // No point in rendering event that already has an element\n const data = eventData.renderData,\n {\n resourceRecord,\n assignmentRecord\n } = data,\n // Event element config, applied to existing element or used to create a new one below\n elementConfig = {\n className: data.wrapperCls,\n tabIndex: '0',\n children: [{\n className: data.cls,\n style: (data.internalStyle || '') + (data.style || ''),\n children: data.children,\n dataset: {\n // Each feature putting contents in the event wrap should have this to simplify syncing and\n // element retrieval after sync\n taskFeature: 'event'\n },\n syncOptions: {\n syncIdField: 'taskBarFeature'\n }\n }, ...data.wrapperChildren],\n style: {\n transform: `translate(${data.left}px, ${data.top}px)`,\n // DomHelper appends px to dimensions when using numbers\n height: data.height,\n width: data.width,\n zIndex: data.zIndex,\n style: data.wrapperStyle || ''\n },\n dataset: {\n resourceId: resourceRecord.id,\n eventId: data.eventId,\n // Not using eventRecord.id to distinguish between Event and ResourceTimeRange\n // Sync using assignment id for events and event id for ResourceTimeRanges\n syncId: assignmentRecord ? assignmentRecord.id : data.eventId\n },\n // Will not be part of DOM, but attached to the element\n elementData: eventData,\n // Dragging etc. flags element as retained, to not reuse/release it during that operation. Events\n // always use assignments, but ResourceTimeRanges does not\n retainElement: (assignmentRecord || data.eventRecord).instanceMeta(this.scheduler).retainElement,\n // Options for this level of sync, lower levels can have their own\n syncOptions: {\n syncIdField: 'taskFeature',\n // Remove instead of release when a feature is disabled\n releaseThreshold: 0\n }\n }; // Do not want to spam dataset with empty prop when not using assignments (ResourceTimeRanges)\n\n if (assignmentRecord) {\n elementConfig.dataset.assignmentId = assignmentRecord.id;\n }\n\n this.scheduler.trigger('beforeRenderEvent', {\n renderData: data,\n domConfig: elementConfig\n }); // Allows access to the used config later, for example to retrieve element\n\n eventData.elementConfig = elementConfig;\n return elementConfig;\n }", "function zb2(data) {\n // 基于准备好的dom,初始化echarts实例\n var myChart1 = echarts.init(document.getElementById('zb1'));\n var myChart2 = echarts.init(document.getElementById('zb2'));\n datafortwo = []\n for(val in data){\n // alert(data[val]);\n datafortwo.push(data[val]);\n }\n var down_or_rise =datafortwo[1];\n var color_for_second = '#FF0000'\n if(down_or_rise>0){\n down_or_rise = '+'+down_or_rise;\n }\n else{\n down_or_rise = ''+down_or_rise;\n color_for_second = '#00FF00'\n } \n option1 = {\n series: [{\t\n type: 'pie',\n radius: ['60%', '70%'],\n color:'#2ECCFA',\n label: {\n normal: {\n position: 'center'\n }\n },\n data: [{\n value:1,\n name: '',\n label: {\n normal: {\n formatter: datafortwo[0]+'',\n textStyle: {\n fontSize: 20,\n color:'#fff',\n }\n }\n }\n }, {\n value: 0,\n name: '',\n label: {\n normal: {\n textStyle: {\n color: '#aaa',\n fontSize: 12\n }\n }\n },\n itemStyle: {\n normal: {\n color: 'rgba(255,255,255,.2)'\n },\n emphasis: {\n color: '#fff'\n }\n },\n }]\n }]\n };\n // alert(data1[0]);\n option2 = {\n series: [{\t\n type: 'pie',\n radius: ['60%', '70%'],\n color:color_for_second,\n label: {\n normal: {\n position: 'center'\n }\n },\n data: [{\n value:1,\n name: '',\n label: {\n normal: {\n formatter: down_or_rise+'%',\n textStyle: {\n fontSize: 20,\n color:'#fff',\n }\n }\n }\n }, {\n value: 0,\n name: '',\n label: {\n normal: {\n textStyle: {\n color: '#aaa',\n fontSize: 12\n }\n }\n },\n itemStyle: {\n normal: {\n color: 'rgba(255,255,255,.2)'\n },\n emphasis: {\n color: '#fff'\n }\n },\n }]\n }]\n }; \n myChart1.setOption(option1)\n myChart2.setOption(option2);\n window.addEventListener(\"resize\",function(){\n myChart1.resize(); \n myChart2.resize();\n });\n }", "function render() {\n\n var\n //scaleOverflowLabel = i18n( 'FormEditorMojit.el_properties_panel.LBL_EE_SCALEOVERFLOW' ),\n //maxLengthLabel = i18n( 'FormEditorMojit.el_properties_panel.LBL_EE_MAXLEN' ),\n panelNode = Y.Node.create( '<div></div>' );\n\n async.series( [ loadPanelHtml, cacheJQuery, loadMedDataTypes, setupAxisTypes ], onAllDone );\n\n function loadPanelHtml( itcb ) {\n // clear any existing content\n jq.me.html( '' );\n isRendered = false;\n\n // load the panel template\n YUI.dcJadeRepository.loadNodeFromTemplate(\n 'editor_chartmd',\n 'FormEditorMojit',\n {},\n panelNode,\n onPanelHtmlLoaded\n );\n\n // add panel template to page\n function onPanelHtmlLoaded( err ) {\n if ( err ) { return itcb( err ); }\n Y.one( '#' + domId ).append( panelNode );\n itcb( null );\n }\n }\n\n function cacheJQuery( itcb ) {\n var\n k;\n\n for ( k in BIND_ELEMENTS ) {\n if ( BIND_ELEMENTS.hasOwnProperty( k ) ) {\n jq[ k ] = $( '#' + k );\n }\n }\n\n jq.btnSelectChartImage = $( '#btnSelectChartImage' );\n\n itcb( null );\n }\n\n function loadMedDataTypes( itcb ) {\n Y.doccirrus.jsonrpc.api.meddata\n .getAllMeddataTypes()\n .then( onTypesLoaded )\n .fail( itcb );\n\n function onTypesLoaded( allMeddataTypes ) {\n var html, k;\n\n allMeddataTypes = allMeddataTypes.data ? allMeddataTypes.data : allMeddataTypes;\n\n for ( k in allMeddataTypes ) {\n if ( allMeddataTypes.hasOwnProperty( k ) ) {\n html = '<option value=\"' + k + '\">' + allMeddataTypes[k] + '</option>';\n jq.selChartMdY.append( html );\n }\n }\n\n itcb( null );\n }\n }\n\n function setupAxisTypes( itcb ) {\n var html, i;\n\n for ( i = 0; i < AXIS_MEDDATA_TYPES.length; i++ ) {\n html = '' +\n '<option value=\"' + AXIS_MEDDATA_TYPES[i] + '\">' +\n i18n( 'v_meddata-schema.medDataTypes.' + AXIS_MEDDATA_TYPES[i] ) +\n '</option>';\n\n jq.selChartMdX.append( html );\n }\n\n itcb( null );\n }\n\n function onAllDone( err ) {\n if ( err ) {\n Y.log( 'Problem initializing chart editor: ' + JSON.stringify( err ), 'warn', NAME );\n return;\n }\n\n function EditChartMDVM() {\n var\n self = this;\n\n self.btnChooseImageI18n = i18n('FormEditorMojit.ctrl.BTN_CHOOSE_IMAGE');\n\n }\n\n ko.applyBindings( new EditChartMDVM(), document.querySelector( '#divElementEditPanelChartMD' ) );\n isRendered = true;\n updateFromElement();\n subscribeToControls();\n }\n\n }", "function create(ecModel, api) {\n var singles = [];\n ecModel.eachComponent('singleAxis', function (axisModel, idx) {\n var single = new single_Single(axisModel, ecModel, api);\n single.name = 'single_' + idx;\n single.resize(axisModel, api);\n axisModel.coordinateSystem = single;\n singles.push(single);\n });\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', util_model[\"b\" /* SINGLE_REFERRING */]).models[0];\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\n }\n });\n return singles;\n}", "function getCellAsDomElement(coord) {\n var elCell = document.querySelector(`#cell${coord.i}-${coord.j}`);\n return elCell;\n}", "GetComponentsAtPoint(x, y)\n\t{\n\t\treturn Object.values(this.collection).map(function(component)\n\t\t{\n\t\t\treturn {\n\t\t\t\tcomponent: component,\n\t\t\t\tBB: component._getBoundingBox()\n\t\t\t};\n\t\t}).filter(function(BBObject)\n\t\t{\n\t\t\treturn CCUtil.Collides(BBObject.BB, x, y);\n\t\t}).map(function(BBObject)\n\t\t{\n\t\t\treturn BBObject.component;\n\t\t});\n\t}", "function registerEvents() {\n var graphViewEvents = graphView.getEvents();\n // Non d3 events\n $baseTopologyTemplate.on(\"click\", \".topology-zoom-in\", function (evt) {\n $container.trigger(topologyConstants.events.zoomIn, {}); // Private Event \n });\n $baseTopologyTemplate.on(\"click\", \".topology-zoom-out\", function (evt) {\n $container.trigger(topologyConstants.events.zoomOut, {}); // Private Event\n });\n $baseTopologyTemplate.on(\"click\", \".topology-reset\", function (evt) {\n reload();\n });\n $baseTopologyTemplate.on(\"click\", \".topology-legend-icon\", function (evt) {\n var $elem = $baseTopologyTemplate.find(\".legend-view-container\");\n if ($elem.hasClass(\"legend-expanded\")) {\n $elem.removeClass(\"legend-expanded\").addClass(\"legend-collapsed\");\n $userContainer.trigger(topologyConstants.events.legendCollapse, {}); // Public Event\n }\n else if ($elem.hasClass(\"legend-collapsed\")) {\n $elem.removeClass(\"legend-collapsed\").addClass(\"legend-expanded\");\n $userContainer.trigger(topologyConstants.events.legendExpand, {}); // Public Event\n }\n });\n\n // d3 events\n graphViewEvents.on('nodeClick', function (d) {\n var node = getNode(d);\n $userContainer.trigger(topologyConstants.events.nodeClick, node); // Public Event\n });\n\n graphViewEvents.on('nodeMouseOver', function (d, i, nodeEl) {\n var node = getNode(d);\n $userContainer.trigger(topologyConstants.events.nodeMouseOver, node); // Public Event\n });\n\n graphViewEvents.on('nodeMouseOut', function (d, i, nodeEl) {\n var node = getNode(d);\n $userContainer.trigger(topologyConstants.events.nodeMouseOut, node); // Public Event\n });\n\n graphViewEvents.on('linkClick', function (d) {\n var node = getNodeLink(d);\n $userContainer.trigger(topologyConstants.events.linkClick, node); // Public Event\n });\n\n graphViewEvents.on('linkMouseOver', function (d) {\n var node = getNodeLink(d);\n $userContainer.trigger(topologyConstants.events.LinkMouseOver, node); // Public Event\n });\n\n graphViewEvents.on('linkMouseOut', function (d) {\n var node = getNodeLink(d);\n $userContainer.trigger(topologyConstants.events.LinkMouseOut, node); // Public Event\n });\n\n function getNode(d) {\n return dataStore && dataStore.get(d.id);\n }\n\n function getNodeLink(d) {\n return dataStore && dataStore.get(d.id);\n }\n }", "function WebCom_ComponentLoader() {\n\n var components = [];\n \n /*public void*/function initComponent(name, version, className, data, onRenderComplete) {\n if(name) {\n //Add component to queue for init\n components.push({\n 'name': name, \n 'className': className,\n 'version': version, \n 'data': data,\n 'onRenderComplete': onRenderComplete\n });\n //Load the component JS file\n WebCom.ResourceLoader.loadLib(name, version, true);\n }\n };\n \n /*public void*/function flushQueue() {\n for(var i=0;i<components.length;i++) {\n startComponent(components[i].className, components[i].data, components[i].onRenderComplete);\n }\n components = [];\n }\n \n /*private void*/function startComponent(className, data, onRenderComplete) {\n var componentClass = eval(className);\n \n if (componentClass && typeof(componentClass.initInstances) == 'function') {\n componentClass.initInstances(data , {listeners: {'renderComplete' : {handler: function() { if(typeof(onRenderComplete) == 'function') { onRenderComplete();}} }}});\n }\n }\n \n this.initComponent = initComponent;\n this.flushQueue = flushQueue;\n \n return this;\n }", "function CustomElementRegistry() {}", "function CustomElementRegistry() {}" ]
[ "0.55974907", "0.5475304", "0.5357767", "0.531706", "0.5299839", "0.52864987", "0.52864987", "0.52864987", "0.52864987", "0.52864987", "0.52864987", "0.52713776", "0.52608424", "0.52194715", "0.51955324", "0.5170994", "0.5170994", "0.5170994", "0.5170994", "0.5141789", "0.5128405", "0.5117542", "0.509062", "0.509062", "0.5049751", "0.5040166", "0.5033565", "0.5025557", "0.5015226", "0.50017387", "0.49914032", "0.4986765", "0.4986444", "0.49838296", "0.49678817", "0.49678817", "0.49672672", "0.49522293", "0.4951281", "0.4950732", "0.49408838", "0.49352348", "0.49343452", "0.4923319", "0.49159002", "0.49157777", "0.4914359", "0.48926038", "0.48926038", "0.48926038", "0.48926038", "0.48926038", "0.48926038", "0.48926038", "0.48926038", "0.48842666", "0.4883093", "0.48784357", "0.48761502", "0.48625082", "0.48491737", "0.4848842", "0.48453742", "0.48407182", "0.48393908", "0.48355806", "0.48325187", "0.48248094", "0.48163056", "0.4814505", "0.480416", "0.48022488", "0.48018155", "0.47872156", "0.47855708", "0.47855708", "0.47834495", "0.47774485", "0.4765377", "0.4764799", "0.47613728", "0.47604376", "0.4755486", "0.47517192", "0.47511542", "0.474795", "0.47475678", "0.4739626", "0.47396037", "0.47329846", "0.47317898", "0.47312027", "0.47303", "0.4728067", "0.4722596", "0.47218725", "0.47209024", "0.472058", "0.47185078", "0.47108886", "0.47108886" ]
0.0
-1
attribute 'color' to represent both concepts of 'colorRange' and 'color', (It means 'colorRange' when 'color' is Array, means 'color' when not array), this problem will be encountered: If a level1 node dont have children, and its siblings has children, and colorRange is set on level1, then the node can not be colored. So we separate 'colorRange' and 'color' to different attributes.
function getRangeVisual(nodeModel, name) { // 'colorRange', 'colorARange', 'colorSRange'. // If not exsits on this node, fetch from levels and series. var range = nodeModel.get(name); return isArray(range) && range.length ? { name: name, range: range } : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function locateColorAttrs(attr, attrName, attrs, level) {\n path[level] = attrName;\n path.length = level + 1;\n if(attr.valType === 'color' && attr.dflt === undefined) {\n colorAttrs.push(path.join('.'));\n }\n }", "function locateColorAttrs(attr, attrName, attrs, level) {\n path[level] = attrName;\n path.length = level + 1;\n if(attr.valType === 'color' && attr.dflt === undefined) {\n colorAttrs.push(path.join('.'));\n }\n }", "function locateColorAttrs(attr, attrName, attrs, level) {\n path[level] = attrName;\n path.length = level + 1;\n if (attr.valType === 'color' && attr.dflt === undefined) {\n colorAttrs.push(path.join('.'));\n }\n }", "function getRangeVisual(nodeModel,name){ // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range=nodeModel.get(name);return isArray(range) && range.length?{name:name,range:range}:null;}", "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "function getRangeVisual(nodeModel, name) {\n\t // 'colorRange', 'colorARange', 'colorSRange'.\n\t // If not exsits on this node, fetch from levels and series.\n\t var range = nodeModel.get(name);\n\t return isArray(range) && range.length ? {\n\t name: name,\n\t range: range\n\t } : null;\n\t }", "nodeColor (d) {\n const color = scaleOrdinal()\n .domain(['reception', 'setting', 'attack'])\n .range(['#009688', '#8BC34A', '#FFC107'])\n\n if (d.value < 1) {\n d.color = '#bbb'\n } else {\n const category = d.name.replace(/ .*/, '').toLowerCase()\n d.color = color(category)\n }\n return d.color\n }", "function getRangeVisual(nodeModel, name) {\n\t // 'colorRange', 'colorARange', 'colorSRange'.\n\t // If not exsits on this node, fetch from levels and series.\n\t var range = nodeModel.get(name);\n\t return isArray(range) && range.length ? { name: name, range: range } : null;\n\t}", "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "function create(range, color) {\n return {\n range: range,\n color: color\n };\n }", "function create(range, color) {\n return {\n range: range,\n color: color\n };\n }", "function create(range, color) {\n return {\n range: range,\n color: color\n };\n }", "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return (isArray(range) && range.length) ? {name: name, range: range} : null;\n }", "function create(range, color) {\n return {\n range: range,\n color: color,\n };\n }", "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return Object(util[\"t\" /* isArray */])(range) && range.length ? {\n name: name,\n range: range\n } : null;\n}", "convertColorRange (colorRange) {\r\n\t\tswitch (colorRange) {\r\n\t\t\tcase 'red':\r\n\t\t\t\treturn ['#fee5d9', '#fcae91', '#fb6a4a', '#de2d26', '#a50f15'];\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'orange':\r\n\t\t\t\treturn ['#feedde', '#fdbe85', '#fd8d3c', '#e6550d', '#a63603'];\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'blue':\r\n\t\t\t\treturn ['#eff3ff', '#bdd7e7', '#6baed6', '#3182bd', '#08519c'];\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'green':\r\n\t\t\t\treturn ['#edf8e9', '#bae4b3', '#74c476', '#31a354', '#006d2c'];\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'grey':\r\n\t\t\t\treturn ['#f7f7f7', '#cccccc', '#969696', '#636363', '#252525'];\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'purple':\r\n\t\t\t\treturn ['#f2f0f7', '#cbc9e2', '#9e9ac8', '#756bb1', '#54278f'];\r\n\t\t\tdefault:\r\n\t\t\t\treturn ['#fee5d9', '#fcae91', '#fb6a4a', '#de2d26', '#a50f15'];\r\n\t\t}\r\n\t}", "function rangeColors(rangeNumber) {\n var colorArr = [];\n var red = new Color(232, 9, 26),\n white = new Color(255, 255, 255),\n green = new Color(6, 170, 60),\n start = green,\n end = red;\n // if (rangeNumber > 50) {\n // start = white,\n // end = red;\n // rangeNumber = rangeNumber % 51;\n // }\n var startColors = start.getColors(),\n endColors = end.getColors();\n for (var i = 0; i <= rangeNumber; i++) {\n var r = Interpolate(startColors.r, endColors.r, rangeNumber, i);\n var g = Interpolate(startColors.g, endColors.g, rangeNumber, i);\n var b = Interpolate(startColors.b, endColors.b, rangeNumber, i);\n var color = \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n colorArr.push(color);\n }\n\n function Interpolate(start, end, steps, count) {\n var s = start,\n e = end,\n final = s + (((e - s) / steps) * count);\n return Math.floor(final);\n }\n\n function Color(_r, _g, _b) {\n var r, g, b;\n var setColors = function(_r, _g, _b) {\n r = _r;\n g = _g;\n b = _b;\n };\n setColors(_r, _g, _b);\n this.getColors = function() {\n var colors = {\n r: r,\n g: g,\n b: b\n };\n return colors;\n };\n }\n return colorArr;\n}", "setColor (color) {\n let levels = Object.keys(LEVELS);\n for (let severity of levels) {\n if (severity === 'level') continue;\n this.levels[severity].setColor(color);\n }\n }", "function color_assign(d) {\n\t\tvar greenClassList = [];\n\t\t\n\t\tif(treeFlag == \"STATIC\"){\n\t\t\tgreenClassList = staticKPIList;\t\t\t\n\t\t}else {\n\t\t\tgreenClassList = KPIList;\n\t\t}\n\t\t\n\t\tvar lay = d.layer;\t\n\t\tif(lay == 2) {\n\t\t\tfor (var i = 0; i < greenClassList.length; i++) {\n\t\t\tif(greenClassList[i] == d.name)\n\t\t\t\treturn \"GREEN\";\n\t\t }\n\t\t\treturn \"RED\";\t \n\t\t}else if(lay == 1) {\t\t\n\t\t\tvar children = classHierarchy[\"children\"];\n\t\t\t\n\t\t\t//console.log(\"1st Level child type \"+ typeof(children));\n\t\t\t//console.log(\"1st Level child \"+ children);\n\t\t\t\n\t\t\tvar count = 0;\n\t\t\tfor(var i in children){\n\t\t\t\t//console.log(\"d.name = \"+ d.name);\n\t\t\t\t//console.log(\"children[i]['name'] = \"+ children[i][\"name\"]);\n\t\t\t\tif(children[i][\"name\"] == d.name){\n\t\t\t\t\tvar chld = children[i][\"children\"];\n\t\t\t\t\t//console.log(\"Typeof child : \"+ typeof(chld));\n\t\t\t\t\t//console.log(\"chld = \", chld);\n\t\t\t\t\tfor(var j in chld){\n\t\t\t\t\t\tfor (var i = 0; i < greenClassList.length; i++) {\n\t\t\t\t\t\t\tif(greenClassList[i] == chld[j][\"name\"]){\n\t\t\t\t\t\t\t\tcount += 1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(chld.length == count){\n\t\t\t\t\t\tfirst_level_class_color.push(\"GREEN\");\n\t\t\t\t\t\treturn \"GREEN\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tfirst_level_class_color.push(\"RED\");\n\t\t\t\t\t\treturn \"RED\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}else {\n\t\t\tfor(var i in first_level_class_color) {\n\t\t\t\tif(first_level_class_color[i] == \"RED\") {\n\t\t\t\t\t//console.log(\"first_level_class_color = \", first_level_class_color[i]);\n\t\t\t\t\treturn \"RED\"\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"GREEN\";\n\t\t} \n\t}", "function color_node(node) {\n // console.log(\"color_node\");\n if (node.selected) { return \"red\"; }\n else { return fill(node.group);}\n }", "colorTreeDefault() {\n let i, color = this.getDefaultColor();\n for(i in this.metadata) {\n this.metadata[i]['branch_color'] = color;\n }\n }", "function color(d) \n{\n return d.name === \"Home\" ? LEVEL_1_COLOR : d.children ? LEVEL_2_COLOR : LEVEL_3_COLOR;\n}", "function matchColorRange(value) {\n var regex = new RegExp(\"^\\\\s*\" + color + \"(\\\\s+to\\\\s+\" + color + \")+\\\\s*$\", \"i\"),\n match = value.match(regex);\n if (match == null) {\n return null;\n }\n return rectifyColors(value.split(/\\s+to\\s+/i));\n}", "set nodeColor(value)\n\t{\n\t\tthis._nodeColor = value;\n\t}", "function getForColorComponent () {\n from = new THREE.Color(dataFrom || el.getAttribute(attribute));\n to = new THREE.Color(dataTo);\n partialSetAttribute = function (value) {\n if (attributeSplit.length > 1) {\n el.setAttribute(attributeSplit[0], attributeSplit[1], rgbVectorToHex(value));\n }\n el.setAttribute(attribute, rgbVectorToHex(value));\n };\n }", "function addColor(treeDataArr, green, lightGreen, yellow, orange) {\n const totalTime = treeDataArr[0].renderTime;\n const workToBeDone = [treeDataArr[0]];\n while (workToBeDone.length > 0) {\n const percentTime = workToBeDone[0].individualTime / totalTime;\n if (percentTime < green) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#80b74c' } };\n } else if (percentTime < lightGreen) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#a1c94f' } };\n } else if (percentTime < yellow) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#e6cc38' } };\n } else if (percentTime < orange) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#f69d27' } };\n } else {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#e74e2c' } };\n }\n for (let i = 0; i < workToBeDone[0].children.length; i += 1) {\n workToBeDone.push(workToBeDone[0].children[i]);\n }\n workToBeDone.shift();\n }\n return treeDataArr;\n }", "function getForColorComponent () {\n\t from = new THREE.Color(dataFrom || el.getAttribute(attribute));\n\t to = new THREE.Color(dataTo);\n\t partialSetAttribute = function (value) {\n\t if (attributeSplit.length > 1) {\n\t el.setAttribute(attributeSplit[0], attributeSplit[1], rgbVectorToHex(value));\n\t }\n\t el.setAttribute(attribute, rgbVectorToHex(value));\n\t };\n\t }", "function create_color(root_node) {\n\t// black color for root\n\troot_node.color = d3.rgb(0,0,0);\n\tvar hue_scale = d3.scaleLinear().domain([0,root_node.children.length-1]).range([10,250])\n\tfor(var c = 0; c < root_node.children.length; c++) {\n\t\tvar child_node = root_node.children[c];\n\t\tvar interpolator = d3.interpolateLab(d3.hsl(hue_scale(c),0.8,0.3), d3.hsl(hue_scale(c),0.8,0.8))\n\t\tchild_node.color = interpolator(0.5);\n\t\tfor(var d = 0; d < child_node.children.length; d++)\n\t\t\tchild_node.children[d].color = interpolator(d / (child_node.children.length-1));\n\t}\n}", "constructor() {\n super();\n\n this.colorOptions = [\n ['#c51b7d','#de77ae','#f1b6da','#fde0ef','#e6f5d0','#b8e186','#7fbc41','#4d9221'],\n ['#fff5eb','#fee6ce','#fdd0a2','#fdae6b','#fd8d3c','#f16913','#d94801','#a63603','#7f2704'],\n ['#fcfbfd','#efedf5','#dadaeb','#bcbddc','#9e9ac8','#807dba','#6a51a3','#54278f','#3f007d'],\n ['#f7fbff','#deebf7','#c6dbef','#9ecae1','#6baed6','#4292c6','#2171b5','#08519c','#08306b'],\n ['#f7fcf5','#e5f5e0','#c7e9c0','#a1d99b','#74c476','#41ab5d','#238b45','#006d2c','#00441b'],\n ['#ffffff','#f0f0f0','#d9d9d9','#bdbdbd','#969696','#737373','#525252','#252525','#000000']\n ];\n this.baseScaleSteps = [,-30,-20,-10,0,10,20,30]//[0,1,2,3,5,10,25,50,75];\n this.colorScale = d3.scaleThreshold()\n .domain(this.baseScaleSteps)\n .range(this.colorOptions[0]);\n }", "validateColorRange(value) {\n const that = this.context;\n\n return Math.min(Math.max(value, that.min), that.max);\n }", "function edge_style_colorlevels(act1, act2, edge_scale_val, color){\n if (act1 === 'start'){\n return \"stroke: \" + color + \"; stroke-width: \" + config_dfg.edge_size_scale(edge_scale_val) + \"px; stroke-dasharray: 4, 10\"\n }\n else if (act2 === 'end') {\n return \"stroke: \" + color + \"; stroke-width: \" + config_dfg.edge_size_scale(edge_scale_val) + \"px; stroke-dasharray: 10, 4\"\n } else {\n return \"stroke: \" + color + \"; stroke-width: \" + config_dfg.edge_size_scale(edge_scale_val) + \"px\";\n }\n \n}", "function setColor(colors, color, type, save, alpha) { // color only full range\n\t\tif (typeof color === 'string') {\n\t\t\tvar color = ColorConverter.txt2color(color); // new object\n\t\t\ttype = color.type;\n\t\t\t_colors[type] = color[type];\n\t\t\talpha = alpha !== undefined ? alpha : color.alpha;\n\t\t} else if (color) {\n\t\t\tfor (var n in color) {\n\t\t\t\tcolors[type][n] = limitValue(color[n] / _valueRanges[type][n][1], 0 , 1);\n\t\t\t}\n\t\t}\n\t\tif (alpha !== undefined) {\n\t\t\tcolors.alpha = limitValue(+alpha, 0, 1);\n\t\t}\n\t\treturn convertColors(type, save ? colors : undefined);\n\t}", "function color(d) {\n return d._children ? '#3182bd' : d.children ? '#c6dbef' : d.color;\n}", "function setColor(depth){\n if (depth > 90){\n return \"#F51313\"\n } else if (depth <= 90 && depth > 70){\n return \"#F56713\"\n } else if (depth <= 70 && depth > 50){\n return \"#F59C13\"\n } else if (depth <= 50 && depth > 30){\n return \"#F5C413\"\n } else if (depth <= 30 && depth > 10){\n return \"#D2F513\"\n } else {\n return \"#83F513\"\n }\n}", "changeColorLevel (r, color) {\n if (!this.imageData) return this\n\n const data = this.imageData.data\n\n if (color == 'red') {\n for (var i = 0; i < data.length; i += 4) {\n data[i] = this.srcData[i] + Math.round(r) - this.rgbAverage.red\n }\n this.average().ctx.putImageData(this.imageData, 0, 0)\n }\n\n if (color == 'green') {\n for (var j = 0; j < data.length; j += 4) {\n data[j + 1] = this.srcData[j + 1] + Math.round(r) - this.rgbAverage.green\n }\n this.average().ctx.putImageData(this.imageData, 0, 0)\n }\n\n if (color == 'blue') {\n for (var k = 0; k < data.length; k += 4) {\n data[k + 2] = this.srcData[k + 2] + Math.round(r) - this.rgbAverage.blue\n }\n this.average().ctx.putImageData(this.imageData, 0, 0)\n }\n\n return this\n }", "function Color(depth){\n if (depth < 10){\n return \"#99ff99\";\n }\n else if (depth < 30){\n return \"#66ff66\"\n }\n else if (depth < 50){\n return \"#33cc33\"\n }\n else if (depth < 70){\n return \"#009933\"\n }\n else{\n return \"#003300\";\n };\n }", "validateColorRange(value) {\n const that = this.context;\n\n if (that._wordLengthNumber < 64) {\n return super.validateColorRange(value);\n }\n\n if (that.mode === 'numeric') {\n value = new JQX.Utilities.BigNumber(value);\n }\n else {\n value = JQX.Utilities.DateTime.validateDate(value);\n value = value.getTimeStamp();\n }\n\n const bigMin = new JQX.Utilities.BigNumber(that.min),\n bigMax = new JQX.Utilities.BigNumber(that.max);\n\n if (value.compare(bigMin) === -1) {\n value = bigMin;\n }\n\n if (value.compare(bigMax) === 1) {\n value = bigMax;\n }\n\n return value;\n }", "function setColor(colors, color, type, save, alpha) { // color only full range\r\n\t\tif (typeof color === 'string') {\r\n\t\t\tvar color = ColorConverter.txt2color(color); // new object\r\n\t\t\ttype = color.type;\r\n\t\t\t_colors[type] = color[type];\r\n\t\t\talpha = alpha !== undefined ? alpha : color.alpha;\r\n\t\t} else if (color) {\r\n\t\t\tfor (var n in color) {\r\n\t\t\t\tcolors[type][n] = limitValue(color[n] / _valueRanges[type][n][1], 0 , 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (alpha !== undefined) {\r\n\t\t\tcolors.alpha = limitValue(+alpha, 0, 1);\r\n\t\t}\r\n\t\treturn convertColors(type, save ? colors : undefined);\r\n\t}", "function nodeColor(d){\n \tif('dod' in d.data) {\n \t\treturn 'crimson';\n } else {\n \t\treturn 'aquamarine';\n \t}\n }", "function ColorRangeManager(args) {\r\n\tvar _this = this;\r\n\t// --------------------------------\r\n\t// constants\r\n\t// --------------------------------\r\n\r\n\tthis.redFrequency = 0.1;\r\n\tthis.grnFrequency = 0.2;\r\n\tthis.bluFrequency = 0.3;\r\n\tthis.center = 128;\r\n\tthis.width = 127;\r\n\tthis.phase1 = 0;\r\n\tthis.phase2 = 0;\r\n\tthis.phase3 = 0;\r\n\r\n\tthis.len = 20;\r\n\r\n\tthis.reverseOrder =false;\r\n\t// --------------------------------\r\n\t// Private Attributes\r\n\t// --------------------------------\r\n\r\n\tthis._emptyDataColor = \"#E8DFE8\";\r\n\r\n\t// other\r\n\tthis._dataRange = {\r\n\t\tmin : null,\r\n\t\tmax : null\r\n\t};\r\n\tthis._debug = false;\r\n\tthis._colorRange = null;\r\n\r\n\t// calculated\r\n\tthis._dataStep = null;\r\n\tthis._maxDataSpace = null;\r\n\r\n\tif (args != null) {\r\n\r\n\t\tif (args.dataRange != null) {\r\n\t\t\tthis._dataRange = args.dataRange;\r\n\t\t}\r\n\t}\r\n\r\n\t// setup color space\r\n\tthis._colorRange = [];\r\n\tthis._setupColorRange();\r\n}", "color(data) {\n\t\treturn d3\n\t\t\t.scaleLinear()\n\t\t\t.domain([0, Math.round(data.length / 2), data.length])\n\t\t\t.range(['#BBE4A0', '#52A8AF', '#00305C'])\n\t}", "function color(d) {\r\n\t\t\t\t\t\t\tif (d.loadDynamic)\r\n\t\t\t\t\t\t\t\treturn \"#3182bd\";\r\n\r\n\t\t\t\t\t\t\tif (d._children)\r\n\t\t\t\t\t\t\t\treturn \"#3182bd\";\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\treturn d.color;\r\n\t\t\t\t\t\t}", "createColors(color, num) {\n //receive hex color from parent, return array of colors for gradient\n //num is # of generated color in return array\n let a = []\n let red = parseInt( color.substring(1, 3), 16)\n let green = parseInt(color.substring(3, 5), 16)\n let blue = parseInt(color.substring(5,7), 16)\n \n let k = 0.8 \n //from lighter colder to darker warmer\n // console.log(red, green, blue)\n for (i=0;i<num;i++) {\n let new_red = (Math.floor(red*k)).toString(16)\n let new_green = (Math.floor(green*k)).toString(16)\n let new_blue = (Math.floor(blue*k)).toString(16)\n let new_color = '#'+new_red+new_green+new_blue\n k += 0.1\n a.push(new_color)\n }\n return a\n\n }", "function r$6(r,e){e.attributeColor?(r.attributes.add(\"color\",\"vec4\"),r.varyings.add(\"vColor\",\"vec4\"),r.vertex.code.add(t$i`void forwardVertexColor() { vColor = color; }`),r.vertex.code.add(t$i`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):r.vertex.code.add(t$i`void forwardVertexColor() {}\nvoid forwardNormalizedVertexColor() {}`);}", "function setColor(d) {\n d.color = color.domain().indexOf(d.name) >= 0 ? color(d.name) : d.parent ? d.parent.color : null;\n if (d.children) d.children.forEach(setColor);\n}", "function color(d) {\n\t\t\t return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n\t\t\t}", "function TStylingRange() {}", "function TStylingRange() {}", "function getColor(node) {\n if (node.x === 0) {\n var r = node.node * 22 % 255 - 30;\n var g = node.node * 24% 255 - 20;\n var b = node.node * 39 % 255 - 10;\n return d3.rgb(r, g, b);\n } else {\n return d3.rgb(0, 0, 0);\n }\n}", "function generateColourScale() {\n\t\t\tlet categoryToColourDict = Database.categoryToColourDictForEachNominalAttr[attributeName];\n\t\t\tlet allCategories = Object.keys(categoryToColourDict).sort();\n\t\t\tlet filteredCategories = []\n\t\t\tlet colourCodeList = [];\n\t\t\tlet filterName = attributeName + ':nominal';\n\t\t\tlet checkedItemList = allCategories;\n\t\t\tlet needToRemoveMissingValues = false;\n\n\t\t\tif (filterName in Filter) {\n\t\t\t\tcheckedItemList = Filter[filterName].getCheckedItemList();\n\t\t\t\tneedToRemoveMissingValues = Filter[filterName].isMissingValueButtonSelected();\n\t\t\t}\n\t\t\tfor (let i = 0; i < allCategories.length; i++) {\n\t\t\t\tlet currentCategory = allCategories[i];\n\t\t\t\tlet currentCategoryFoundInCheckedItemList = checkedItemList.indexOf(currentCategory) != -1;\n\t\t\t\tif (currentCategory == '##missing' && needToRemoveMissingValues) continue;\n\t\t\t\tif (!currentCategoryFoundInCheckedItemList) continue;\n\t\t\t\tfilteredCategories.push(currentCategory);\n\t\t\t}\n\t\t\tfor (let i = 0; i < filteredCategories.length; i++) {\n\t\t\t\tlet currentCategory = filteredCategories[i];\n\t\t\t\tlet currentColourCode = categoryToColourDict[currentCategory];\n\t\t\t\tcolourCodeList.push(currentColourCode);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdomain: filteredCategories,\n\t\t\t\trange: colourCodeList \n\t\t\t};\n\t\t}", "function getColor(me) {\n\t\tlet label = getLabel(me);\n\t\tif (label == -1) return d3.lab(\"#000\");\n\t\tlet metaid = +me.parentNode.parentNode.getAttribute(\"metacluster\");\n\t\tlet col = d3.lab(color10[metaid % 10]);\n\t\tlet n = +me.parentNode.getAttribute(\"n\");\n\t\treturn col.darker(0.2 * n);\n\t}", "function color(d) {\n return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n }", "function circleColour(d){\n if(d.type ==\"member\"){ //node type\n return \"#ff8c69\";\n } else {\n return \"#8aded8\";\n }\n}", "function buildColorScale(min, mid, max, minColor, midColor, maxColor) {\n //return scale of colors for min to mid to max values\n var colors = d3.scale.linear()\n .domain([min, mid, max])\n .range([minColor, midColor, maxColor]);\n return colors;\n }", "function markNodesOfSameType(d, color) {\n\tif (d.node.type === \"text\") {\n\t\tfor (let node of nodes) {\n\t\t\tif (node.node.type === \"text\")\n\t\t\t\tnode.fillStyle = color;\n\t\t\telse\n\t\t\t\tnode.fillStyle = undefined;\n\t\t}\n\t} else {\n\t\tfor (let node of nodes) {\n\t\t\tif (node.node.tagName === d.node.tagName)\n\t\t\t\tnode.fillStyle = color;\n\t\t\telse\n\t\t\t\tnode.fillStyle = undefined;\n\t\t}\n\t}\n}", "function getColor(depth) {\n if (depth > 90) {\n color = \"#EB411A\";\n }\n else if (depth > 70) {\n color = \"#EB631A\";\n }\n else if (depth > 50) {\n color = \"#EB8F1A\";\n }\n else if (depth > 30) {\n color = \"#EBA954\";\n }\n else if (depth > 10) {\n color = \"#EBE554\";\n }\n else {\n color = \"#88E445\";\n }\n return color\n}", "function TStylingRange() { }", "function setColors (n, c) {\n if(n.strokeWidth=='1') { // adding time, cs, dv, nom to a node with no stroke\n n.strokeWidth = '4';\n n.strokeColor = c;\n n.nodeCol = taggedColor;\n if(dvColor==c) {\n // check if array, if not, make it an array\n // console.log(Object.prototype.toString.call(zparams.zdv));\n zparams.zdv = Object.prototype.toString.call(zparams.zdv) == \"[object Array]\" ? zparams.zdv : [];\n zparams.zdv.push(n.name);\n }\n else if(csColor==c) {\n zparams.zcross = Object.prototype.toString.call(zparams.zcross) == \"[object Array]\" ? zparams.zcross : [];\n zparams.zcross.push(n.name);\n }\n else if(timeColor==c) {\n zparams.ztime = Object.prototype.toString.call(zparams.ztime) == \"[object Array]\" ? zparams.ztime : [];\n zparams.ztime.push(n.name);\n }\n else if(nomColor==c) {\n zparams.znom = Object.prototype.toString.call(zparams.znom) == \"[object Array]\" ? zparams.znom : [];\n zparams.znom.push(n.name);\n }\n \n d3.select(\"#tab1\").select(\"p#\".concat(n.name))\n .style('background-color', hexToRgba(c));\n }\n else if (n.strokeWidth=='4') {\n if(c==n.strokeColor) { // deselecting time, cs, dv, nom\n n.strokeWidth = '1';\n n.strokeColor = selVarColor;\n n.nodeCol=colors(n.id);\n d3.select(\"#tab1\").select(\"p#\".concat(n.name))\n .style('background-color', hexToRgba(selVarColor));\n \n if(dvColor==c) {\n var dvIndex = zparams.zdv.indexOf(n.name);\n if (dvIndex > -1) { zparams.zdv.splice(dvIndex, 1); }\n }\n else if(csColor==c) {\n var csIndex = zparams.zcross.indexOf(n.name);\n if (csIndex > -1) { zparams.zcross.splice(csIndex, 1); }\n }\n else if(timeColor==c) {\n var timeIndex = zparams.ztime.indexOf(n.name);\n if (timeIndex > -1) { zparams.ztime.splice(timeIndex, 1); }\n }\n else if(nomColor==c) {\n var nomIndex = zparams.znom.indexOf(n.name);\n if (nomIndex > -1) { zparams.znom.splice(nomIndex, 1); }\n }\n }\n else { // deselecting time, cs, dv, nom AND changing it to time, cs, dv, nom\n if(dvColor==n.strokeColor) {\n var dvIndex = zparams.zdv.indexOf(n.name);\n if (dvIndex > -1) { zparams.zdv.splice(dvIndex, 1); }\n }\n else if(csColor==n.strokeColor) {\n var csIndex = zparams.zcross.indexOf(n.name);\n if (csIndex > -1) { zparams.zcross.splice(csIndex, 1); }\n }\n else if(timeColor==n.strokeColor) {\n var timeIndex = zparams.ztime.indexOf(n.name);\n if (timeIndex > -1) { zparams.ztime.splice(timeIndex, 1); }\n }\n else if(nomColor==n.strokeColor) {\n var nomIndex = zparams.znom.indexOf(n.name);\n if (nomIndex > -1) { zparams.znom.splice(nomIndex, 1); }\n }\n n.strokeColor = c;\n d3.select(\"#tab1\").select(\"p#\".concat(n.name))\n .style('background-color', hexToRgba(c));\n \n if(dvColor==c) {zparams.zdv.push(n.name);}\n else if(csColor==c) {zparams.zcross.push(n.name);}\n else if(timeColor==c) {zparams.ztime.push(n.name);}\n else if(nomColor==c) {zparams.znom.push(n.name);}\n }\n }\n}", "function circleColour(d) {\n if(d.type ===\"NODE\"){\n// \treturn \"#753d54\";\n return \"gray\";\n\n } else {\n \treturn \"#c41f6e\";\n }\n\n}", "function nodeColor(d) {\n if (d.name.slice(0, 4) != \"bsms\") {\n return \"silver\";\n } else {\n return \"grey\";\n }\n }", "function testMatchColorRange(console) {\n $$.each([\n \"red\",\n \"red to blue\",\n \"f00 to 00f\",\n \"'#f00' to '#00f'\"\n ], function(test) {\n console.log(test, \"=>\", matchColorRange(test));\n });\n}", "function color(d) {\n return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n }", "function colorMe(value, ranges) {\n for (let i = 0; i <= ranges.length; i++) {\n if (value <= ranges[i]) {\n if (i === 0) {\n return colors[i];\n } else {\n return colors[i - 1];\n }\n }\n }\n }", "get color() { return this._color || this.selectionList.color; }", "get color() { return this._color || this.selectionList.color; }", "function nodeColors(regualrColor, disabledColor) {\n document.getElementById(\"infoSidebar\").style.borderLeft = \"5px solid \" + regualrColor;\n document.getElementById(\"set-name\").style.color = regualrColor;\n document.getElementById(\"set-type\").style.backgroundColor = regualrColor;\n document.getElementById(\"set-node-title\").style.backgroundColor = disabledColor;\n document.getElementById(\"toggle-info-btn\").style.backgroundColor = regualrColor;\n}", "function tagColors(heightListing, stats) {\n window.console.log(\"About to tag mappings with color.\");\n var colorScale = d3.scale.linear().domain([1, stats.redThreshold]).clamp(true);\n colorScale.domain([0, 0.5, 1].map(colorScale.invert));\n colorScale.range([\"blue\", \"red\"]);\n for (var i = 0; i < heightListing.length; ++i) {\n var listing = heightListing[i];\n if (listing && !listing.color) {\n listing.color = colorScale(listing.reads);\n }\n }\n}", "function linkColour(d){\n if(d.type == \"member\"){ //edges type\n return \"#d98686\";\n } else {\n return \"red\";\n }\n}", "function color(d) {\n return d._children ? '#3182bd' : d.children ? '#c6dbef' : '#fd8d3c';\n}", "_colorEventListener() {\r\n d3.selectAll('[data-color]').on('click', function () {\r\n d3.selectAll('[data-color]').classed('active', false);\r\n d3.select(this).classed('active', true);\r\n\r\n this.color = d3.select(this).attr('data-color');\r\n\r\n })\r\n }", "_getColorForNode(nodeName) {\n const underscoreInd = nodeName.indexOf('_') === -1 ? nodeName.length : nodeName.indexOf('_');\n const nodeType = nodeName.substring(0, underscoreInd);\n if (this.props.removedNodes.has(nodeName)) {\n return GRAY;\n }\n if (nodeType === 'Part') {\n return ORDINAL_COLORS(nodeName);\n } else {\n return TYPE_COLORS[nodeType];\n }\n }", "function getColor(depth){\n if(depth <= 10){\n return \"#17ff0a\"\n\n } else if(depth >10 && depth <= 30){\n return \"#5cb60a\"\n } else if(depth >30 && depth <= 50){\n return \"#f4bd09\"\n }else if(depth >50 && depth <= 70){\n return \"#f46f0c\"\n }else if(depth >70 && depth <= 90){\n return \"#ff4702\"\n }\n else{\n return \"#f90909\"\n }\n }", "function chooseColor(depth) {\n var color_value;\n if (depth > 20) {\n color_value = \"darkred\"\n }\n else if (depth <= 20 && depth > 8) {\n color_value = \"yellow\"\n }\n else if (depth < 4) {\n color_value = \"green\"\n }\n return color_value;\n }", "function colorthis(measurement) {\r\n\t\r\n\tM = parseFloat(measurement)\r\n\t//rgb to hex conversion function borrowed from https://campushippo.com/lessons/how-to-convert-rgb-colors-to-hexadecimal-with-javascript-78219fdb\r\n\tfunction rgbToHex(rgb){ \r\n\t\tvar hex = Number(rgb).toString(16);\r\n\t\tif (hex.length < 2) {\r\n\t\t hex = \"0\" + hex;\r\n\t\t}\r\n\t\treturn hex;\r\n\t\t};\r\n\t\r\n\t//map the measurement domain on the the RGB color range\r\n\tvar\tcolorScale = d3.scaleLinear()\r\n\t\t.domain([d_min,d_max])\r\n\t\t.range([0,255]);\r\n\t\r\n\t//starting at (0,255,0); for values less than the midpoint we need to add the red channel until we get to (255,255,0)\r\n\tif(M < d_midpt){\r\n\t\tvar red = Math.round(2 * colorScale(M))\r\n\t\tvar green = 255\r\n\t\tvar blue = 0\r\n\t\tvar hexcolor = \"#\"+rgbToHex(red)+rgbToHex(green)+rgbToHex(blue)\r\n\t\treturn hexcolor\r\n\t\r\n\t//for values greater than the midpoint we need to subtract from the green channel until we get to (255,0,0)\r\n\t} else {\r\n\t\tred = 255 \r\n\t\tgreen = (255-Math.round(colorScale(M)))\r\n\t\tblue = 0\r\n\t\tvar hexcolor = \"#\"+rgbToHex(red)+rgbToHex(green)+rgbToHex(blue)\r\n\t\treturn hexcolor\r\n\t};\r\n}", "function choropleth (props, colorScale){\n //make sure attribute value is a number\n var val = parseFloat(props[expressed]);\n //if attribute value exists, assign it a color, otherwise grey\n if (typeof val == 'number' && !isNaN(val)){\n return colorScale (val);\n } else {\n return \"#ffffff\";\n };\n}", "function getColorClass(color, level) {\n var lvlClass = level ? '-' + level : '';\n return 'mdl-color--' + color + lvlClass;\n}", "function choropleth(props, colorScale){\n\t\t//make sure attribute value is a number\n\t\tvar val=parseFloat(props[expressed]);\n\t\t//if attribute value exists, assign a color; otherwise gray\n\t\tif (typeof val=='number' &&!isNaN(val)){\n\t\t\treturn colorScale(val);\n\t\t} else {\n\t\t\treturn \"#CCC\";\n\t\t};\n\t}", "function getRGBRange(color: Color) {\n var rgb = sortBy(color.rgb().array()).reverse();\n var [max, med, min] = rgb;\n return (max - min) / 10;\n}", "paintColors ( ) {\n this.colorScale = d3.scaleOrdinal( )\n .range( [\n \"#316395\",\"#dc3912\",\"#ff9900\",\"#109618\",\"#990099\",\"#0099c6\",\"#8b0707\",\n \"#3b3eac\",\"#b82e2e\",\"#994499\",\"#22aa99\",\"#aaaa11\",\"#6633cc\",\"#e67300\",\n ] )\n .domain( this.data.children.map( d => d.name ) );\n this.tile.attr( 'fill', d => this.colorScale( d.data.category ) );\n\n return this;\n }", "function initializeRangeValue() {\n nodes.innerHTML = customRange2.value;\n}", "function attrFill(a) {\n switch (a) {\n case \"A\": return \"#00af54\"; // green\n case \"B\": return \"#f27935\"; // orange\n case \"C\": return \"#d4071c\"; // red\n case \"D\": return \"#70bdc2\"; // cyan\n case \"E\": return \"#fcf384\"; // gold\n case \"F\": return \"#e69aaf\"; // pink\n case \"G\": return \"#08488f\"; // blue\n case \"H\": return \"#866310\"; // brown\n case \"I\": return \"#9270c2\"; // purple\n case \"J\": return \"#a3cf62\"; // chartreuse\n case \"K\": return \"#91a4c2\"; // lightgray bluish\n case \"L\": return \"#af70c2\"; // magenta\n case \"S\": return \"#d4071c\"; // red\n default: return \"transparent\";\n }\n }", "function generateColor(level) {\n var factor = level * 100;\n var color;\n if (factor < 3) {\n color = colors[0];\n } else if (factor > 3 && factor <= 8) {\n color = colors[1];\n } else if (factor > 8 && factor <= 11) {\n color = colors[2];\n } else if (factor > 11 && factor <= 14) {\n color = colors[3];\n } else if (factor > 14) {\n color = colors[4];\n }\n return color;\n}", "function variaceColor(){\n\n\treturn d3.scale.linear()\n\t\t\t\t\t.domain([0, 1])\n\t\t\t\t\t.range(['#fee0d2', '#de2d26']);\n}", "function setRangeOptions_colors(){\n\tvar range = \tSpreadsheetApp.getActiveSpreadsheet().getActiveRange();\n\tSheeter().setRangeOptions(range, 'color', 'red');\n}", "calculateColors() {\n // find node with the maximum stress\n let max_stress = 0;\n for (let i = 0; i < this.n * this.m; ++i) {\n if (this.stress[i] > max_stress) max_stress = this.stress[i];\n }\n\n // normilize coefficient\n let coeff = 1 / max_stress;\n\n let color_row_delta = 3 * this.m;\n let color_column_delta = 3;\n\n // iterate over colours array and set colour between blue and red based on stress value\n for (let i = 0; i < this.n; ++i) {\n for (let j = 0; j < this.m; ++j) {\n this.color[i * color_row_delta + j * color_column_delta] = this.stress[i * this.m + j] * coeff;\n this.color[i * color_row_delta + j * color_column_delta + 1] = 0;\n this.color[i * color_row_delta + j * color_column_delta + 2] = 1 - this.stress[i * this.m + j] * coeff;\n }\n }\n }", "function colorElementInput() {\n if (colorInput.active) {\n let color = colorInput.colorElement.value;\n if (colorInput.hasAlpha) { // combine rgb with alpha from range (all elements are synchro)\n color += hexString(colorInput.rangeElement.value);\n }\n colorInput.updateValue(color);\n }\n }", "function recolor() {\n\td3.selectAll(\"rect\").style(\"fill\", function() {\n\t\tvar values = stdSlider.noUiSlider.get();\n\t\tleft = values[0];\n\t\tright = values[1];\n\t\tvar lilval = (Math.floor(backwards(this.x.baseVal.value)));\n\t\treturn colorUp(lilval);\n\t})\n}", "function applyColor(color) {\n wrapNodesWithFormat(textProps.nodesForFormatting, color);\n }", "function dualColor (){\n \n\tcounter += 1;\n\tdocument.getElementById('model__baseC').getAttribute('color');\n\tswitch (counter) {\n\t\tcase 1:\n\t\tdocument.getElementById('model__baseC').setAttribute('color', '0.4627 0.4627 0.4627 0.3549 0.3549 0.3549');\n\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\tdocument.getElementById('model__baseC').setAttribute('color', '0.003922 0.1255 0.3059 0.1294 0.1294 0.1294');\n\t\t\tbreak;\n\t\tcase 3:\n\t\tdocument.getElementById('model__baseC').setAttribute('color', '0.2549 -0.5529 -0.5529 0.1294 0.1294 0.1294');\n\t\t\tbreak;\n\n\t\t\tcase 4:\n\t\tdocument.getElementById('model__baseC').setAttribute('color', '0.003922 0.5333 0.4275 0.1725 0.04314 0.09412');\n\t\t\tbreak;\n\n\t\tcase 5:\n\t\t\tcounter = 0;\n\t\t\tdocument.getElementById('model__baseC').setAttribute('color', '0.003922 0.003922 0.003922 0.1294 0.1294 0.1294');\n\t\t\tbreak;\n\t}\n\t\t\t\n\n}", "function choropleth(props, colorScale){\n //make sure attribute value is a number\n var val = parseFloat(props);\n //if attribute value exists, assign a color; otherwise assign gray\n if (val && val != NaN){\n return colorScale(val);\n } else {\n return \"#CCC\";\n };\n }", "function getRange(hexColor) {\n const end = \"#fff\";\n return [\n chroma(hexColor)\n .darken(1.4)\n .hex(),\n hexColor,\n end\n ]\n}" ]
[ "0.63619906", "0.63619906", "0.6360443", "0.6170336", "0.60562044", "0.60562044", "0.6054188", "0.60462403", "0.60265625", "0.5981543", "0.5981543", "0.5981543", "0.5981543", "0.59813595", "0.59813595", "0.59813595", "0.59418565", "0.59411913", "0.5850726", "0.5762965", "0.5734996", "0.566837", "0.5641111", "0.56378645", "0.55939174", "0.55482376", "0.552304", "0.549259", "0.54885274", "0.5487588", "0.54716736", "0.5444767", "0.5397722", "0.53842986", "0.5376151", "0.53659785", "0.5359091", "0.53464544", "0.53367627", "0.53336847", "0.53040063", "0.5298313", "0.52928287", "0.52848613", "0.5264037", "0.5246921", "0.52422464", "0.5241011", "0.5230918", "0.5217668", "0.5203615", "0.5203615", "0.51999664", "0.5199474", "0.51944506", "0.5192092", "0.51910245", "0.5189609", "0.5186283", "0.51804876", "0.51737297", "0.51703435", "0.51680386", "0.5161168", "0.515615", "0.51407", "0.5139345", "0.51275146", "0.51275146", "0.51205117", "0.51201653", "0.51090735", "0.5104906", "0.5099455", "0.50949854", "0.5088893", "0.50748104", "0.5071825", "0.50685763", "0.50645673", "0.50609976", "0.5060628", "0.5056507", "0.5049895", "0.50478536", "0.5043557", "0.50433517", "0.5038275", "0.50272983", "0.502454", "0.50156885", "0.5011785", "0.5006304", "0.49989298", "0.49978274" ]
0.5855089
23
Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not support the API. Wrapping the native API works around differences in behavior from different browsers.
function getBrowserPerformance() { var performance = Object(_misc__WEBPACK_IMPORTED_MODULE_0__[/* getGlobalObject */ "e"])().performance; if (!performance || !performance.now) { return undefined; } // Replace performance.timeOrigin with our own timeOrigin based on Date.now(). // // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin + // performance.now() gives a date arbitrarily in the past. // // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is // undefined. // // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to // interact with data coming out of performance entries. // // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have // observed skews that can be as long as days, weeks or months. // // See https://github.com/getsentry/sentry-javascript/issues/2590. // // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation // transactions of long-lived web pages. var timeOrigin = Date.now() - performance.now(); return { now: function () { return performance.now(); }, timeOrigin: timeOrigin, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBrowserPerformance() {\n var performance = global_1.getGlobalObject().performance;\n if (!performance || !performance.now) {\n return undefined;\n }\n // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n //\n // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n // performance.now() gives a date arbitrarily in the past.\n //\n // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n // undefined.\n //\n // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n // interact with data coming out of performance entries.\n //\n // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n // observed skews that can be as long as days, weeks or months.\n //\n // See https://github.com/getsentry/sentry-javascript/issues/2590.\n //\n // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n // transactions of long-lived web pages.\n var timeOrigin = Date.now() - performance.now();\n return {\n now: function () { return performance.now(); },\n timeOrigin: timeOrigin,\n };\n}", "function getBrowserPerformance() {\r\n var performance = getGlobalObject().performance;\r\n if (!performance || !performance.now) {\r\n return undefined;\r\n }\r\n // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\r\n //\r\n // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\r\n // performance.now() gives a date arbitrarily in the past.\r\n //\r\n // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\r\n // undefined.\r\n //\r\n // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\r\n // interact with data coming out of performance entries.\r\n //\r\n // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\r\n // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\r\n // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\r\n // observed skews that can be as long as days, weeks or months.\r\n //\r\n // See https://github.com/getsentry/sentry-javascript/issues/2590.\r\n //\r\n // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\r\n // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\r\n // transactions of long-lived web pages.\r\n var timeOrigin = Date.now() - performance.now();\r\n return {\r\n now: function () { return performance.now(); },\r\n timeOrigin: timeOrigin,\r\n };\r\n}", "function getNodePerformance() {\r\n try {\r\n var perfHooks = dynamicRequire(module, 'perf_hooks');\r\n return perfHooks.performance;\r\n }\r\n catch (_) {\r\n return undefined;\r\n }\r\n}", "function polyfill () {\n window.performance = window.performance || {};\n window.performance.now = function () {\n return performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function () {\n return new Date().getTime();\n };\n }();\n }", "function getNodePerformance() {\n try {\n var perfHooks = Object(_node__WEBPACK_IMPORTED_MODULE_1__[/* dynamicRequire */ \"a\"])(module, 'perf_hooks');\n return perfHooks.performance;\n }\n catch (_) {\n return undefined;\n }\n}", "function getNodePerformance() {\n try {\n var perfHooks = node_1.dynamicRequire(module, 'perf_hooks');\n return perfHooks.performance;\n }\n catch (_) {\n return undefined;\n }\n}", "function getNodePerformance() {\n\t try {\n\t const perfHooks = dynamicRequire(module, 'perf_hooks') ;\n\t return perfHooks.performance;\n\t } catch (_) {\n\t return undefined;\n\t }\n\t}", "function getNodePerformance() {\n try {\n const perfHooks = node.dynamicRequire(module, 'perf_hooks') ;\n return perfHooks.performance;\n } catch (_) {\n return undefined;\n }\n}", "function getNodePerformance() {\n try {\n const perfHooks = dynamicRequire(module, 'perf_hooks') ;\n return perfHooks.performance;\n } catch (_) {\n return undefined;\n }\n }", "function PerformanceReporter() {\n }", "function getLowLevelMetrics() {\n const r = {};\n const perfNav = window.performance.getEntriesByType('navigation');\n if (perfNav.length > 0) {\n r.DC = Math.round(perfNav[0].domComplete);\n r.DI = Math.round(perfNav[0].domInteractive);\n r.DCL = Math.round(perfNav[0].domContentLoadedEventEnd);\n r.L = Math.round(perfNav[0].loadEventEnd);\n }\n const perfRes = window.performance.getEntriesByType('resource');\n if (perfRes.length > 0) {\n r.DBS = 0; // decoded body size\n r.EBS = 0; // encoded body size\n r.TS = 0; // transfer size\n perfRes.forEach((performanceEntry) => {\n if ('decodedBodySize' in performanceEntry) {\n r.DBS += performanceEntry.decodedBodySize;\n }\n if ('encodedBodySize' in performanceEntry) {\n r.EBS += performanceEntry.encodedBodySize;\n }\n if ('transferSize' in performanceEntry) {\n r.TS += performanceEntry.transferSize;\n }\n });\n }\n return r;\n}", "function getSpeed() {\n \n var point = agent.search(\"msie\");\n \n if(point === -1) {\n \n return [33.3, 0];\n \n }\n else {\n \n var ver = parseInt(agent.substr(point + 4, point + 5), 10), speed = ver >= 9 ? 16.6 : 33.3;\n \n return [speed, ver];\n \n }\n \n }", "function fetchWebPerfMetrics() {\n // web-vitals.js doesn't have a way to remove previous listeners, so we'll save whether\n // we've already installed the listeners before installing them again.\n // See https://github.com/GoogleChrome/web-vitals/issues/55.\n if (self._hasInstalledPerfMetrics) return;\n self._hasInstalledPerfMetrics = true;\n\n webVitals.getCLS((metric) => {\n // As CLS values can fire frequently in the case\n // of animations or highly-dynamic content, we\n // debounce the broadcast of the metric.\n latestCLS = metric;\n debouncedCLSBroadcast();\n }, true);\n webVitals.getLCP((metric) => {\n broadcastMetricsUpdates('lcp', metric);\n }, true);\n webVitals.getFID((metric) => {\n broadcastMetricsUpdates('fid', metric);\n }, true);\n }", "now() {\n return window.performance.now();\n }", "function usePlatformMethods(_ref) {\n var pointerEvents = _ref.pointerEvents,\n style = _ref.style;\n // Avoid creating a new ref on every render.\n var ref = (0, _useStable.default)(() => hostNode => {\n if (hostNode != null) {\n hostNode.measure = callback => _UIManager.default.measure(hostNode, callback);\n hostNode.measureLayout = (relativeToNode, success, failure) => _UIManager.default.measureLayout(hostNode, relativeToNode, failure, success);\n hostNode.measureInWindow = callback => _UIManager.default.measureInWindow(hostNode, callback);\n }\n });\n return ref;\n}", "function v8Profile() {\n if (!enabled) {\n throw new Error('Heap profiler is not enabled.');\n }\n return heap_profiler_bindings_1.getAllocationProfile();\n}", "function _installTimerWrappers() {\n global.setInterval = (...args) => {\n let timer = setIntervalNative(...args);\n\n timers.push({ timer, clear: () => global.clearInterval(timer) });\n\n return timer;\n };\n global.setTimeout = (...args) => {\n let timer = setTimeoutNative(...args);\n\n timers.push({ timer, clear: () => global.clearTimeout(timer) });\n\n return timer;\n };\n global.setImmediate = (...args) => {\n let timer = setImmediateNative(...args);\n\n timers.push({ timer, clear: () => global.clearImmediate(timer) });\n\n return timer;\n };\n }", "function performanceTiming(context, timing)\n{\n var t = timing;\n var elapsed = t.loadEventEnd - t.navigationStart;\n\n var objects = [];\n var rep = PerformanceTimingRep;\n var bars = calculateBars(t);\n\n var result = [];\n for (var i=0; i<bars.length; i++)\n {\n var bar = bars[i];\n\n // Filter our empty bars.\n if (!bar.elapsed)\n continue;\n\n bar.left = calculatePos(bar.start, elapsed);\n bar.width = calculatePos(bar.elapsed, elapsed);\n bar.label = bar.label + \" \" + Str.formatTime(bar.elapsed);\n\n result.push(bar);\n }\n\n // Events\n var domLoading = calculatePos(t.domLoading - t.navigationStart, elapsed);\n var domInteractive = calculatePos(t.domInteractive - t.navigationStart, elapsed);\n var domContentLoaded = calculatePos(t.domContentLoadedEventStart - t.navigationStart, elapsed);\n var onLoad = calculatePos(t.loadEventStart - t.navigationStart, elapsed);\n\n for (var i=0; i<result.length; i++)\n {\n var bar = result[i];\n bar.domLoading = domLoading;\n bar.domInteractive = domInteractive;\n bar.domContentLoaded = domContentLoaded;\n bar.onLoad = onLoad;\n }\n\n var input = new PerfTimingObj(result, t);\n Firebug.Console.log(input, context, \"perfTiming\", rep, true);\n\n // Create a log group first (collapsed by default). All the timing details will be rendered\n // inside the group (within 'logGroupBody' element).\n var row = Firebug.Console.openCollapsedGroup(\"perfTimingDetails\", context, \"perfTimingDetails\",\n DetailsCaption, true, null, true);\n Firebug.Console.closeGroup(context, true);\n\n // Get 'logGroupBody' element and render the timing details.\n var logGroupBody = row.getElementsByClassName(\"logGroupBody\")[0];\n var table = DetailsTable.tag.replace({object: t}, logGroupBody);\n var tBody = table.lastChild;\n\n // Iterate only known properties (these are also localized).\n var timings = [];\n for (var i=0; i<timingProps.length; i++)\n {\n var name = timingProps[i];\n var value = t[name];\n var startTime = value ? (value - t.navigationStart) : 0;\n var timing = {\n name: name,\n timeLabel: startTime ? \"+\" + Str.formatTime(startTime) : 0,\n desc: Locale.$STR(\"perftiming.\" + name),\n time: startTime,\n };\n timings.push(timing);\n }\n\n timings.sort(function(a, b) {\n return a.time > b.time ? 1 : -1;\n });\n\n DetailsEntry.tag.insertRows({timings: timings}, tBody);\n\n return Firebug.Console.getDefaultReturnValue();\n}", "function PerformanceTestCase() {\n}", "constructor() {\n super('page-timing');\n\n let sourceInfo = {};\n let timingInfo = {};\n let timing = performance.timing;\n\n let timingEntries = ['connect', 'domainLookup', 'domContentLoadedEvent',\n 'loadEvent', 'redirect', 'response', 'unloadEvent'];\n\n let locationEntries = ['origin', 'protocol','pathname'];\n\n for (let entry of timingEntries) {\n let start = timing[entry + 'Start'];\n let end = timing[entry + 'End'];\n\n timingInfo[entry] = end - start;\n }\n\n sourceInfo['title'] = window.document.title;\n\n for (let entry of locationEntries) {\n sourceInfo[entry] = window.document.location[entry];\n }\n\n this._data = {\n 'source' : sourceInfo,\n 'timing' : timingInfo\n };\n }", "function now() {\r\n return window.performance.now();\r\n}", "get(_, prop) {\n\t\treturn new Proxy(()=>{}, {\n\t\t\tapply(targ, thisArg, args) {\n\t\t\t\tif (thisArg === targ) {\n\t\t\t\t\tif (!targ.chromeMethod) targ.chromeMethod = chrome;\n\t\t\t\t\ttarg.chromeThis = targ.chromeMethod;\n\t\t\t\t\ttarg.chromeMethod = targ.chromeMethod[args[0]];\n\t\t\t\t} else {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tchromeMethod,\n\t\t\t\t\t\tchromeThis,\n\t\t\t\t\t} = targ;\n\n\t\t\t\t\tdelete targ.chromeMethod;\n\t\t\t\t\tdelete targ.chromeThis;\n\t\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tchromeMethod.call(chromeThis, ...args, resolve);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\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\tget(targ, prop, rec) {\n\t\t\t\tif (prop === Symbol.toPrimitive) {// chromium dev tools likes to call this\n\t\t\t\t\treturn ()=> `prome`;\n\t\t\t\t} else {\n\t\t\t\t\tFunction.prototype.call.call(rec, targ, prop);\n\t\t\t\t\treturn rec;\n\t\t\t\t}\n\t\t\t},\n\t\t})[prop];\n\t}", "__init2() {this.performanceEvents = [];}", "function polyfills(param) {\n remove_polyfill();\n requestAnimationFrame_polyfill();\n \n }", "static _now() {\n return window.performance ? window.performance.now() : Date.now();\n }", "function usePlatformMethods(_ref) {\n var classList = _ref.classList,\n pointerEvents = _ref.pointerEvents,\n style = _ref.style;\n var previousStyleRef = (0, _react.useRef)(null);\n var setNativePropsArgsRef = (0, _react.useRef)(null);\n setNativePropsArgsRef.current = {\n classList: classList,\n pointerEvents: pointerEvents,\n style: style\n }; // Avoid creating a new ref on every render. The props only need to be\n // available to 'setNativeProps' when it is called.\n\n var ref = (0, _useStable.default)(function () {\n return function (hostNode) {\n if (hostNode != null) {\n hostNode.measure = function (callback) {\n return _UIManager.default.measure(hostNode, callback);\n };\n\n hostNode.measureLayout = function (relativeToNode, success, failure) {\n return _UIManager.default.measureLayout(hostNode, relativeToNode, failure, success);\n };\n\n hostNode.measureInWindow = function (callback) {\n return _UIManager.default.measureInWindow(hostNode, callback);\n };\n\n hostNode.setNativeProps = function (nativeProps) {\n var _ref2 = setNativePropsArgsRef.current || emptyObject,\n classList = _ref2.classList,\n style = _ref2.style,\n pointerEvents = _ref2.pointerEvents;\n\n setNativeProps(hostNode, nativeProps, classList, pointerEvents, style, previousStyleRef);\n };\n }\n };\n });\n return ref;\n}", "function AppMeasurement(r) {\n var a = this;\n a.version = \"2.22.4\";\n var h = window;\n h.s_c_in || ((h.s_c_il = []), (h.s_c_in = 0));\n a._il = h.s_c_il;\n a._in = h.s_c_in;\n a._il[a._in] = a;\n h.s_c_in++;\n a._c = \"s_c\";\n var q = h.AppMeasurement.hc;\n q || (q = null);\n var p = h,\n m,\n s;\n try {\n for (\n m = p.parent, s = p.location;\n m &&\n m.location &&\n s &&\n \"\" + m.location !== \"\" + s &&\n p.location &&\n \"\" + m.location !== \"\" + p.location &&\n m.location.host === s.host;\n\n )\n (p = m), (m = p.parent);\n } catch (u) {}\n a.log = function(a) {\n try {\n console.log(a);\n } catch (b) {}\n };\n a.Qa = function(a) {\n return \"\" + parseInt(a) == \"\" + a;\n };\n a.replace = function(a, b, d) {\n return !a || 0 > a.indexOf(b) ? a : a.split(b).join(d);\n };\n a.escape = function(c) {\n var b, d;\n if (!c) return c;\n c = encodeURIComponent(c);\n for (b = 0; 7 > b; b++)\n (d = \"+~!*()'\".substring(b, b + 1)),\n 0 <= c.indexOf(d) &&\n (c = a.replace(\n c,\n d,\n \"%\" +\n d\n .charCodeAt(0)\n .toString(16)\n .toUpperCase()\n ));\n return c;\n };\n a.unescape = function(c) {\n if (!c) return c;\n c = 0 <= c.indexOf(\"+\") ? a.replace(c, \"+\", \" \") : c;\n try {\n return decodeURIComponent(c);\n } catch (b) {}\n return unescape(c);\n };\n a.Mb = function() {\n var c = h.location.hostname,\n b = a.fpCookieDomainPeriods,\n d;\n b || (b = a.cookieDomainPeriods);\n if (\n c &&\n !a.Ja &&\n !/^[0-9.]+$/.test(c) &&\n ((b = b ? parseInt(b) : 2),\n (b = 2 < b ? b : 2),\n (d = c.lastIndexOf(\".\")),\n 0 <= d)\n ) {\n for (; 0 <= d && 1 < b; ) (d = c.lastIndexOf(\".\", d - 1)), b--;\n a.Ja = 0 < d ? c.substring(d) : c;\n }\n return a.Ja;\n };\n a.c_r = a.cookieRead = function(c) {\n c = a.escape(c);\n var b = \" \" + a.d.cookie,\n d = b.indexOf(\" \" + c + \"=\"),\n f = 0 > d ? d : b.indexOf(\";\", d);\n c =\n 0 > d\n ? \"\"\n : a.unescape(b.substring(d + 2 + c.length, 0 > f ? b.length : f));\n return \"[[B]]\" != c ? c : \"\";\n };\n a.c_w = a.cookieWrite = function(c, b, d) {\n var f = a.Mb(),\n e = a.cookieLifetime,\n g;\n b = \"\" + b;\n e = e ? (\"\" + e).toUpperCase() : \"\";\n d &&\n \"SESSION\" != e &&\n \"NONE\" != e &&\n ((g = \"\" != b ? parseInt(e ? e : 0) : -60)\n ? ((d = new Date()), d.setTime(d.getTime() + 1e3 * g))\n : 1 === d &&\n ((d = new Date()),\n (g = d.getYear()),\n d.setYear(g + 2 + (1900 > g ? 1900 : 0))));\n return c && \"NONE\" != e\n ? ((a.d.cookie =\n a.escape(c) +\n \"=\" +\n a.escape(\"\" != b ? b : \"[[B]]\") +\n \"; path=/;\" +\n (d && \"SESSION\" != e ? \" expires=\" + d.toUTCString() + \";\" : \"\") +\n (f ? \" domain=\" + f + \";\" : \"\") +\n (a.writeSecureCookies ? \" secure;\" : \"\")),\n a.cookieRead(c) == b)\n : 0;\n };\n a.Jb = function() {\n var c = a.Util.getIeVersion();\n \"number\" === typeof c &&\n 10 > c &&\n ((a.unsupportedBrowser = !0), a.wb(a, function() {}));\n };\n a.xa = function() {\n var a = navigator.userAgent;\n return \"Microsoft Internet Explorer\" === navigator.appName ||\n 0 <= a.indexOf(\"MSIE \") ||\n (0 <= a.indexOf(\"Trident/\") && 0 <= a.indexOf(\"Windows NT 6\"))\n ? !0\n : !1;\n };\n a.wb = function(a, b) {\n for (var d in a)\n Object.prototype.hasOwnProperty.call(a, d) &&\n \"function\" === typeof a[d] &&\n (a[d] = b);\n };\n a.J = [];\n a.ea = function(c, b, d) {\n if (a.Ka) return 0;\n a.maxDelay || (a.maxDelay = 250);\n var f = 0,\n e = new Date().getTime() + a.maxDelay,\n g = a.d.visibilityState,\n k = [\"webkitvisibilitychange\", \"visibilitychange\"];\n g || (g = a.d.webkitVisibilityState);\n if (g && \"prerender\" == g) {\n if (!a.fa)\n for (a.fa = 1, d = 0; d < k.length; d++)\n a.d.addEventListener(k[d], function() {\n var c = a.d.visibilityState;\n c || (c = a.d.webkitVisibilityState);\n \"visible\" == c && ((a.fa = 0), a.delayReady());\n });\n f = 1;\n e = 0;\n } else d || (a.u(\"_d\") && (f = 1));\n f &&\n (a.J.push({ m: c, a: b, t: e }),\n a.fa || setTimeout(a.delayReady, a.maxDelay));\n return f;\n };\n a.delayReady = function() {\n var c = new Date().getTime(),\n b = 0,\n d;\n for (a.u(\"_d\") ? (b = 1) : a.za(); 0 < a.J.length; ) {\n d = a.J.shift();\n if (b && !d.t && d.t > c) {\n a.J.unshift(d);\n setTimeout(a.delayReady, parseInt(a.maxDelay / 2));\n break;\n }\n a.Ka = 1;\n a[d.m].apply(a, d.a);\n a.Ka = 0;\n }\n };\n a.setAccount = a.sa = function(c) {\n var b, d;\n if (!a.ea(\"setAccount\", arguments))\n if (((a.account = c), a.allAccounts))\n for (\n b = a.allAccounts.concat(c.split(\",\")),\n a.allAccounts = [],\n b.sort(),\n d = 0;\n d < b.length;\n d++\n )\n (0 != d && b[d - 1] == b[d]) || a.allAccounts.push(b[d]);\n else a.allAccounts = c.split(\",\");\n };\n a.foreachVar = function(c, b) {\n var d,\n f,\n e,\n g,\n k = \"\";\n e = f = \"\";\n if (a.lightProfileID)\n (d = a.N),\n (k = a.lightTrackVars) && (k = \",\" + k + \",\" + a.ka.join(\",\") + \",\");\n else {\n d = a.g;\n if (a.pe || a.linkType)\n (k = a.linkTrackVars),\n (f = a.linkTrackEvents),\n a.pe &&\n ((e = a.pe.substring(0, 1).toUpperCase() + a.pe.substring(1)),\n a[e] && ((k = a[e].cc), (f = a[e].bc)));\n k && (k = \",\" + k + \",\" + a.D.join(\",\") + \",\");\n f && k && (k += \",events,\");\n }\n b && (b = \",\" + b + \",\");\n for (f = 0; f < d.length; f++)\n (e = d[f]),\n (g = a[e]) &&\n (!k || 0 <= k.indexOf(\",\" + e + \",\")) &&\n (!b || 0 <= b.indexOf(\",\" + e + \",\")) &&\n c(e, g);\n };\n a.o = function(c, b, d, f, e) {\n var g = \"\",\n k,\n l,\n h,\n n,\n m = 0;\n \"contextData\" == c && (c = \"c\");\n if (b) {\n for (k in b)\n if (\n !(Object.prototype[k] || (e && k.substring(0, e.length) != e)) &&\n b[k] &&\n (!d || 0 <= d.indexOf(\",\" + (f ? f + \".\" : \"\") + k + \",\"))\n ) {\n h = !1;\n if (m)\n for (l = 0; l < m.length; l++)\n if (k.substring(0, m[l].length) == m[l]) {\n h = !0;\n break;\n }\n if (\n !h &&\n (\"\" == g && (g += \"&\" + c + \".\"),\n (l = b[k]),\n e && (k = k.substring(e.length)),\n 0 < k.length)\n )\n if (((h = k.indexOf(\".\")), 0 < h))\n (l = k.substring(0, h)),\n (h = (e ? e : \"\") + l + \".\"),\n m || (m = []),\n m.push(h),\n (g += a.o(l, b, d, f, h));\n else if ((\"boolean\" == typeof l && (l = l ? \"true\" : \"false\"), l)) {\n if (\"retrieveLightData\" == f && 0 > e.indexOf(\".contextData.\"))\n switch (((h = k.substring(0, 4)), (n = k.substring(4)), k)) {\n case \"transactionID\":\n k = \"xact\";\n break;\n case \"channel\":\n k = \"ch\";\n break;\n case \"campaign\":\n k = \"v0\";\n break;\n default:\n a.Qa(n) &&\n (\"prop\" == h\n ? (k = \"c\" + n)\n : \"eVar\" == h\n ? (k = \"v\" + n)\n : \"list\" == h\n ? (k = \"l\" + n)\n : \"hier\" == h &&\n ((k = \"h\" + n), (l = l.substring(0, 255))));\n }\n g += \"&\" + a.escape(k) + \"=\" + a.escape(l);\n }\n }\n \"\" != g && (g += \"&.\" + c);\n }\n return g;\n };\n a.usePostbacks = 0;\n a.Pb = function() {\n var c = \"\",\n b,\n d,\n f,\n e,\n g,\n k,\n l,\n h,\n n = \"\",\n m = \"\",\n p = (e = \"\"),\n r = a.S();\n if (a.lightProfileID)\n (b = a.N),\n (n = a.lightTrackVars) && (n = \",\" + n + \",\" + a.ka.join(\",\") + \",\");\n else {\n b = a.g;\n if (a.pe || a.linkType)\n (n = a.linkTrackVars),\n (m = a.linkTrackEvents),\n a.pe &&\n ((e = a.pe.substring(0, 1).toUpperCase() + a.pe.substring(1)),\n a[e] && ((n = a[e].cc), (m = a[e].bc)));\n n && (n = \",\" + n + \",\" + a.D.join(\",\") + \",\");\n m && ((m = \",\" + m + \",\"), n && (n += \",events,\"));\n a.events2 && (p += (\"\" != p ? \",\" : \"\") + a.events2);\n }\n if (r && r.getCustomerIDs) {\n e = q;\n if ((g = r.getCustomerIDs()))\n for (d in g)\n Object.prototype[d] ||\n ((f = g[d]),\n \"object\" == typeof f &&\n (e || (e = {}),\n f.id && (e[d + \".id\"] = f.id),\n f.authState && (e[d + \".as\"] = f.authState)));\n e && (c += a.o(\"cid\", e));\n }\n a.AudienceManagement &&\n a.AudienceManagement.isReady() &&\n (c += a.o(\"d\", a.AudienceManagement.getEventCallConfigParams()));\n for (d = 0; d < b.length; d++) {\n e = b[d];\n g = a[e];\n f = e.substring(0, 4);\n k = e.substring(4);\n g ||\n (\"events\" == e && p\n ? ((g = p), (p = \"\"))\n : \"marketingCloudOrgID\" == e &&\n r &&\n a.U(\"ECID\") &&\n (g = r.marketingCloudOrgID));\n if (g && (!n || 0 <= n.indexOf(\",\" + e + \",\"))) {\n switch (e) {\n case \"customerPerspective\":\n e = \"cp\";\n break;\n case \"marketingCloudOrgID\":\n e = \"mcorgid\";\n break;\n case \"supplementalDataID\":\n e = \"sdid\";\n break;\n case \"timestamp\":\n e = \"ts\";\n break;\n case \"dynamicVariablePrefix\":\n e = \"D\";\n break;\n case \"visitorID\":\n e = \"vid\";\n break;\n case \"marketingCloudVisitorID\":\n e = \"mid\";\n break;\n case \"analyticsVisitorID\":\n e = \"aid\";\n break;\n case \"audienceManagerLocationHint\":\n e = \"aamlh\";\n break;\n case \"audienceManagerBlob\":\n e = \"aamb\";\n break;\n case \"authState\":\n e = \"as\";\n break;\n case \"pageURL\":\n e = \"g\";\n 255 < g.length &&\n ((a.pageURLRest = g.substring(255)), (g = g.substring(0, 255)));\n break;\n case \"pageURLRest\":\n e = \"-g\";\n break;\n case \"referrer\":\n e = \"r\";\n break;\n case \"vmk\":\n case \"visitorMigrationKey\":\n e = \"vmt\";\n break;\n case \"visitorMigrationServer\":\n e = \"vmf\";\n a.ssl && a.visitorMigrationServerSecure && (g = \"\");\n break;\n case \"visitorMigrationServerSecure\":\n e = \"vmf\";\n !a.ssl && a.visitorMigrationServer && (g = \"\");\n break;\n case \"charSet\":\n e = \"ce\";\n break;\n case \"visitorNamespace\":\n e = \"ns\";\n break;\n case \"cookieDomainPeriods\":\n e = \"cdp\";\n break;\n case \"cookieLifetime\":\n e = \"cl\";\n break;\n case \"variableProvider\":\n e = \"vvp\";\n break;\n case \"currencyCode\":\n e = \"cc\";\n break;\n case \"channel\":\n e = \"ch\";\n break;\n case \"transactionID\":\n e = \"xact\";\n break;\n case \"campaign\":\n e = \"v0\";\n break;\n case \"latitude\":\n e = \"lat\";\n break;\n case \"longitude\":\n e = \"lon\";\n break;\n case \"resolution\":\n e = \"s\";\n break;\n case \"colorDepth\":\n e = \"c\";\n break;\n case \"javascriptVersion\":\n e = \"j\";\n break;\n case \"javaEnabled\":\n e = \"v\";\n break;\n case \"cookiesEnabled\":\n e = \"k\";\n break;\n case \"browserWidth\":\n e = \"bw\";\n break;\n case \"browserHeight\":\n e = \"bh\";\n break;\n case \"connectionType\":\n e = \"ct\";\n break;\n case \"homepage\":\n e = \"hp\";\n break;\n case \"events\":\n p && (g += (\"\" != g ? \",\" : \"\") + p);\n if (m)\n for (k = g.split(\",\"), g = \"\", f = 0; f < k.length; f++)\n (l = k[f]),\n (h = l.indexOf(\"=\")),\n 0 <= h && (l = l.substring(0, h)),\n (h = l.indexOf(\":\")),\n 0 <= h && (l = l.substring(0, h)),\n 0 <= m.indexOf(\",\" + l + \",\") && (g += (g ? \",\" : \"\") + k[f]);\n break;\n case \"events2\":\n g = \"\";\n break;\n case \"contextData\":\n c += a.o(\"c\", a[e], n, e);\n g = \"\";\n break;\n case \"lightProfileID\":\n e = \"mtp\";\n break;\n case \"lightStoreForSeconds\":\n e = \"mtss\";\n a.lightProfileID || (g = \"\");\n break;\n case \"lightIncrementBy\":\n e = \"mti\";\n a.lightProfileID || (g = \"\");\n break;\n case \"retrieveLightProfiles\":\n e = \"mtsr\";\n break;\n case \"deleteLightProfiles\":\n e = \"mtsd\";\n break;\n case \"retrieveLightData\":\n a.retrieveLightProfiles && (c += a.o(\"mts\", a[e], n, e));\n g = \"\";\n break;\n default:\n a.Qa(k) &&\n (\"prop\" == f\n ? (e = \"c\" + k)\n : \"eVar\" == f\n ? (e = \"v\" + k)\n : \"list\" == f\n ? (e = \"l\" + k)\n : \"hier\" == f && ((e = \"h\" + k), (g = g.substring(0, 255))));\n }\n g &&\n (c += \"&\" + e + \"=\" + (\"pev\" != e.substring(0, 3) ? a.escape(g) : g));\n }\n \"pev3\" == e && a.e && (c += a.e);\n }\n a.ja && ((c += \"&lrt=\" + a.ja), (a.ja = null));\n return c;\n };\n a.B = function(a) {\n var b = a.tagName;\n if (\n \"undefined\" != \"\" + a.kc ||\n (\"undefined\" != \"\" + a.Yb && \"HTML\" != (\"\" + a.Yb).toUpperCase())\n )\n return \"\";\n b = b && b.toUpperCase ? b.toUpperCase() : \"\";\n \"SHAPE\" == b && (b = \"\");\n b &&\n ((\"INPUT\" == b || \"BUTTON\" == b) && a.type && a.type.toUpperCase\n ? (b = a.type.toUpperCase())\n : !b && a.href && (b = \"A\"));\n return b;\n };\n a.Ma = function(a) {\n var b = h.location,\n d = a.href ? a.href : \"\",\n f,\n e,\n g;\n \"string\" !== typeof d && (d = \"\");\n f = d.indexOf(\":\");\n e = d.indexOf(\"?\");\n g = d.indexOf(\"/\");\n d &&\n (0 > f || (0 <= e && f > e) || (0 <= g && f > g)) &&\n ((e =\n a.protocol && 1 < a.protocol.length\n ? a.protocol\n : b.protocol\n ? b.protocol\n : \"\"),\n (f = b.pathname.lastIndexOf(\"/\")),\n (d =\n (e ? e + \"//\" : \"\") +\n (a.host ? a.host : b.host ? b.host : \"\") +\n (\"/\" != d.substring(0, 1)\n ? b.pathname.substring(0, 0 > f ? 0 : f) + \"/\"\n : \"\") +\n d));\n return d;\n };\n a.K = function(c) {\n var b = a.B(c),\n d,\n f,\n e = \"\",\n g = 0;\n return b &&\n ((d = c.protocol),\n (f = c.onclick),\n !c.href ||\n (\"A\" != b && \"AREA\" != b) ||\n (f && d && !(0 > d.toLowerCase().indexOf(\"javascript\")))\n ? f\n ? ((e = a.replace(\n a.replace(\n a.replace(a.replace(\"\" + f, \"\\r\", \"\"), \"\\n\", \"\"),\n \"\\t\",\n \"\"\n ),\n \" \",\n \"\"\n )),\n (g = 2))\n : \"INPUT\" == b || \"SUBMIT\" == b\n ? (c.value\n ? (e = c.value)\n : c.innerText\n ? (e = c.innerText)\n : c.textContent && (e = c.textContent),\n (g = 3))\n : \"IMAGE\" == b && c.src && (e = c.src)\n : (e = a.Ma(c)),\n e)\n ? { id: e.substring(0, 100), type: g }\n : 0;\n };\n a.ic = function(c) {\n for (var b = a.B(c), d = a.K(c); c && !d && \"BODY\" != b; )\n if ((c = c.parentElement ? c.parentElement : c.parentNode))\n (b = a.B(c)), (d = a.K(c));\n (d && \"BODY\" != b) || (c = 0);\n c &&\n ((b = c.onclick ? \"\" + c.onclick : \"\"),\n 0 <= b.indexOf(\".tl(\") || 0 <= b.indexOf(\".trackLink(\")) &&\n (c = 0);\n return c;\n };\n a.Xb = function() {\n var c,\n b,\n d = a.linkObject,\n f = a.linkType,\n e = a.linkURL,\n g,\n k;\n a.la = 1;\n d || ((a.la = 0), (d = a.clickObject));\n if (d) {\n c = a.B(d);\n for (b = a.K(d); d && !b && \"BODY\" != c; )\n if ((d = d.parentElement ? d.parentElement : d.parentNode))\n (c = a.B(d)), (b = a.K(d));\n (b && \"BODY\" != c) || (d = 0);\n if (d && !a.linkObject) {\n var l = d.onclick ? \"\" + d.onclick : \"\";\n if (0 <= l.indexOf(\".tl(\") || 0 <= l.indexOf(\".trackLink(\")) d = 0;\n }\n } else a.la = 1;\n !e && d && (e = a.Ma(d));\n e &&\n !a.linkLeaveQueryString &&\n ((g = e.indexOf(\"?\")), 0 <= g && (e = e.substring(0, g)));\n if (!f && e) {\n var m = 0,\n n = 0,\n p;\n if (a.trackDownloadLinks && a.linkDownloadFileTypes)\n for (\n l = e.toLowerCase(),\n g = l.indexOf(\"?\"),\n k = l.indexOf(\"#\"),\n 0 <= g ? 0 <= k && k < g && (g = k) : (g = k),\n 0 <= g && (l = l.substring(0, g)),\n g = a.linkDownloadFileTypes.toLowerCase().split(\",\"),\n k = 0;\n k < g.length;\n k++\n )\n (p = g[k]) &&\n l.substring(l.length - (p.length + 1)) == \".\" + p &&\n (f = \"d\");\n if (\n a.trackExternalLinks &&\n !f &&\n ((l = e.toLowerCase()),\n a.Pa(l) &&\n (a.linkInternalFilters ||\n (a.linkInternalFilters = h.location.hostname),\n (g = 0),\n a.linkExternalFilters\n ? ((g = a.linkExternalFilters.toLowerCase().split(\",\")), (m = 1))\n : a.linkInternalFilters &&\n (g = a.linkInternalFilters.toLowerCase().split(\",\")),\n g))\n ) {\n for (k = 0; k < g.length; k++) (p = g[k]), 0 <= l.indexOf(p) && (n = 1);\n n ? m && (f = \"e\") : m || (f = \"e\");\n }\n }\n a.linkObject = d;\n a.linkURL = e;\n a.linkType = f;\n if (a.trackClickMap || a.trackInlineStats)\n (a.e = \"\"),\n d &&\n ((f = a.pageName),\n (e = 1),\n (d = d.sourceIndex),\n f || ((f = a.pageURL), (e = 0)),\n h.s_objectID && ((b.id = h.s_objectID), (d = b.type = 1)),\n f &&\n b &&\n b.id &&\n c &&\n (a.e =\n \"&pid=\" +\n a.escape(f.substring(0, 255)) +\n (e ? \"&pidt=\" + e : \"\") +\n \"&oid=\" +\n a.escape(b.id.substring(0, 100)) +\n (b.type ? \"&oidt=\" + b.type : \"\") +\n \"&ot=\" +\n c +\n (d ? \"&oi=\" + d : \"\")));\n };\n a.Qb = function() {\n var c = a.la,\n b = a.linkType,\n d = a.linkURL,\n f = a.linkName;\n b &&\n (d || f) &&\n ((b = b.toLowerCase()),\n \"d\" != b && \"e\" != b && (b = \"o\"),\n (a.pe = \"lnk_\" + b),\n (a.pev1 = d ? a.escape(d) : \"\"),\n (a.pev2 = f ? a.escape(f) : \"\"),\n (c = 1));\n a.abort && (c = 0);\n if (a.trackClickMap || a.trackInlineStats || a.Tb()) {\n var b = {},\n d = 0,\n e = a.qb(),\n g = e ? e.split(\"&\") : 0,\n k,\n l,\n h,\n e = 0;\n if (g)\n for (k = 0; k < g.length; k++)\n (l = g[k].split(\"=\")),\n (f = a.unescape(l[0]).split(\",\")),\n (l = a.unescape(l[1])),\n (b[l] = f);\n f = a.account.split(\",\");\n k = {};\n for (h in a.contextData)\n h &&\n !Object.prototype[h] &&\n \"a.activitymap.\" == h.substring(0, 14) &&\n ((k[h] = a.contextData[h]), (a.contextData[h] = \"\"));\n a.e = a.o(\"c\", k) + (a.e ? a.e : \"\");\n if (c || a.e) {\n c && !a.e && (e = 1);\n for (l in b)\n if (!Object.prototype[l])\n for (h = 0; h < f.length; h++)\n for (\n e &&\n ((g = b[l].join(\",\")),\n g == a.account &&\n ((a.e += (\"&\" != l.charAt(0) ? \"&\" : \"\") + l),\n (b[l] = []),\n (d = 1))),\n k = 0;\n k < b[l].length;\n k++\n )\n (g = b[l][k]),\n g == f[h] &&\n (e &&\n (a.e +=\n \"&u=\" +\n a.escape(g) +\n (\"&\" != l.charAt(0) ? \"&\" : \"\") +\n l +\n \"&u=0\"),\n b[l].splice(k, 1),\n (d = 1));\n c || (d = 1);\n if (d) {\n e = \"\";\n k = 2;\n !c &&\n a.e &&\n ((e = a.escape(f.join(\",\")) + \"=\" + a.escape(a.e)), (k = 1));\n for (l in b)\n !Object.prototype[l] &&\n 0 < k &&\n 0 < b[l].length &&\n ((e +=\n (e ? \"&\" : \"\") + a.escape(b[l].join(\",\")) + \"=\" + a.escape(l)),\n k--);\n a.yb(e);\n }\n }\n }\n return c;\n };\n a.qb = function() {\n if (a.useLinkTrackSessionStorage) {\n if (a.Da()) return h.sessionStorage.getItem(a.O);\n } else return a.cookieRead(a.O);\n };\n a.Da = function() {\n return h.sessionStorage ? !0 : !1;\n };\n a.yb = function(c) {\n a.useLinkTrackSessionStorage\n ? a.Da() && h.sessionStorage.setItem(a.O, c)\n : a.cookieWrite(a.O, c);\n };\n a.Rb = function() {\n if (!a.ac) {\n var c = new Date(),\n b = p.location,\n d,\n f,\n e = (f = d = \"\"),\n g = \"\",\n k = \"\",\n l = \"1.2\",\n h = a.cookieWrite(\"s_cc\", \"true\", 0) ? \"Y\" : \"N\",\n m = \"\",\n q = \"\";\n if (\n c.setUTCDate &&\n ((l = \"1.3\"), (0).toPrecision && ((l = \"1.5\"), (c = []), c.forEach))\n ) {\n l = \"1.6\";\n f = 0;\n d = {};\n try {\n (f = new Iterator(d)),\n f.next &&\n ((l = \"1.7\"),\n c.reduce &&\n ((l = \"1.8\"),\n l.trim &&\n ((l = \"1.8.1\"),\n Date.parse &&\n ((l = \"1.8.2\"), Object.create && (l = \"1.8.5\")))));\n } catch (r) {}\n }\n d = screen.width + \"x\" + screen.height;\n e = navigator.javaEnabled() ? \"Y\" : \"N\";\n f = screen.pixelDepth ? screen.pixelDepth : screen.colorDepth;\n g = a.w.innerWidth ? a.w.innerWidth : a.d.documentElement.offsetWidth;\n k = a.w.innerHeight ? a.w.innerHeight : a.d.documentElement.offsetHeight;\n try {\n a.b.addBehavior(\"#default#homePage\"), (m = a.b.jc(b) ? \"Y\" : \"N\");\n } catch (s) {}\n try {\n a.b.addBehavior(\"#default#clientCaps\"), (q = a.b.connectionType);\n } catch (t) {}\n a.resolution = d;\n a.colorDepth = f;\n a.javascriptVersion = l;\n a.javaEnabled = e;\n a.cookiesEnabled = h;\n a.browserWidth = g;\n a.browserHeight = k;\n a.connectionType = q;\n a.homepage = m;\n a.ac = 1;\n }\n };\n a.P = {};\n a.loadModule = function(c, b) {\n var d = a.P[c];\n if (!d) {\n d = h[\"AppMeasurement_Module_\" + c]\n ? new h[\"AppMeasurement_Module_\" + c](a)\n : {};\n a.P[c] = a[c] = d;\n d.jb = function() {\n return d.tb;\n };\n d.zb = function(b) {\n if ((d.tb = b))\n (a[c + \"_onLoad\"] = b), a.ea(c + \"_onLoad\", [a, d], 1) || b(a, d);\n };\n try {\n Object.defineProperty\n ? Object.defineProperty(d, \"onLoad\", { get: d.jb, set: d.zb })\n : (d._olc = 1);\n } catch (f) {\n d._olc = 1;\n }\n }\n b && ((a[c + \"_onLoad\"] = b), a.ea(c + \"_onLoad\", [a, d], 1) || b(a, d));\n };\n a.u = function(c) {\n var b, d;\n for (b in a.P)\n if (\n !Object.prototype[b] &&\n (d = a.P[b]) &&\n (d._olc && d.onLoad && ((d._olc = 0), d.onLoad(a, d)), d[c] && d[c]())\n )\n return 1;\n return 0;\n };\n a.Tb = function() {\n return a.ActivityMap && a.ActivityMap._c ? !0 : !1;\n };\n a.Ub = function() {\n var c = Math.floor(1e13 * Math.random()),\n b = a.visitorSampling,\n d = a.visitorSamplingGroup,\n d =\n \"s_vsn_\" +\n (a.visitorNamespace ? a.visitorNamespace : a.account) +\n (d ? \"_\" + d : \"\"),\n f = a.cookieRead(d);\n if (b) {\n b *= 100;\n f && (f = parseInt(f));\n if (!f) {\n if (!a.cookieWrite(d, c)) return 0;\n f = c;\n }\n if (f % 1e4 > b) return 0;\n }\n return 1;\n };\n a.R = function(c, b) {\n var d, f, e, g, k, h, m;\n m = {};\n for (d = 0; 2 > d; d++)\n for (f = 0 < d ? a.Fa : a.g, e = 0; e < f.length; e++)\n if (((g = f[e]), (k = c[g]) || c[\"!\" + g])) {\n if (\n k &&\n !b &&\n (\"contextData\" == g || \"retrieveLightData\" == g) &&\n a[g]\n )\n for (h in a[g]) k[h] || (k[h] = a[g][h]);\n a[g] || (m[\"!\" + g] = 1);\n m[g] = a[g];\n a[g] = k;\n }\n return m;\n };\n a.gc = function(c) {\n var b, d, f, e;\n for (b = 0; 2 > b; b++)\n for (d = 0 < b ? a.Fa : a.g, f = 0; f < d.length; f++)\n (e = d[f]),\n (c[e] = a[e]),\n c[e] ||\n (\"prop\" !== e.substring(0, 4) &&\n \"eVar\" !== e.substring(0, 4) &&\n \"hier\" !== e.substring(0, 4) &&\n \"list\" !== e.substring(0, 4) &&\n \"channel\" !== e &&\n \"events\" !== e &&\n \"eventList\" !== e &&\n \"products\" !== e &&\n \"productList\" !== e &&\n \"purchaseID\" !== e &&\n \"transactionID\" !== e &&\n \"state\" !== e &&\n \"zip\" !== e &&\n \"campaign\" !== e &&\n \"events2\" !== e &&\n \"latitude\" !== e &&\n \"longitude\" !== e &&\n \"ms_a\" !== e &&\n \"contextData\" !== e &&\n \"supplementalDataID\" !== e &&\n \"tnt\" !== e &&\n \"timestamp\" !== e &&\n \"abort\" !== e &&\n \"useBeacon\" !== e &&\n \"linkObject\" !== e &&\n \"clickObject\" !== e &&\n \"linkType\" !== e &&\n \"linkName\" !== e &&\n \"linkURL\" !== e &&\n \"bodyClickTarget\" !== e &&\n \"bodyClickFunction\" !== e) ||\n (c[\"!\" + e] = 1);\n };\n a.Lb = function(a) {\n var b,\n d,\n f,\n e,\n g,\n k = 0,\n h,\n m = \"\",\n n = \"\";\n if (\n a &&\n 255 < a.length &&\n ((b = \"\" + a),\n (d = b.indexOf(\"?\")),\n 0 < d &&\n ((h = b.substring(d + 1)),\n (b = b.substring(0, d)),\n (e = b.toLowerCase()),\n (f = 0),\n \"http://\" == e.substring(0, 7)\n ? (f += 7)\n : \"https://\" == e.substring(0, 8) && (f += 8),\n (d = e.indexOf(\"/\", f)),\n 0 < d &&\n ((e = e.substring(f, d)),\n (g = b.substring(d)),\n (b = b.substring(0, d)),\n 0 <= e.indexOf(\"google\")\n ? (k = \",q,ie,start,search_key,word,kw,cd,\")\n : 0 <= e.indexOf(\"yahoo.co\")\n ? (k = \",p,ei,\")\n : 0 <= e.indexOf(\"baidu.\") && (k = \",wd,word,\"),\n k && h)))\n ) {\n if ((a = h.split(\"&\")) && 1 < a.length) {\n for (f = 0; f < a.length; f++)\n (e = a[f]),\n (d = e.indexOf(\"=\")),\n 0 < d && 0 <= k.indexOf(\",\" + e.substring(0, d) + \",\")\n ? (m += (m ? \"&\" : \"\") + e)\n : (n += (n ? \"&\" : \"\") + e);\n m && n ? (h = m + \"&\" + n) : (n = \"\");\n }\n d = 253 - (h.length - n.length) - b.length;\n a = b + (0 < d ? g.substring(0, d) : \"\") + \"?\" + h;\n }\n return a;\n };\n a.cb = function(c) {\n var b = a.d.visibilityState,\n d = [\"webkitvisibilitychange\", \"visibilitychange\"];\n b || (b = a.d.webkitVisibilityState);\n if (b && \"prerender\" == b) {\n if (c)\n for (b = 0; b < d.length; b++)\n a.d.addEventListener(d[b], function() {\n var b = a.d.visibilityState;\n b || (b = a.d.webkitVisibilityState);\n \"visible\" == b && c();\n });\n return !1;\n }\n return !0;\n };\n a.ba = !1;\n a.G = !1;\n a.Bb = function() {\n a.G = !0;\n a.p();\n };\n a.H = !1;\n a.Cb = function(c) {\n a.marketingCloudVisitorID = c.MCMID;\n a.visitorOptedOut = c.MCOPTOUT;\n a.analyticsVisitorID = c.MCAID;\n a.audienceManagerLocationHint = c.MCAAMLH;\n a.audienceManagerBlob = c.MCAAMB;\n a.H = !1;\n a.p();\n };\n a.bb = function(c) {\n a.maxDelay || (a.maxDelay = 250);\n return a.u(\"_d\")\n ? (c &&\n setTimeout(function() {\n c();\n }, a.maxDelay),\n !1)\n : !0;\n };\n a.Z = !1;\n a.F = !1;\n a.za = function() {\n a.F = !0;\n a.p();\n };\n a.isReadyToTrack = function() {\n var c = !0;\n if (!a.nb() || !a.lb()) return !1;\n a.pb() || (c = !1);\n a.sb() || (c = !1);\n return c;\n };\n a.nb = function() {\n a.ba || a.G || (a.cb(a.Bb) ? (a.G = !0) : (a.ba = !0));\n return a.ba && !a.G ? !1 : !0;\n };\n a.lb = function() {\n var c = a.va();\n if (c)\n if (a.ra || a.aa)\n if (a.ra) {\n if (!c.isApproved(c.Categories.ANALYTICS)) return !1;\n } else return !1;\n else return c.fetchPermissions(a.ub, !0), (a.aa = !0), !1;\n return !0;\n };\n a.U = function(c) {\n var b = a.va();\n return b && !b.isApproved(b.Categories[c]) ? !1 : !0;\n };\n a.va = function() {\n return h.adobe && h.adobe.optIn ? h.adobe.optIn : null;\n };\n a.X = !0;\n a.pb = function() {\n var c = a.S();\n if (!c || !c.getVisitorValues) return !0;\n a.X && ((a.X = !1), a.H || ((a.H = !0), c.getVisitorValues(a.Cb)));\n return !a.H;\n };\n a.S = function() {\n var c = a.visitor;\n c && !c.isAllowed() && (c = null);\n return c;\n };\n a.sb = function() {\n a.Z || a.F || (a.bb(a.za) ? (a.F = !0) : (a.Z = !0));\n return a.Z && !a.F ? !1 : !0;\n };\n a.aa = !1;\n a.ub = function() {\n a.aa = !1;\n a.ra = !0;\n };\n a.j = q;\n a.q = 0;\n a.callbackWhenReadyToTrack = function(c, b, d) {\n var f;\n f = {};\n f.Gb = c;\n f.Fb = b;\n f.Db = d;\n a.j == q && (a.j = []);\n a.j.push(f);\n 0 == a.q && (a.q = setInterval(a.p, 100));\n };\n a.p = function() {\n var c;\n if (a.isReadyToTrack() && (a.Ab(), a.j != q))\n for (; 0 < a.j.length; ) (c = a.j.shift()), c.Fb.apply(c.Gb, c.Db);\n };\n a.Ab = function() {\n a.q && (clearInterval(a.q), (a.q = 0));\n };\n a.ta = function(c) {\n var b,\n d = {};\n a.gc(d);\n if (c != q) for (b in c) d[b] = c[b];\n a.callbackWhenReadyToTrack(a, a.Ea, [d]);\n a.Ca();\n };\n a.Nb = function() {\n var c = a.cookieRead(\"s_fid\"),\n b = \"\",\n d = \"\",\n f;\n f = 8;\n var e = 4;\n if (!c || 0 > c.indexOf(\"-\")) {\n for (c = 0; 16 > c; c++)\n (f = Math.floor(Math.random() * f)),\n (b += \"0123456789ABCDEF\".substring(f, f + 1)),\n (f = Math.floor(Math.random() * e)),\n (d += \"0123456789ABCDEF\".substring(f, f + 1)),\n (f = e = 16);\n c = b + \"-\" + d;\n }\n a.cookieWrite(\"s_fid\", c, 1) || (c = 0);\n return c;\n };\n a.Ea = function(c) {\n var b = new Date(),\n d =\n \"s\" +\n (Math.floor(b.getTime() / 108e5) % 10) +\n Math.floor(1e13 * Math.random()),\n f = b.getYear(),\n f =\n \"t=\" +\n a.escape(\n b.getDate() +\n \"/\" +\n b.getMonth() +\n \"/\" +\n (1900 > f ? f + 1900 : f) +\n \" \" +\n b.getHours() +\n \":\" +\n b.getMinutes() +\n \":\" +\n b.getSeconds() +\n \" \" +\n b.getDay() +\n \" \" +\n b.getTimezoneOffset()\n ),\n e = a.S(),\n g;\n c && (g = a.R(c, 1));\n a.Ub() &&\n !a.visitorOptedOut &&\n (a.wa() || (a.fid = a.Nb()),\n a.Xb(),\n a.usePlugins && a.doPlugins && a.doPlugins(a),\n a.account &&\n (a.abort ||\n (a.trackOffline &&\n !a.timestamp &&\n (a.timestamp = Math.floor(b.getTime() / 1e3)),\n (c = h.location),\n a.pageURL || (a.pageURL = c.href ? c.href : c),\n a.referrer ||\n a.Za ||\n ((c = a.Util.getQueryParam(\"adobe_mc_ref\", null, null, !0)),\n (a.referrer =\n c || void 0 === c\n ? void 0 === c\n ? \"\"\n : c\n : p.document.referrer)),\n (a.Za = 1),\n !a.referrer && a.Y && (a.referrer = a.Y),\n (a.Y = 0),\n (a.referrer = a.Lb(a.referrer)),\n a.u(\"_g\")),\n a.Qb() &&\n !a.abort &&\n (e &&\n a.U(\"TARGET\") &&\n !a.supplementalDataID &&\n e.getSupplementalDataID &&\n (a.supplementalDataID = e.getSupplementalDataID(\n \"AppMeasurement:\" + a._in,\n a.expectSupplementalData ? !1 : !0\n )),\n a.U(\"AAM\") || (a.contextData[\"cm.ssf\"] = 1),\n a.Rb(),\n a.vb(),\n (f += a.Pb()),\n a.rb(d, f),\n a.u(\"_t\"),\n (a.referrer = \"\"))));\n a.referrer && (a.Y = a.referrer);\n a.Ca();\n g && a.R(g, 1);\n };\n a.t = a.track = function(c, b) {\n b && a.R(b);\n a.X = !0;\n a.isReadyToTrack()\n ? null != a.j && 0 < a.j.length\n ? (a.ta(c), a.p())\n : a.Ea(c)\n : a.ta(c);\n };\n a.vb = function() {\n a.writeSecureCookies && !a.ssl && a.$a();\n };\n a.$a = function() {\n a.contextData.excCodes = a.contextData.excCodes\n ? a.contextData.excCodes\n : [];\n a.contextData.excCodes.push(1);\n };\n a.Ca = function() {\n a.abort = a.supplementalDataID = a.timestamp = a.pageURLRest = a.linkObject = a.clickObject = a.linkURL = a.linkName = a.linkType = h.s_objectID = a.pe = a.pev1 = a.pev2 = a.pev3 = a.e = a.lightProfileID = a.useBeacon = a.referrer = 0;\n a.contextData && a.contextData.excCodes && (a.contextData.excCodes = 0);\n };\n a.Ba = [];\n a.registerPreTrackCallback = function(c) {\n for (var b = [], d = 1; d < arguments.length; d++) b.push(arguments[d]);\n \"function\" == typeof c\n ? a.Ba.push([c, b])\n : a.debugTracking &&\n a.log(\"Warning, Non function type passed to registerPreTrackCallback\");\n };\n a.gb = function(c) {\n a.ua(a.Ba, c);\n };\n a.Aa = [];\n a.registerPostTrackCallback = function(c) {\n for (var b = [], d = 1; d < arguments.length; d++) b.push(arguments[d]);\n \"function\" == typeof c\n ? a.Aa.push([c, b])\n : a.debugTracking &&\n a.log(\"Warning, Non function type passed to registerPostTrackCallback\");\n };\n a.fb = function(c) {\n a.ua(a.Aa, c);\n };\n a.ua = function(c, b) {\n if (\"object\" == typeof c)\n for (var d = 0; d < c.length; d++) {\n var f = c[d][0],\n e = c[d][1].slice();\n e.unshift(b);\n if (\"function\" == typeof f)\n try {\n f.apply(null, e);\n } catch (g) {\n a.debugTracking && a.log(g.message);\n }\n }\n };\n a.tl = a.trackLink = function(c, b, d, f, e) {\n a.linkObject = c;\n a.linkType = b;\n a.linkName = d;\n e && ((a.bodyClickTarget = c), (a.bodyClickFunction = e));\n return a.track(f);\n };\n a.trackLight = function(c, b, d, f) {\n a.lightProfileID = c;\n a.lightStoreForSeconds = b;\n a.lightIncrementBy = d;\n return a.track(f);\n };\n a.clearVars = function() {\n var c, b;\n for (c = 0; c < a.g.length; c++)\n if (\n ((b = a.g[c]),\n \"prop\" == b.substring(0, 4) ||\n \"eVar\" == b.substring(0, 4) ||\n \"hier\" == b.substring(0, 4) ||\n \"list\" == b.substring(0, 4) ||\n \"channel\" == b ||\n \"events\" == b ||\n \"eventList\" == b ||\n \"products\" == b ||\n \"productList\" == b ||\n \"purchaseID\" == b ||\n \"transactionID\" == b ||\n \"state\" == b ||\n \"zip\" == b ||\n \"campaign\" == b)\n )\n a[b] = void 0;\n };\n a.tagContainerMarker = \"\";\n a.rb = function(c, b) {\n var d =\n a.hb() +\n \"/\" +\n c +\n \"?AQB=1&ndh=1&pf=1&\" +\n (a.ya() ? \"callback=s_c_il[\" + a._in + \"].doPostbacks&et=1&\" : \"\") +\n b +\n \"&AQE=1\";\n a.gb(d);\n a.eb(d);\n a.T();\n };\n a.hb = function() {\n var c = a.ib();\n return (\n \"http\" +\n (a.ssl ? \"s\" : \"\") +\n \"://\" +\n c +\n \"/b/ss/\" +\n a.account +\n \"/\" +\n (a.mobile ? \"5.\" : \"\") +\n (a.ya() ? \"10\" : \"1\") +\n \"/JS-\" +\n a.version +\n (a.$b ? \"T\" : \"\") +\n (a.tagContainerMarker ? \"-\" + a.tagContainerMarker : \"\")\n );\n };\n a.ya = function() {\n return (\n (a.AudienceManagement && a.AudienceManagement.isReady()) ||\n 0 != a.usePostbacks\n );\n };\n a.ib = function() {\n var c = a.dc,\n b = a.trackingServer;\n b\n ? a.trackingServerSecure && a.ssl && (b = a.trackingServerSecure)\n : ((c = c ? (\"\" + c).toLowerCase() : \"d1\"),\n \"d1\" == c ? (c = \"112\") : \"d2\" == c && (c = \"122\"),\n (b = a.kb() + \".\" + c + \".2o7.net\"));\n return b;\n };\n a.kb = function() {\n var c = a.visitorNamespace;\n c || ((c = a.account.split(\",\")[0]), (c = c.replace(/[^0-9a-z]/gi, \"\")));\n return c;\n };\n a.Ya = /{(%?)(.*?)(%?)}/;\n a.fc = RegExp(a.Ya.source, \"g\");\n a.Kb = function(c) {\n if (\"object\" == typeof c.dests)\n for (var b = 0; b < c.dests.length; ++b) {\n var d = c.dests[b];\n if (\"string\" == typeof d.c && \"aa.\" == d.id.substr(0, 3))\n for (var f = d.c.match(a.fc), e = 0; e < f.length; ++e) {\n var g = f[e],\n k = g.match(a.Ya),\n h = \"\";\n \"%\" == k[1] && \"timezone_offset\" == k[2]\n ? (h = new Date().getTimezoneOffset())\n : \"%\" == k[1] && \"timestampz\" == k[2] && (h = a.Ob());\n d.c = d.c.replace(g, a.escape(h));\n }\n }\n };\n a.Ob = function() {\n var c = new Date(),\n b = new Date(6e4 * Math.abs(c.getTimezoneOffset()));\n return (\n a.k(4, c.getFullYear()) +\n \"-\" +\n a.k(2, c.getMonth() + 1) +\n \"-\" +\n a.k(2, c.getDate()) +\n \"T\" +\n a.k(2, c.getHours()) +\n \":\" +\n a.k(2, c.getMinutes()) +\n \":\" +\n a.k(2, c.getSeconds()) +\n (0 < c.getTimezoneOffset() ? \"-\" : \"+\") +\n a.k(2, b.getUTCHours()) +\n \":\" +\n a.k(2, b.getUTCMinutes())\n );\n };\n a.k = function(a, b) {\n return (Array(a + 1).join(0) + b).slice(-a);\n };\n a.pa = {};\n a.doPostbacks = function(c) {\n if (\"object\" == typeof c)\n if (\n (a.Kb(c),\n \"object\" == typeof a.AudienceManagement &&\n \"function\" == typeof a.AudienceManagement.isReady &&\n a.AudienceManagement.isReady() &&\n \"function\" == typeof a.AudienceManagement.passData)\n )\n a.AudienceManagement.passData(c);\n else if (\"object\" == typeof c && \"object\" == typeof c.dests)\n for (var b = 0; b < c.dests.length; ++b) {\n var d = c.dests[b];\n \"object\" == typeof d &&\n \"string\" == typeof d.c &&\n \"string\" == typeof d.id &&\n \"aa.\" == d.id.substr(0, 3) &&\n ((a.pa[d.id] = new Image()),\n (a.pa[d.id].alt = \"\"),\n (a.pa[d.id].src = d.c));\n }\n };\n a.eb = function(c) {\n a.i || a.Sb();\n a.i.push(c);\n a.ia = a.A();\n a.Xa();\n };\n a.Sb = function() {\n a.i = a.Vb();\n a.i || (a.i = []);\n };\n a.Vb = function() {\n var c, b;\n if (a.oa()) {\n try {\n (b = h.localStorage.getItem(a.ma())) && (c = h.JSON.parse(b));\n } catch (d) {}\n return c;\n }\n };\n a.oa = function() {\n var c = !0;\n (a.trackOffline && a.offlineFilename && h.localStorage && h.JSON) ||\n (c = !1);\n return c;\n };\n a.Na = function() {\n var c = 0;\n a.i && (c = a.i.length);\n a.l && c++;\n return c;\n };\n a.T = function() {\n if (a.l && (a.v && a.v.complete && a.v.C && a.v.Q(), a.l)) return;\n a.Oa = q;\n if (a.na) a.ia > a.M && a.Va(a.i), a.qa(500);\n else {\n var c = a.Eb();\n if (0 < c) a.qa(c);\n else if ((c = a.La())) (a.l = 1), a.Wb(c), a.Zb(c);\n }\n };\n a.qa = function(c) {\n a.Oa || (c || (c = 0), (a.Oa = setTimeout(a.T, c)));\n };\n a.Eb = function() {\n var c;\n if (!a.trackOffline || 0 >= a.offlineThrottleDelay) return 0;\n c = a.A() - a.Ta;\n return a.offlineThrottleDelay < c ? 0 : a.offlineThrottleDelay - c;\n };\n a.La = function() {\n if (0 < a.i.length) return a.i.shift();\n };\n a.Wb = function(c) {\n if (a.debugTracking) {\n var b = \"AppMeasurement Debug: \" + c;\n c = c.split(\"&\");\n var d;\n for (d = 0; d < c.length; d++) b += \"\\n\\t\" + a.unescape(c[d]);\n a.log(b);\n }\n };\n a.wa = function() {\n return a.marketingCloudVisitorID || a.analyticsVisitorID;\n };\n a.W = !1;\n var t;\n try {\n t = JSON.parse('{\"x\":\"y\"}');\n } catch (v) {\n t = null;\n }\n t && \"y\" == t.x\n ? ((a.W = !0),\n (a.V = function(a) {\n return JSON.parse(a);\n }))\n : h.$ && h.$.parseJSON\n ? ((a.V = function(a) {\n return h.$.parseJSON(a);\n }),\n (a.W = !0))\n : (a.V = function() {\n return null;\n });\n a.Zb = function(c) {\n var b, d, f;\n a.mb(c) &&\n ((d = 1),\n (b = {\n send: function(c) {\n a.useBeacon = !1;\n navigator.sendBeacon(c) ? b.Q() : b.ga();\n }\n }));\n !b &&\n a.wa() &&\n 2047 < c.length &&\n (a.ab() && ((d = 2), (b = new XMLHttpRequest())),\n b &&\n ((a.AudienceManagement && a.AudienceManagement.isReady()) ||\n 0 != a.usePostbacks) &&\n (a.W ? (b.Ga = !0) : (b = 0)));\n !b && a.ec && (c = c.substring(0, 2047));\n !b &&\n a.d.createElement &&\n (0 != a.usePostbacks ||\n (a.AudienceManagement && a.AudienceManagement.isReady())) &&\n (b = a.d.createElement(\"SCRIPT\")) &&\n \"async\" in b &&\n ((f = (f = a.d.getElementsByTagName(\"HEAD\")) && f[0] ? f[0] : a.d.body)\n ? ((b.type = \"text/javascript\"),\n b.setAttribute(\"async\", \"async\"),\n (d = 3))\n : (b = 0));\n b ||\n ((b = new Image()),\n (b.alt = \"\"),\n b.abort ||\n \"undefined\" === typeof h.InstallTrigger ||\n (b.abort = function() {\n b.src = q;\n }));\n b.Ua = Date.now();\n b.Ia = function() {\n try {\n b.C && (clearTimeout(b.C), (b.C = 0));\n } catch (a) {}\n };\n b.onload = b.Q = function() {\n b.Ua && (a.ja = Date.now() - b.Ua);\n a.fb(c);\n b.Ia();\n a.Ib();\n a.ca();\n a.l = 0;\n a.T();\n if (b.Ga) {\n b.Ga = !1;\n try {\n a.doPostbacks(a.V(b.responseText));\n } catch (d) {}\n }\n };\n b.onabort = b.onerror = b.ga = function() {\n b.Ia();\n (a.trackOffline || a.na) && a.l && a.i.unshift(a.Hb);\n a.l = 0;\n a.ia > a.M && a.Va(a.i);\n a.ca();\n a.qa(500);\n };\n b.onreadystatechange = function() {\n 4 == b.readyState && (200 == b.status ? b.Q() : b.ga());\n };\n a.Ta = a.A();\n if (1 === d) b.send(c);\n else if (2 === d)\n (f = c.indexOf(\"?\")),\n (d = c.substring(0, f)),\n (f = c.substring(f + 1)),\n (f = f.replace(/&callback=[a-zA-Z0-9_.\\[\\]]+/, \"\")),\n b.open(\"POST\", d, !0),\n (b.withCredentials = !0),\n b.send(f);\n else if (((b.src = c), 3 === d)) {\n if (a.Ra)\n try {\n f.removeChild(a.Ra);\n } catch (e) {}\n f.firstChild ? f.insertBefore(b, f.firstChild) : f.appendChild(b);\n a.Ra = a.v;\n }\n b.C = setTimeout(function() {\n b.C &&\n (b.complete ? b.Q() : (a.trackOffline && b.abort && b.abort(), b.ga()));\n }, 5e3);\n a.Hb = c;\n a.v = h[\"s_i_\" + a.replace(a.account, \",\", \"_\")] = b;\n if ((a.useForcedLinkTracking && a.I) || a.bodyClickFunction)\n a.forcedLinkTrackingTimeout || (a.forcedLinkTrackingTimeout = 250),\n (a.da = setTimeout(a.ca, a.forcedLinkTrackingTimeout));\n };\n a.mb = function(c) {\n var b = !1;\n navigator.sendBeacon && (a.ob(c) ? (b = !0) : a.useBeacon && (b = !0));\n a.xb(c) && (b = !1);\n return b;\n };\n a.ob = function(a) {\n return a && 0 < a.indexOf(\"pe=lnk_e\") ? !0 : !1;\n };\n a.xb = function(a) {\n return 64e3 <= a.length;\n };\n a.ab = function() {\n return \"undefined\" !== typeof XMLHttpRequest &&\n \"withCredentials\" in new XMLHttpRequest()\n ? !0\n : !1;\n };\n a.Ib = function() {\n if (a.oa() && !(a.Sa > a.M))\n try {\n h.localStorage.removeItem(a.ma()), (a.Sa = a.A());\n } catch (c) {}\n };\n a.Va = function(c) {\n if (a.oa()) {\n a.Xa();\n try {\n h.localStorage.setItem(a.ma(), h.JSON.stringify(c)), (a.M = a.A());\n } catch (b) {}\n }\n };\n a.Xa = function() {\n if (a.trackOffline) {\n if (!a.offlineLimit || 0 >= a.offlineLimit) a.offlineLimit = 10;\n for (; a.i.length > a.offlineLimit; ) a.La();\n }\n };\n a.forceOffline = function() {\n a.na = !0;\n };\n a.forceOnline = function() {\n a.na = !1;\n };\n a.ma = function() {\n return a.offlineFilename + \"-\" + a.visitorNamespace + a.account;\n };\n a.A = function() {\n return new Date().getTime();\n };\n a.Pa = function(a) {\n a = a.toLowerCase();\n return 0 != a.indexOf(\"#\") &&\n 0 != a.indexOf(\"about:\") &&\n 0 != a.indexOf(\"opera:\") &&\n 0 != a.indexOf(\"javascript:\")\n ? !0\n : !1;\n };\n a.setTagContainer = function(c) {\n var b, d, f;\n a.$b = c;\n for (b = 0; b < a._il.length; b++)\n if ((d = a._il[b]) && \"s_l\" == d._c && d.tagContainerName == c) {\n a.R(d);\n if (d.lmq)\n for (b = 0; b < d.lmq.length; b++) (f = d.lmq[b]), a.loadModule(f.n);\n if (d.ml)\n for (f in d.ml)\n if (a[f])\n for (b in ((c = a[f]), (f = d.ml[f]), f))\n !Object.prototype[b] &&\n (\"function\" != typeof f[b] ||\n 0 > (\"\" + f[b]).indexOf(\"s_c_il\")) &&\n (c[b] = f[b]);\n if (d.mmq)\n for (b = 0; b < d.mmq.length; b++)\n (f = d.mmq[b]),\n a[f.m] &&\n ((c = a[f.m]),\n c[f.f] &&\n \"function\" == typeof c[f.f] &&\n (f.a ? c[f.f].apply(c, f.a) : c[f.f].apply(c)));\n if (d.tq) for (b = 0; b < d.tq.length; b++) a.track(d.tq[b]);\n d.s = a;\n break;\n }\n };\n a.Util = {\n urlEncode: a.escape,\n urlDecode: a.unescape,\n cookieRead: a.cookieRead,\n cookieWrite: a.cookieWrite,\n getQueryParam: function(c, b, d, f) {\n var e,\n g = \"\";\n b || (b = a.pageURL ? a.pageURL : h.location);\n d = d ? d : \"&\";\n if (!c || !b) return g;\n b = \"\" + b;\n e = b.indexOf(\"?\");\n if (0 > e) return g;\n b = d + b.substring(e + 1) + d;\n if (\n !f ||\n !(0 <= b.indexOf(d + c + d) || 0 <= b.indexOf(d + c + \"=\" + d))\n ) {\n e = b.indexOf(\"#\");\n 0 <= e && (b = b.substr(0, e) + d);\n e = b.indexOf(d + c + \"=\");\n if (0 > e) return g;\n b = b.substring(e + d.length + c.length + 1);\n e = b.indexOf(d);\n 0 <= e && (b = b.substring(0, e));\n 0 < b.length && (g = a.unescape(b));\n return g;\n }\n },\n getIeVersion: function() {\n return document.documentMode ? document.documentMode : a.xa() ? 7 : null;\n }\n };\n a.D = \"supplementalDataID timestamp dynamicVariablePrefix visitorID marketingCloudVisitorID analyticsVisitorID audienceManagerLocationHint authState fid vmk visitorMigrationKey visitorMigrationServer visitorMigrationServerSecure charSet visitorNamespace cookieDomainPeriods fpCookieDomainPeriods cookieLifetime pageName pageURL customerPerspective referrer contextData contextData.cm.ssf contextData.opt.dmp contextData.opt.sell currencyCode lightProfileID lightStoreForSeconds lightIncrementBy retrieveLightProfiles deleteLightProfiles retrieveLightData\".split(\n \" \"\n );\n a.g = a.D.concat(\n \"purchaseID variableProvider channel server pageType transactionID campaign state zip events events2 products audienceManagerBlob tnt\".split(\n \" \"\n )\n );\n a.ka = \"timestamp charSet visitorNamespace cookieDomainPeriods cookieLifetime contextData lightProfileID lightStoreForSeconds lightIncrementBy\".split(\n \" \"\n );\n a.N = a.ka.slice(0);\n a.Fa = \"account allAccounts debugTracking visitor visitorOptedOut trackOffline offlineLimit offlineThrottleDelay offlineFilename usePlugins doPlugins configURL visitorSampling visitorSamplingGroup linkObject clickObject linkURL linkName linkType trackDownloadLinks trackExternalLinks trackClickMap trackInlineStats linkLeaveQueryString linkTrackVars linkTrackEvents linkDownloadFileTypes linkExternalFilters linkInternalFilters useForcedLinkTracking forcedLinkTrackingTimeout writeSecureCookies useLinkTrackSessionStorage trackingServer trackingServerSecure ssl abort mobile dc lightTrackVars maxDelay expectSupplementalData useBeacon usePostbacks registerPreTrackCallback registerPostTrackCallback bodyClickTarget bodyClickFunction AudienceManagement\".split(\n \" \"\n );\n for (m = 0; 250 >= m; m++)\n 76 > m && (a.g.push(\"prop\" + m), a.N.push(\"prop\" + m)),\n a.g.push(\"eVar\" + m),\n a.N.push(\"eVar\" + m),\n 6 > m && a.g.push(\"hier\" + m),\n 4 > m && a.g.push(\"list\" + m);\n m = \"pe pev1 pev2 pev3 latitude longitude resolution colorDepth javascriptVersion javaEnabled cookiesEnabled browserWidth browserHeight connectionType homepage pageURLRest marketingCloudOrgID ms_a\".split(\n \" \"\n );\n a.g = a.g.concat(m);\n a.D = a.D.concat(m);\n a.ssl = 0 <= h.location.protocol.toLowerCase().indexOf(\"https\");\n a.charSet = \"UTF-8\";\n a.contextData = {};\n a.writeSecureCookies = !1;\n a.offlineThrottleDelay = 0;\n a.offlineFilename = \"AppMeasurement.offline\";\n a.O = \"s_sq\";\n a.Ta = 0;\n a.ia = 0;\n a.M = 0;\n a.Sa = 0;\n a.linkDownloadFileTypes =\n \"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";\n a.w = h;\n a.d = h.document;\n a.ca = function() {\n a.da && (h.clearTimeout(a.da), (a.da = q));\n a.bodyClickTarget && a.I && a.bodyClickTarget.dispatchEvent(a.I);\n a.bodyClickFunction &&\n (\"function\" == typeof a.bodyClickFunction\n ? a.bodyClickFunction()\n : a.bodyClickTarget &&\n a.bodyClickTarget.href &&\n (a.d.location = a.bodyClickTarget.href));\n a.bodyClickTarget = a.I = a.bodyClickFunction = 0;\n };\n a.Wa = function() {\n a.b = a.d.body;\n a.b\n ? ((a.r = function(c) {\n var b, d, f, e, g;\n if (\n !(\n (a.d && a.d.getElementById(\"cppXYctnr\")) ||\n (c && c[\"s_fe_\" + a._in])\n )\n ) {\n if (a.Ha)\n if (a.useForcedLinkTracking)\n a.b.removeEventListener(\"click\", a.r, !1);\n else {\n a.b.removeEventListener(\"click\", a.r, !0);\n a.Ha = a.useForcedLinkTracking = 0;\n return;\n }\n else a.useForcedLinkTracking = 0;\n a.clickObject = c.srcElement ? c.srcElement : c.target;\n try {\n if (\n !a.clickObject ||\n (a.L && a.L == a.clickObject) ||\n !(\n a.clickObject.tagName ||\n a.clickObject.parentElement ||\n a.clickObject.parentNode\n )\n )\n a.clickObject = 0;\n else {\n var k = (a.L = a.clickObject);\n a.ha && (clearTimeout(a.ha), (a.ha = 0));\n a.ha = setTimeout(function() {\n a.L == k && (a.L = 0);\n }, 1e4);\n f = a.Na();\n a.track();\n if (f < a.Na() && a.useForcedLinkTracking && c.target) {\n for (\n e = c.target;\n e &&\n e != a.b &&\n \"A\" != e.tagName.toUpperCase() &&\n \"AREA\" != e.tagName.toUpperCase();\n\n )\n e = e.parentNode;\n if (\n e &&\n ((g = e.href),\n a.Pa(g) || (g = 0),\n (d = e.target),\n c.target.dispatchEvent &&\n g &&\n (!d ||\n \"_self\" == d ||\n \"_top\" == d ||\n \"_parent\" == d ||\n (h.name && d == h.name)))\n ) {\n try {\n b = a.d.createEvent(\"MouseEvents\");\n } catch (l) {\n b = new h.MouseEvent();\n }\n if (b) {\n try {\n b.initMouseEvent(\n \"click\",\n c.bubbles,\n c.cancelable,\n c.view,\n c.detail,\n c.screenX,\n c.screenY,\n c.clientX,\n c.clientY,\n c.ctrlKey,\n c.altKey,\n c.shiftKey,\n c.metaKey,\n c.button,\n c.relatedTarget\n );\n } catch (m) {\n b = 0;\n }\n b &&\n ((b[\"s_fe_\" + a._in] = b.s_fe = 1),\n c.stopPropagation(),\n c.stopImmediatePropagation &&\n c.stopImmediatePropagation(),\n c.preventDefault(),\n (a.bodyClickTarget = c.target),\n (a.I = b));\n }\n }\n }\n }\n } catch (n) {\n a.clickObject = 0;\n }\n }\n }),\n a.b && a.b.attachEvent\n ? a.b.attachEvent(\"onclick\", a.r)\n : a.b &&\n a.b.addEventListener &&\n (navigator &&\n ((0 <= navigator.userAgent.indexOf(\"WebKit\") &&\n a.d.createEvent) ||\n (0 <= navigator.userAgent.indexOf(\"Firefox/2\") &&\n h.MouseEvent)) &&\n ((a.Ha = 1),\n (a.useForcedLinkTracking = 1),\n a.b.addEventListener(\"click\", a.r, !0)),\n a.b.addEventListener(\"click\", a.r, !1)))\n : setTimeout(a.Wa, 30);\n };\n a.ec = a.xa();\n a.Jb();\n a.lc ||\n (r\n ? a.setAccount(r)\n : a.log(\n \"Error, missing Report Suite ID in AppMeasurement initialization\"\n ),\n a.Wa(),\n a.loadModule(\"ActivityMap\"));\n}", "function now() {\n return window.performance ? performance.now() : Date.now();\n}", "getMeterProvider() {\n return (0, global_utils_1.getGlobal)(API_NAME) || NoopMeterProvider_1.NOOP_METER_PROVIDER;\n }", "function consolePolyfill () {\n // Use window console (if debug is enabled and the console object exists)\n if (consts.debug && (console || objectPath.has(window, 'console'))) {\n return console || window.console\n\n // Give an object with correct properties but with function that does nothing\n } else {\n return {\n clear: noop,\n count: noop,\n debug: noop,\n error: noop,\n group: noop,\n info: noop,\n log: noop,\n table: noop,\n time: noop,\n timeEnd: noop,\n trace: noop,\n warn: noop\n }\n }\n}", "function polyfill() {\n // return when scrollBehavior interface is supported\n if ('scrollBehavior' in d.documentElement.style) {\n return;\n }\n\n /*\n * globals\n */\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n /*\n * object gathering original scroll methods\n */\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n /*\n * define timing method\n */\n var now = w.performance && w.performance.now\n ? w.performance.now.bind(w.performance) : Date.now;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} x\n * @returns {Boolean}\n */\n function shouldBailOut(x) {\n if (typeof x !== 'object'\n || x === null\n || x.behavior === undefined\n || x.behavior === 'auto'\n || x.behavior === 'instant') {\n // first arg not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof x === 'object'\n && x.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError('behavior not valid');\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n var isBody;\n var hasScrollableSpace;\n var hasVisibleOverflow;\n\n do {\n el = el.parentNode;\n\n // set condition variables\n isBody = el === d.body;\n hasScrollableSpace =\n el.clientHeight < el.scrollHeight ||\n el.clientWidth < el.scrollWidth;\n hasVisibleOverflow =\n w.getComputedStyle(el, null).overflow === 'visible';\n } while (!isBody && !(hasScrollableSpace && !hasVisibleOverflow));\n\n isBody = hasScrollableSpace = hasVisibleOverflow = null;\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n /*\n * ORIGINAL METHODS OVERRIDES\n */\n\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scroll.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left,\n ~~arguments[0].top\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.elScroll.call(\n this,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'number' ? left : this.scrollLeft,\n typeof top === 'number' ? top : this.scrollTop\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object') {\n this.scroll({\n left: arg0.left + this.scrollLeft,\n top: arg0.top + this.scrollTop,\n behavior: arg0.behavior\n });\n } else {\n this.scroll(\n this.scrollLeft + arg0,\n this.scrollTop + arguments[1]\n );\n }\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n // reveal parent in viewport\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }", "function polyfill() {\n // return when scrollBehavior interface is supported\n if ('scrollBehavior' in d.documentElement.style) {\n return;\n }\n\n /*\n * globals\n */\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n /*\n * object gathering original scroll methods\n */\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n /*\n * define timing method\n */\n var now = w.performance && w.performance.now\n ? w.performance.now.bind(w.performance) : Date.now;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} x\n * @returns {Boolean}\n */\n function shouldBailOut(x) {\n if (typeof x !== 'object'\n || x === null\n || x.behavior === undefined\n || x.behavior === 'auto'\n || x.behavior === 'instant') {\n // first arg not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof x === 'object'\n && x.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError('behavior not valid');\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n var isBody;\n var hasScrollableSpace;\n var hasVisibleOverflow;\n\n do {\n el = el.parentNode;\n\n // set condition variables\n isBody = el === d.body;\n hasScrollableSpace =\n el.clientHeight < el.scrollHeight ||\n el.clientWidth < el.scrollWidth;\n hasVisibleOverflow =\n w.getComputedStyle(el, null).overflow === 'visible';\n } while (!isBody && !(hasScrollableSpace && !hasVisibleOverflow));\n\n isBody = hasScrollableSpace = hasVisibleOverflow = null;\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n /*\n * ORIGINAL METHODS OVERRIDES\n */\n\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scroll.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left,\n ~~arguments[0].top\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.elScroll.call(\n this,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'number' ? left : this.scrollLeft,\n typeof top === 'number' ? top : this.scrollTop\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object') {\n this.scroll({\n left: arg0.left + this.scrollLeft,\n top: arg0.top + this.scrollTop,\n behavior: arg0.behavior\n });\n } else {\n this.scroll(\n this.scrollLeft + arg0,\n this.scrollTop + arguments[1]\n );\n }\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n // reveal parent in viewport\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }", "function polyfill() {\n // return when scrollBehavior interface is supported\n if ('scrollBehavior' in d.documentElement.style) {\n return;\n }\n\n /*\n * globals\n */\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n /*\n * object gathering original scroll methods\n */\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n /*\n * define timing method\n */\n var now = w.performance && w.performance.now\n ? w.performance.now.bind(w.performance) : Date.now;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} x\n * @returns {Boolean}\n */\n function shouldBailOut(x) {\n if (typeof x !== 'object'\n || x === null\n || x.behavior === undefined\n || x.behavior === 'auto'\n || x.behavior === 'instant') {\n // first arg not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof x === 'object'\n && x.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError('behavior not valid');\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n var isBody;\n var hasScrollableSpace;\n var hasVisibleOverflow;\n\n do {\n el = el.parentNode;\n\n // set condition variables\n isBody = el === d.body;\n hasScrollableSpace =\n el.clientHeight < el.scrollHeight ||\n el.clientWidth < el.scrollWidth;\n hasVisibleOverflow =\n w.getComputedStyle(el, null).overflow === 'visible';\n } while (!isBody && !(hasScrollableSpace && !hasVisibleOverflow));\n\n isBody = hasScrollableSpace = hasVisibleOverflow = null;\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n /*\n * ORIGINAL METHODS OVERRIDES\n */\n\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scroll.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left,\n ~~arguments[0].top\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.elScroll.call(\n this,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n arguments[0].left,\n arguments[0].top\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object') {\n this.scroll({\n left: arg0.left + this.scrollLeft,\n top: arg0.top + this.scrollTop,\n behavior: arg0.behavior\n });\n } else {\n this.scroll(\n this.scrollLeft + arg0,\n this.scrollTop + arguments[1]\n );\n }\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollIntoView.call(this, arguments[0] || true);\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n // reveal parent in viewport\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }", "cacheNatives() {\n return this.evaluateScriptOnLoad(`window.__nativePromise = Promise;\n window.__nativeError = Error;`);\n }", "function getUsedResolutionFirefox() {\n return undefined;\n}", "function Stopwatch() { \n let startTime, endTime, running, duration = 0;\n\n // Object.defineProperty()\n\n Object.defineProperty(this, 'duration', {\n get: function() { return duration; },\n // setter allow prototype method to update its value but has the significant\n // downside of making the duration value unreliable\n set: function(value) { duration = value; }\n });\n\n // expose these private variables so the prototype methods can access them\n // this has the downside of polluting our object's interface\n // this is an example of premature or unnecessary optimization\n Object.defineProperty(this, 'startTime', {\n get: function() { return startTime; }\n });\n Object.defineProperty(this, 'endTime', {\n get: function() { return endTime; }\n });\n Object.defineProperty(this, 'running', {\n get: function() { return running; }\n });\n}", "function getVisualViewport() {\n // tslint:disable-next-line:no-any\n return ('visualViewport' in window) ? window.visualViewport : new VisualViewportPolyfill();\n}", "function requestLegacyStats() {\n if (Object.keys(peerConnectionDataStore).length > 0) {\n chrome.send('getLegacyStats');\n }\n}", "function pollForCPUInfo() {\n chrome.system.cpu.getInfo(function(info) {\n CPU_info = info;\n setTimeout(pollForCPUInfo, POLL_TIME_DELAY);\n });\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function getCpuCurrentSpeedSync() {\n\n let cpus = os.cpus();\n let minFreq = 999999999;\n let maxFreq = 0;\n let avgFreq = 0;\n\n if (cpus.length) {\n for (let i in cpus) {\n if (cpus.hasOwnProperty(i)) {\n avgFreq = avgFreq + cpus[i].speed;\n if (cpus[i].speed > maxFreq) maxFreq = cpus[i].speed;\n if (cpus[i].speed < minFreq) minFreq = cpus[i].speed;\n }\n }\n avgFreq = avgFreq / cpus.length;\n return {\n min: parseFloat((minFreq / 1000).toFixed(2)),\n max: parseFloat((maxFreq / 1000).toFixed(2)),\n avg: parseFloat((avgFreq / 1000).toFixed(2))\n }\n } else {\n return {\n min: 0,\n max: 0,\n avg: 0\n }\n }\n}", "function detectRenderingEngineVersion() {\r\n return _float(((/(?:rv\\:|ari\\/|sto\\/)(\\d+\\.\\d+(\\.\\d+)?)/.\r\n exec(_nu) || [,0])[1]).\r\n toString().replace(/[^\\d\\.]/g, \"\").\r\n replace(/^(\\d+\\.\\d+)(\\.(\\d+))?$/, \"$1$3\"));\r\n}", "function getBrowserAPI() {\n var api;\n\n try {\n api = global.chrome || global.browser || browser;\n } catch (error) {\n api = browser;\n }\n\n if (!api) {\n throw new Error(\"Browser API is not present\");\n }\n\n return api;\n}", "function So() {\n // `window` is not always available, e.g. in ReactNative and WebWorkers.\n // eslint-disable-next-line no-restricted-globals\n return \"undefined\" != typeof window ? window : null;\n}", "function FoxMeterService() \r\n{\r\n\tthis.wrappedJSObject = this;\r\n\tthis.init();\r\n}", "function BrowserDetect() {}", "function loadImplementation(){\n\t if(typeof window.Promise === 'undefined'){\n\t throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n\t \" e.g: require('any-promise/register/bluebird')\")\n\t }\n\t return {\n\t Promise: window.Promise,\n\t implementation: 'window.Promise'\n\t }\n\t}", "function InstallWebVRSpecShim() {\n if ('VRDisplay' in window && !('VRFrameData' in window)) {\n // Provide the VRFrameData object.\n window.VRFrameData = VRFrameData;\n\n // A lot of Chrome builds don't have depthNear and depthFar, even\n // though they're in the WebVR 1.0 spec. Patch them in if they're not present.\n if(!('depthNear' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthNear = 0.01;\n }\n\n if(!('depthFar' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthFar = 10000.0;\n }\n\n window.VRDisplay.prototype.getFrameData = function(frameData) {\n return Util.frameDataFromPose(frameData, this.getPose(), this);\n }\n }\n}", "function InstallWebVRSpecShim() {\n if ('VRDisplay' in window && !('VRFrameData' in window)) {\n // Provide the VRFrameData object.\n window.VRFrameData = VRFrameData;\n\n // A lot of Chrome builds don't have depthNear and depthFar, even\n // though they're in the WebVR 1.0 spec. Patch them in if they're not present.\n if(!('depthNear' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthNear = 0.01;\n }\n\n if(!('depthFar' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthFar = 10000.0;\n }\n\n window.VRDisplay.prototype.getFrameData = function(frameData) {\n return Util.frameDataFromPose(frameData, this.getPose(), this);\n }\n }\n}", "function InstallWebVRSpecShim() {\n if ('VRDisplay' in window && !('VRFrameData' in window)) {\n // Provide the VRFrameData object.\n window.VRFrameData = VRFrameData;\n\n // A lot of Chrome builds don't have depthNear and depthFar, even\n // though they're in the WebVR 1.0 spec. Patch them in if they're not present.\n if(!('depthNear' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthNear = 0.01;\n }\n\n if(!('depthFar' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthFar = 10000.0;\n }\n\n window.VRDisplay.prototype.getFrameData = function(frameData) {\n return Util.frameDataFromPose(frameData, this.getPose(), this);\n }\n }\n}", "function InstallWebVRSpecShim() {\n if ('VRDisplay' in window && !('VRFrameData' in window)) {\n // Provide the VRFrameData object.\n window.VRFrameData = VRFrameData;\n\n // A lot of Chrome builds don't have depthNear and depthFar, even\n // though they're in the WebVR 1.0 spec. Patch them in if they're not present.\n if(!('depthNear' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthNear = 0.01;\n }\n\n if(!('depthFar' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthFar = 10000.0;\n }\n\n window.VRDisplay.prototype.getFrameData = function(frameData) {\n return Util.frameDataFromPose(frameData, this.getPose(), this);\n }\n }\n}", "function InstallWebVRSpecShim() {\n if ('VRDisplay' in window && !('VRFrameData' in window)) {\n // Provide the VRFrameData object.\n window.VRFrameData = VRFrameData;\n\n // A lot of Chrome builds don't have depthNear and depthFar, even\n // though they're in the WebVR 1.0 spec. Patch them in if they're not present.\n if(!('depthNear' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthNear = 0.01;\n }\n\n if(!('depthFar' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthFar = 10000.0;\n }\n\n window.VRDisplay.prototype.getFrameData = function(frameData) {\n return Util.frameDataFromPose(frameData, this.getPose(), this);\n }\n }\n}", "function InstallWebVRSpecShim() {\n if ('VRDisplay' in window && !('VRFrameData' in window)) {\n // Provide the VRFrameData object.\n window.VRFrameData = VRFrameData;\n\n // A lot of Chrome builds don't have depthNear and depthFar, even\n // though they're in the WebVR 1.0 spec. Patch them in if they're not present.\n if(!('depthNear' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthNear = 0.01;\n }\n\n if(!('depthFar' in window.VRDisplay.prototype)) {\n window.VRDisplay.prototype.depthFar = 10000.0;\n }\n\n window.VRDisplay.prototype.getFrameData = function(frameData) {\n return Util.frameDataFromPose(frameData, this.getPose(), this);\n }\n }\n}", "function Runtime() {}", "function addPerformanceNavigationTiming(props) {\n var transaction = props.transaction, entry = props.entry, event = props.event, timeOrigin = props.timeOrigin, eventEnd = props.eventEnd, description = props.description;\n var end = eventEnd ? entry[eventEnd] : entry[event + \"End\"];\n var start = entry[event + \"Start\"];\n if (!start || !end) {\n return;\n }\n _startChild(transaction, {\n op: 'browser',\n description: (description !== null && description !== void 0 ? description : event),\n startTimestamp: timeOrigin + msToSec(start),\n endTimestamp: timeOrigin + msToSec(end),\n });\n}", "function polyfill() {\n // return when scrollBehavior interface is supported\n if ('scrollBehavior' in d.documentElement.style) {\n return;\n }\n\n /*\n * globals\n */\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 400;\n\n /*\n * object gathering original scroll methods\n */\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} x\n * @returns {Boolean}\n */\n function shouldBailOut(x) {\n if (typeof x !== 'object'\n || x === null\n || x.behavior === undefined\n || x.behavior === 'auto'\n || x.behavior === 'instant') {\n // first arg not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof x === 'object'\n && x.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError('behavior not valid');\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Element} el\n * @returns {Element} el\n */\n function findScrollableParent(el) {\n while (el = el.parentElement) {\n if (el === d.body || (el.clientHeight < el.scrollHeight ||\n el.clientWidth < el.scrollWidth) && w.getComputedStyle(el, null).overflow !== 'visible')\n return el;\n }\n return null;\n }\n\n /**\n * scrolls window with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n */\n function smoothScroll(el, x, y) {\n if (\"msZoomTo\" in el)\n return el.msZoomTo({ contentX: x, contentY: y, viewportX: 0, viewportY: 0 });\n w.requestAnimationFrame(time => {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = time;\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n w.requestAnimationFrame(function step(time) {\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = startX + (x - startX) * value;\n currentY = startY + (y - startY) * value;\n\n method.call(scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (elapsed < 1) {\n w.requestAnimationFrame(step);\n }\n });\n });\n }\n\n /*\n * ORIGINAL METHODS OVERRIDES\n */\n\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scroll.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left,\n ~~arguments[0].top\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.elScroll.call(\n this,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'number' ? left : this.scrollLeft,\n typeof top === 'number' ? top : this.scrollTop\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object') {\n this.scroll({\n left: arg0.left + this.scrollLeft,\n top: arg0.top + this.scrollTop,\n behavior: arg0.behavior\n });\n } else {\n this.scroll(\n this.scrollLeft + arg0,\n this.scrollTop + arguments[1]\n );\n }\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function scrollIntoView(arg = undefined) {\n // avoid smooth behavior if not required\n if (shouldBailOut(arg))\n return original.scrollIntoView.apply(this, arguments);\n\n // LET THE SMOOTHNESS BEGIN!\n const { block = \"start\", inline = \"nearest\" } = arg;\n var scrollableParent = this;\n var clientRects = this.getBoundingClientRect();\n while (scrollableParent = findScrollableParent(scrollableParent)) {\n var parentRects;\n if (scrollableParent === d.body)\n parentRects = {\n width: d.documentElement.clientWidth,\n height: d.documentElement.clientHeight,\n top: 0,\n right: d.documentElement.clientWidth,\n bottom: d.documentElement.clientHeight,\n left: 0\n };\n else\n parentRects = scrollableParent.getBoundingClientRect();\n\n let left = 0, top = 0;\n switch (inline) {\n case \"start\":\n left = clientRects.left - parentRects.left;\n break;\n case \"end\":\n left = clientRects.right - parentRects.right;\n break;\n case \"center\":\n left = clientRects.left + clientRects.width / 2 - (parentRects.left + parentRects.width / 2);\n break;\n default:\n if (clientRects.left <= parentRects.left && clientRects.right >= parentRects.right)\n ;\n else if (clientRects.left < parentRects.left && clientRects.width <= parentRects.width || clientRects.right > parentRects.right && clientRects.width >= parentRects.width)\n left = clientRects.left - parentRects.left;\n else if (clientRects.left < parentRects.left && clientRects.width >= parentRects.width || clientRects.right > parentRects.right && clientRects.width <= parentRects.width)\n left = clientRects.right - parentRects.right;\n break;\n }\n switch (block) {\n case \"start\":\n top = clientRects.top - parentRects.top;\n break;\n case \"end\":\n top = clientRects.bottom - parentRects.bottom;\n break;\n case \"center\":\n top = clientRects.top + clientRects.height / 2 - (parentRects.top + parentRects.height / 2);\n break;\n default:\n if (clientRects.top <= parentRects.top && clientRects.bottom >= parentRects.bottom)\n ;\n else if (clientRects.top < parentRects.top && clientRects.height <= parentRects.height || clientRects.bottom > parentRects.bottom && clientRects.height >= parentRects.height)\n top = clientRects.top - parentRects.top;\n else if (clientRects.top < parentRects.top && clientRects.height >= parentRects.height || clientRects.bottom > parentRects.bottom && clientRects.height <= parentRects.height)\n top = clientRects.bottom - parentRects.bottom;\n break;\n }\n let clientWidth, clientHeight;\n if (scrollableParent === d.body) {\n scrollableParent = d.scrollingElement;\n clientWidth = d.documentElement.clientWidth;\n clientHeight = d.documentElement.clientHeight;\n } else {\n clientWidth = scrollableParent.clientWidth;\n clientHeight = scrollableParent.clientHeight;\n }\n const scrollLeft = scrollableParent.scrollLeft;\n const scrollTop = scrollableParent.scrollTop;\n const x = Math.max(0, Math.min(scrollLeft + left, scrollableParent.scrollWidth - clientWidth));\n const y = Math.max(0, Math.min(scrollTop + top, scrollableParent.scrollHeight - clientHeight));\n if (x == scrollLeft && y == scrollTop)\n continue;\n\n smoothScroll(scrollableParent, x, y);\n\n clientRects = {\n width: clientRects.width,\n height: clientRects.height,\n top: clientRects.top - (y - scrollTop),\n right: clientRects.right - (x - scrollLeft),\n bottom: clientRects.bottom - (y - scrollTop),\n left: clientRects.left - (x - scrollLeft)\n };\n }\n };\n }", "function LA(){var e=navigator,t=e.userAgent,n=t.indexOf(\"compatible\")>-1&&t.indexOf(\"MSIE\")>-1,r=t.indexOf(\"Trident\")>-1&&t.indexOf(\"rv:11.0\")>-1;if(n){var a=new RegExp(\"MSIE (\\\\d+\\\\.\\\\d+);\"),o=t.match(a);if(!o)return-1;var i=parseFloat(o[1]);return i<7?6:i}return r?11:Number.MAX_SAFE_INTEGER}", "function InstallWebVRSpecShim() {\n\t if ('VRDisplay' in window && !('VRFrameData' in window)) {\n\t // Provide the VRFrameData object.\n\t window.VRFrameData = VRFrameData;\n\n\t // A lot of Chrome builds don't have depthNear and depthFar, even\n\t // though they're in the WebVR 1.0 spec. Patch them in if they're not present.\n\t if(!('depthNear' in window.VRDisplay.prototype)) {\n\t window.VRDisplay.prototype.depthNear = 0.01;\n\t }\n\n\t if(!('depthFar' in window.VRDisplay.prototype)) {\n\t window.VRDisplay.prototype.depthFar = 10000.0;\n\t }\n\n\t window.VRDisplay.prototype.getFrameData = function(frameData) {\n\t return Util.frameDataFromPose(frameData, this.getPose(), this);\n\t }\n\t }\n\t}", "function getBrowserNotSupportedInfo() {\n return ( _config ? _config.browserNotSupportedInfo : undefined) || DEFAULT_BROWSER_NOT_SUPPORTED_INFO;\n }", "function AppMeasurement() {\n var a = this;\n a.version = \"1.6.2\";\n var k = window;\n k.s_c_in || (k.s_c_il = [], k.s_c_in = 0);\n a._il = k.s_c_il;\n a._in = k.s_c_in;\n a._il[a._in] = a;\n k.s_c_in++;\n a._c = \"s_c\";\n var q = k.AppMeasurement.Ib;\n q || (q = null);\n var r = k,\n n, t;\n try {\n for (n = r.parent, t = r.location; n && n.location && t && \"\" + n.location != \"\" + t && r.location && \"\" + n.location != \"\" + r.location && n.location.host == t.host;) r = n, n = r.parent\n } catch (u) { }\n a.xb = function (a) {\n try {\n console.log(a)\n } catch (b) { }\n };\n a.Ga = function (a) {\n return \"\" + parseInt(a) == \"\" + a\n };\n a.replace = function (a, b, d) {\n return !a ||\n 0 > a.indexOf(b) ? a : a.split(b).join(d)\n };\n a.escape = function (c) {\n var b, d;\n if (!c) return c;\n c = encodeURIComponent(c);\n for (b = 0; 7 > b; b++) d = \"+~!*()'\".substring(b, b + 1), 0 <= c.indexOf(d) && (c = a.replace(c, d, \"%\" + d.charCodeAt(0).toString(16).toUpperCase()));\n return c\n };\n a.unescape = function (c) {\n if (!c) return c;\n c = 0 <= c.indexOf(\"+\") ? a.replace(c, \"+\", \" \") : c;\n try {\n return decodeURIComponent(c)\n } catch (b) { }\n return unescape(c)\n };\n a.ob = function () {\n var c = k.location.hostname,\n b = a.fpCookieDomainPeriods,\n d;\n b || (b = a.cookieDomainPeriods);\n if (c && !a.cookieDomain &&\n !/^[0-9.]+$/.test(c) && (b = b ? parseInt(b) : 2, b = 2 < b ? b : 2, d = c.lastIndexOf(\".\"), 0 <= d)) {\n for (; 0 <= d && 1 < b;) d = c.lastIndexOf(\".\", d - 1), b--;\n a.cookieDomain = 0 < d ? c.substring(d) : c\n }\n return a.cookieDomain\n };\n a.c_r = a.cookieRead = function (c) {\n c = a.escape(c);\n var b = \" \" + a.d.cookie,\n d = b.indexOf(\" \" + c + \"=\"),\n f = 0 > d ? d : b.indexOf(\";\", d);\n c = 0 > d ? \"\" : a.unescape(b.substring(d + 2 + c.length, 0 > f ? b.length : f));\n return \"[[B]]\" != c ? c : \"\"\n };\n a.c_w = a.cookieWrite = function (c, b, d) {\n var f = a.ob(),\n e = a.cookieLifetime,\n g;\n b = \"\" + b;\n e = e ? (\"\" + e).toUpperCase() : \"\";\n d && \"SESSION\" !=\n e && \"NONE\" != e && ((g = \"\" != b ? parseInt(e ? e : 0) : -60) ? (d = new Date, d.setTime(d.getTime() + 1E3 * g)) : 1 == d && (d = new Date, g = d.getYear(), d.setYear(g + 5 + (1900 > g ? 1900 : 0))));\n return c && \"NONE\" != e ? (a.d.cookie = c + \"=\" + a.escape(\"\" != b ? b : \"[[B]]\") + \"; path=/;\" + (d && \"SESSION\" != e ? \" expires=\" + d.toGMTString() + \";\" : \"\") + (f ? \" domain=\" + f + \";\" : \"\"), a.cookieRead(c) == b) : 0\n };\n a.J = [];\n a.ga = function (c, b, d) {\n if (a.za) return 0;\n a.maxDelay || (a.maxDelay = 250);\n var f = 0,\n e = (new Date).getTime() + a.maxDelay,\n g = a.d.visibilityState,\n m = [\"webkitvisibilitychange\", \"visibilitychange\"];\n g || (g = a.d.webkitVisibilityState);\n if (g && \"prerender\" == g) {\n if (!a.ha)\n for (a.ha = 1, d = 0; d < m.length; d++) a.d.addEventListener(m[d], function () {\n var b = a.d.visibilityState;\n b || (b = a.d.webkitVisibilityState);\n \"visible\" == b && (a.ha = 0, a.delayReady())\n });\n f = 1;\n e = 0\n } else d || a.p(\"_d\") && (f = 1);\n f && (a.J.push({\n m: c,\n a: b,\n t: e\n }), a.ha || setTimeout(a.delayReady, a.maxDelay));\n return f\n };\n a.delayReady = function () {\n var c = (new Date).getTime(),\n b = 0,\n d;\n for (a.p(\"_d\") ? b = 1 : a.ua() ; 0 < a.J.length;) {\n d = a.J.shift();\n if (b && !d.t && d.t > c) {\n a.J.unshift(d);\n setTimeout(a.delayReady,\n parseInt(a.maxDelay / 2));\n break\n }\n a.za = 1;\n a[d.m].apply(a, d.a);\n a.za = 0\n }\n };\n a.setAccount = a.sa = function (c) {\n var b, d;\n if (!a.ga(\"setAccount\", arguments))\n if (a.account = c, a.allAccounts)\n for (b = a.allAccounts.concat(c.split(\",\")), a.allAccounts = [], b.sort(), d = 0; d < b.length; d++) 0 != d && b[d - 1] == b[d] || a.allAccounts.push(b[d]);\n else a.allAccounts = c.split(\",\")\n };\n a.foreachVar = function (c, b) {\n var d, f, e, g, m = \"\";\n e = f = \"\";\n if (a.lightProfileID) d = a.N, (m = a.lightTrackVars) && (m = \",\" + m + \",\" + a.la.join(\",\") + \",\");\n else {\n d = a.g;\n if (a.pe || a.linkType) m = a.linkTrackVars,\n f = a.linkTrackEvents, a.pe && (e = a.pe.substring(0, 1).toUpperCase() + a.pe.substring(1), a[e] && (m = a[e].Gb, f = a[e].Fb));\n m && (m = \",\" + m + \",\" + a.F.join(\",\") + \",\");\n f && m && (m += \",events,\")\n }\n b && (b = \",\" + b + \",\");\n for (f = 0; f < d.length; f++) e = d[f], (g = a[e]) && (!m || 0 <= m.indexOf(\",\" + e + \",\")) && (!b || 0 <= b.indexOf(\",\" + e + \",\")) && c(e, g)\n };\n a.r = function (c, b, d, f, e) {\n var g = \"\",\n m, p, k, w, n = 0;\n \"contextData\" == c && (c = \"c\");\n if (b) {\n for (m in b)\n if (!(Object.prototype[m] || e && m.substring(0, e.length) != e) && b[m] && (!d || 0 <= d.indexOf(\",\" + (f ? f + \".\" : \"\") + m + \",\"))) {\n k = !1;\n if (n)\n for (p =\n 0; p < n.length; p++) m.substring(0, n[p].length) == n[p] && (k = !0);\n if (!k && (\"\" == g && (g += \"&\" + c + \".\"), p = b[m], e && (m = m.substring(e.length)), 0 < m.length))\n if (k = m.indexOf(\".\"), 0 < k) p = m.substring(0, k), k = (e ? e : \"\") + p + \".\", n || (n = []), n.push(k), g += a.r(p, b, d, f, k);\n else if (\"boolean\" == typeof p && (p = p ? \"true\" : \"false\"), p) {\n if (\"retrieveLightData\" == f && 0 > e.indexOf(\".contextData.\")) switch (k = m.substring(0, 4), w = m.substring(4), m) {\n case \"transactionID\":\n m = \"xact\";\n break;\n case \"channel\":\n m = \"ch\";\n break;\n case \"campaign\":\n m = \"v0\";\n break;\n default:\n a.Ga(w) && (\"prop\" ==\n k ? m = \"c\" + w : \"eVar\" == k ? m = \"v\" + w : \"list\" == k ? m = \"l\" + w : \"hier\" == k && (m = \"h\" + w, p = p.substring(0, 255)))\n }\n g += \"&\" + a.escape(m) + \"=\" + a.escape(p)\n }\n }\n \"\" != g && (g += \"&.\" + c)\n }\n return g\n };\n a.usePostbacks = 0;\n a.rb = function () {\n var c = \"\",\n b, d, f, e, g, m, p, k, n = \"\",\n r = \"\",\n s = e = \"\";\n if (a.lightProfileID) b = a.N, (n = a.lightTrackVars) && (n = \",\" + n + \",\" + a.la.join(\",\") + \",\");\n else {\n b = a.g;\n if (a.pe || a.linkType) n = a.linkTrackVars, r = a.linkTrackEvents, a.pe && (e = a.pe.substring(0, 1).toUpperCase() + a.pe.substring(1), a[e] && (n = a[e].Gb, r = a[e].Fb));\n n && (n = \",\" + n + \",\" + a.F.join(\",\") + \",\");\n r && (r = \",\" + r + \",\", n && (n += \",events,\"));\n a.events2 && (s += (\"\" != s ? \",\" : \"\") + a.events2)\n }\n if (a.visitor && 1.5 <= parseFloat(a.visitor.version) && a.visitor.getCustomerIDs) {\n e = q;\n if (g = a.visitor.getCustomerIDs())\n for (d in g) Object.prototype[d] || (f = g[d], e || (e = {}), f.id && (e[d + \".id\"] = f.id), f.authState && (e[d + \".as\"] = f.authState));\n e && (c += a.r(\"cid\", e))\n }\n a.AudienceManagement && a.AudienceManagement.isReady() && (c += a.r(\"d\", a.AudienceManagement.getEventCallConfigParams()));\n for (d = 0; d < b.length; d++) {\n e = b[d];\n g = a[e];\n f = e.substring(0, 4);\n m = e.substring(4);\n !g && \"events\" == e && s && (g = s, s = \"\");\n if (g && (!n || 0 <= n.indexOf(\",\" + e + \",\"))) {\n switch (e) {\n case \"supplementalDataID\":\n e = \"sdid\";\n break;\n case \"timestamp\":\n e = \"ts\";\n break;\n case \"dynamicVariablePrefix\":\n e = \"D\";\n break;\n case \"visitorID\":\n e = \"vid\";\n break;\n case \"marketingCloudVisitorID\":\n e = \"mid\";\n break;\n case \"analyticsVisitorID\":\n e = \"aid\";\n break;\n case \"audienceManagerLocationHint\":\n e = \"aamlh\";\n break;\n case \"audienceManagerBlob\":\n e = \"aamb\";\n break;\n case \"authState\":\n e = \"as\";\n break;\n case \"pageURL\":\n e = \"g\";\n 255 < g.length && (a.pageURLRest = g.substring(255), g = g.substring(0,\n 255));\n break;\n case \"pageURLRest\":\n e = \"-g\";\n break;\n case \"referrer\":\n e = \"r\";\n break;\n case \"vmk\":\n case \"visitorMigrationKey\":\n e = \"vmt\";\n break;\n case \"visitorMigrationServer\":\n e = \"vmf\";\n a.ssl && a.visitorMigrationServerSecure && (g = \"\");\n break;\n case \"visitorMigrationServerSecure\":\n e = \"vmf\";\n !a.ssl && a.visitorMigrationServer && (g = \"\");\n break;\n case \"charSet\":\n e = \"ce\";\n break;\n case \"visitorNamespace\":\n e = \"ns\";\n break;\n case \"cookieDomainPeriods\":\n e = \"cdp\";\n break;\n case \"cookieLifetime\":\n e = \"cl\";\n break;\n case \"variableProvider\":\n e = \"vvp\";\n break;\n case \"currencyCode\":\n e =\n \"cc\";\n break;\n case \"channel\":\n e = \"ch\";\n break;\n case \"transactionID\":\n e = \"xact\";\n break;\n case \"campaign\":\n e = \"v0\";\n break;\n case \"latitude\":\n e = \"lat\";\n break;\n case \"longitude\":\n e = \"lon\";\n break;\n case \"resolution\":\n e = \"s\";\n break;\n case \"colorDepth\":\n e = \"c\";\n break;\n case \"javascriptVersion\":\n e = \"j\";\n break;\n case \"javaEnabled\":\n e = \"v\";\n break;\n case \"cookiesEnabled\":\n e = \"k\";\n break;\n case \"browserWidth\":\n e = \"bw\";\n break;\n case \"browserHeight\":\n e = \"bh\";\n break;\n case \"connectionType\":\n e = \"ct\";\n break;\n case \"homepage\":\n e = \"hp\";\n break;\n case \"events\":\n s && (g += (\"\" != g ? \",\" : \"\") + s);\n if (r)\n for (m =\n g.split(\",\"), g = \"\", f = 0; f < m.length; f++) p = m[f], k = p.indexOf(\"=\"), 0 <= k && (p = p.substring(0, k)), k = p.indexOf(\":\"), 0 <= k && (p = p.substring(0, k)), 0 <= r.indexOf(\",\" + p + \",\") && (g += (g ? \",\" : \"\") + m[f]);\n break;\n case \"events2\":\n g = \"\";\n break;\n case \"contextData\":\n c += a.r(\"c\", a[e], n, e);\n g = \"\";\n break;\n case \"lightProfileID\":\n e = \"mtp\";\n break;\n case \"lightStoreForSeconds\":\n e = \"mtss\";\n a.lightProfileID || (g = \"\");\n break;\n case \"lightIncrementBy\":\n e = \"mti\";\n a.lightProfileID || (g = \"\");\n break;\n case \"retrieveLightProfiles\":\n e = \"mtsr\";\n break;\n case \"deleteLightProfiles\":\n e =\n \"mtsd\";\n break;\n case \"retrieveLightData\":\n a.retrieveLightProfiles && (c += a.r(\"mts\", a[e], n, e));\n g = \"\";\n break;\n default:\n a.Ga(m) && (\"prop\" == f ? e = \"c\" + m : \"eVar\" == f ? e = \"v\" + m : \"list\" == f ? e = \"l\" + m : \"hier\" == f && (e = \"h\" + m, g = g.substring(0, 255)))\n }\n g && (c += \"&\" + e + \"=\" + (\"pev\" != e.substring(0, 3) ? a.escape(g) : g))\n }\n \"pev3\" == e && a.e && (c += a.e)\n }\n return c\n };\n a.D = function (a) {\n var b = a.tagName;\n if (\"undefined\" != \"\" + a.Lb || \"undefined\" != \"\" + a.Bb && \"HTML\" != (\"\" + a.Bb).toUpperCase()) return \"\";\n b = b && b.toUpperCase ? b.toUpperCase() : \"\";\n \"SHAPE\" == b && (b = \"\");\n b && ((\"INPUT\" == b ||\n \"BUTTON\" == b) && a.type && a.type.toUpperCase ? b = a.type.toUpperCase() : !b && a.href && (b = \"A\"));\n return b\n };\n a.Ca = function (a) {\n var b = a.href ? a.href : \"\",\n d, f, e;\n d = b.indexOf(\":\");\n f = b.indexOf(\"?\");\n e = b.indexOf(\"/\");\n b && (0 > d || 0 <= f && d > f || 0 <= e && d > e) && (f = a.protocol && 1 < a.protocol.length ? a.protocol : l.protocol ? l.protocol : \"\", d = l.pathname.lastIndexOf(\"/\"), b = (f ? f + \"//\" : \"\") + (a.host ? a.host : l.host ? l.host : \"\") + (\"/\" != h.substring(0, 1) ? l.pathname.substring(0, 0 > d ? 0 : d) + \"/\" : \"\") + b);\n return b\n };\n a.K = function (c) {\n var b = a.D(c),\n d, f, e = \"\",\n g = 0;\n return b &&\n (d = c.protocol, f = c.onclick, !c.href || \"A\" != b && \"AREA\" != b || f && d && !(0 > d.toLowerCase().indexOf(\"javascript\")) ? f ? (e = a.replace(a.replace(a.replace(a.replace(\"\" + f, \"\\r\", \"\"), \"\\n\", \"\"), \"\\t\", \"\"), \" \", \"\"), g = 2) : \"INPUT\" == b || \"SUBMIT\" == b ? (c.value ? e = c.value : c.innerText ? e = c.innerText : c.textContent && (e = c.textContent), g = 3) : \"IMAGE\" == b && c.src && (e = c.src) : e = a.Ca(c), e) ? {\n id: e.substring(0, 100),\n type: g\n } : 0\n };\n a.Jb = function (c) {\n for (var b = a.D(c), d = a.K(c) ; c && !d && \"BODY\" != b;)\n if (c = c.parentElement ? c.parentElement : c.parentNode) b = a.D(c), d = a.K(c);\n d && \"BODY\" != b || (c = 0);\n c && (b = c.onclick ? \"\" + c.onclick : \"\", 0 <= b.indexOf(\".tl(\") || 0 <= b.indexOf(\".trackLink(\")) && (c = 0);\n return c\n };\n a.Ab = function () {\n var c, b, d = a.linkObject,\n f = a.linkType,\n e = a.linkURL,\n g, m;\n a.ma = 1;\n d || (a.ma = 0, d = a.clickObject);\n if (d) {\n c = a.D(d);\n for (b = a.K(d) ; d && !b && \"BODY\" != c;)\n if (d = d.parentElement ? d.parentElement : d.parentNode) c = a.D(d), b = a.K(d);\n b && \"BODY\" != c || (d = 0);\n if (d && !a.linkObject) {\n var p = d.onclick ? \"\" + d.onclick : \"\";\n if (0 <= p.indexOf(\".tl(\") || 0 <= p.indexOf(\".trackLink(\")) d = 0\n }\n } else a.ma = 1;\n !e && d && (e = a.Ca(d));\n e &&\n !a.linkLeaveQueryString && (g = e.indexOf(\"?\"), 0 <= g && (e = e.substring(0, g)));\n if (!f && e) {\n var n = 0,\n r = 0,\n q;\n if (a.trackDownloadLinks && a.linkDownloadFileTypes)\n for (p = e.toLowerCase(), g = p.indexOf(\"?\"), m = p.indexOf(\"#\"), 0 <= g ? 0 <= m && m < g && (g = m) : g = m, 0 <= g && (p = p.substring(0, g)), g = a.linkDownloadFileTypes.toLowerCase().split(\",\"), m = 0; m < g.length; m++) (q = g[m]) && p.substring(p.length - (q.length + 1)) == \".\" + q && (f = \"d\");\n if (a.trackExternalLinks && !f && (p = e.toLowerCase(), a.Fa(p) && (a.linkInternalFilters || (a.linkInternalFilters = k.location.hostname),\n g = 0, a.linkExternalFilters ? (g = a.linkExternalFilters.toLowerCase().split(\",\"), n = 1) : a.linkInternalFilters && (g = a.linkInternalFilters.toLowerCase().split(\",\")), g))) {\n for (m = 0; m < g.length; m++) q = g[m], 0 <= p.indexOf(q) && (r = 1);\n r ? n && (f = \"e\") : n || (f = \"e\")\n }\n }\n a.linkObject = d;\n a.linkURL = e;\n a.linkType = f;\n if (a.trackClickMap || a.trackInlineStats) a.e = \"\", d && (f = a.pageName, e = 1, d = d.sourceIndex, f || (f = a.pageURL, e = 0), k.s_objectID && (b.id = k.s_objectID, d = b.type = 1), f && b && b.id && c && (a.e = \"&pid=\" + a.escape(f.substring(0, 255)) + (e ? \"&pidt=\" + e : \"\") +\n \"&oid=\" + a.escape(b.id.substring(0, 100)) + (b.type ? \"&oidt=\" + b.type : \"\") + \"&ot=\" + c + (d ? \"&oi=\" + d : \"\")))\n };\n a.sb = function () {\n var c = a.ma,\n b = a.linkType,\n d = a.linkURL,\n f = a.linkName;\n b && (d || f) && (b = b.toLowerCase(), \"d\" != b && \"e\" != b && (b = \"o\"), a.pe = \"lnk_\" + b, a.pev1 = d ? a.escape(d) : \"\", a.pev2 = f ? a.escape(f) : \"\", c = 1);\n a.abort && (c = 0);\n if (a.trackClickMap || a.trackInlineStats || a.ActivityMap) {\n var b = {},\n d = 0,\n e = a.cookieRead(\"s_sq\"),\n g = e ? e.split(\"&\") : 0,\n m, p, k, e = 0;\n if (g)\n for (m = 0; m < g.length; m++) p = g[m].split(\"=\"), f = a.unescape(p[0]).split(\",\"), p = a.unescape(p[1]),\n b[p] = f;\n f = a.account.split(\",\");\n m = {};\n for (k in a.contextData) k && !Object.prototype[k] && \"a.activitymap.\" == k.substring(0, 14) && (m[k] = a.contextData[k], a.contextData[k] = \"\");\n a.e = a.r(\"c\", m) + (a.e ? a.e : \"\");\n if (c || a.e) {\n c && !a.e && (e = 1);\n for (p in b)\n if (!Object.prototype[p])\n for (k = 0; k < f.length; k++)\n for (e && (g = b[p].join(\",\"), g == a.account && (a.e += (\"&\" != p.charAt(0) ? \"&\" : \"\") + p, b[p] = [], d = 1)), m = 0; m < b[p].length; m++) g = b[p][m], g == f[k] && (e && (a.e += \"&u=\" + a.escape(g) + (\"&\" != p.charAt(0) ? \"&\" : \"\") + p + \"&u=0\"), b[p].splice(m, 1), d = 1);\n c || (d = 1);\n if (d) {\n e =\n \"\";\n m = 2;\n !c && a.e && (e = a.escape(f.join(\",\")) + \"=\" + a.escape(a.e), m = 1);\n for (p in b) !Object.prototype[p] && 0 < m && 0 < b[p].length && (e += (e ? \"&\" : \"\") + a.escape(b[p].join(\",\")) + \"=\" + a.escape(p), m--);\n a.cookieWrite(\"s_sq\", e)\n }\n }\n }\n return c\n };\n a.tb = function () {\n if (!a.Eb) {\n var c = new Date,\n b = r.location,\n d, f, e = f = d = \"\",\n g = \"\",\n m = \"\",\n k = \"1.2\",\n n = a.cookieWrite(\"s_cc\", \"true\", 0) ? \"Y\" : \"N\",\n q = \"\",\n s = \"\";\n if (c.setUTCDate && (k = \"1.3\", (0).toPrecision && (k = \"1.5\", c = [], c.forEach))) {\n k = \"1.6\";\n f = 0;\n d = {};\n try {\n f = new Iterator(d), f.next && (k = \"1.7\", c.reduce && (k = \"1.8\", k.trim &&\n (k = \"1.8.1\", Date.parse && (k = \"1.8.2\", Object.create && (k = \"1.8.5\")))))\n } catch (t) { }\n }\n d = screen.width + \"x\" + screen.height;\n e = navigator.javaEnabled() ? \"Y\" : \"N\";\n f = screen.pixelDepth ? screen.pixelDepth : screen.colorDepth;\n g = a.w.innerWidth ? a.w.innerWidth : a.d.documentElement.offsetWidth;\n m = a.w.innerHeight ? a.w.innerHeight : a.d.documentElement.offsetHeight;\n try {\n a.b.addBehavior(\"#default#homePage\"), q = a.b.Kb(b) ? \"Y\" : \"N\"\n } catch (u) { }\n try {\n a.b.addBehavior(\"#default#clientCaps\"), s = a.b.connectionType\n } catch (x) { }\n a.resolution = d;\n a.colorDepth =\n f;\n a.javascriptVersion = k;\n a.javaEnabled = e;\n a.cookiesEnabled = n;\n a.browserWidth = g;\n a.browserHeight = m;\n a.connectionType = s;\n a.homepage = q;\n a.Eb = 1\n }\n };\n a.O = {};\n a.loadModule = function (c, b) {\n var d = a.O[c];\n if (!d) {\n d = k[\"AppMeasurement_Module_\" + c] ? new k[\"AppMeasurement_Module_\" + c](a) : {};\n a.O[c] = a[c] = d;\n d.Wa = function () {\n return d.$a\n };\n d.ab = function (b) {\n if (d.$a = b) a[c + \"_onLoad\"] = b, a.ga(c + \"_onLoad\", [a, d], 1) || b(a, d)\n };\n try {\n Object.defineProperty ? Object.defineProperty(d, \"onLoad\", {\n get: d.Wa,\n set: d.ab\n }) : d._olc = 1\n } catch (f) {\n d._olc = 1\n }\n }\n b && (a[c + \"_onLoad\"] =\n b, a.ga(c + \"_onLoad\", [a, d], 1) || b(a, d))\n };\n a.p = function (c) {\n var b, d;\n for (b in a.O)\n if (!Object.prototype[b] && (d = a.O[b]) && (d._olc && d.onLoad && (d._olc = 0, d.onLoad(a, d)), d[c] && d[c]())) return 1;\n return 0\n };\n a.vb = function () {\n var c = Math.floor(1E13 * Math.random()),\n b = a.visitorSampling,\n d = a.visitorSamplingGroup,\n d = \"s_vsn_\" + (a.visitorNamespace ? a.visitorNamespace : a.account) + (d ? \"_\" + d : \"\"),\n f = a.cookieRead(d);\n if (b) {\n f && (f = parseInt(f));\n if (!f) {\n if (!a.cookieWrite(d, c)) return 0;\n f = c\n }\n if (f % 1E4 > v) return 0\n }\n return 1\n };\n a.P = function (c, b) {\n var d,\n f, e, g, m, k;\n for (d = 0; 2 > d; d++)\n for (f = 0 < d ? a.va : a.g, e = 0; e < f.length; e++)\n if (g = f[e], (m = c[g]) || c[\"!\" + g]) {\n if (!b && (\"contextData\" == g || \"retrieveLightData\" == g) && a[g])\n for (k in a[g]) m[k] || (m[k] = a[g][k]);\n a[g] = m\n }\n };\n a.Pa = function (c, b) {\n var d, f, e, g;\n for (d = 0; 2 > d; d++)\n for (f = 0 < d ? a.va : a.g, e = 0; e < f.length; e++) g = f[e], c[g] = a[g], b || c[g] || (c[\"!\" + g] = 1)\n };\n a.nb = function (a) {\n var b, d, f, e, g, k = 0,\n p, n = \"\",\n q = \"\";\n if (a && 255 < a.length && (b = \"\" + a, d = b.indexOf(\"?\"), 0 < d && (p = b.substring(d + 1), b = b.substring(0, d), e = b.toLowerCase(), f = 0, \"http://\" == e.substring(0,\n 7) ? f += 7 : \"https://\" == e.substring(0, 8) && (f += 8), d = e.indexOf(\"/\", f), 0 < d && (e = e.substring(f, d), g = b.substring(d), b = b.substring(0, d), 0 <= e.indexOf(\"google\") ? k = \",q,ie,start,search_key,word,kw,cd,\" : 0 <= e.indexOf(\"yahoo.co\") && (k = \",p,ei,\"), k && p)))) {\n if ((a = p.split(\"&\")) && 1 < a.length) {\n for (f = 0; f < a.length; f++) e = a[f], d = e.indexOf(\"=\"), 0 < d && 0 <= k.indexOf(\",\" + e.substring(0, d) + \",\") ? n += (n ? \"&\" : \"\") + e : q += (q ? \"&\" : \"\") + e;\n n && q ? p = n + \"&\" + q : q = \"\"\n }\n d = 253 - (p.length - q.length) - b.length;\n a = b + (0 < d ? g.substring(0, d) : \"\") + \"?\" + p\n }\n return a\n };\n a.Va = function (c) {\n var b =\n a.d.visibilityState,\n d = [\"webkitvisibilitychange\", \"visibilitychange\"];\n b || (b = a.d.webkitVisibilityState);\n if (b && \"prerender\" == b) {\n if (c)\n for (b = 0; b < d.length; b++) a.d.addEventListener(d[b], function () {\n var b = a.d.visibilityState;\n b || (b = a.d.webkitVisibilityState);\n \"visible\" == b && c()\n });\n return !1\n }\n return !0\n };\n a.ca = !1;\n a.H = !1;\n a.cb = function () {\n a.H = !0;\n a.j()\n };\n a.aa = !1;\n a.T = !1;\n a.Za = function (c) {\n a.marketingCloudVisitorID = c;\n a.T = !0;\n a.j()\n };\n a.da = !1;\n a.U = !1;\n a.eb = function (c) {\n a.visitorOptedOut = c;\n a.U = !0;\n a.j()\n };\n a.X = !1;\n a.Q = !1;\n a.Ra = function (c) {\n a.analyticsVisitorID =\n c;\n a.Q = !0;\n a.j()\n };\n a.Z = !1;\n a.S = !1;\n a.Ta = function (c) {\n a.audienceManagerLocationHint = c;\n a.S = !0;\n a.j()\n };\n a.Y = !1;\n a.R = !1;\n a.Sa = function (c) {\n a.audienceManagerBlob = c;\n a.R = !0;\n a.j()\n };\n a.Ua = function (c) {\n a.maxDelay || (a.maxDelay = 250);\n return a.p(\"_d\") ? (c && setTimeout(function () {\n c()\n }, a.maxDelay), !1) : !0\n };\n a.ba = !1;\n a.G = !1;\n a.ua = function () {\n a.G = !0;\n a.j()\n };\n a.isReadyToTrack = function () {\n var c = !0,\n b = a.visitor,\n d, f, e;\n a.ca || a.H || (a.Va(a.cb) ? a.H = !0 : a.ca = !0);\n if (a.ca && !a.H) return !1;\n b && b.isAllowed() && (a.aa || a.marketingCloudVisitorID || !b.getMarketingCloudVisitorID ||\n (a.aa = !0, a.marketingCloudVisitorID = b.getMarketingCloudVisitorID([a, a.Za]), a.marketingCloudVisitorID && (a.T = !0)), a.da || a.visitorOptedOut || !b.isOptedOut || (a.da = !0, a.visitorOptedOut = b.isOptedOut([a, a.eb]), a.visitorOptedOut != q && (a.U = !0)), a.X || a.analyticsVisitorID || !b.getAnalyticsVisitorID || (a.X = !0, a.analyticsVisitorID = b.getAnalyticsVisitorID([a, a.Ra]), a.analyticsVisitorID && (a.Q = !0)), a.Z || a.audienceManagerLocationHint || !b.getAudienceManagerLocationHint || (a.Z = !0, a.audienceManagerLocationHint = b.getAudienceManagerLocationHint([a,\n a.Ta\n ]), a.audienceManagerLocationHint && (a.S = !0)), a.Y || a.audienceManagerBlob || !b.getAudienceManagerBlob || (a.Y = !0, a.audienceManagerBlob = b.getAudienceManagerBlob([a, a.Sa]), a.audienceManagerBlob && (a.R = !0)), c = a.aa && !a.T && !a.marketingCloudVisitorID, b = a.X && !a.Q && !a.analyticsVisitorID, d = a.Z && !a.S && !a.audienceManagerLocationHint, f = a.Y && !a.R && !a.audienceManagerBlob, e = a.da && !a.U, c = c || b || d || f || e ? !1 : !0);\n a.ba || a.G || (a.Ua(a.ua) ? a.G = !0 : a.ba = !0);\n a.ba && !a.G && (c = !1);\n return c\n };\n a.o = q;\n a.u = 0;\n a.callbackWhenReadyToTrack = function (c,\n b, d) {\n var f;\n f = {};\n f.ib = c;\n f.hb = b;\n f.fb = d;\n a.o == q && (a.o = []);\n a.o.push(f);\n 0 == a.u && (a.u = setInterval(a.j, 100))\n };\n a.j = function () {\n var c;\n if (a.isReadyToTrack() && (a.bb(), a.o != q))\n for (; 0 < a.o.length;) c = a.o.shift(), c.hb.apply(c.ib, c.fb)\n };\n a.bb = function () {\n a.u && (clearInterval(a.u), a.u = 0)\n };\n a.Xa = function (c) {\n var b, d, f = q,\n e = q;\n if (!a.isReadyToTrack()) {\n b = [];\n if (c != q)\n for (d in f = {}, c) f[d] = c[d];\n e = {};\n a.Pa(e, !0);\n b.push(f);\n b.push(e);\n a.callbackWhenReadyToTrack(a, a.track, b);\n return !0\n }\n return !1\n };\n a.pb = function () {\n var c = a.cookieRead(\"s_fid\"),\n b = \"\",\n d = \"\",\n f;\n f = 8;\n var e = 4;\n if (!c || 0 > c.indexOf(\"-\")) {\n for (c = 0; 16 > c; c++) f = Math.floor(Math.random() * f), b += \"0123456789ABCDEF\".substring(f, f + 1), f = Math.floor(Math.random() * e), d += \"0123456789ABCDEF\".substring(f, f + 1), f = e = 16;\n c = b + \"-\" + d\n }\n a.cookieWrite(\"s_fid\", c, 1) || (c = 0);\n return c\n };\n a.t = a.track = function (c, b) {\n var d, f = new Date,\n e = \"s\" + Math.floor(f.getTime() / 108E5) % 10 + Math.floor(1E13 * Math.random()),\n g = f.getYear(),\n g = \"t=\" + a.escape(f.getDate() + \"/\" + f.getMonth() + \"/\" + (1900 > g ? g + 1900 : g) + \" \" + f.getHours() + \":\" + f.getMinutes() + \":\" + f.getSeconds() +\n \" \" + f.getDay() + \" \" + f.getTimezoneOffset());\n a.visitor && (a.visitor.getAuthState && (a.authState = a.visitor.getAuthState()), !a.supplementalDataID && a.visitor.getSupplementalDataID && (a.supplementalDataID = a.visitor.getSupplementalDataID(\"AppMeasurement:\" + a._in, a.expectSupplementalData ? !1 : !0)));\n a.p(\"_s\");\n a.Xa(c) || (b && a.P(b), c && (d = {}, a.Pa(d, 0), a.P(c)), a.vb() && !a.visitorOptedOut && (a.analyticsVisitorID || a.marketingCloudVisitorID || (a.fid = a.pb()), a.Ab(), a.usePlugins && a.doPlugins && a.doPlugins(a), a.account && (a.abort ||\n (a.trackOffline && !a.timestamp && (a.timestamp = Math.floor(f.getTime() / 1E3)), f = k.location, a.pageURL || (a.pageURL = f.href ? f.href : f), a.referrer || a.Qa || (a.referrer = r.document.referrer), a.Qa = 1, a.referrer = a.nb(a.referrer), a.p(\"_g\")), a.sb() && !a.abort && (a.tb(), g += a.rb(), a.zb(e, g), a.p(\"_t\"), a.referrer = \"\"))), c && a.P(d, 1));\n a.abort = a.supplementalDataID = a.timestamp = a.pageURLRest = a.linkObject = a.clickObject = a.linkURL = a.linkName = a.linkType = k.s_objectID = a.pe = a.pev1 = a.pev2 = a.pev3 = a.e = a.lightProfileID = 0\n };\n a.tl = a.trackLink =\n function (c, b, d, f, e) {\n a.linkObject = c;\n a.linkType = b;\n a.linkName = d;\n e && (a.l = c, a.A = e);\n return a.track(f)\n };\n a.trackLight = function (c, b, d, f) {\n a.lightProfileID = c;\n a.lightStoreForSeconds = b;\n a.lightIncrementBy = d;\n return a.track(f)\n };\n a.clearVars = function () {\n var c, b;\n for (c = 0; c < a.g.length; c++)\n if (b = a.g[c], \"prop\" == b.substring(0, 4) || \"eVar\" == b.substring(0, 4) || \"hier\" == b.substring(0, 4) || \"list\" == b.substring(0, 4) || \"channel\" == b || \"events\" == b || \"eventList\" == b || \"products\" == b || \"productList\" == b || \"purchaseID\" == b || \"transactionID\" == b || \"state\" ==\n b || \"zip\" == b || \"campaign\" == b) a[b] = void 0\n };\n a.tagContainerMarker = \"\";\n a.zb = function (c, b) {\n var d, f = a.trackingServer;\n d = \"\";\n var e = a.dc,\n g = \"sc.\",\n k = a.visitorNamespace;\n f ? a.trackingServerSecure && a.ssl && (f = a.trackingServerSecure) : (k || (k = a.account, f = k.indexOf(\",\"), 0 <= f && (k = k.substring(0, f)), k = k.replace(/[^A-Za-z0-9]/g, \"\")), d || (d = \"2o7.net\"), e = e ? (\"\" + e).toLowerCase() : \"d1\", \"2o7.net\" == d && (\"d1\" == e ? e = \"112\" : \"d2\" == e && (e = \"122\"), g = \"\"), f = k + \".\" + e + \".\" + g + d);\n d = a.ssl ? \"https://\" : \"http://\";\n e = a.AudienceManagement && a.AudienceManagement.isReady() ||\n 0 != a.usePostbacks;\n d += f + \"/b/ss/\" + a.account + \"/\" + (a.mobile ? \"5.\" : \"\") + (e ? \"10\" : \"1\") + \"/JS-\" + a.version + (a.Db ? \"T\" : \"\") + (a.tagContainerMarker ? \"-\" + a.tagContainerMarker : \"\") + \"/\" + c + \"?AQB=1&ndh=1&pf=1&\" + (e ? \"callback=s_c_il[\" + a._in + \"].doPostbacks&et=1&\" : \"\") + b + \"&AQE=1\";\n a.lb(d);\n a.ia()\n };\n a.Oa = /{(%?)(.*?)(%?)}/;\n a.Hb = RegExp(a.Oa.source, \"g\");\n a.mb = function (c) {\n if (\"object\" == typeof c.dests)\n for (var b = 0; b < c.dests.length; ++b)\n if (o = c.dests[b], \"string\" == typeof o.c && \"aa.\" == o.id.substr(0, 3))\n for (var d = o.c.match(a.Hb), b = 0; b < d.length; ++b) {\n match =\n d[b];\n var f = match.match(a.Oa),\n e = \"\";\n \"%\" == f[1] && \"timezone_offset\" == f[2] ? e = (new Date).getTimezoneOffset() : \"%\" == f[1] && \"timestampz\" == f[2] && (e = a.qb());\n o.c = o.c.replace(match, a.escape(e))\n }\n };\n a.qb = function () {\n var c = new Date,\n b = new Date(6E4 * Math.abs(c.getTimezoneOffset()));\n return a.k(4, c.getFullYear()) + \"-\" + a.k(2, c.getMonth() + 1) + \"-\" + a.k(2, c.getDate()) + \"T\" + a.k(2, c.getHours()) + \":\" + a.k(2, c.getMinutes()) + \":\" + a.k(2, c.getSeconds()) + (0 < c.getTimezoneOffset() ? \"-\" : \"+\") + a.k(2, b.getUTCHours()) + \":\" + a.k(2, b.getUTCMinutes())\n };\n a.k = function (a, b) {\n return (Array(a + 1).join(0) + b).slice(-a)\n };\n a.qa = {};\n a.doPostbacks = function (c) {\n if (\"object\" == typeof c)\n if (a.mb(c), \"object\" == typeof a.AudienceManagement && \"function\" == typeof a.AudienceManagement.isReady && a.AudienceManagement.isReady() && \"function\" == typeof a.AudienceManagement.passData) a.AudienceManagement.passData(c);\n else if (\"object\" == typeof c && \"object\" == typeof c.dests)\n for (var b = 0; b < c.dests.length; ++b) dest = c.dests[b], \"object\" == typeof dest && \"string\" == typeof dest.c && \"string\" == typeof dest.id &&\n \"aa.\" == dest.id.substr(0, 3) && (a.qa[dest.id] = new Image, a.qa[dest.id].alt = \"\", a.qa[dest.id].src = dest.c)\n };\n a.lb = function (c) {\n a.i || a.ub();\n a.i.push(c);\n a.ka = a.C();\n a.Ma()\n };\n a.ub = function () {\n a.i = a.wb();\n a.i || (a.i = [])\n };\n a.wb = function () {\n var c, b;\n if (a.pa()) {\n try {\n (b = k.localStorage.getItem(a.na())) && (c = k.JSON.parse(b))\n } catch (d) { }\n return c\n }\n };\n a.pa = function () {\n var c = !0;\n a.trackOffline && a.offlineFilename && k.localStorage && k.JSON || (c = !1);\n return c\n };\n a.Da = function () {\n var c = 0;\n a.i && (c = a.i.length);\n a.q && c++;\n return c\n };\n a.ia = function () {\n if (a.q &&\n (a.B && a.B.complete && a.B.timeout && a.B.ta(), a.q)) return;\n a.Ea = q;\n if (a.oa) a.ka > a.M && a.Ka(a.i), a.ra(500);\n else {\n var c = a.gb();\n if (0 < c) a.ra(c);\n else if (c = a.Aa()) a.q = 1, a.yb(c), a.Cb(c)\n }\n };\n a.ra = function (c) {\n a.Ea || (c || (c = 0), a.Ea = setTimeout(a.ia, c))\n };\n a.gb = function () {\n var c;\n if (!a.trackOffline || 0 >= a.offlineThrottleDelay) return 0;\n c = a.C() - a.Ja;\n return a.offlineThrottleDelay < c ? 0 : a.offlineThrottleDelay - c\n };\n a.Aa = function () {\n if (0 < a.i.length) return a.i.shift()\n };\n a.yb = function (c) {\n if (a.debugTracking) {\n var b = \"AppMeasurement Debug: \" +\n c;\n c = c.split(\"&\");\n var d;\n for (d = 0; d < c.length; d++) b += \"\\n\\t\" + a.unescape(c[d]);\n a.xb(b)\n }\n };\n a.Ya = function () {\n return a.marketingCloudVisitorID || a.analyticsVisitorID\n };\n a.W = !1;\n var s;\n try {\n s = JSON.parse('{\"x\":\"y\"}')\n } catch (x) {\n s = null\n }\n s && \"y\" == s.x ? (a.W = !0, a.V = function (a) {\n return JSON.parse(a)\n }) : k.$ && k.$.parseJSON ? (a.V = function (a) {\n return k.$.parseJSON(a)\n }, a.W = !0) : a.V = function () {\n return null\n };\n a.Cb = function (c) {\n var b, d, f;\n a.Ya() && 2047 < c.length && (\"undefined\" != typeof XMLHttpRequest && (b = new XMLHttpRequest, \"withCredentials\" in b ?\n d = 1 : b = 0), b || \"undefined\" == typeof XDomainRequest || (b = new XDomainRequest, d = 2), b && (a.AudienceManagement && a.AudienceManagement.isReady() || 0 != a.usePostbacks) && (a.W ? b.wa = !0 : b = 0));\n !b && a.Na && (c = c.substring(0, 2047));\n !b && a.d.createElement && (0 != a.usePostbacks || a.AudienceManagement && a.AudienceManagement.isReady()) && (b = a.d.createElement(\"SCRIPT\")) && \"async\" in b && ((f = (f = a.d.getElementsByTagName(\"HEAD\")) && f[0] ? f[0] : a.d.body) ? (b.type = \"text/javascript\", b.setAttribute(\"async\", \"async\"), d = 3) : b = 0);\n b || (b = new Image, b.alt =\n \"\", b.abort || \"undefined\" === typeof k.InstallTrigger || (b.abort = function () {\n b.src = q\n }));\n b.ya = function () {\n try {\n b.timeout && (clearTimeout(b.timeout), b.timeout = 0)\n } catch (a) { }\n };\n b.onload = b.ta = function () {\n b.ya();\n a.kb();\n a.ea();\n a.q = 0;\n a.ia();\n if (b.wa) {\n b.wa = !1;\n try {\n a.doPostbacks(a.V(b.responseText))\n } catch (c) { }\n }\n };\n b.onabort = b.onerror = b.Ba = function () {\n b.ya();\n (a.trackOffline || a.oa) && a.q && a.i.unshift(a.jb);\n a.q = 0;\n a.ka > a.M && a.Ka(a.i);\n a.ea();\n a.ra(500)\n };\n b.onreadystatechange = function () {\n 4 == b.readyState && (200 == b.status ? b.ta() : b.Ba())\n };\n a.Ja = a.C();\n if (1 == d || 2 == d) {\n var e = c.indexOf(\"?\");\n f = c.substring(0, e);\n e = c.substring(e + 1);\n e = e.replace(/&callback=[a-zA-Z0-9_.\\[\\]]+/, \"\");\n 1 == d ? (b.open(\"POST\", f, !0), b.send(e)) : 2 == d && (b.open(\"POST\", f), b.send(e))\n } else if (b.src = c, 3 == d) {\n if (a.Ha) try {\n f.removeChild(a.Ha)\n } catch (g) { }\n f.firstChild ? f.insertBefore(b, f.firstChild) : f.appendChild(b);\n a.Ha = a.B\n }\n b.timeout = setTimeout(function () {\n b.timeout && (b.complete ? b.ta() : (a.trackOffline && b.abort && b.abort(), b.Ba()))\n }, 5E3);\n a.jb = c;\n a.B = k[\"s_i_\" + a.replace(a.account, \",\", \"_\")] =\n b;\n if (a.useForcedLinkTracking && a.I || a.A) a.forcedLinkTrackingTimeout || (a.forcedLinkTrackingTimeout = 250), a.fa = setTimeout(a.ea, a.forcedLinkTrackingTimeout)\n };\n a.kb = function () {\n if (a.pa() && !(a.Ia > a.M)) try {\n k.localStorage.removeItem(a.na()), a.Ia = a.C()\n } catch (c) { }\n };\n a.Ka = function (c) {\n if (a.pa()) {\n a.Ma();\n try {\n k.localStorage.setItem(a.na(), k.JSON.stringify(c)), a.M = a.C()\n } catch (b) { }\n }\n };\n a.Ma = function () {\n if (a.trackOffline) {\n if (!a.offlineLimit || 0 >= a.offlineLimit) a.offlineLimit = 10;\n for (; a.i.length > a.offlineLimit;) a.Aa()\n }\n };\n a.forceOffline =\n function () {\n a.oa = !0\n };\n a.forceOnline = function () {\n a.oa = !1\n };\n a.na = function () {\n return a.offlineFilename + \"-\" + a.visitorNamespace + a.account\n };\n a.C = function () {\n return (new Date).getTime()\n };\n a.Fa = function (a) {\n a = a.toLowerCase();\n return 0 != a.indexOf(\"#\") && 0 != a.indexOf(\"about:\") && 0 != a.indexOf(\"opera:\") && 0 != a.indexOf(\"javascript:\") ? !0 : !1\n };\n a.setTagContainer = function (c) {\n var b, d, f;\n a.Db = c;\n for (b = 0; b < a._il.length; b++)\n if ((d = a._il[b]) && \"s_l\" == d._c && d.tagContainerName == c) {\n a.P(d);\n if (d.lmq)\n for (b = 0; b < d.lmq.length; b++) f = d.lmq[b], a.loadModule(f.n);\n if (d.ml)\n for (f in d.ml)\n if (a[f])\n for (b in c = a[f], f = d.ml[f], f) !Object.prototype[b] && (\"function\" != typeof f[b] || 0 > (\"\" + f[b]).indexOf(\"s_c_il\")) && (c[b] = f[b]);\n if (d.mmq)\n for (b = 0; b < d.mmq.length; b++) f = d.mmq[b], a[f.m] && (c = a[f.m], c[f.f] && \"function\" == typeof c[f.f] && (f.a ? c[f.f].apply(c, f.a) : c[f.f].apply(c)));\n if (d.tq)\n for (b = 0; b < d.tq.length; b++) a.track(d.tq[b]);\n d.s = a;\n break\n }\n };\n a.Util = {\n urlEncode: a.escape,\n urlDecode: a.unescape,\n cookieRead: a.cookieRead,\n cookieWrite: a.cookieWrite,\n getQueryParam: function (c, b, d) {\n var f;\n b || (b = a.pageURL ?\n a.pageURL : k.location);\n d || (d = \"&\");\n return c && b && (b = \"\" + b, f = b.indexOf(\"?\"), 0 <= f && (b = d + b.substring(f + 1) + d, f = b.indexOf(d + c + \"=\"), 0 <= f && (b = b.substring(f + d.length + c.length + 1), f = b.indexOf(d), 0 <= f && (b = b.substring(0, f)), 0 < b.length))) ? a.unescape(b) : \"\"\n }\n };\n a.F = \"supplementalDataID timestamp dynamicVariablePrefix visitorID marketingCloudVisitorID analyticsVisitorID audienceManagerLocationHint authState fid vmk visitorMigrationKey visitorMigrationServer visitorMigrationServerSecure charSet visitorNamespace cookieDomainPeriods fpCookieDomainPeriods cookieLifetime pageName pageURL referrer contextData currencyCode lightProfileID lightStoreForSeconds lightIncrementBy retrieveLightProfiles deleteLightProfiles retrieveLightData\".split(\" \");\n a.g = a.F.concat(\"purchaseID variableProvider channel server pageType transactionID campaign state zip events events2 products audienceManagerBlob tnt\".split(\" \"));\n a.la = \"timestamp charSet visitorNamespace cookieDomainPeriods cookieLifetime contextData lightProfileID lightStoreForSeconds lightIncrementBy\".split(\" \");\n a.N = a.la.slice(0);\n a.va = \"account allAccounts debugTracking visitor visitorOptedOut trackOffline offlineLimit offlineThrottleDelay offlineFilename usePlugins doPlugins configURL visitorSampling visitorSamplingGroup linkObject clickObject linkURL linkName linkType trackDownloadLinks trackExternalLinks trackClickMap trackInlineStats linkLeaveQueryString linkTrackVars linkTrackEvents linkDownloadFileTypes linkExternalFilters linkInternalFilters useForcedLinkTracking forcedLinkTrackingTimeout trackingServer trackingServerSecure ssl abort mobile dc lightTrackVars maxDelay expectSupplementalData usePostbacks AudienceManagement\".split(\" \");\n for (n = 0; 250 >= n; n++) 76 > n && (a.g.push(\"prop\" + n), a.N.push(\"prop\" + n)), a.g.push(\"eVar\" + n), a.N.push(\"eVar\" + n), 6 > n && a.g.push(\"hier\" + n), 4 > n && a.g.push(\"list\" + n);\n n = \"pe pev1 pev2 pev3 latitude longitude resolution colorDepth javascriptVersion javaEnabled cookiesEnabled browserWidth browserHeight connectionType homepage pageURLRest\".split(\" \");\n a.g = a.g.concat(n);\n a.F = a.F.concat(n);\n a.ssl = 0 <= k.location.protocol.toLowerCase().indexOf(\"https\");\n a.charSet = \"UTF-8\";\n a.contextData = {};\n a.offlineThrottleDelay = 0;\n a.offlineFilename =\n \"AppMeasurement.offline\";\n a.Ja = 0;\n a.ka = 0;\n a.M = 0;\n a.Ia = 0;\n a.linkDownloadFileTypes = \"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";\n a.w = k;\n a.d = k.document;\n try {\n if (a.Na = !1, navigator) {\n var y = navigator.userAgent;\n if (\"Microsoft Internet Explorer\" == navigator.appName || 0 <= y.indexOf(\"MSIE \") || 0 <= y.indexOf(\"Trident/\") && 0 <= y.indexOf(\"Windows NT 6\")) a.Na = !0\n }\n } catch (z) { }\n a.ea = function () {\n a.fa && (k.clearTimeout(a.fa), a.fa = q);\n a.l && a.I && a.l.dispatchEvent(a.I);\n a.A && (\"function\" == typeof a.A ? a.A() : a.l && a.l.href && (a.d.location =\n a.l.href));\n a.l = a.I = a.A = 0\n };\n a.La = function () {\n a.b = a.d.body;\n a.b ? (a.v = function (c) {\n var b, d, f, e, g;\n if (!(a.d && a.d.getElementById(\"cppXYctnr\") || c && c[\"s_fe_\" + a._in])) {\n if (a.xa)\n if (a.useForcedLinkTracking) a.b.removeEventListener(\"click\", a.v, !1);\n else {\n a.b.removeEventListener(\"click\", a.v, !0);\n a.xa = a.useForcedLinkTracking = 0;\n return\n }\n else a.useForcedLinkTracking = 0;\n a.clickObject = c.srcElement ? c.srcElement : c.target;\n try {\n if (!a.clickObject || a.L && a.L == a.clickObject || !(a.clickObject.tagName || a.clickObject.parentElement || a.clickObject.parentNode)) a.clickObject =\n 0;\n else {\n var m = a.L = a.clickObject;\n a.ja && (clearTimeout(a.ja), a.ja = 0);\n a.ja = setTimeout(function () {\n a.L == m && (a.L = 0)\n }, 1E4);\n f = a.Da();\n a.track();\n if (f < a.Da() && a.useForcedLinkTracking && c.target) {\n for (e = c.target; e && e != a.b && \"A\" != e.tagName.toUpperCase() && \"AREA\" != e.tagName.toUpperCase() ;) e = e.parentNode;\n if (e && (g = e.href, a.Fa(g) || (g = 0), d = e.target, c.target.dispatchEvent && g && (!d || \"_self\" == d || \"_top\" == d || \"_parent\" == d || k.name && d == k.name))) {\n try {\n b = a.d.createEvent(\"MouseEvents\")\n } catch (n) {\n b = new k.MouseEvent\n }\n if (b) {\n try {\n b.initMouseEvent(\"click\",\n c.bubbles, c.cancelable, c.view, c.detail, c.screenX, c.screenY, c.clientX, c.clientY, c.ctrlKey, c.altKey, c.shiftKey, c.metaKey, c.button, c.relatedTarget)\n } catch (q) {\n b = 0\n }\n b && (b[\"s_fe_\" + a._in] = b.s_fe = 1, c.stopPropagation(), c.stopImmediatePropagation && c.stopImmediatePropagation(), c.preventDefault(), a.l = c.target, a.I = b)\n }\n }\n }\n }\n } catch (r) {\n a.clickObject = 0\n }\n }\n }, a.b && a.b.attachEvent ? a.b.attachEvent(\"onclick\", a.v) : a.b && a.b.addEventListener && (navigator && (0 <= navigator.userAgent.indexOf(\"WebKit\") && a.d.createEvent || 0 <= navigator.userAgent.indexOf(\"Firefox/2\") &&\n k.MouseEvent) && (a.xa = 1, a.useForcedLinkTracking = 1, a.b.addEventListener(\"click\", a.v, !0)), a.b.addEventListener(\"click\", a.v, !1))) : setTimeout(a.La, 30)\n };\n a.La();\n a.loadModule(\"ActivityMap\")\n}", "function calc() { // @ret Object: { processing, redirect, appcache,\n // dns, dom, load, fetch }\n // processing - Number: Processing time\n // redirect - Number: redirect elapsed\n // appcache - Number: Application cache elapsed\n // dns - Number: DomainLookup elapsed\n // dom - Number: DOMContentLoaded event elapsed\n // load - Number: window.load event elapsed\n // fetch - Number: fetchStart to window.load event finished\n // @help: Perf.calc\n // @desc: calc performance data\n\n var tm = (global.performance || 0).timing || 0;\n\n if (!tm) {\n return { processing: 0, redirect: 0, appcache: 0,\n dns: 0, dom: 0, load: 0, fetch: 0 };\n }\n return {\n processing: tm.loadEventStart - tm.responseEnd,\n redirect: tm.redirectEnd - tm.redirectStart,\n appcache: tm.domainLookupStart - tm.fetchStart,\n dns: tm.domainLookupEnd - tm.domainLookupStart,\n dom: tm.domContentLoadedEventEnd - tm.domContentLoadedEventStart,\n load: tm.loadEventEnd - tm.loadEventStart,\n fetch: tm.loadEventEnd - tm.fetchStart\n };\n}", "function isMsie() {\n return navigator.cpuClass && !navigator.product;\n }", "function getTime() {\n return performance.now();\n}", "function browser(){}", "function browser(){}", "function addPerformanceNavigationTiming(props) {\n var transaction = props.transaction, entry = props.entry, event = props.event, timeOrigin = props.timeOrigin, eventEnd = props.eventEnd, description = props.description;\n var end = eventEnd ? entry[eventEnd] : entry[event + \"End\"];\n var start = entry[event + \"Start\"];\n if (!start || !end) {\n return;\n }\n _startChild(transaction, {\n op: 'browser',\n description: (description !== null && description !== void 0 ? description : event),\n startTimestamp: timeOrigin + utils_2.msToSec(start),\n endTimestamp: timeOrigin + utils_2.msToSec(end),\n });\n}", "function prefixBrowser() {\n window.browser = function () {\n return window.msBrowser || window.browser || window.chrome;\n }();\n}", "function getCpuCurrentSpeedSync() {\n\tvar output = \"\";\n\tvar result = \"0.00\";\n\tif (fs.existsSync(\"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq\")) {\n\t\toutput = fs.readFileSync(\"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq\").toString();\n\t} else if (fs.existsSync(\"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\")) {\n\t\toutput = fs.readFileSync(\"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\").toString();\n\t}\n\tif (output.trim()) {\n\t\tvar lines = output.toString().split('\\n');\n\t\tresult = parseFloat((parseInt(lines[0]) / 1000 / 1000).toFixed(2));\n\t}\n\treturn result;\n}", "function getCpuUsage() {\n return cpu.getCpuUsage();\n}", "function isMsie() {\n\t\treturn navigator.cpuClass && !navigator.product;\n\t}", "function sendTiming(){\n try{\n if (performance === undefined) {\n console.log(\"sendTiming: performance NOT supported\");\n return;\n }\n var performanceData = {};\n var entries = []\n performanceData.entries = entries;\n var navStart = performance.timing.navigationStart;\n var resources = performance.getEntriesByType(\"resource\");\n if (resources === undefined || resources.length <= 0) {\n console.log(\"sendTiming: there are NO `resource` performance records\");\n return;\n }\n var b;\n for (b = 0; b < resources.length; b++) {\n var resource = resources[b];\n //if(validateResource(resource)){\n if(true){\n var item = {\n \"name\":resource.name ? resource.name : \"\",\n \"initiatortype\":resource.initiatorType ? resource.initiatorType : \"\",\n \"duration\":resource.duration ? Math.ceil(resource.duration) : 0,\n \"ts\":navStart,\n \"transfersize\":resource.transferSize ? resource.transferSize : 0,\n \"starttime\":resource.startTime ? Math.ceil(resource.startTime) : 0\n }\n performanceData.entries.push(item);\n }else{\n console.log(\"sendTiming: some of the required timing parameter(s) are missing\");\n }\n\n }\n var dictionary = {};\n dictionary.action = \"performanceTiming\";\n dictionary.type = \"string\";\n dictionary.key = \"performanceData\";\n dictionary.value = performanceData;\n if(!window.hasOwnProperty(\"cordova\")){\n sendIntegrationEvent(dictionary);\n }else{\n console.log(\"cordova app detected: performance NOT recorded \");\n }\n } catch (e) {}\n}", "get get_runtime () {\n\n return this._runtime;\n\n }", "function cpuTemperature(callback) {\n\n return new Promise((resolve, reject) => {\n process.nextTick(() => {\n if (_windows) {\n let error = new Error(NOT_SUPPORTED);\n if (callback) { callback(NOT_SUPPORTED) }\n reject(error);\n }\n\n let result = {\n main: -1.0,\n cores: [],\n max: -1.0\n };\n if (_linux) {\n exec(\"sensors\", function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n let regex = /\\+([^°]*)/g;\n let temps = line.match(regex);\n if (line.split(':')[0].toUpperCase().indexOf('PHYSICAL') != -1) {\n result.main = parseFloat(temps);\n }\n if (line.split(':')[0].toUpperCase().indexOf('CORE ') != -1) {\n result.cores.push(parseFloat(temps));\n }\n });\n if (result.cores.length > 0) {\n let maxtmp = Math.max.apply(Math, result.cores);\n result.max = (maxtmp > result.main) ? maxtmp : result.main;\n }\n if (callback) { callback(result) }\n resolve(result);\n } else {\n exec(\"/opt/vc/bin/vcgencmd measure_temp\", function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0 && lines[0].indexOf('=')) {\n result.main = parseFloat(lines[0].split(\"=\")[1]);\n result.max = result.main\n }\n }\n if (callback) { callback(result) }\n resolve(result);\n });\n\n }\n });\n }\n if (_darwin) {\n if (callback) { callback(result) }\n resolve(result);\n }\n });\n });\n}", "function getBrowserZoomLevel(){\n return window.devicePixelRatio;\n\n}", "__init4() {this._performanceObserver = null;}", "function PlatformDetectionService() {\n\n return {\n getPlatformInfo: function() {\n return {\n name: bowser.browser.name,\n version: bowser.browser.version,\n os: navigator.platform\n };\n }\n };\n}", "function amzn_ps_bm_browser() {\n DOCUMENT = document;\n var interfaceMembers = ['getPlatformConfigs','setPlatformConfigs','addLocalPlatformConfig','init']; // these member function that should be implemented across all browsers\n this.getInterfaceMembers = function(){\n return interfaceMembers;\n };\n this.name = 'chrome';\n}", "function changeToLegacyGetStats() {\n currentGetStatsMethod = OPTION_GETSTATS_LEGACY;\n const selectElement = $('statsSelectElement');\n selectElement.value = currentGetStatsMethod;\n requestStats();\n}", "getNativeDevServerPort() {\n var ref;\n const server1 = devServers.find((server)=>server.isTargetingNative()\n );\n var _port;\n return (_port = (ref = server1 == null ? void 0 : server1.getInstance()) == null ? void 0 : ref.location.port) != null ? _port : null;\n }", "function requestAnimationFrame_polyfill(param) {\n return (// requestAnimationFrame polyfill\n (function() {\n var lastTime = 0;\n var vendors = ['ms', 'moz', 'webkit', 'o'];\n for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {\n window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];\n window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']\n || window[vendors[x]+'CancelRequestAnimationFrame'];\n }\n\n if (!window.requestAnimationFrame)\n window.requestAnimationFrame = function(callback, element) {\n var currTime = new Date().getTime();\n var timeToCall = Math.max(0, 16 - (currTime - lastTime));\n var id = window.setTimeout(function() { callback(currTime + timeToCall); },\n timeToCall);\n lastTime = currTime + timeToCall;\n return id;\n };\n\n if (!window.cancelAnimationFrame)\n window.cancelAnimationFrame = function(id) {\n clearTimeout(id);\n };\n }()));\n }", "function KAJAX_browserDetect()\n{\n\tthis.screenHeight = window.screen.availHeight;\n\tthis.screenWidth = window.screen.availWidth;\n\tthis.colorDepth = window.screen.colorDepth;\n\tthis.timeNow = new Date();\n\tthis.referrer = escape(document.referrer);\n\tthis.windows = this.mac = this.linux = \"\";\n\tthis.ie = this.op = this.moz = this.misc = this.browsercode = this.browsername = this.browserversion = this.operatingsys = \"\";\n\tthis.dom = this.ienew = this.ie4 = this.ie5 = this.ie6 = this.moz_rv = this.moz_rv_sub = this.ie5mac = this.ie5xwin = this.opnu = this.op4 = this.op5 = this.op6 = this.op7 = this.saf = this.konq = \"\";\n\tthis.appName = this.appVersion = this.userAgent = \"\";\n\tthis.appName = navigator.appName;\n\tthis.appVersion = navigator.appVersion;\n\tthis.userAgent = navigator.userAgent.toLowerCase();\n\tthis.title = document.title;\n\tthis.DOMBROWSER = \"default\";\n\n\tthis.windows = (this.appVersion.indexOf('Win') != -1);\n\tthis.mac = (this.appVersion.indexOf('Mac') != -1);\n\tthis.linux = (this.appVersion.indexOf('Linux') != -1);\n\n\t// DOM Compatible?\n\tif (!document.layers)\n\t{\n\t\tthis.dom = (document.getElementById ) ? document.getElementById : false;\n\t} else {\n\t\tthis.dom = false;\n\t}\n\n\tif (document.getElementById)\n\t{\n\t\tthis.DOMBROWSER = \"default\";\n\t} else if (document.layers) {\n\t\tthis.DOMBROWSER = \"NS4\";\n\t} else if (document.all) {\n\t\tthis.DOMBROWSER = \"IE4\";\n\t}\n\n\tthis.misc=(this.appVersion.substring(0,1) < 4);\n\tthis.op=(this.userAgent.indexOf('opera') != -1);\n\tthis.moz=(this.userAgent.indexOf('gecko') != -1);\n\tthis.ie=(document.all && !this.op);\n\tthis.saf=((this.userAgent.indexOf('safari') != -1) || (navigator.vendor == \"Apple Computer, Inc.\"));\n\tthis.konq=(this.userAgent.indexOf('konqueror') != -1);\n\n\t// Opera\n\tif (this.op) {\n\t\tthis.op_pos = this.userAgent.indexOf('opera');\n\t\tthis.opnu = this.userAgent.substr((this.op_pos+6),4);\n\t\tthis.op5 = (this.opnu.substring(0,1) == 5);\n\t\tthis.op6 = (this.opnu.substring(0,1) == 6);\n\t\tthis.op7 = (this.opnu.substring(0,1) == 7);\n\n\t// Mozilla\n\t} else if (this.moz){\n\t\tthis.rv_pos = this.userAgent.indexOf('rv');\n\t\tthis.moz_rv = this.userAgent.substr((this.rv_pos+3),3);\n\t\tthis.moz_rv_sub = this.userAgent.substr((this.rv_pos+7),1);\n\t\tif (this.moz_rv_sub == ' ' || isNaN(this.moz_rv_sub)) {\n\t\t\tthis.moz_rv_sub='';\n\t\t}\n\t\tthis.moz_rv = this.moz_rv + this.moz_rv_sub;\n\n\t// IE\n\t} else if (this.ie){\n\t\tthis.ie_pos = this.userAgent.indexOf('msie');\n\t\tthis.ienu = this.userAgent.substr((this.ie_pos+5),3);\n\t\tthis.ie4 = (!this.dom);\n\t\tthis.ie5 = (this.ienu.substring(0,1) == 5);\n\t\tthis.ie6 = (this.ienu.substring(0,1) == 6);\n\t}\n\n\tif (this.konq) {\n\t\tthis.browsercode = \"KO\";\n\t\tthis.browserversion = this.appVersion;\n\t\tthis.browsername = \"Knoqueror\";\n\t} else if (this.saf) {\n\t\tthis.browsercode = \"SF\";\n\t\tthis.browserversion = this.appVersion;\n\t\tthis.browsername = \"Safari\";\n\t} else if (this.op) {\n\t\tthis.browsercode = \"OP\";\n\t\tif (this.op5) {\n\t\t\tthis.browserversion = \"5\";\n\t\t} else if (this.op6) {\n\t\t\tthis.browserversion = \"6\";\n\t\t} else if (this.op7) {\n\t\t\tthis.browserversion = \"7\";\n\t\t} else {\n\t\t\tthis.browserversion = this.appVersion;\n\t\t}\n\t\tthis.browsername = \"Opera\";\n\t} else if (this.moz) {\n\t\tthis.browsercode = \"MO\";\n\t\tthis.browserversion = this.appVersion;\n\t\tthis.browsername = \"Mozilla\";\n\t\tvar result = /.*Firefox\\/([\\d\\.]+).*/.exec(navigator.userAgent);\n\t\tif (result) {\n\t\t\tthis.firefoxVersion = result[1];\n\t\t}\n\t} else if (this.ie) {\n\t\tthis.browsercode = \"IE\";\n\t\tif (this.ie4) {\n\t\t\tthis.browserversion = \"4\";\n\t\t} else if (this.ie5) {\n\t\t\tthis.browserversion = \"5\";\n\t\t} else if (this.ie6) {\n\t\t\tthis.browserversion = \"6\";\n\t\t} else {\n\t\t\tthis.browserversion = this.appVersion;\n\t\t}\n\t\tthis.browsername = \"Internet Explorer\";\n\t}\n\n\tif (this.windows) {\n\t\tthis.operatingsys = \"Windows\";\n\t} else if (this.linux) {\n\t\tthis.operatingsys = \"Linux\";\n\t} else if (this.mac) {\n\t\tthis.operatingsys = \"Mac\";\n\t} else {\n\t\tthis.operatingsys = \"Unkown\";\n\t}\n\n\tif (this.ie)\n\t{\n\t\tthis.innerWidth = this.screenWidth;\n\t\tthis.innerHeight = this.screenHeight;\n\t} else {\n\t\tthis.innerWidth = window.innerWidth;\n\t\tthis.innerHeight = window.innerHeight;\n\t}\n}", "function timestamp() {\n return window.performance && window.performance.now ? window.performance.now() : new Date().getTime();\n}", "function timestamp() {\n return window.performance && window.performance.now ? window.performance.now() : new Date().getTime();\n}", "function getSystemData() {\n return String(browser.execute(() => navigator.appVersion));\n }", "function getCpuFreePromise() {\n return new Promise(function (resolve, reject) {\n var cpuFree = os_utils_1.default.cpuFree(function (v) {\n resolve(v);\n });\n });\n}", "get userAgent() {\n const ua = navigator.userAgent;\n const manifest = browser.runtime.getManifest();\n\n const soup = new Set(['webext']);\n const flavor = {\n major: 0,\n soup: soup,\n is: (value) => soup.has(value),\n };\n\n const dispatch = function() {\n window.dispatchEvent(new CustomEvent('browserInfoLoaded'));\n };\n\n // Whether this is a dev build.\n if (/^\\d+\\.\\d+\\.\\d+\\D/.test(browser.runtime.getManifest().version)) {\n soup.add('devbuild');\n }\n\n if (/\\bMobile\\b/.test(ua)) {\n soup.add('mobile');\n }\n\n // Asynchronous -- more accurate detection for Firefox\n (async () => {\n try {\n const info = await browser.runtime.getBrowserInfo();\n flavor.major = parseInt(info.version, 10) || 0;\n soup.add(info.vendor.toLowerCase());\n soup.add(info.name.toLowerCase());\n } catch (ex) {\n // dummy event for potential listeners\n dispatch();\n }\n })();\n\n // Synchronous -- order of tests is important\n let match;\n if ((match = /\\bFirefox\\/(\\d+)/.exec(ua)) !== null) {\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('mozilla').add('firefox');\n } else if ((match = /\\bEdge\\/(\\d+)/.exec(ua)) !== null) {\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('microsoft').add('edge');\n } else if ((match = /\\bOPR\\/(\\d+)/.exec(ua)) !== null) {\n const reEx = /\\bChrom(?:e|ium)\\/([\\d.]+)/;\n if (reEx.test(ua)) { match = reEx.exec(ua); }\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('opera').add('chromium');\n } else if ((match = /\\bChromium\\/(\\d+)/.exec(ua)) !== null) {\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('chromium');\n } else if ((match = /\\bChrome\\/(\\d+)/.exec(ua)) !== null) {\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('google').add('chromium');\n } else if ((match = /\\bSafari\\/(\\d+)/.exec(ua)) !== null) {\n flavor.major = parseInt(match[1], 10) || 0;\n soup.add('apple').add('safari');\n }\n\n if (manifest.browser_specific_settings && manifest.browser_specific_settings.gecko) {\n soup.add('gecko');\n }\n\n Object.defineProperty(this, 'userAgent', { value: flavor });\n return flavor;\n }", "static getMeasureElement(sourceElement, parentElement = doc.body) {\n const sourceElementStyle = win.getComputedStyle(sourceElement),\n offScreenDiv = parentElement.offScreenDiv = parentElement.offScreenDiv || DH$1.createElement({\n parent: parentElement,\n style: 'position:fixed;top:-10000px;left:-10000px;visibility:hidden;contain:strict',\n className: 'b-measure-element',\n children: [{\n style: 'white-space:nowrap;display:inline-block;will-change:contents;width:auto;contain:none'\n }]\n }, true)[1];\n fontProps.forEach(prop => {\n if (offScreenDiv.style[prop] !== sourceElementStyle[prop]) {\n offScreenDiv.style[prop] = sourceElementStyle[prop];\n }\n });\n offScreenDiv.className = sourceElement.className; // In case the measure element was moved/removed, re-add it\n\n if (offScreenDiv.parentElement.parentElement !== parentElement) {\n parentElement.appendChild(offScreenDiv.parentElement);\n }\n\n return offScreenDiv;\n }", "function getPixelRatio() {\n return window.devicePixelRatio || 1;\n}", "function timestamp () {\n return window.performance && window.performance.now ? window.performance.now() : new Date().getTime()\n}" ]
[ "0.73013914", "0.7155615", "0.6459154", "0.64586353", "0.64429426", "0.6427585", "0.6427123", "0.6411863", "0.63525313", "0.5877083", "0.56639206", "0.53158796", "0.5205851", "0.5202694", "0.51719266", "0.5155014", "0.50735724", "0.5063916", "0.50532377", "0.4981765", "0.49765193", "0.49506503", "0.49435383", "0.49126735", "0.48973358", "0.48873788", "0.487997", "0.48764002", "0.48686895", "0.48425868", "0.48393333", "0.48393333", "0.48393333", "0.47895357", "0.47871986", "0.47848457", "0.47764573", "0.4764373", "0.47477576", "0.47376177", "0.47376177", "0.47376177", "0.47376177", "0.47376177", "0.47376177", "0.47376177", "0.47376177", "0.47376177", "0.47376177", "0.47376177", "0.47376177", "0.4729512", "0.4722756", "0.47106418", "0.46938962", "0.46820766", "0.46706566", "0.46667895", "0.46450847", "0.46450847", "0.46450847", "0.46450847", "0.46450847", "0.46450847", "0.46421137", "0.46398884", "0.46383154", "0.46380284", "0.46348548", "0.46250698", "0.46148226", "0.46018896", "0.4588273", "0.45835614", "0.45793033", "0.45793033", "0.45784697", "0.45717832", "0.45559433", "0.45431936", "0.4542252", "0.45415613", "0.45415494", "0.4538305", "0.45382324", "0.45348245", "0.45322588", "0.45290634", "0.4526447", "0.45261058", "0.4525524", "0.45210987", "0.45090345", "0.45090345", "0.45079562", "0.4507072", "0.45068967", "0.4504767", "0.4499108", "0.4491222" ]
0.74283653
0
Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't implement the API.
function getNodePerformance() { try { var perfHooks = Object(_node__WEBPACK_IMPORTED_MODULE_1__[/* dynamicRequire */ "a"])(module, 'perf_hooks'); return perfHooks.performance; } catch (_) { return undefined; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNodePerformance() {\n try {\n const perfHooks = node.dynamicRequire(module, 'perf_hooks') ;\n return perfHooks.performance;\n } catch (_) {\n return undefined;\n }\n}", "function getNodePerformance() {\n try {\n var perfHooks = node_1.dynamicRequire(module, 'perf_hooks');\n return perfHooks.performance;\n }\n catch (_) {\n return undefined;\n }\n}", "function getNodePerformance() {\r\n try {\r\n var perfHooks = dynamicRequire(module, 'perf_hooks');\r\n return perfHooks.performance;\r\n }\r\n catch (_) {\r\n return undefined;\r\n }\r\n}", "function getNodePerformance() {\n\t try {\n\t const perfHooks = dynamicRequire(module, 'perf_hooks') ;\n\t return perfHooks.performance;\n\t } catch (_) {\n\t return undefined;\n\t }\n\t}", "function getNodePerformance() {\n try {\n const perfHooks = dynamicRequire(module, 'perf_hooks') ;\n return perfHooks.performance;\n } catch (_) {\n return undefined;\n }\n }", "function getBrowserPerformance() {\n var performance = Object(_misc__WEBPACK_IMPORTED_MODULE_0__[/* getGlobalObject */ \"e\"])().performance;\n if (!performance || !performance.now) {\n return undefined;\n }\n // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n //\n // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n // performance.now() gives a date arbitrarily in the past.\n //\n // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n // undefined.\n //\n // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n // interact with data coming out of performance entries.\n //\n // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n // observed skews that can be as long as days, weeks or months.\n //\n // See https://github.com/getsentry/sentry-javascript/issues/2590.\n //\n // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n // transactions of long-lived web pages.\n var timeOrigin = Date.now() - performance.now();\n return {\n now: function () { return performance.now(); },\n timeOrigin: timeOrigin,\n };\n}", "function getBrowserPerformance() {\n var performance = global_1.getGlobalObject().performance;\n if (!performance || !performance.now) {\n return undefined;\n }\n // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n //\n // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n // performance.now() gives a date arbitrarily in the past.\n //\n // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n // undefined.\n //\n // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n // interact with data coming out of performance entries.\n //\n // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n // observed skews that can be as long as days, weeks or months.\n //\n // See https://github.com/getsentry/sentry-javascript/issues/2590.\n //\n // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n // transactions of long-lived web pages.\n var timeOrigin = Date.now() - performance.now();\n return {\n now: function () { return performance.now(); },\n timeOrigin: timeOrigin,\n };\n}", "function getBrowserPerformance() {\r\n var performance = getGlobalObject().performance;\r\n if (!performance || !performance.now) {\r\n return undefined;\r\n }\r\n // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\r\n //\r\n // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\r\n // performance.now() gives a date arbitrarily in the past.\r\n //\r\n // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\r\n // undefined.\r\n //\r\n // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\r\n // interact with data coming out of performance entries.\r\n //\r\n // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\r\n // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\r\n // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\r\n // observed skews that can be as long as days, weeks or months.\r\n //\r\n // See https://github.com/getsentry/sentry-javascript/issues/2590.\r\n //\r\n // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\r\n // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\r\n // transactions of long-lived web pages.\r\n var timeOrigin = Date.now() - performance.now();\r\n return {\r\n now: function () { return performance.now(); },\r\n timeOrigin: timeOrigin,\r\n };\r\n}", "function polyfill () {\n window.performance = window.performance || {};\n window.performance.now = function () {\n return performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function () {\n return new Date().getTime();\n };\n }();\n }", "function v8Profile() {\n if (!enabled) {\n throw new Error('Heap profiler is not enabled.');\n }\n return heap_profiler_bindings_1.getAllocationProfile();\n}", "function Runtime() {}", "function runtime() {\n\t require(\"./runtime\");\n\t}", "function PerformanceReporter() {\n }", "function getLowLevelMetrics() {\n const r = {};\n const perfNav = window.performance.getEntriesByType('navigation');\n if (perfNav.length > 0) {\n r.DC = Math.round(perfNav[0].domComplete);\n r.DI = Math.round(perfNav[0].domInteractive);\n r.DCL = Math.round(perfNav[0].domContentLoadedEventEnd);\n r.L = Math.round(perfNav[0].loadEventEnd);\n }\n const perfRes = window.performance.getEntriesByType('resource');\n if (perfRes.length > 0) {\n r.DBS = 0; // decoded body size\n r.EBS = 0; // encoded body size\n r.TS = 0; // transfer size\n perfRes.forEach((performanceEntry) => {\n if ('decodedBodySize' in performanceEntry) {\n r.DBS += performanceEntry.decodedBodySize;\n }\n if ('encodedBodySize' in performanceEntry) {\n r.EBS += performanceEntry.encodedBodySize;\n }\n if ('transferSize' in performanceEntry) {\n r.TS += performanceEntry.transferSize;\n }\n });\n }\n return r;\n}", "now(): number {\n // TODO investigate process.hrtime; verify it is available in all Node versions.\n // http://stackoverflow.com/questions/11725691/how-to-get-a-microtime-in-node-js\n return Date.now();\n }", "function getCpuFreePromise() {\n return new Promise(function (resolve, reject) {\n var cpuFree = os_utils_1.default.cpuFree(function (v) {\n resolve(v);\n });\n });\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n }\n}", "function getRuntimeInfo() {\n const msRestRuntime = {\n key: \"core-http\",\n value: Constants.coreHttpVersion,\n };\n return [msRestRuntime];\n}", "function getRuntimeInfo() {\n const msRestRuntime = {\n key: \"core-http\",\n value: Constants.coreHttpVersion,\n };\n return [msRestRuntime];\n}", "getNativeDevServerPort() {\n var ref;\n const server1 = devServers.find((server)=>server.isTargetingNative()\n );\n var _port;\n return (_port = (ref = server1 == null ? void 0 : server1.getInstance()) == null ? void 0 : ref.location.port) != null ? _port : null;\n }", "function loadImplementation(){\n\t if(typeof window.Promise === 'undefined'){\n\t throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n\t \" e.g: require('any-promise/register/bluebird')\")\n\t }\n\t return {\n\t Promise: window.Promise,\n\t implementation: 'window.Promise'\n\t }\n\t}", "function getCpuCurrentSpeedSync() {\n\n let cpus = os.cpus();\n let minFreq = 999999999;\n let maxFreq = 0;\n let avgFreq = 0;\n\n if (cpus.length) {\n for (let i in cpus) {\n if (cpus.hasOwnProperty(i)) {\n avgFreq = avgFreq + cpus[i].speed;\n if (cpus[i].speed > maxFreq) maxFreq = cpus[i].speed;\n if (cpus[i].speed < minFreq) minFreq = cpus[i].speed;\n }\n }\n avgFreq = avgFreq / cpus.length;\n return {\n min: parseFloat((minFreq / 1000).toFixed(2)),\n max: parseFloat((maxFreq / 1000).toFixed(2)),\n avg: parseFloat((avgFreq / 1000).toFixed(2))\n }\n } else {\n return {\n min: 0,\n max: 0,\n avg: 0\n }\n }\n}", "function getRuntimeInfo() {\n var msRestRuntime = {\n key: \"core-http\",\n value: Constants.coreHttpVersion\n };\n return [msRestRuntime];\n }", "now() {\n return window.performance.now();\n }", "function getCpuUsage() {\n return cpu.getCpuUsage();\n}", "get get_runtime () {\n\n return this._runtime;\n\n }", "constructor() {\n this.startTime = Date.now();\n this.attributes = {\n \"version\": 0.5, \n \"lang\": \"node.js\",\n \"startTime\": this.startTime\n };\n\n this.inspectedCPU = false;\n this.inspectedMemory = false;\n this.inspectedContainer = false;\n this.inspectedPlatform = false;\n this.inspectedLinux = false;\n }", "function getSpeed() {\n \n var point = agent.search(\"msie\");\n \n if(point === -1) {\n \n return [33.3, 0];\n \n }\n else {\n \n var ver = parseInt(agent.substr(point + 4, point + 5), 10), speed = ver >= 9 ? 16.6 : 33.3;\n \n return [speed, ver];\n \n }\n \n }", "static _now() {\n return window.performance ? window.performance.now() : Date.now();\n }", "statusRuntimeInfo() {\r\n return this.request('GET', 'status/runtimeinfo');\r\n }", "function cpuTemperature(callback) {\n\n return new Promise((resolve, reject) => {\n process.nextTick(() => {\n if (_windows) {\n let error = new Error(NOT_SUPPORTED);\n if (callback) { callback(NOT_SUPPORTED) }\n reject(error);\n }\n\n let result = {\n main: -1.0,\n cores: [],\n max: -1.0\n };\n if (_linux) {\n exec(\"sensors\", function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n lines.forEach(function (line) {\n let regex = /\\+([^°]*)/g;\n let temps = line.match(regex);\n if (line.split(':')[0].toUpperCase().indexOf('PHYSICAL') != -1) {\n result.main = parseFloat(temps);\n }\n if (line.split(':')[0].toUpperCase().indexOf('CORE ') != -1) {\n result.cores.push(parseFloat(temps));\n }\n });\n if (result.cores.length > 0) {\n let maxtmp = Math.max.apply(Math, result.cores);\n result.max = (maxtmp > result.main) ? maxtmp : result.main;\n }\n if (callback) { callback(result) }\n resolve(result);\n } else {\n exec(\"/opt/vc/bin/vcgencmd measure_temp\", function (error, stdout) {\n if (!error) {\n let lines = stdout.toString().split('\\n');\n if (lines.length > 0 && lines[0].indexOf('=')) {\n result.main = parseFloat(lines[0].split(\"=\")[1]);\n result.max = result.main\n }\n }\n if (callback) { callback(result) }\n resolve(result);\n });\n\n }\n });\n }\n if (_darwin) {\n if (callback) { callback(result) }\n resolve(result);\n }\n });\n });\n}", "function PerformanceTestCase() {\n}", "function now() {\r\n return window.performance.now();\r\n}", "function getCpuCurrentSpeedSync() {\n\tvar output = \"\";\n\tvar result = \"0.00\";\n\tif (fs.existsSync(\"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq\")) {\n\t\toutput = fs.readFileSync(\"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq\").toString();\n\t} else if (fs.existsSync(\"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\")) {\n\t\toutput = fs.readFileSync(\"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\").toString();\n\t}\n\tif (output.trim()) {\n\t\tvar lines = output.toString().split('\\n');\n\t\tresult = parseFloat((parseInt(lines[0]) / 1000 / 1000).toFixed(2));\n\t}\n\treturn result;\n}", "run() {\n var method = this[os.platform()];\n if (method) {\n return method.apply(this);\n } else {\n throw new OSNotSupported(os.platform());\n }\n }", "function now() {\n return window.performance ? performance.now() : Date.now();\n}", "getMeterProvider() {\n return (0, global_utils_1.getGlobal)(API_NAME) || NoopMeterProvider_1.NOOP_METER_PROVIDER;\n }", "function Stopwatch() { \n let startTime, endTime, running, duration = 0;\n\n // Object.defineProperty()\n\n Object.defineProperty(this, 'duration', {\n get: function() { return duration; },\n // setter allow prototype method to update its value but has the significant\n // downside of making the duration value unreliable\n set: function(value) { duration = value; }\n });\n\n // expose these private variables so the prototype methods can access them\n // this has the downside of polluting our object's interface\n // this is an example of premature or unnecessary optimization\n Object.defineProperty(this, 'startTime', {\n get: function() { return startTime; }\n });\n Object.defineProperty(this, 'endTime', {\n get: function() { return endTime; }\n });\n Object.defineProperty(this, 'running', {\n get: function() { return running; }\n });\n}", "static get platform() {\n if (!HostPlatform.platformInstance) {\n switch (process.platform) {\n case \"win32\":\n HostPlatform.platformInstance = new WindowsHostPlatform();\n break;\n case \"darwin\":\n HostPlatform.platformInstance = new OSXHostPlatform();\n break;\n case \"linux\":\n HostPlatform.platformInstance = new LinuxHostPlatform();\n break;\n default:\n HostPlatform.platformInstance = new LinuxHostPlatform();\n break;\n }\n }\n return HostPlatform.platformInstance;\n }", "runtimeForProject (project) {\n return this.runtime()\n }", "constructor(options) {\n this._memoryAvailable = false;\n this._cpuAvailable = false;\n this._currentMemory = 0;\n this._currentCpuPercent = 0;\n this._memoryLimit = null;\n this._units = 'B';\n this._changed = new Signal(this);\n this._values = [];\n for (let i = 0; i < N_BUFFER; i++) {\n this._values.push({ memoryPercent: 0, cpuPercent: 0 });\n }\n this._poll = new Poll({\n factory: () => Private.factory(),\n frequency: {\n interval: options.refreshRate,\n backoff: true,\n },\n name: 'jupyterlab-system-monitor:ResourceUsage#metrics',\n });\n this._poll.ticked.connect((poll) => {\n const { payload, phase } = poll.state;\n if (phase === 'resolved') {\n this._updateMetricsValues(payload);\n return;\n }\n if (phase === 'rejected') {\n const oldMemoryAvailable = this._memoryAvailable;\n const oldCpuAvailable = this._cpuAvailable;\n this._memoryAvailable = false;\n this._cpuAvailable = false;\n this._currentMemory = 0;\n this._memoryLimit = null;\n this._units = 'B';\n if (oldMemoryAvailable || oldCpuAvailable) {\n this._changed.emit();\n }\n return;\n }\n });\n }", "function getRuntime(showName) {\n\trequestTVInfo('shows/'+showName+'?extended=full', function (error, response, data) {\n\t\tif (error) {\n\t\t\tconsole.log(error);\n\t\t} else {\n\t\t\treturn JSON.parse(data).runtime;\n\t\t}\n\t});\n}", "static getInstance() {\n if (!this._instance) {\n this._instance = new MetricsAPI();\n }\n return this._instance;\n }", "getPromiseNative() {\n return (\n typeof window.Promise !== \"undefined\" &&\n window.Promise.toString().indexOf(\"[native code]\") !== -1\n );\n }", "cacheNatives() {\n return this.evaluateScriptOnLoad(`window.__nativePromise = Promise;\n window.__nativeError = Error;`);\n }", "systemLib() {\n const getSysLib = this.getGlobalFunc(\"runtime.SystemLib\");\n const mod = getSysLib();\n getSysLib.dispose();\n return mod;\n }", "function fetchWebPerfMetrics() {\n // web-vitals.js doesn't have a way to remove previous listeners, so we'll save whether\n // we've already installed the listeners before installing them again.\n // See https://github.com/GoogleChrome/web-vitals/issues/55.\n if (self._hasInstalledPerfMetrics) return;\n self._hasInstalledPerfMetrics = true;\n\n webVitals.getCLS((metric) => {\n // As CLS values can fire frequently in the case\n // of animations or highly-dynamic content, we\n // debounce the broadcast of the metric.\n latestCLS = metric;\n debouncedCLSBroadcast();\n }, true);\n webVitals.getLCP((metric) => {\n broadcastMetricsUpdates('lcp', metric);\n }, true);\n webVitals.getFID((metric) => {\n broadcastMetricsUpdates('fid', metric);\n }, true);\n }", "function getSyscall() {\n return syscall;\n }", "static get dedicatedServer() {}", "function getCpuLoad() {\n return new Promise((resolve, reject) => {\n const start = cpuAverage();\n setTimeout(() => {\n const end = cpuAverage();\n const idleDiff = end.idle - start.idle;\n const totalDiff = end.total - start.total;\n //calc % load\n const percentageLoad = 100 - Math.floor((100 * idleDiff) / totalDiff);\n resolve(percentageLoad);\n }, 100);\n });\n}", "function ThreadLocalGet() {\r\n}", "function getTime() {\n return performance.now();\n}", "function WKD() {\n this._fetch = typeof window !== 'undefined' ? window.fetch : require('node-fetch');\n}", "function requestLegacyStats() {\n if (Object.keys(peerConnectionDataStore).length > 0) {\n chrome.send('getLegacyStats');\n }\n}", "function get_stats(callback){\n data = {\n \"time\": null,\n \"cpu\": null,\n \"tot_mem\": null,\n \"free_mem\": null\n }\n\n os.cpuUsage(function(cpu){\n cpu = Math.round(cpu * 100);\n\n data = {\n \"time\": curr_time(),\n \"cpu\": cpu,\n \"tot_mem\": os.totalmem(),\n \"free_mem\": os.freemem()\n }\n\n callback(data);\n })\n}", "get Device() {\n return require('./device').default\n }", "function getTime() {\n return performance.now()\n}", "function fallbackToNodeJSCheck(){const cores=_os.default.cpus().filter(function(cpu,index){const hasHyperthreading=cpu.model.includes(`Intel`);const isOdd=index%2===1;return!hasHyperthreading||isOdd;});return cores.length;}", "function System() {\n}", "function Stopwatch() {}", "get resolution() {}", "function Module(stdlib, foreign, heap) {\n \"use asm\";\n var a = new stdlib.Int16Array(heap);\n function f() {\n return a[23 >> -1];\n }\n return { f:f };\n}", "function runtime() {\n\t _dereq_(578);\n\t}", "function usePlatformMethods(_ref) {\n var pointerEvents = _ref.pointerEvents,\n style = _ref.style;\n // Avoid creating a new ref on every render.\n var ref = (0, _useStable.default)(() => hostNode => {\n if (hostNode != null) {\n hostNode.measure = callback => _UIManager.default.measure(hostNode, callback);\n hostNode.measureLayout = (relativeToNode, success, failure) => _UIManager.default.measureLayout(hostNode, relativeToNode, failure, success);\n hostNode.measureInWindow = callback => _UIManager.default.measureInWindow(hostNode, callback);\n }\n });\n return ref;\n}", "function time() {\n\treturn {\n\t\tcurrent : Date.now(),\n\t\tuptime : os.uptime()\n\t};\n}", "get pptr() {\r\n if (this._pptr) {\r\n return this._pptr;\r\n }\r\n // Whoopsie\r\n console.warn(`\n Puppeteer is missing. :-)\n\n Note: puppeteer is a peer dependency of puppeteer-extra,\n which means you can install your own preferred version.\n\n - To get the latest stable version run: 'yarn add puppeteer' or 'npm i puppeteer'\n\n Alternatively:\n - To get puppeteer without the bundled Chromium browser install 'puppeteer-core'\n - To use puppeteer-firefox install 'puppeteer-firefox' and use the 'addExtra' export\n `);\r\n throw this._requireError || new Error('No puppeteer instance provided.');\r\n }", "initCoreModule() {\n if (WebAssembly) {\n // WebAssembly.instantiateStreaming is not currently available in Safari\n if (WebAssembly && !WebAssembly.instantiateStreaming) {\n // polyfill\n WebAssembly.instantiateStreaming = async (resp, importObject) => {\n const source = await (await resp).arrayBuffer();\n return await WebAssembly.instantiate(source, importObject);\n };\n }\n\n const go = new Go();\n WebAssembly.instantiateStreaming(\n fetch(\"productimon.wasm\"),\n go.importObject\n ).then((result) => {\n go.run(result.instance);\n });\n } else {\n log.error(logger, \"WebAssembly is not supported in your browser\");\n }\n }", "get slow() {\n return Common.getSlow(this._.root.current)\n }", "function consolePolyfill () {\n // Use window console (if debug is enabled and the console object exists)\n if (consts.debug && (console || objectPath.has(window, 'console'))) {\n return console || window.console\n\n // Give an object with correct properties but with function that does nothing\n } else {\n return {\n clear: noop,\n count: noop,\n debug: noop,\n error: noop,\n group: noop,\n info: noop,\n log: noop,\n table: noop,\n time: noop,\n timeEnd: noop,\n trace: noop,\n warn: noop\n }\n }\n}", "function measureGetStatsPerformance() {\n let t0 = performance.now();\n peerConnection_().getStats()\n .then(function(report) {\n let t1 = performance.now();\n for (let stats of report.values()) {\n verifyStatsIsAllowlisted_(stats);\n }\n for (let mandatoryType of mandatoryStatsTypes()) {\n let mandatoryTypeExists = false;\n for (let stats of report.values()) {\n if (stats.type == mandatoryType) {\n mandatoryTypeExists = true;\n break;\n }\n }\n if (!mandatoryTypeExists) {\n returnToTest('Missing mandatory type: ' + mandatoryType);\n }\n }\n returnToTest('ok-' + (t1 - t0));\n },\n function(e) {\n throw failTest('Promise was rejected: ' + e);\n });\n}", "function getFreePort() {\n return ports.find((port) => port.usableCache);\n}", "function detectSeriseType(legacyFunc) {\n Scheduler_seriesType = null;\n\n try {\n // Assume there is no async when calling `eachSeriesByType`.\n legacyFunc(ecModelMock, apiMock);\n } catch (e) {}\n\n return Scheduler_seriesType;\n}", "static get supportsRateLimiting() {\n return false;\n }", "function getsp() {\n function helper() {\n // This code currently assumes that whatever precedes topCallFrame in\n // memory is non-zero. This seems to be true on all tested platforms.\n controller[1] = vm_top_call_frame_addr_dbl;\n return memarr[0];\n }\n // DFGByteCodeParser won't inline Math.max with more than 3 arguments\n // https://github.com/WebKit/webkit/blob/e86028b7dfe764ab22b460d150720b00207f9714/\n // Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp#L2244\n // As such, this will force a new CallFrame to be created.\n let sp = Math.max({valueOf: helper}, -1, -2, -3);\n return Int64.fromDouble(sp);\n }", "function getLoad(callback) {\n\tvar result = {};\n\tvar loads = os.loadavg().map(function(x) { return x / _cores; } );\n\tresult.avgload = parseFloat((Math.max.apply(Math, loads)).toFixed(2));\n\tresult.currentload = -1;\n\n\tvar cmd = (_darwin) ? \"ps -caxm -o pcpu\" : \"ps axo pcpu\";\n\texec(cmd, function(error, stdout) {\n\t\tif (!error) {\n\t\t\tvar lines = stdout.toString().replace(/,+/g, \".\").split('\\n');\n\t\t\tlines.shift();\n\t\t\tlines.pop();\n\t\t\tresult.currentload = parseFloat(((lines.reduce(function (pv, cv) {\n\t\t\t\treturn pv + parseFloat(cv.trim());\n\t\t\t}, 0)) / _cores).toFixed(2));\n\t\t}\n\t\tcallback(result)\n\t});\n}", "constructor(name) {\n this._namespace = `${name}-`\n // Length of the namespace prefix (with the '-' postfix)\n const nslen = this._namespace.length\n\n this._names = {}\n const results = (this._results = [])\n this._observer = new PerformanceObserver((list) => {\n list.getEntries().forEach((entry) => {\n const en = entry.name\n // Only include PerformanceEntry objects in\n // the namespace of this PerformanceTimer\n if (en.startsWith(this._namespace)) {\n results.push({\n name: en.slice(nslen),\n duration: entry.duration\n })\n }\n })\n }, false)\n this._observer.observe({entryTypes: ['measure']})\n this._nextOperationId = 1\n }", "getStatistics () {\n return instance.get(base.dev + '/statistics')\n }", "GetVersion() {}", "_getCPUQueue(priorityLevel) {\n return this.runningQueues[priorityLevel];\n }", "function getMemoryUsage( args ) {\n const v8 = require('v8');\n var\n result = {\n statistics: v8.getHeapStatistics(),\n usage: process.memoryUsage()\n };\n\n args.callback( null, result );\n }", "getTracerProvider() {\n return (0, global_utils_1.getGlobal)(API_NAME) || this._proxyTracerProvider;\n }", "async function getSystemMetrics(params, options) {\n\tconst { topology, metricsGroups } = params;\n\tconst { logger } = options;\n\tif (!topology) {\n\t\tthrow new Error('Missing required parameter: topology');\n\t}\n\tif (!metricsGroups) {\n\t\tthrow new Error('Missing required parameter: metricsGroups');\n\t}\n\tvar systemMetrics = await _getTimelineMetrics(\"SystemOverview\", metricTypes.System, topology, metricsGroups, options);\n\treturn systemMetrics;\n}", "function now() {\n\treturn performance.now();\n}", "function sc_currentMicroseconds() {\n return (new Date()).getTime();\n}", "function pollForCPUInfo() {\n chrome.system.cpu.getInfo(function(info) {\n CPU_info = info;\n setTimeout(pollForCPUInfo, POLL_TIME_DELAY);\n });\n}", "constructor() {\n super('page-timing');\n\n let sourceInfo = {};\n let timingInfo = {};\n let timing = performance.timing;\n\n let timingEntries = ['connect', 'domainLookup', 'domContentLoadedEvent',\n 'loadEvent', 'redirect', 'response', 'unloadEvent'];\n\n let locationEntries = ['origin', 'protocol','pathname'];\n\n for (let entry of timingEntries) {\n let start = timing[entry + 'Start'];\n let end = timing[entry + 'End'];\n\n timingInfo[entry] = end - start;\n }\n\n sourceInfo['title'] = window.document.title;\n\n for (let entry of locationEntries) {\n sourceInfo[entry] = window.document.location[entry];\n }\n\n this._data = {\n 'source' : sourceInfo,\n 'timing' : timingInfo\n };\n }", "function getTestRate(r) {\n var decodedQueryString = querystring.decode(r.variables.query_string);\n var speedString = decodedQueryString.speed;\n\n // Determine speed for nginx's limit_rate variable\n var speed;\n switch (speedString) {\n case 'vslow':\n speed = 1000;\n break;\n case 'slow':\n speed = 256000; // 256kBps\n break;\n case 'medium':\n speed = 542000; // 542kBps\n break;\n case 'fast':\n speed = 1627000; // 1627kBps\n break;\n default:\n speed = 0; // disables rate limiting\n break;\n }\n return speed;\n}", "function calc() { // @ret Object: { processing, redirect, appcache,\n // dns, dom, load, fetch }\n // processing - Number: Processing time\n // redirect - Number: redirect elapsed\n // appcache - Number: Application cache elapsed\n // dns - Number: DomainLookup elapsed\n // dom - Number: DOMContentLoaded event elapsed\n // load - Number: window.load event elapsed\n // fetch - Number: fetchStart to window.load event finished\n // @help: Perf.calc\n // @desc: calc performance data\n\n var tm = (global.performance || 0).timing || 0;\n\n if (!tm) {\n return { processing: 0, redirect: 0, appcache: 0,\n dns: 0, dom: 0, load: 0, fetch: 0 };\n }\n return {\n processing: tm.loadEventStart - tm.responseEnd,\n redirect: tm.redirectEnd - tm.redirectStart,\n appcache: tm.domainLookupStart - tm.fetchStart,\n dns: tm.domainLookupEnd - tm.domainLookupStart,\n dom: tm.domContentLoadedEventEnd - tm.domContentLoadedEventStart,\n load: tm.loadEventEnd - tm.loadEventStart,\n fetch: tm.loadEventEnd - tm.fetchStart\n };\n}", "function fetchNodeTime(base) {\n return request_1.default({\n base: base,\n url: '/utils/time'\n });\n}" ]
[ "0.72891647", "0.72782433", "0.7228223", "0.7197571", "0.7179545", "0.6287327", "0.61517394", "0.6042175", "0.56824195", "0.54146206", "0.5385064", "0.5351549", "0.52193046", "0.5199999", "0.5183398", "0.51653475", "0.5127289", "0.5127289", "0.5127289", "0.5127289", "0.5127289", "0.5127289", "0.5127289", "0.5127289", "0.5127289", "0.5127289", "0.5127289", "0.5127289", "0.5111315", "0.5111315", "0.50968057", "0.50524855", "0.5045599", "0.49823335", "0.4960994", "0.4946415", "0.48868", "0.4846724", "0.4833051", "0.47996172", "0.4796174", "0.4769632", "0.4734162", "0.47333983", "0.47191903", "0.46901155", "0.4671494", "0.46686274", "0.46411583", "0.46211785", "0.4613007", "0.46129856", "0.46081173", "0.46069378", "0.4603842", "0.45891818", "0.45866796", "0.4579111", "0.45709118", "0.45698646", "0.4556206", "0.4548995", "0.4525574", "0.45244744", "0.45190704", "0.44998002", "0.44986796", "0.4493118", "0.448953", "0.4484453", "0.44828188", "0.44811434", "0.44736", "0.44721606", "0.44628823", "0.444016", "0.44386685", "0.44112095", "0.4410638", "0.44090307", "0.4406528", "0.4391518", "0.4390752", "0.43887275", "0.4388346", "0.43852848", "0.43850362", "0.43741098", "0.437179", "0.4364553", "0.43546024", "0.43473732", "0.43451303", "0.43450025", "0.43381268", "0.43369326", "0.43364787", "0.433616", "0.43349418", "0.4331588" ]
0.7035801
5
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. FIXME Where to create the simple view coordinate system
function getViewRect(seriesModel, api, aspect) { var option = seriesModel.getBoxLayoutParams(); option.aspect = aspect; return getLayoutRect(option, { width: api.getWidth(), height: api.getHeight() }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function View(projection) {\n 'use strict';\n /**\n * centerUser define the center of the view\n * @type {number[]}\n */\n this.centerUser = [0,0];\n /**\n * zoomMin define the minimal zoom possible of the map\n * @type {number}\n */\n this.zoomMin = 0;\n /**\n * zoomMax define the maximal zoom possible of the map\n * @type {number}\n */\n this.zoomMax = 18;\n /**\n * zoomInit define the initial zoom of the view\n * @type {number}\n */\n this.zoomSelect = 6;\n /**\n * view is the ol.View used in the map\n * @type {null}\n */\n this.view = null;\n\n\t/**\n * limitExtent define the bounding extent of the view\n * @type {number[]}\n */\n\tvar limitExtent ;\n\t\n\t/**\n * resolutions define the resolution array of the view\n * @type {number[]}\n */\n\tthis.resolutions = [];\n\t\n\tthis.setResolutions = function(res) {\n\t\tthis.resolutions = res;\n\t};\n\t\n\tthis.getResolutions = function() {\n\t\tvar resol;\n\t\tif (this.resolutions.length > 0){\n\t\t\tresol = this.resolutions;\n\t\t}\n\t\treturn resol;\n\t};\n\t\n /**\n * View Method\n * setCenter is a setter to define the center of the view\n * @param newCenter is the new coordinates of the center of the view\n */\n this.setCenter = function (newCenter){\n if(newCenter === null){\n this.centerUser = ol.proj.fromLonLat(this.centerUser, projection.getProjection());\n }else{\n this.centerUser = newCenter;\n }\n };\n\n /**\n * View Method\n * getCenter is a getter to access at the center of the view\n * @returns {number[]} the coordinates of the center of the view\n */\n this.getCenter = function (){\n return this.centerUser;\n };\n\n /**\n * View Method\n * getZoomSelect is a getter to access at the zoom of the view\n * @returns {number} the level of zoom\n */\n this.getZoomSelect = function (){\n return this.zoomSelect;\n };\n\n /**\n * View Method\n * setZoomSelect is a setter to define the zoom of the view\n * @param newZoom is the level of zoom\n */\n this.setZoomSelect = function (newZoom){\n this.zoomSelect = parseInt(newZoom);\n };\n\n /**\n * View Method\n * setZoom is a setter to define the maximal and minimal zoom of the view\n * @param min the minimal zoom level\n * @param max the maximal zoom level\n */\n this.setZoom = function (min, max){\n this.zoomMin = parseInt(min);\n this.zoomMax = parseInt(max);\n };\n\n /**\n * View Method\n * getView is a getter to access to the view\n * @returns {ol.View} the view of the map\n */\n this.getView = function (){\n return this.view;\n };\n\n\t\n\t /**\n * View Method\n * getLimitExtent is a getter to access the bounding extent\n\t * @returns {number[]} the extent\n */\n\tthis.getLimitExtent = function (){\n\t\tif ( this.limitExtent === undefined){\n\t\t\treturn projection.getExtent();\n\t\t}\n\t\telse{\n\t\t\treturn this.limitExtent;\n\t\t}\t\t\t\n };\n\n /**\n * View Method\n * setLimitExtent is a setter to define the bounding extent\n * @param extent is the extent\n */\n this.setLimitExtent = function (extent){\n this.limitExtent = extent;\n };\n\t\n /**\n * View Method\n * createView initialize the view with all parameters\n */\n this.createView = function(){\n this.view = new ol.View({\n projection: projection.getProjection().getCode(),\n extent: this.getLimitExtent(),\n center: this.centerUser,\n zoom: this.zoomSelect,\n //minZoom: this.zoomMin,\n //maxZoom: this.zoomMax,\n\t\t\t resolutions: this.getResolutions()\n\n });\n };\n}", "function ViewPort() {\n this.selfCoords = [];\n}", "getViewMatrix() {\n ...\n }", "function View(world, vector) {\n this.world = world;\n this.vector = vector;\n}", "function update_model_view() {\r\n\tlet mv = mult(rotateZ(thetas[2]), mult(rotateY(thetas[1]), rotateX(thetas[0])));\r\n\tmv = mult(translate(position[0], position[1], position[2]), mv);\r\n\tmv = mult(scalem(cur_scale, cur_scale, cur_scale), mv);\r\n\tgl.uniformMatrix4fv(model_view_loc, false, flatten(mv));\r\n}", "setView() {\n this.view = new ol.View({\n projection: this.projection,\n center: ol.extent.getCenter(this.extent),\n zoom: 1,\n maxZoom: 8,\n maxResolution: 1.4\n });\n }", "function ViewManager() {\n \n var SECTION_SIZE = window.MAX_DISTANCE * 1.5;\n \n this.views = {};\n \n var self = this;\n \n /**\n * Convert a vector to the relative coordiantes of a section\n * @author Miguel Celedon\n * @param {String} sectionName The name of the section\n * @param {Object} vector The original vector\n * @returns {THREE.Vector3} A new vector with the positions relative to the section center\n */\n this.translateToSection = function(sectionName, vector) {\n \n // if(window.map.views[sectionName].title !== \"Render\") {\n sectionName = window.map.views[sectionName] || window.map.start;\n var section = sectionName.section || [0, 0];\n var newVector = vector.clone();\n \n if(typeof section !== 'undefined') {\n \n newVector.x = vector.x + section[0] * SECTION_SIZE;\n newVector.y = vector.y + section[1] * SECTION_SIZE;\n }\n \n return newVector;\n // }\n };\n \n /**\n * Creates the structure of the transition functions depending of the view\n * @author Miguel Celedon\n * @lastmodifiedBy Emmanuel Colina\n * @lastmodifiedBy Ricardo Delgado\n * @param {String} view The name of the view to process\n * @returns {Object} An object containing all the possible functions that can be called\n */\n function setTransition(view) {\n \n var transition = 5000;\n var actions = {},\n enter = null, exit = null, reset = null, zoom = null, backButton = null;\n \n if(window.map.views[view].enabled === true) {\n \n switch(view) {\n\n case 'table':\n enter = function() {\n\n window.tableEdit.addButton();\n\n window.tileManager.transform(true, 3000 + transition);\n \n setTimeout(function(){\n window.signLayer.transformSignLayer();\n }, 9500);\n \n //Special: If coming from home, delay the animation\n if(window.actualView === 'home')\n transition = transition + 3000;\n\n window.headers.transformTable(transition);\n\n window.developer.delete();\n };\n \n backButton = function() {\n \n window.changeView();\n \n setTimeout(function(){\n window.signLayer.transformSignLayer();\n }, 2500);\n\n window.developer.delete();\n }; \n \n exit = function() {\n window.tileManager.rollBack();\n\n buttonsManager.removeAllButtons();\n };\n\n reset = function() {\n window.tileManager.rollBack();\n\n window.headers.transformTable(2000);\n\n setTimeout(function(){\n window.signLayer.transformSignLayer();\n }, 3000);\n };\n\n break;\n case 'stack':\n enter = function() {\n\n if(!window.headersUp) {\n headers.showHeaders(transition);\n window.headersUp = true;\n }\n window.headers.transformStack(transition);\n\n window.helper.hideBackButton();\n\n };\n\n exit = function() {\n window.headers.deleteArrows(transition);\n };\n\n break;\n case 'home':\n enter = function() {\n window.logo.stopFade(2000);\n //window.guide.addButton();\n };\n \n exit = function() {\n \n //window.buttonsManager.removeAllButtons();\n\n if(window.guide.active){\n window.guide.removeHelp();\n window.guide.active = false;\n }\n };\n break;\n case 'book':\n case 'readme':\n case 'whitepaper':\n enter = function() {\n setTimeout(function(){\n window.magazine.init(view);\n }, 2000); \n };\n \n reset = function() {\n window.magazine.actionSpecial();\n };\n\n exit = function() {\n window.magazine.remove();\n };\n\n break;\n case 'workflows': \n enter = function() {\n if(!window.headersUp) {\n headers.showHeaders(transition);\n window.headersUp = true;\n }\n window.workFlowManager.getHeaderFLow();\n window.headers.transformWorkFlow(transition);\n window.workFlowEdit.addButton(); \n };\n \n backButton = reset = function() {\n\n window.workFlowManager.showWorkFlow();\n };\n\n exit = function() {\n window.buttonsManager.removeAllButtons();\n window.workFlowManager.deleteAllWorkFlows();\n };\n break;\n case 'network':\n enter = function() {\n window.networkViewer = new NetworkViewer();\n window.networkViewer.load();\n \n };\n \n exit = function() {\n window.networkViewer.unload();\n window.networkViewer = null;\n \n window.camera.disableFreeMode();\n window.camera.freeView = false;\n };\n \n zoom = function() {\n \n window.camera.enableFreeMode();\n window.helper.showBackButton();\n \n if(window.networkViewer)\n window.networkViewer.setCameraTarget();\n };\n \n reset = function() {\n if(window.networkViewer)\n window.networkViewer.reset();\n \n window.helper.hideBackButton();\n window.camera.resetPosition();\n };\n \n backButton = function() {\n \n if(window.networkViewer && window.networkViewer.closeChild() === null) {\n reset();\n }\n };\n \n break;\n case 'developers':\n enter = function(){\n window.developer.getDeveloper();\n\n setTimeout(function(){\n window.developer.animateDeveloper();\n }, 2500); \n };\n \n backButton = reset = function() {\n //setTimeout(function(){\n window.developer.animateDeveloper();\n //}, 2000);\n \n window.changeView();\n };\n\n exit = function() {\n window.developer.delete();\n };\n\n break;\n default:\n break;\n }\n }\n \n actions = {\n enter : enter || function(){},\n exit : exit || function(){},\n reset : reset || function(){},\n zoom : zoom || function(){},\n backButton : backButton || function(){}\n };\n \n return actions;\n }\n \n /**\n * Create a basic skeleton of the views, with exit, enter and reset functions as empty\n * @author Miguel Celedon\n */\n function initViews() {\n \n for(var view in window.map.views) {\n self.views[view] = setTransition(view);\n }\n }\n \n initViews();\n}", "function calculateMatrixAndOffset(_ref) {\n var projectionMode = _ref.projectionMode,\n positionOrigin = _ref.positionOrigin,\n viewport = _ref.viewport;\n var viewMatrixUncentered = viewport.viewMatrixUncentered,\n projectionMatrix = viewport.projectionMatrix;\n var viewMatrix = viewport.viewMatrix,\n viewProjectionMatrix = viewport.viewProjectionMatrix;\n\n var projectionCenter = void 0;\n\n switch (projectionMode) {\n\n case __WEBPACK_IMPORTED_MODULE_4__lib_constants__[\"a\" /* COORDINATE_SYSTEM */].IDENTITY:\n case __WEBPACK_IMPORTED_MODULE_4__lib_constants__[\"a\" /* COORDINATE_SYSTEM */].LNGLAT:\n projectionCenter = ZERO_VECTOR;\n break;\n\n // TODO: make lighitng work for meter offset mode\n case __WEBPACK_IMPORTED_MODULE_4__lib_constants__[\"a\" /* COORDINATE_SYSTEM */].METER_OFFSETS:\n // Calculate transformed projectionCenter (in 64 bit precision)\n // This is the key to offset mode precision (avoids doing this\n // addition in 32 bit precision)\n var positionPixels = viewport.projectFlat(positionOrigin);\n // projectionCenter = new Matrix4(viewProjectionMatrix)\n // .transformVector([positionPixels[0], positionPixels[1], 0.0, 1.0]);\n projectionCenter = __WEBPACK_IMPORTED_MODULE_2_gl_vec4_transformMat4___default()([], [positionPixels[0], positionPixels[1], 0.0, 1.0], viewProjectionMatrix);\n\n // Always apply uncentered projection matrix if available (shader adds center)\n // Zero out 4th coordinate (\"after\" model matrix) - avoids further translations\n // viewMatrix = new Matrix4(viewMatrixUncentered || viewMatrix)\n // .multiplyRight(VECTOR_TO_POINT_MATRIX);\n viewMatrix = __WEBPACK_IMPORTED_MODULE_1_gl_mat4_multiply___default()([], viewMatrixUncentered || viewMatrix, VECTOR_TO_POINT_MATRIX);\n viewProjectionMatrix = __WEBPACK_IMPORTED_MODULE_1_gl_mat4_multiply___default()([], projectionMatrix, viewMatrix);\n break;\n\n default:\n throw new Error('Unknown projection mode');\n }\n\n var viewMatrixInv = __WEBPACK_IMPORTED_MODULE_0_gl_mat4_invert___default()([], viewMatrix) || viewMatrix;\n var cameraPos = [viewMatrixInv[12], viewMatrixInv[13], viewMatrixInv[14]];\n\n return {\n viewMatrix: viewMatrix,\n viewProjectionMatrix: viewProjectionMatrix,\n projectionCenter: projectionCenter,\n cameraPos: cameraPos\n };\n}", "static makeViewMatrix(cameraPos, target, cameraUp){\n // cameraForward\n let f = Vector.sub(cameraPos, target);\n Vector.normalize(f);\n \n // cameraRight\n let r = Vector.cross(cameraUp, f);\n Vector.normalize(r);\n \n // should be unit vector already\n let v = Vector.cross(f, r);\n \n let p = cameraPos;\n \n return Matrix.make(\n [\n [r[0], r[1], r[2], -r[0]*p[0]-r[1]*p[1]-r[2]*p[2] ],\n [v[0], v[1], v[2], -v[0]*p[0]-v[1]*p[1]-v[2]*p[2] ],\n [f[0], f[1], f[2], -f[0]*p[0]-f[1]*p[1]-f[2]*p[2] ],\n [ 0, 0, 0, 1 ]\n ]\n );\n}", "calculateModelView() {\n this.modelViewMatrix = this.camera.getViewTransform();\n }", "get modelViewMatrix() { return this._modelViewMatrix; }", "function CMView() \r\n{\r\n\tthis.TheScene=null;\r\n\t\r\n\tthis.RefX=0; // Left edge of the map\r\n\tthis.RefY=0; // Top of the map\r\n\t\r\n\tthis.ZoomLevel=0; // most zoomed in (typically 1 meter, may be a fraction of a degree)\r\n\t\r\n\tthis.MinScale=1.0; // scale is computed from this (Scale=RefUnits per Pixel (Ref/Pixel))\r\n\t\r\n\tthis.MinZoom=-100000; // a really big negative number\r\n\tthis.MaxZoom=100000; // a really big positive number\r\n\t\r\n\tthis.TheCanvas=null;\r\n\t\r\n\t// Get the drawing context from our <canvas> \r\n\t\r\n\tthis.TheContext=null;\r\n\t\r\n\tthis.CurrentTool=CMView.TOOL_SELECT;\r\n\tthis.Dragging=false;\r\n\tthis.DragRefX=0;\r\n\tthis.DragRefY=0;\r\n\t\r\n\tthis.MaxBounds=null;\r\n\t\r\n\tthis.CollisionChecking=false;\r\n\tthis.CollisionArray=null;\r\n}", "function setModelView() {\n // viewer point, look-at point, up direction.\n e = vec3(0.0, 0.0, 8.0);\n a = vec3(0.0, 0.0, 0.0);\n vup = vec3(0.0, 1.0, 0.0);\n\n calcMAndMinv();\n}", "getViewMatrix() {\nreturn this.viewMat;\n}", "setupView() {\n const self = this;\n const renderer = this.renderer;\n const view = this.renderer.view;\n const container = this.container;\n const deviceScale = this.deviceScale;\n\n view.style.position = 'absolute';\n\n document.body.appendChild(this.renderer.view);\n\n this.windowWidth = window.innerWidth;\n this.windowHeight = window.innerHeight;\n\n container.position.x = renderer.width / 2;\n container.position.y = renderer.height / 2;\n\n container.scale.x = deviceScale;\n container.scale.y = deviceScale;\n\n this.viewCssWidth = 0;\n this.viewCssHeight = 0;\n this.resize(this.windowWidth, this.windowHeight);\n\n\n function resizeRenderer() {\n self.resize(window.innerWidth, window.innerHeight);\n }\n\n window.addEventListener('resize', resizeRenderer);\n window.addEventListener('orientationchange', resizeRenderer);\n }", "get viewMatrix() {\n\t\treturn this._v.matrix;\n\t}", "updateViewMatrix() {\n var matViewUniformLocation = this.gl.getUniformLocation(this.program, 'mView');\n this.gl.uniformMatrix4fv(matViewUniformLocation, this.gl.FALSE, this.viewMatrix);\n }", "function orient_view () {\n if (viewer != null) {\n\t\t var front = new THREE.Vector3(55, -75, 88); // THREE.Vector3 {x: -840.5865265814298, y: -863.2277424197167, z: 442.6790285404255}\n\t\t viewer.navigation.setPosition(front);\n\t\t viewer.fitToView (true) ;\n\t\t viewer.createViewCube();\n\t\t viewer.displayViewCube(true);\n } else{\n\t\t\tconsole.log(\"viewer is null\");\n\t }\n}", "adjustPosition() {\n //this.geometry.applyMatrix( new THREE.Matrix4().makeTranslation( -(this.width / 2), 0, -(this.height / 2)) );\n this.geometry.translate(-(this.width / 2), 0, -(this.height / 2));\n }", "function positionwidget(name,params) {\n var wd = $scope.view.wdg[name];\n var cd = new Vector4().Set3(wd.x,wd.y,wd.z) // set location\n .Transform(params.transform); // and transform it to the pose given by the helper app\n var ef = new Matrix4().RotateFromEuler(wd.rx, wd.ry, wd.rz,true) // set the orientation\n .Multiply(params.transform.m).ToEuler(true); // and transform it to the pose given by the helper app\n var gh = new Vector4().FromEuler(ef); // turn into Euler angles for tml\n tml3dRenderer.setTranslation(name,cd.X(),cd.Y(),cd.Z()); //set position\n tml3dRenderer.setRotation (name,gh.X(),gh.Y(),gh.Z()); //set orientation\n }", "function Maths() {\n\tconst PI = 3.14;\n\t\n\t/**\n\t * Shifts angle into radian. \n\t */\n\tthis.toRadians = function(angle) {\n\t\treturn (angle / 180) * PI;\n\t}\n\t\n\t/**\n\t * Creates perspective transformation (projection) matrix from arguments.\n\t * \n\t * @param nearPlane - Vector4f-type object argument of nearest clipping plane\n\t * @param farPlane - Vector4f-type object argument of farthest clipping plane\n\t * @param FOV - Number-type argument of field of view\n\t * \n\t * @return Matrix4f-type object of projection Matrix\n\t */\n\tthis.createProjectionMatrix = function(nearPlane, farPlane, FOV) {\n\t\tvar projectionMatrix = new __WEBPACK_IMPORTED_MODULE_0__matrix_Matrix4f__[\"a\" /* Matrix4f */]();\n\t\tvar aspectRatio = __WEBPACK_IMPORTED_MODULE_2__index__[\"a\" /* gl */].viewportWidth / __WEBPACK_IMPORTED_MODULE_2__index__[\"a\" /* gl */].viewportHeight;\n\t\tvar yScale = 1 / Math.tan(Math.toRadians(FOV / 2));\n\t\tvar xScale = yScale / aspectRatio;\n\t\tvar frustumLength = farPlane - nearPlane;\n\t\t\n\t\tprojectionMatrix.setIdentity();\n\t\t\n\t\tprojectionMatrix.m[0][0] = xScale;\n\t\tprojectionMatrix.m[1][1] = yScale;\n\t\tprojectionMatrix.m[2][2] = -((farPlane + nearPlane) / frustumLength); \n\t\tprojectionMatrix.m[2][3] = -1;\n\t\tprojectionMatrix.m[3][2] = -((2 * nearPlane * farPlane) / frustumLength);\n\t\tprojectionMatrix.m[3][3] = 0; \n\t\t\n\t\treturn projectionMatrix;\n\t\t\n\t}\n\t\n\t/**\n\t * Creates camera view transformation (view) matrix from camera object.\n\t * \n\t * @param camera - Camera-type object argument\n\t * \n\t * @return Matrix4f-type object of view matrix\n\t */\n\tthis.createViewMatrix = function(camera) {\n\t\tvar viewMatrix = new __WEBPACK_IMPORTED_MODULE_0__matrix_Matrix4f__[\"a\" /* Matrix4f */]();\n\t\tviewMatrix.setIdentity();\n\t\tviewMatrix.rotate(Math.toRadians(camera.getPitch()), new __WEBPACK_IMPORTED_MODULE_1__vector_Vector3f__[\"a\" /* Vector3f */](1, 0, 0));\n\t\tviewMatrix.rotate(Math.toRadians(camera.getYaw()), new __WEBPACK_IMPORTED_MODULE_1__vector_Vector3f__[\"a\" /* Vector3f */](0, 1, 0));\n\t\tviewMatrix.rotate(Math.toRadians(camera.getRoll()), new __WEBPACK_IMPORTED_MODULE_1__vector_Vector3f__[\"a\" /* Vector3f */](0, 0, 1));\n\t\tvar negativeCameraPosition = new __WEBPACK_IMPORTED_MODULE_1__vector_Vector3f__[\"a\" /* Vector3f */](\n\t\t\t\t-camera.getPosition().x, -camera.getPosition().y, -camera.getPosition().z);\n\t\tviewMatrix.translate3f(negativeCameraPosition);\n\t\t\n\t\treturn viewMatrix;\n\t}\n\t\n\t\n}", "setViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}", "update(viewMatrix, projectionMatrix) {\n _math_Matrix44__WEBPACK_IMPORTED_MODULE_0__[\"default\"].multiplyTo(projectionMatrix, viewMatrix, this.__vp);\n this.zNear.x = this.__vp.m20 + this.__vp.m30;\n this.zNear.y = this.__vp.m21 + this.__vp.m31;\n this.zNear.z = this.__vp.m22 + this.__vp.m32;\n this.zNear.w = this.__vp.m23 + this.__vp.m33;\n this.zNear.normalize3();\n this.zFar.x = -this.__vp.m20 + this.__vp.m30;\n this.zFar.y = -this.__vp.m21 + this.__vp.m31;\n this.zFar.z = -this.__vp.m22 + this.__vp.m32;\n this.zFar.w = -this.__vp.m23 + this.__vp.m33;\n this.zFar.normalize3();\n this.bottom.x = this.__vp.m10 + this.__vp.m30;\n this.bottom.y = this.__vp.m11 + this.__vp.m31;\n this.bottom.z = this.__vp.m12 + this.__vp.m32;\n this.bottom.w = this.__vp.m13 + this.__vp.m33;\n this.bottom.normalize3();\n this.top.x = -this.__vp.m10 + this.__vp.m30;\n this.top.y = -this.__vp.m11 + this.__vp.m31;\n this.top.z = -this.__vp.m12 + this.__vp.m32;\n this.top.w = -this.__vp.m13 + this.__vp.m33;\n this.top.normalize3();\n this.left.x = this.__vp.m00 + this.__vp.m30;\n this.left.y = this.__vp.m01 + this.__vp.m31;\n this.left.z = this.__vp.m02 + this.__vp.m32;\n this.left.w = this.__vp.m03 + this.__vp.m33;\n this.left.normalize3();\n this.right.x = -this.__vp.m00 + this.__vp.m30;\n this.right.y = -this.__vp.m01 + this.__vp.m31;\n this.right.z = -this.__vp.m02 + this.__vp.m32;\n this.right.w = -this.__vp.m03 + this.__vp.m33;\n this.right.normalize3();\n }", "function Camera(startPos, wView, hView, ctx) {\n this.direction = {x: 0, y: 0};\n this.x = startPos.x;\n this.y = startPos.y;\n this.width = wView;\n this.height = hView;\n this.scale = 1;\n\n this.toWorld = function(clientX, clientY) {\n return [\n clientX/this.scale - ((wView/this.scale/2) - this.x),\n clientY/this.scale - ((hView/this.scale/2) - this.y)\n ]\n };\n\n this.zoom = function() {\n if (this.scale == 1) {\n this.scale = 0.75;\n } else {\n this.scale = 1;\n }\n };\n\n this.update = function(mod) {\n if (this.direction.x == 1) {\n this.x += 5;\n }\n if (this.direction.x == -1) {\n this.x -= 5;\n }\n if (this.direction.y == 1) {\n this.y += 5;\n }\n if (this.direction.y == -1) {\n this.y -= 5;\n }\n };\n\n this.render = function() {\n // Apply the scale first\n ctx.scale(this.scale, this.scale);\n // Move the scene, in relation to the middle of the viewport ()\n ctx.translate(this.width/this.scale/2 - this.x, (this.height/this.scale/2) - this.y);\n };\n\n this.inside = function(x, y, width, height) {\n // target x + 1/2 width of target should be great than left bound\n // left bound = camera.x (center) - width/2\n // width should be / by scale\n if (x + width/2/this.scale > this.x - ((this.width/this.scale)/2)\n && x - width/2/this.scale < this.x + ((this.width/this.scale)/2)) {\n if (y + height/2/this.scale > this.y - ((this.height/this.scale)/2)\n && y - height/2/this.scale < this.y + ((this.height/this.scale)/2)) {\n return true\n }\n }\n return false\n };\n}", "get viewMatrix() {\n if (!this._viewMatrix) {\n return this.scene.camera.viewMatrix;\n }\n if (this._viewMatrixDirty) {\n math.mulMat4(this.scene.camera.viewMatrix, this._worldMatrix, this._viewMatrix);\n math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);\n math.transposeMat4(this._viewNormalMatrix);\n this._viewMatrixDirty = false;\n }\n return this._viewMatrix;\n }", "function base_set_mapview_origin(gui_x0, gui_y0)\n{\n /* We need to calculate the vector of movement of the mapview. So\n * we find the GUI distance vector and then use this to calculate\n * the original mapview origin relative to the current position. Thus\n * if we move one tile to the left, even if this causes GUI positions\n * to wrap the distance vector is only one tile. */\n var g = normalize_gui_pos(gui_x0, gui_y0);\n gui_x0 = g['gui_x'];\n gui_y0 = g['gui_y'];\n \n mapview['gui_x0'] = gui_x0;\n mapview['gui_y0'] = gui_y0;\n \n}", "_getWorldCoords() {\n const corners = [\n tempCorner1.set(-1, 1, 0), // plane's top left corner\n tempCorner2.set(1, 1, 0), // plane's top right corner\n tempCorner3.set(1, -1, 0), // plane's bottom right corner\n tempCorner4.set(-1, -1, 0), // plane's bottom left corner\n ];\n\n // corners with model view projection matrix applied\n let mvpCorners = [];\n // eventual clipped corners\n let clippedCorners = [];\n\n // we are going to get our plane's four corners relative to our model view projection matrix\n for(let i = 0; i < corners.length; i++) {\n const mvpCorner = corners[i].applyMat4(this._matrices.modelViewProjection.matrix);\n mvpCorners.push(mvpCorner);\n\n // Z position is > 1 or < -1 means the corner is clipped\n if(Math.abs(mvpCorner.z) > 1) {\n clippedCorners.push(i);\n }\n }\n\n // near plane is clipping, get intersections between plane and near plane\n if(clippedCorners.length) {\n mvpCorners = this._getNearPlaneIntersections(corners, mvpCorners, clippedCorners);\n }\n\n // we need to check for the X and Y min and max values\n // use arbitrary integers that will be overriden anyway\n let minX = Infinity;\n let maxX = -Infinity;\n\n let minY = Infinity;\n let maxY = -Infinity;\n\n for(let i = 0; i < mvpCorners.length; i++) {\n const corner = mvpCorners[i];\n\n if(corner.x < minX) {\n minX = corner.x;\n }\n if(corner.x > maxX) {\n maxX = corner.x;\n }\n\n if(corner.y < minY) {\n minY = corner.y;\n }\n if(corner.y > maxY) {\n maxY = corner.y;\n }\n }\n\n return {\n top: maxY,\n right: maxX,\n bottom: minY,\n left: minX,\n };\n }", "setViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\t\tif ( this.view === null ) {\n\n\t\t\t\tthis.view = {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tfullWidth: 1,\n\t\t\t\t\tfullHeight: 1,\n\t\t\t\t\toffsetX: 0,\n\t\t\t\t\toffsetY: 0,\n\t\t\t\t\twidth: 1,\n\t\t\t\t\theight: 1\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\tthis.view.enabled = true;\n\t\t\tthis.view.fullWidth = fullWidth;\n\t\t\tthis.view.fullHeight = fullHeight;\n\t\t\tthis.view.offsetX = x;\n\t\t\tthis.view.offsetY = y;\n\t\t\tthis.view.width = width;\n\t\t\tthis.view.height = height;\n\n\t\t\tthis.updateProjectionMatrix();\n\n\t\t}", "function LView() {}", "function LView() {}", "function LView() {}", "_setWorldPosition() {\n // dimensions and positions of our plane in the document and clip spaces\n // don't forget translations in webgl space are referring to the center of our plane and canvas\n const planeCenter = {\n x: (this._boundingRect.document.width / 2) + this._boundingRect.document.left,\n y: (this._boundingRect.document.height / 2) + this._boundingRect.document.top,\n };\n\n const containerCenter = {\n x: (this.renderer._boundingRect.width / 2) + this.renderer._boundingRect.left,\n y: (this.renderer._boundingRect.height / 2) + this.renderer._boundingRect.top,\n };\n\n this._boundingRect.world.top = ((containerCenter.y - planeCenter.y) / this.renderer._boundingRect.height) * this._boundingRect.world.ratios.height;\n this._boundingRect.world.left = ((planeCenter.x - containerCenter.x) / this.renderer._boundingRect.width) * this._boundingRect.world.ratios.width;\n }", "world2canvas(modelMatrix, viewMatrix, projectionMatrix) {\n // https://webglfundamentals.org/webgl/lessons/webgl-text-html.html\n // We just got through computing a matrix to draw our\n // F in 3D.\n\n // compute a clip space position\n // using the matrix we computed for the F\n const clipspace = vec4.create()\n\n // duplicate in programHelper\n const modelViewMatrix = mat4.create();\n mat4.multiply(modelViewMatrix, viewMatrix, modelMatrix);\n const mvpMatrix = mat4.create();\n mat4.multiply(mvpMatrix, projectionMatrix, modelViewMatrix);\n\n vec4.transformMat4(clipspace, [0.5, 0.5, 0.5, 1], mvpMatrix);\n\n if (clipspace[3] < 0)\n return null\n // divide X and Y by W just like the GPU does.\n clipspace[0] /= clipspace[3];\n clipspace[1] /= clipspace[3];\n\n // convert from clipspace to pixels\n var pixelX = (clipspace[0] * 0.5 + 0.5) * gl.canvas.width;\n var pixelY = (clipspace[1] * -0.5 + 0.5) * gl.canvas.height;\n\n if (pixelX < 0 || pixelX > gl.canvas.width)\n return null\n if (pixelY < 0 || pixelY > gl.canvas.height)\n return null\n\n // position the div\n // div.style.left = Math.floor(pixelX) + \"px\";\n //div.style.top = Math.floor(pixelY) + \"px\";\n //textNode.nodeValue = clock.toFixed(2);\n return { x: Math.floor(pixelX), y: Math.floor(pixelY), z: clipspace[3] }\n }", "function drawScene() {\n\t\n\tvar pMatrix;\n\t\n\tvar mvMatrix = mat4();\n\t\n\t// Clearing the frame-buffer and the depth-buffer\n\t\n\tgl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\t\n\t// Computing the Projection Matrix\n\t\n\tif( projectionType == 0 ) {\n\t\t\n\t\t// For now, the default orthogonal view volume\n\t\t\n\t\tpMatrix = ortho( -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 );\n\t\t\n\t\t// Global transformation !!\n\t\t\n\t\tglobalTz = 0.0;\n\t\t\n\t\t// NEW --- The viewer is on the ZZ axis at an indefinite distance\n\t\t\n\t\tpos_Viewer[0] = pos_Viewer[1] = pos_Viewer[3] = 0.0;\n\t\t\n\t\tpos_Viewer[2] = 1.0; \n\t\t\n\t\t// TO BE DONE !\n\t\t\n\t\t// Allow the user to control the size of the view volume\n\t}\n\telse {\t\n\n\t\t// A standard view volume.\n\t\t\n\t\t// Viewer is at (0,0,0)\n\t\t\n\t\t// Ensure that the model is \"inside\" the view volume\n\t\t\n\t\tpMatrix = perspective( 45, 1, 0.05, 15 );\n\t\t\n\t\t// Global transformation !!\n\t\t\n\t\tglobalTz = -3;\n\n\t\t// NEW --- The viewer is on (0,0,0)\n\t\t\n\t\tpos_Viewer[0] = pos_Viewer[1] = pos_Viewer[2] = 0.0;\n\t\t\n\t\tpos_Viewer[3] = 1.0; \n\t\t\n\t\t// TO BE DONE !\n\t\t\n\t\t// Allow the user to control the size of the view volume\n\t}\n\t\n\t// Passing the Projection Matrix to apply the current projection\n\t\n\tvar pUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n\t\n\tgl.uniformMatrix4fv(pUniform, false, new Float32Array(flatten(pMatrix)));\n\t\n\t// NEW --- Passing the viewer position to the vertex shader\n\t\n\tgl.uniform4fv( gl.getUniformLocation(shaderProgram, \"viewerPosition\"),\n flatten(pos_Viewer) );\n\t\n\t// GLOBAL TRANSFORMATION FOR THE WHOLE SCENE\n\t\n\tmvMatrix = mult(mvMatrix, translationMatrix( 0, 0, globalTz ));\n\tmvMatrix = mult(mvMatrix, rotationXXMatrix(-55));\n\tmvMatrix = mult(mvMatrix, rotationZZMatrix(globalAngleZZ));\n\n\t\n\t// NEW - Updating the position of the light sources, if required\n\t\n\t// FOR EACH LIGHT SOURCE\n\t \n\tfor(var i = 0; i < lightSources.length; i++ )\n\t{\n\t\t// Animating the light source, if defined\n\t\t \n\t\tvar lightSourceMatrix = mat4();\n\n\t\tif( !lightSources[i].isOff() ) {\n\t\t\t\t\n\t\t\t// COMPLETE THE CODE FOR THE OTHER ROTATION AXES\n\n\t\t\tif( lightSources[i].isRotYYOn() ) \n\t\t\t{\n\t\t\t\tlightSourceMatrix = mult( \n\t\t\t\t\t\tlightSourceMatrix, \n\t\t\t\t\t\trotationYYMatrix( lightSources[i].getRotAngleYY() ) );\n\t\t\t}\n\t\t}\n\t\t\n\t\t// NEW Passing the Light Souree Matrix to apply\n\t\n\t\tvar lsmUniform = gl.getUniformLocation(shaderProgram, \"allLights[\"+ String(i) + \"].lightSourceMatrix\");\n\t\n\t\tgl.uniformMatrix4fv(lsmUniform, false, new Float32Array(flatten(lightSourceMatrix)));\n\t}\n\t\t\t\n\t// Instantianting all scene models\n\tfor(var i = 0; i < sceneModels.length; i++ )\n\t{ \n\t\tdrawModel( sceneModels[i],\n\t\t\t mvMatrix,\n\t primitiveType );\n\t}\n\t \n\t// NEW - Counting the frames\n\t\n\tcountFrames();\n}", "function isViewCoordSys(coordSys) {\n return coordSys.type === 'view';\n}", "function panAquSpCen(){\n map.setView(new ol.View({\n center: aquSpMercator,\n zoom: 19\n }));\n}", "function createView(container1,container2, width, height) {\n\n\t\n\t\n\tvar view1 = new JenScript.View({\n\t\tname : container1,\n\t\twidth : width,\n\t\theight : height,\n\t\twest : 60,\n\t\tsouth:60\n\t\t\n\t});\n\n\tvar proj1 = new JenScript.LinearProjection({\n\t\tname : container2,\n\t\tminX : -1000,\n\t\tmaxX : 1000,\n\t\tminY : -1000,\n\t\tmaxY : 1000\n\t});\n\tview1.registerProjection(proj1);\n\t\n\t\n\tvar outline = new JenScript.DeviceOutlinePlugin({color : '#1abc9c'});\n\tproj1.registerPlugin(outline);\n\t\n\tvar legend1 = new JenScript.TitleLegendPlugin({\n\t\tlayout : 'relative',\n\t\tpart : JenScript.ViewPart.Device,\n\t\ttext : 'View 1 Synch.',\n\t\tfontSize : 8,\n\t\ttextColor : 'purple',\n\t\txAlign : 'right',\n\t\tyAlign : 'top',\n\t});\n\tproj1.registerPlugin(legend1);\n\t\n\tvar southMetrics1 = new JenScript.AxisMetricsModeled({\n\t\taxis : JenScript.Axis.AxisSouth,\n\t\tminor:minor,\n\t\tmedian:median,\n\t\tmajor:major\n\t});\n\tproj1.registerPlugin(southMetrics1);\n\n\tvar westMetrics1 = new JenScript.AxisMetricsModeled({\n\t\taxis : JenScript.Axis.AxisWest,\n\t\tminor:minor,\n\t\tmedian:median,\n\t\tmajor:major\n\t});\n\tproj1.registerPlugin(westMetrics1);\n\n\tvar lens1 = new JenScript.ZoomLensPlugin();\n\tproj1.registerPlugin(lens1);\n\n\tvar lx1 = new JenScript.LensX({\n\t\tbuttonStrokeWidth : 2,\n\t\tbuttonDrawColor : '#9b59b6',\n\t\tbuttonRolloverDrawColor:'#e74c3c',\n\t});\n\tlens1.registerWidget(lx1);\n\n\t\n\t\n\tvar view2 = new JenScript.View({\n\t\tname : container2,\n\t\twidth : width,\n\t\theight : height,\n\t\twest : 60,\n\t\tsouth:60\n\t});\n\n\tvar proj2 = new JenScript.LinearProjection({\n\t\tname : \"proj2\",\n\t\tminX : -1000,\n\t\tmaxX : 1000,\n\t\tminY : -1000,\n\t\tmaxY : 1000\n\t});\n\tview2.registerProjection(proj2);\n\t\n\tvar legend2 = new JenScript.TitleLegendPlugin({\n\t\tlayout : 'relative',\n\t\tpart : JenScript.ViewPart.Device,\n\t\ttext : 'View 2 Synch.',\n\t\tfontSize : 8,\n\t\ttextColor : 'purple',\n\t\txAlign : 'right',\n\t\tyAlign : 'top',\n\t});\n\tproj2.registerPlugin(legend2);\n\t\n\tvar outline2 = new JenScript.DeviceOutlinePlugin({color : 'darkslategrey'});\n\tproj2.registerPlugin(outline2);\n\t\n\n\tvar southMetrics2 = new JenScript.AxisMetricsModeled({\n\t\taxis : JenScript.Axis.AxisSouth,\n\t\tminor:minor,\n\t\tmedian:median,\n\t\tmajor:major,\n\t});\n\tproj2.registerPlugin(southMetrics2);\n\n\tvar westMetrics2 = new JenScript.AxisMetricsModeled({\n\t\taxis : JenScript.Axis.AxisWest,\n\t\tminor:minor,\n\t\tmedian:median,\n\t\tmajor:major\n\t});\n\tproj2.registerPlugin(westMetrics2);\n\n\tvar lens2 = new JenScript.ZoomLensPlugin();\n\tproj2.registerPlugin(lens2);\n\n\tvar lx2 = new JenScript.LensX({\n\t\tbuttonStrokeWidth : 2,\n\t\tbuttonDrawColor : '#9b59b6',\n\t\tbuttonRolloverDrawColor:'#e74c3c',\n\t});\n\tlens2.registerWidget(lx2);\n\n\tvar synchronizer = new JenScript.ZoomLensSynchronizer({\n\t\tlenses : [ lens1, lens2 ]\n\t});\n\tlens1.select();\n}", "function viewingInit(gl) {\n // Set up an orthographic projection matrix (parallel lines are always parallel)\n var left = 0;\n var right = gl.canvas.clientWidth;\n var bottom = gl.canvas.clientHeight;\n var top = 0;\n var near = 2000;\n var far = -2000;\n //var projectionMatrix = m4.orthographic(left, right, bottom, top, near, far);\n\n // Set up a perspective projection matrix (parallel lines meet at infinity)\n var fieldOfViewDegrees = 60;\n var fieldOfViewRadians = fieldOfViewDegrees * Math.PI / 180;\n var aspect = gl.canvas.clientWidth / gl.canvas.clientHeight;\n var zNear = 1;\n var zFar = 2000;\n var projectionMatrix = m4.perspective(fieldOfViewRadians, aspect, zNear, zFar);\n \n // Set up the camera matrix\n // Create the cameraMatrix\n var cameraMatrix = m4.identity();\n cameraMatrix = m4.xRotate(cameraMatrix, cameraAngleRadians[0]);\n cameraMatrix = m4.yRotate(cameraMatrix, cameraAngleRadians[1]);\n cameraMatrix = m4.zRotate(cameraMatrix, cameraAngleRadians[2]);\n cameraMatrix = m4.translate(cameraMatrix, xCameraOffset, yCameraOffset, zCameraOffset + camRadius * 1.5);\n\n // Set up for the lookAt miatrix\n // get camera's position from the matrix\n var cameraPosition = [\n cameraMatrix[12],\n cameraMatrix[13],\n cameraMatrix[14],\n ];\n // get the vector for 'up' for computing normals\n var up = [0, 1, 0];\n\n // Pick some place to lookAt\n var target = [0, 250, 0];\n // Compute the camera's matrix to lookAt point\n var lookAtMatrix = m4.lookAt(cameraPosition, target, up);\n\n // Set up the view matrix, 'moves' the camera to the origin\n //var viewMatrix = m4.inverse(cameraMatrix);\n var viewMatrix = m4.inverse(lookAtMatrix);\n\n // view projection matrix\n var viewProjectionMatrix = m4.multiply(projectionMatrix, viewMatrix);\n // Compute the world matrix\n var worldMatrix = m4.identity();\n var worldInverseMatrix = m4.inverse(worldMatrix);\n var worldInverseTransposeMatrix = m4.transpose(worldInverseMatrix);\n // worldViewProjectMatrix\n var worldViewProjectMatrix = m4.multiply(viewProjectionMatrix, worldInverseTransposeMatrix);\n\n // Put it into our main matrix\n //matrix = m4.multiply(matrix, viewProjectionMatrix);\n //matrix = m4.multiply(matrix, worldViewProjectMatrix);\n\n // Set the uniforms in the shaders\n gl.uniformMatrix4fv(programInfo.uniforms.worldViewProjection, false, worldViewProjectMatrix);\n gl.uniformMatrix4fv(programInfo.uniforms.worldInverseTranspose, \n false, \n worldInverseTransposeMatrix);\n gl.uniformMatrix4fv(programInfo.uniforms.world, false, worldMatrix);\n // set the camera/view position\n gl.uniform3fv(programInfo.uniforms.viewWorldPosition, cameraPosition);\n\n //var v = m4.transformPoint(worldMatrix, [20, 30, 50]);\n //gl.uniform3fv(programInfo.uniforms.lightWorldPosition, v);\n\n return worldViewProjectMatrix;\n}", "initViews(){\n this.views = [];\n for(var key in this.graph.views){\n var near = this.graph.views[key].near;\n var far = this.graph.views[key].far;\n var angle = this.graph.views[key].angle;\n var left = this.graph.views[key].left;\n var right = this.graph.views[key].right;\n var top = this.graph.views[key].top;\n var bottom = this.graph.views[key].bottom;\n var from = this.graph.views[key].from;\n var to = this.graph.views[key].to;\n\n if(this.graph.views[key].type == \"perspective\"){\n this.views[key] = new CGFcamera(angle, near, far, vec3.fromValues(from.x, from.y, from.z), vec3.fromValues(to.x, to.y, to.z));\n }\n else{\n this.views[key] = new CGFcameraOrtho(left, right, bottom, top, near, far, vec3.fromValues(from.x, from.y, from.z), vec3.fromValues(to.x, to.y, to.z), vec3.fromValues(0,1,0));\n }\n }\n }", "get modelViewMatrix() {\n\t\treturn SpiderGL.Math.Mat4.dup(this.modelViewMatrix$);\n\t}", "render(renderParameters) {\n const [width, height] = this.view.state.size;\n // The view state must be kept in-sync with the MapView of the ArcGIS API.\n const state = renderParameters.state;\n\n _commons__WEBPACK_IMPORTED_MODULE_0__[\"render\"].call(this, {\n gl: renderParameters.context,\n width,\n height,\n viewState: {\n latitude: this.view.center.latitude,\n longitude: this.view.center.longitude,\n zoom: this.view.featuresTilingScheme.scaleToLevel(state.scale),\n bearing: -state.rotation,\n pitch: 0\n }\n });\n }", "function ViewProperties()\n{\n\tthis.x=0;\n\tthis.y=0;\n\tthis.scale=1;\n\treturn this;\n}", "get viewPort() {\n return this.getProperty(\"viewPort\", () => new Vector4());\n }", "static adjust_point(view, [px, py]) {\n const scale = 2 ** view.scale;\n return [\n (px - view.origin[0]) * scale + view.width / 2,\n (py - view.origin[1]) * scale + view.height / 2,\n ];\n }", "function setUpCamera() {\n \n // set up your projection\n // defualt is orthographic projection\n let projMatrix = glMatrix.mat4.create();\n //glMatrix.mat4.ortho(projMatrix, -5, 5, -5, 5, 1.0, 300.0);\n glMatrix.mat4.perspective(projMatrix, radians(60), 1, 5, 100);\n gl.uniformMatrix4fv (program.uProjT, false, projMatrix);\n\n \n // set up your view\n // defaut is at (0,0,-5) looking at the origin\n let viewMatrix = glMatrix.mat4.create();\n glMatrix.mat4.lookAt(viewMatrix, [0, 3, -11], [0, 0, 0], [0, 1, 0]);\n gl.uniformMatrix4fv (program.uViewT, false, viewMatrix);\n}", "function panbobStand(){\n map.setView(new ol.View({\n center: bobStadMercator,\n zoom: 19\n }));\n}", "getMatrixForWindowCoordsToSVGUserSpaceCoords() {\n const { transformationContainer } = this;\n return transformationContainer.getScreenCTM().inverse();\n }", "get worldSpaceViewerPosition$() {\n\t\treturn (this._c.wp || (this._c.wp = SpiderGL.Math.Vec4.to3(SpiderGL.Math.Mat4.col(this.viewMatrixInverse$, 3))));\n\t}", "function updateModelViewMatrix() {\r\n let mv = glMatrix.mat4.fromRotationTranslationScale(glMatrix.mat4.create(),\r\n glMatrix.quat.fromEuler(glMatrix.quat.create(), ...rotation), position, scale);\r\n gl.uniformMatrix4fv(gl.program.uModelViewMatrix, false, mv);\r\n}", "_calculateViewProps() {\n const root = this._root;\n const {center} = root.boundingVolume;\n // TODO - handle all cases\n if (!center) {\n // eslint-disable-next-line\n console.warn('center was not pre-calculated for the root tile');\n this.cartographicCenter = new math_gl__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\n this.zoom = 16;\n return;\n }\n this.cartographicCenter = _math_gl_geospatial__WEBPACK_IMPORTED_MODULE_1__[\"Ellipsoid\"].WGS84.cartesianToCartographic(center, new math_gl__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]());\n this.zoom = getZoom(root.boundingVolume);\n }", "function renderView() {\n\t\t// request new frame\n requestAnimationFrame(function(){\n renderView();\n });\n\t\trenderer.render(scene, camera);\n\t\t\n\t\tif(rotation_enabled){\n\t\t\trender_model.rotation.x += 0.0015;\n\t\t\trender_model.rotation.y += 0.0015;\n\t\t}\n\t\t//bump_map.needsUpdate = true;\n\t\t//ao_map.needsUpdate = true;\n\t\t\n\t}", "function TView() {}", "function TView() {}", "function TView() {}", "get modelSpaceViewerPosition$() {\n\t\treturn (this._c.mp || (this._c.mp = SpiderGL.Math.Vec4.to3(SpiderGL.Math.Mat4.col(this.modelViewMatrixInverse$, 3))));\n\t}", "function L2DViewMatrix() {\n\t L2DMatrix44.prototype.constructor.call(this);\n\t this.screenLeft = null;\n\t this.screenRight = null;\n\t this.screenTop = null;\n\t this.screenBottom = null;\n\t this.maxLeft = null;\n\t this.maxRight = null;\n\t this.maxTop = null;\n\t this.maxBottom = null;\n\t this.max = Number.MAX_VALUE;\n\t this.min = 0;\n\t}", "get modelSpaceViewerPosition() {\n\t\treturn SpiderGL.Math.Vec3.dup(this.modelSpaceViewerPosition$);\n\t}", "function drawCube(modelMatrix)\n{\n\n // bind the shader\n gl.useProgram(shader);\n\n // get the index for the a_Position attribute defined in the vertex shader\n var positionIndex = gl.getAttribLocation(shader, 'a_Position');\n if (positionIndex < 0) {\n console.log('Failed to get the storage location of a_Position');\n return;\n }\n\n var colorIndex = gl.getAttribLocation(shader, 'a_Color');\n if (colorIndex < 0) {\n\t console.log('Failed to get the storage location of a_');\n\t return;\n\t }\n\n // \"enable\" the a_position attribute\n gl.enableVertexAttribArray(positionIndex);\n gl.enableVertexAttribArray(colorIndex);\n\n // bind buffers for points\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.vertexAttribPointer(positionIndex, 3, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\n gl.vertexAttribPointer(colorIndex, 4, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n // set uniform in shader for projection * view * model transformation\n var transform = new Matrix4().multiply(projection).multiply(view).multiply(modelMatrix);\n var transformLoc = gl.getUniformLocation(shader, \"transform\");\n gl.uniformMatrix4fv(transformLoc, false, transform.elements);\n\n gl.drawArrays(gl.TRIANGLES, 0, 36);\n\n// // draw axes (not transformed by model transformation)\n// gl.bindBuffer(gl.ARRAY_BUFFER, axisBuffer);\n// gl.vertexAttribPointer(positionIndex, 3, gl.FLOAT, false, 0, 0);\n// gl.bindBuffer(gl.ARRAY_BUFFER, axisColorBuffer);\n// gl.vertexAttribPointer(colorIndex, 4, gl.FLOAT, false, 0, 0);\n// gl.bindBuffer(gl.ARRAY_BUFFER, null);\n//\n// // set transformation to projection * view only\n// transform = new Matrix4().multiply(projection).multiply(view);\n// gl.uniformMatrix4fv(transformLoc, false, transform.elements);\n//\n// // draw axes\n// gl.drawArrays(gl.LINES, 0, 6);\n\n // unbind shader and \"disable\" the attribute indices\n // (not really necessary when there is only one shader)\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n gl.disableVertexAttribArray(positionIndex);\n gl.disableVertexAttribArray(colorIndex);\n gl.useProgram(null);\n\n}", "screenToWorldCoordinates(point) {\n var _a, _b, _c, _d;\n let newX = point.x;\n let newY = point.y;\n // transform back to world space\n newX = (newX / this.viewport.width) * this.drawWidth;\n newY = (newY / this.viewport.height) * this.drawHeight;\n // transform based on zoom\n newX = newX - this.halfDrawWidth;\n newY = newY - this.halfDrawHeight;\n // shift by focus\n newX += (_b = (_a = this._camera) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;\n newY += (_d = (_c = this._camera) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0;\n return new Vector(Math.floor(newX), Math.floor(newY));\n }", "function modelToViewPos(x, y, cellSize) {\n return {\n x: (x * cellSize) + (cellSize / 2),\n y: (y * cellSize) + (cellSize / 2),\n };\n}", "function LView(){}", "createLayerView(view) {\r\n if (view.type === '2d') {\r\n return new result.ArcGISDeckLayerView2D({\r\n view,\r\n layer: this\r\n });\r\n } else {\r\n console.error('ArcGISDeckLayer does not support SceneView at the moment.');\r\n return null;\r\n }\r\n }", "function rotateView(m, angle, axis){\n var c = Math.cos(angle);\n var s = Math.sin(angle);\n\n if(axis == 'X'){\n var mv1 = m[1], mv5 = m[5], mv9 = m[9];\n\n m[1] = m[1] * c - m[2] * s;\n m[5] = m[5] * c - m[6] * s;\n m[9] = m[9] * c - m[10] * s;\n\n m[2] = m[2] * c + mv1 * s;\n m[6] = m[6] * c + mv5 * s;\n m[10] = m[10] * c + mv9 * s;\n }\n else if (axis == 'Y'){\n var mv0 = m[0], mv4 = m[4], mv8 = m[8];\n\n m[0] = c * m[0] + s * m[2];\n m[4] = c * m[4] + s * m[6];\n m[8] = c * m[8] + s * m[10];\n\n m[2] = c * m[2] - s * mv0;\n m[6] = c * m[6] - s * mv4;\n m[10] = c * m[10] - s * mv8;\n }\n}", "setPosition(gl, x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n\n let translatedPositions = [];\n gl.bindBuffer(gl.ARRAY_BUFFER, this.buffers.position);\n translatedPositions = this.sourcePositions.slice();\n let i = 0;\n for (i = 0; i < 12 * this.treeLOD; i++) {\n translatedPositions[i * 3] += this.x;\n translatedPositions[i * 3 + 1] += this.y;\n translatedPositions[i * 3 + 2] += this.z;\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(translatedPositions), gl.STATIC_DRAW);\n \n }", "renderView(){\n\n var left = Math.floor( window.innerWidth * this._config.left );\n var bottom = Math.floor( window.innerHeight * this._config.bottom );\n var width = Math.floor( window.innerWidth * this._config.width );\n var height = Math.floor( window.innerHeight * this._config.height );\n\n this._renderer.setViewport( left, bottom, width, height );\n this._renderer.setScissor( left, bottom, width, height );\n this._renderer.setScissorTest( true );\n this._renderer.setClearColor( this._backgroundColor );\n this._camera.aspect = width / height;\n this._camera.updateProjectionMatrix();\n this._renderer.render( this._scene, this._camera );\n }", "centre_view() {\n if (this.quiver.cells.length > 0 && this.quiver.cells[0].size > 0) {\n // We want to centre the view on the diagram, so we take the range of all vertex\n // offsets.\n let min_offset = new Offset(Infinity, Infinity);\n let max_offset = new Offset(-Infinity, -Infinity);\n this.view = Offset.zero();\n\n for (const vertex of this.quiver.cells[0]) {\n const offset = this.centre_offset_from_position(vertex.position);\n const centre = this.cell_centre_at_position(vertex.position);\n min_offset = min_offset.min(offset.sub(centre));\n max_offset = max_offset.max(offset.add(centre));\n }\n\n const panel_offset = new Offset(this.panel.element.offsetWidth, 0).div(2);\n this.pan_view(min_offset.add(max_offset).div(2).add(panel_offset));\n }\n }", "function jglVisualAngleCoordinates() {\n\tlet w = app.view.parentNode.clientWidth,\n\t\th = app.view.parentNode.clientHeight;\n\tconsole.log('Setting 0,0 to: ' + w/2 + ', ' +h/2);\n\tjgl.pixi.container.setTransform(w/2, h/2);\n\tjgl.pixi.usingVisualAngles = true;\n}", "project(coord, transMat) {\n var point = BABYLON.Vector3.TransformCoordinates(coord, transMat);\n // The transformed coordinates will be based on coordinate system\n // starting on the center of the screen. But drawing on screen normally starts\n // from top left. We then need to transform them again to have x:0, y:0 on top left.\n var x = point.x * this.workingWidth + this.workingWidth / 2.0 >> 0; // >>0 二进制右移 相当于取整\n var y = -point.y * this.workingHeight + this.workingHeight / 2.0 >> 0;\n return (new BABYLON.Vector2(x, y));\n }", "project(ax, ay, az, angles){\r\n var x = ax - this.camera_p.x;\r\n var y = ay - this.camera_p.y;\r\n var z = az - this.camera_p.z;\r\n \r\n var dx = angles.cy*(angles.sz*y + angles.cz*x) - angles.sy*z;\r\n var dy = angles.sx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) + angles.cx*(angles.cz*y - angles.sz*x);\r\n var dz = angles.cx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) - angles.sx*(angles.cz*y - angles.sz*x);\r\n return {x: (this.view_p.z*dx)/dz - this.view_p.x, y: (this.view_p.z*dy)/dz - this.view_p.y, dx:dx, dy:dy, dz:dz};\r\n }", "function Example() {\n return (\n <Worldview\n defaultCameraState={{\n ...DEFAULT_CAMERA_STATE,\n distance: 15,\n thetaOffset: (-3 * Math.PI) / 4,\n }}>\n <Axes />\n <Grid />\n <GLTFScene model={duckModel}>\n {{\n pose: {\n position: { x: 0, y: 0, z: 0 },\n orientation: { x: 0, y: 0, z: 0, w: 1 },\n },\n scale: { x: 3, y: 3, z: 3 },\n }}\n </GLTFScene>\n </Worldview>\n );\n}", "function updateView(){\n gl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n loadRotation();\n loadViewMatrix();\n loadProjectionMatrix();\n loadPhongModel();\n var l = points.length;\n gl.uniform1i(textureLoc, material);\n gl.drawArrays( gl.TRIANGLES, 0, l);\n\n updateUIContent();\n}", "viewToLightSpace(viewPos, camera) {\n return viewPos.applyMatrix4(camera.matrixWorldInverse);\n }", "function camera_perspective_view() {\n camera.rotation.x += Math.PI/4;\n camera.position.x = -1;\n camera.position.z = 6;\n camera.position.y = -0.4;\n camera.lookAt(new THREE.Vector3(0,0,0))\n}", "function onFrame() {\n var vector = destination - view.center;\n setViewCenter(view.center + (vector / 15));\n}", "function LView() { }", "function LView() { }", "function initializeMapViews() {\n // Webmap\n app.webmap = new Webmap({\n portalItem: {\n id: app.webmapId\n }\n });\n // 2D - MapView\n app.mapView = new MapView({\n container: app.mapDiv,\n map: app.webmap,\n zoom: app.zoom,\n center: app.lonlat,\n padding: app.padding,\n ui: app.uiPadding,\n popup: new Popup(app.popupOptions),\n visible: true\n });\n // Set active view\n app.activeView = app.mapView;\n // 3D - SceneView\n app.sceneView = new SceneView({\n container: app.sceneDiv,\n map: app.webmap,\n zoom: app.zoom,\n center: app.lonlat,\n padding: app.padding,\n ui: app.uiPadding,\n popup: new Popup(app.popupOptions),\n visible: false\n });\n\n // Listen for view breakpoint changes and update control location\n app.mapView.watch(\"widthBreakpoint\", function(newVal, oldVal) {\n function setPadding(newVal, oldVal) {\n if (!app.panelSettings) {\n return;\n }\n if (newVal === \"small\" && oldVal === \"medium\") {\n app.panelSettings.setPadding(app.panelSettings.activeLayout.viewPaddingSmallScreen, app.panelSettings.activeLayout.uiPadding);\n } else if (newVal === \"medium\" && oldVal === \"small\") {\n app.panelSettings.setPadding(app.panelSettings.activeLayout.viewPadding, app.panelSettings.activeLayout.uiPadding);\n }\n }\n // Set padding for navs that change height\n if (app.panelSettings.activeLayout.viewPaddingSmallScreen) {\n setPadding(newVal, oldVal);\n }\n });\n}", "bindAsView() {\n this.pipeline.bind();\n this.gl.uniformMatrix4fv(\n this.pipeline.uniformLocations['uProjectionMatrix'],\n false,\n this.projectionMatrix\n );\n this.gl.uniformMatrix4fv(\n this.pipeline.uniformLocations['uViewMatrix'],\n false,\n this.viewMatrix\n );\n }", "setViewAndCameraMatrix() {\r\n let gl = glSys.get();\r\n // Step A1: Set up the viewport: area on canvas to be drawn\r\n gl.viewport(this.mViewport[0], // x position of bottom-left corner of the area to be drawn\r\n this.mViewport[1], // y position of bottom-left corner of the area to be drawn\r\n this.mViewport[2], // width of the area to be drawn\r\n this.mViewport[3]); // height of the area to be drawn\r\n // Step A2: set up the corresponding scissor area to limit the clear area\r\n gl.scissor(this.mScissorBound[0], // x position of bottom-left corner of the area to be drawn\r\n this.mScissorBound[1], // y position of bottom-left corner of the area to be drawn\r\n this.mScissorBound[2], // width of the area to be drawn\r\n this.mScissorBound[3]);// height of the area to be drawn\r\n\r\n // Step A3: set the color to be clear\r\n gl.clearColor(this.mBGColor[0], this.mBGColor[1], this.mBGColor[2], this.mBGColor[3]); // set the color to be cleared\r\n // Step A4: enable the scissor area, clear, and then disable the scissor area\r\n gl.enable(gl.SCISSOR_TEST);\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n gl.disable(gl.SCISSOR_TEST);\r\n\r\n // Step B: Compute the Camera Matrix\r\n let center = [];\r\n if (this.mCameraShake !== null) {\r\n center = this.mCameraShake.getCenter();\r\n } else {\r\n center = this.getWCCenter();\r\n }\r\n\r\n // Step B1: following the translation, scale to: (-1, -1) to (1, 1): a 2x2 square at origin\r\n mat4.scale(this.mCameraMatrix, mat4.create(), vec3.fromValues(2.0 / this.getWCWidth(), 2.0 / this.getWCHeight(), 1.0));\r\n\r\n // Step B2: first operation to perform is to translate camera center to the origin\r\n mat4.translate(this.mCameraMatrix, this.mCameraMatrix, vec3.fromValues(-center[0], -center[1], 0));\r\n }", "function vxlViewInteractor(){\r\n this.view = undefined;\r\n\tthis.camera = undefined;\r\n\tthis.UID = vxl.util.generateUID();\r\n\tthis.keymap = {};\r\n\tthis.keysEnabled = true; //keys enabled by default\r\n}", "function panAqua(){\n map.setView(new ol.View({\n center: aquSpMercator,\n zoom: 19\n }));\n}", "function projectPoint(modelViewMatrix, projMatrix, viewport, src, dest) {\n\tif (!dest)\n\t\tdest = new Float32Array(3);\n\n\t_v0[0] = src[0]; _v0[1] = src[1]; _v0[2] = src[2]; _v0[3] = 1;\n\n\t// transform point from model space to clip space\n\ttransformVector4(modelViewMatrix, _v0, _v1);\n\ttransformVector4(projMatrix, _v1, _v0);\n\n\t/* to normalized device coordinates */\n\t_v0[0] /= _v0[3];\n\t_v0[1] /= _v0[3];\n\t_v0[2] /= _v0[3];\n\n\t/* to window coordinates */\n\tdest[0] = viewport[0] + 0.5 * (1 + _v0[0]) * viewport[2];\n\tdest[1] = -viewport[1] + 0.5 * (1 - _v0[1]) * viewport[3];\n\tdest[2] = 0.5 * (1 + _v0[2]);\n\n\treturn dest;\n}", "function TView() { }", "function TView() { }", "get modelViewMatrix$() {\n\t\treturn (this._mv.m || (this._mv.m = SpiderGL.Math.Mat4.mul(this.viewMatrix$, this.modelMatrix$)));\n\t}", "setup(context) {\n\n var self = this;\n\n var externalRenderers = this.esriLoaderContext.externalRenderers;\n var SpatialReference = this.esriLoaderContext.SpatialReference;\n\n var view = context.view; //this.esriLoaderContext.view;\n\n function setPosition(worldPosition, object3d)\n {\n let pos = [0, 0, 0];\n\n externalRenderers.toRenderCoordinates(\n view,\n worldPosition,\n 0,\n SpatialReference.WGS84,\n pos,\n 0,\n 1\n );\n object3d.position.set(pos[0], pos[1], pos[2]);\n\n let transform = new THREE.Matrix4();\n let arr = externalRenderers.renderCoordinateTransformAt(\n view,\n worldPosition,\n SpatialReference.WGS84,\n new Array(16)\n );\n transform.fromArray(arr);\n transform.decompose(object3d.position, object3d.quaternion, object3d.scale);\n\n const m2 = new THREE.Matrix4();\n m2.makeRotationX(THREE.Math.degToRad(90));\n transform.multiply(m2);\n object3d.setRotationFromMatrix(transform);\n }\n\n // initialize the three.js renderer\n //////////////////////////////////////////////////////////////////////////////////////\n this.renderer = new THREE.WebGLRenderer({\n context: context.gl,\n //premultipliedAlpha: true,\n //alpha : true\n });\n this.renderer.setPixelRatio(window.devicePixelRatio);\n this.renderer.setSize(context.camera.fullWidth, context.camera.fullHeight);\n\n // prevent three.js from clearing the buffers provided by the ArcGIS JS API.\n this.renderer.autoClear = false;\n this.renderer.autoClearDepth = false;\n this.renderer.autoClearStencil = false;\n this.renderer.autoClearColor = false;\n\n this.renderer.localClippingEnabled = true; // need fo clipping plane usage\n\n // The ArcGIS JS API renders to custom offscreen buffers, and not to the default framebuffers.\n // We have to inject this bit of code into the three.js runtime in order for it to bind those\n // buffers instead of the default ones.\n\n var originalSetRenderTarget = this.renderer.setRenderTarget.bind(this.renderer);\n\n this.renderer.setRenderTarget = function(target) {\n originalSetRenderTarget(target);\n if (target == null) {\n context.bindRenderTarget();\n }\n };\n\n ///////////////////////////////////////////////////////////////////////////////////////\n\n this.scene = new THREE.Scene();\n\n // setup the camera\n var cam = context.camera;\n this.camera = new THREE.PerspectiveCamera(cam.fovY, cam.aspect, cam.near, cam.far);\n this.camera.position.set(cam.eye[0], cam.eye[1], cam.eye[2]);\n this.camera.up.set(cam.up[0], cam.up[1], cam.up[2]);\n this.camera.lookAt(new THREE.Vector3(cam.center[0], cam.center[1], cam.center[2]));\n // Projection matrix can be copied directly\n this.camera.projectionMatrix.fromArray(cam.projectionMatrix);\n\n // set positions ----------------\n\n //lat longs\n const curve_path = [];\n\n this.geo_curve_path.forEach(x => {\n let pos = [0, 0, 0];\n externalRenderers.toRenderCoordinates(view, x, 0, SpatialReference.WGS84, pos, 0, 1);\n curve_path.push(new THREE.Vector3(pos[0], pos[1], pos[2])); // we make all coords in global world coord sys !\n });\n\n let curve = new THREE.CatmullRomCurve3(curve_path);\n\n this.images3dContainer = new Image3DContainer(curve);\n\n let imgs = this.images.map(config => new ImageFrame(config));\n\n for (let i = 0; i < imgs.length; i++) \n {\n this.images3dContainer.add(imgs[i]);\n }\n\n for (let i = 0; i < this.images3dContainer.children.length; i++) \n {\n let image3d = this.images3dContainer.children[i];\n\n setPosition(image3d.config.position, image3d);\n }\n\n // create curve\n //var tubeGeometry = new THREE.TubeBufferGeometry(curve, 50, 200, 28, false);\n //var material = new THREE.MeshNormalMaterial({\n // side: THREE.FrontSide,\n // transparent: true,\n // opacity: 0.3,\n //});\n //this.route = new THREE.Mesh(tubeGeometry, material);\n\n if (true)\n {\n\n this.images3DContainerCarousel = new Image3DContainerCarousel();\n\n setPosition(\n [\n 121.6210941952765,\n 25.06134876641631,\n 600.7899992370605\n ], this.images3DContainerCarousel);\n\n let imgs = this.images.map(config => new ImageFrame(config));\n\n for (let i = 0; i < imgs.length; i++) \n {\n this.images3DContainerCarousel.add(imgs[i]);\n }\n\n }\n //\n\n this.start();\n\n // cleanup after ourselfs\n context.resetWebGLState();\n }", "function base_canvas_to_map_pos(canvas_x, canvas_y)\n{\n return gui_to_map_pos(canvas_x + mapview.gui_x0,\n canvas_y + mapview.gui_y0);\t\t \n}", "function View() {}", "function View() {}", "function View() {}", "function View() {}", "function setGeometry(gl) {\n var positions = new Float32Array([\n // left column front\n 0, 0, 0,\n 0, 150, 0,\n 30, 0, 0,\n 0, 150, 0,\n 30, 150, 0,\n 30, 0, 0,\n\n // top rung front\n 30, 0, 0,\n 30, 30, 0,\n 100, 0, 0,\n 30, 30, 0,\n 100, 30, 0,\n 100, 0, 0,\n\n // middle rung front\n 30, 60, 0,\n 30, 90, 0,\n 67, 60, 0,\n 30, 90, 0,\n 67, 90, 0,\n 67, 60, 0,\n\n // left column back\n 0, 0, 30,\n 30, 0, 30,\n 0, 150, 30,\n 0, 150, 30,\n 30, 0, 30,\n 30, 150, 30,\n\n // top rung back\n 30, 0, 30,\n 100, 0, 30,\n 30, 30, 30,\n 30, 30, 30,\n 100, 0, 30,\n 100, 30, 30,\n\n // middle rung back\n 30, 60, 30,\n 67, 60, 30,\n 30, 90, 30,\n 30, 90, 30,\n 67, 60, 30,\n 67, 90, 30,\n\n // top\n 0, 0, 0,\n 100, 0, 0,\n 100, 0, 30,\n 0, 0, 0,\n 100, 0, 30,\n 0, 0, 30,\n\n // top rung right\n 100, 0, 0,\n 100, 30, 0,\n 100, 30, 30,\n 100, 0, 0,\n 100, 30, 30,\n 100, 0, 30,\n\n // under top rung\n 30, 30, 0,\n 30, 30, 30,\n 100, 30, 30,\n 30, 30, 0,\n 100, 30, 30,\n 100, 30, 0,\n\n // between top rung and middle\n 30, 30, 0,\n 30, 60, 30,\n 30, 30, 30,\n 30, 30, 0,\n 30, 60, 0,\n 30, 60, 30,\n\n // top of middle rung\n 30, 60, 0,\n 67, 60, 30,\n 30, 60, 30,\n 30, 60, 0,\n 67, 60, 0,\n 67, 60, 30,\n\n // right of middle rung\n 67, 60, 0,\n 67, 90, 30,\n 67, 60, 30,\n 67, 60, 0,\n 67, 90, 0,\n 67, 90, 30,\n\n // bottom of middle rung.\n 30, 90, 0,\n 30, 90, 30,\n 67, 90, 30,\n 30, 90, 0,\n 67, 90, 30,\n 67, 90, 0,\n\n // right of bottom\n 30, 90, 0,\n 30, 150, 30,\n 30, 90, 30,\n 30, 90, 0,\n 30, 150, 0,\n 30, 150, 30,\n\n // bottom\n 0, 150, 0,\n 0, 150, 30,\n 30, 150, 30,\n 0, 150, 0,\n 30, 150, 30,\n 30, 150, 0,\n\n // left side\n 0, 0, 0,\n 0, 0, 30,\n 0, 150, 30,\n 0, 0, 0,\n 0, 150, 30,\n 0, 150, 0]);\n\n // Center the F around the origin and Flip it around. We do this because\n // we're in 3D now with and +Y is up where as before when we started with 2D\n // we had +Y as down.\n\n // We could do by changing all the values above but I'm lazy.\n // We could also do it with a matrix at draw time but you should\n // never do stuff at draw time if you can do it at init time.\n var matrix = m4.xRotation(Math.PI);\n matrix = m4.translate(matrix, -50, -75, -15);\n\n for (var ii = 0; ii < positions.length; ii += 3) {\n var vector = m4.transformPoint(matrix, [positions[ii + 0], positions[ii + 1], positions[ii + 2], 1]);\n positions[ii + 0] = vector[0];\n positions[ii + 1] = vector[1];\n positions[ii + 2] = vector[2];\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n}", "init()\n {\n this.x = this.scene.viewport.width / 2;\n this.y = this.scene.viewport.height / 2;\n }", "function setViewBox( new_boxX0, new_boxY0, new_boxW, new_boxH ) {\n boxX0 = new_boxX0;\n boxY0 = new_boxY0;\n boxW = new_boxW;\n boxH = new_boxH;\n svgRoot.setAttribute( 'viewBox', boxX0+' '+boxY0+' '+boxW+' '+boxH );\n }", "initializeViewerPosition() {\n this.viewportFollow = this.gameClient.playerInfo.playerID;\n const coord = this.gameState.getPlayer(this.viewportFollow).mapCoord;\n this.setViewerPosition(coord, 0.5, 0.5);\n }", "function ViewManager() { }", "function ArcView(view) \r\n{\r\n if (arguments.length > 0) {\r\n\tthis.init(view);\r\n }\r\n}", "function coordinateSystem(unit) {\n return {\n dx: new Point(unit / 3, -unit / 3),\n dy: new Point(unit, 0),\n dz: new Point(0, unit)\n };\n}", "getViewProjectionMatrix(gl) {\n mat4.lookAt(this._viewMatrix, this._eye, this._lookAtPoint, this._up);\n const aspectRatio = gl.canvas.clientWidth / gl.canvas.clientHeight;\n const projectionMatrix = mat4.create();\n mat4.perspective(projectionMatrix, this._fovY, aspectRatio, this._near, this._far);\n\n const vpMatrix = mat4.create();\n mat4.multiply(vpMatrix, projectionMatrix, this._viewMatrix);\n return vpMatrix;\n }", "get viewProjectionMatrix() {\n\t\treturn SpiderGL.Math.Mat4.dup(this.viewProjectionMatrix$);\n\t}", "addVertex(givenX, givenY, xMove, yMove, zoom){ //generally the mouse coords\n\n //apply transformations!\n let xcoor = (givenX - (width/2)) / (width/2);\n let ycoor = ((height - givenY) - (height/2)) / (height/2); //weird since canvas is upside down for mouse\n let hit = false;\n //now you have to apply the transformations for world, not inverse\n xcoor = xcoor/zoom;\n ycoor = ycoor/zoom;\n\n\n xcoor -= xMove; //minus because shifting left is negative, so subtracting a negative value moves to the right\n ycoor -= yMove;\n\n //now just create a vertex with these coords\n this.numVertices++; //get a unique ID\n\n let vert = new Vertex(xcoor, ycoor, this.numVertices);\n this.vertices.addFront(new VertexItem(vert));\n this.vertArray.push(vert);\n\n }" ]
[ "0.6192853", "0.6091999", "0.60366374", "0.60334706", "0.6004408", "0.5991304", "0.5938834", "0.5920568", "0.5900496", "0.58869183", "0.58195364", "0.581382", "0.5787588", "0.5783509", "0.57745093", "0.57741964", "0.5695295", "0.56733745", "0.56659806", "0.56338286", "0.5629572", "0.56278753", "0.5626042", "0.5612222", "0.55988586", "0.5586912", "0.55741084", "0.5560523", "0.55502105", "0.55502105", "0.55502105", "0.55467427", "0.554146", "0.55246836", "0.55181086", "0.55022657", "0.54827124", "0.5476891", "0.54524493", "0.5451594", "0.5441952", "0.5433701", "0.54293066", "0.5419011", "0.5416948", "0.5414966", "0.5414429", "0.54137504", "0.54117733", "0.54077375", "0.539726", "0.53870106", "0.53870106", "0.53870106", "0.5373226", "0.53698623", "0.53681326", "0.5367447", "0.53585386", "0.53579295", "0.5354798", "0.5353721", "0.53460103", "0.5342342", "0.5342218", "0.5338504", "0.53215265", "0.5313634", "0.53068256", "0.5304574", "0.5302403", "0.5298317", "0.5289029", "0.5286404", "0.5281838", "0.5281838", "0.5275533", "0.5274759", "0.52709126", "0.5269097", "0.5267657", "0.52657205", "0.5264074", "0.5264074", "0.526078", "0.52564096", "0.5239872", "0.5237249", "0.5237249", "0.5237249", "0.5237249", "0.523209", "0.522986", "0.5227505", "0.522015", "0.5219412", "0.5217991", "0.5209531", "0.52079844", "0.52035296", "0.5191888" ]
0.0
-1
Retrieve the those raw params from option, which will be cached separately. becasue they will be overwritten by normalized/calculated values in the main process.
function retrieveRawOption(option) { var ret = {}; each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) { option.hasOwnProperty(name) && (ret[name] = option[name]); }); return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function retrieveRawOption(option) {\n\t var ret = {};\n\t each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\n\t option.hasOwnProperty(name) && (ret[name] = option[name]);\n\t });\n\t return ret;\n\t }", "function retrieveRawOption(option) {\n var ret = {};\n Object(util[\"k\" /* each */])(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\n option.hasOwnProperty(name) && (ret[name] = option[name]);\n });\n return ret;\n}", "function prepareOptions () {\n var options = {\n account : req.params.address,\n sequence : req.params.sequence,\n binary : !req.query.binary || (/false/i).test(req.query.binary) ? false : true\n };\n\n return options;\n }", "function getParams() {\n return util.copyObject(currentState.params);\n }", "getGeneralParameters() {\n\t\t\tconst params = {};\n\t\t\tObject.keys(this.$route.query).forEach((key) => {\n\t\t\t\tif (!(key in this.filters)) {\n\t\t\t\t\tparams[key] = this.$route.query[key];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn params;\n\t\t}", "function get_opt(params, args) {\n var newParams = pj_get_params(args);\n var geoIsSet = ['datum', 'ellps', 'a', 'b', 'rf', 'f'].reduce(function(memo, key) {\n return memo || key in params;\n }, false);\n Object.keys(newParams).forEach(function(key) {\n // don't override existing params\n if (key in params) return;\n // don't set ellps if earth model info is set\n if (key == 'ellps' && geoIsSet) return;\n params[key] = newParams[key];\n });\n}", "function getOptions() {\n const o = {};\n input.forEach(i => {\n if(i.slice(0,2) !== '--') return; // we don't deal with unknown params\n const [option,value] = i.slice(2).split('=');\n o[option] = value || true;\n });\n return o;\n}", "function getScriptParams() {\n var scriptOpts = {};\n var scripts = document.getElementsByTagName('script');\n var scriptName = scripts[scripts.length-1];\n\n /* Override any defaults for values that can only be set globally via\n * the 'data-' calls and not on a per slider basis. */\n for(opt in dataOnlyOptions) {\n var attr = $(scriptName).attr(dataOnlyOptions[opt]);\n if (typeof attr !== typeof undefined && attr !== false) {\n if(attr === 'true') {\n eval(opt+'='+true);\n } else {\n eval(opt+'='+false);\n }\n }\n }\n\n /* Define each option that can be called via the 'data-' calls or at\n * slider initialization in order to setup the default values. */\n for(opt in validOptions) {\n scriptOpts[opt] = $(scriptName).attr(validOptions[opt]);\n }\n setOptions('default',scriptOpts);\n }", "function getScriptParams() {\n var scriptOpts = {};\n var scripts = document.getElementsByTagName('script');\n var scriptName = scripts[scripts.length-1];\n\n /* Override any defaults for values that can only be set globally via\n * the 'data-' calls and not on a per slider basis. */\n for(opt in dataOnlyOptions) {\n var attr = $(scriptName).attr(dataOnlyOptions[opt]);\n if (typeof attr !== typeof undefined && attr !== false) {\n if(attr === 'true') {\n eval(opt+'='+true);\n } else {\n eval(opt+'='+false);\n }\n }\n }\n\n /* Define each option that can be called via the 'data-' calls or at\n * slider initialization in order to setup the default values. */\n for(opt in validOptions) {\n scriptOpts[opt] = $(scriptName).attr(validOptions[opt]);\n }\n setOptions('default',scriptOpts);\n }", "get options() {\n return this[$options];\n }", "parseParams() {\n\n let parms = this.omniJsonDef.propSetMap.customAttributes;\n\n // Find the values in the list (don't want to be fussy about the order)\n parms.forEach((val) => {\n if (val.name === \"headers\") {\n this.parms_headers = val.source;\n console.log('Headers = ' + this.parms_headers);\n }\n\n if (val.name === 'values') {\n this.parms_values = val.source;\n console.log('Values = ' + this.parms_values);\n }\n\n if (val.name === 'input') {\n this.parms_input = val.source;\n console.log('Input @ ' + this.parms_input);\n }\n\n if (val.name === 'select') {\n // Note that select defaults to true\n let s = val.source.toUpperCase();\n if (s === 'F' || s === 'FALSE' || s === 'N' || s === \"NO\") {\n this.parms_showSelect = false;\n }\n console.log('Select = ' + String(this.parms_showSelect));\n }\n\n });\n\n }", "mergeParamsWithStandardParams(opts) {\n if (this.defaultOptions) {\n return Object.assign({}, opts, this.defaultOptions);\n }\n else {\n return opts;\n }\n }", "opts() {\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] = key === this.versionOptionName ? this._version : this[key];\n }\n\n return result;\n }", "function getParams() {\n var params = {};\n if (isVideoDropped) {\n params[\"./videoId\"] = storedId;\n params[\"./type\"] = getType();\n params[\"./videoService\"] = \"brightcove\";\n } else {\n params[\"./fileReference\"] = storedId;\n params[\"./type\"] = getType();\n params[\"./imageCrop\"] = calculateCrop();\n }\n return params;\n }", "function parseOptions() {\n const nextQuestion = fetchQuestion();\n return nextQuestion.options;\n }", "prepareRequestParams(options) {\n let requestParams;\n const searchKeys = _.split(options.searchKey, ','), matchModes = _.split(options.matchMode, ','), formFields = {};\n _.forEach(searchKeys, (colName, index) => {\n formFields[colName] = {\n value: options.query,\n logicalOp: 'AND',\n matchMode: matchModes[index] || matchModes[0] || 'startignorecase'\n };\n });\n requestParams = {\n filterFields: formFields,\n page: options.page,\n pagesize: options.limit || options.pagesize,\n skipDataSetUpdate: true,\n skipToggleState: true,\n inFlightBehavior: 'executeAll',\n logicalOp: 'OR',\n orderBy: options.orderby ? _.replace(options.orderby, /:/g, ' ') : ''\n };\n if (options.onBeforeservicecall) {\n options.onBeforeservicecall(formFields);\n }\n return requestParams;\n }", "function getSharedArgs(options) {\n return [\n /**\n * Width\n */\n ...(options.width ? ['--width', options.width.toString()] : []),\n /**\n * Height\n */\n ...(options.height ? ['--height', options.height.toString()] : []),\n /**\n * Rotation\n */\n ...(options.rotation ? ['--rotation', options.rotation.toString()] : []),\n /**\n * Horizontal flip\n */\n ...(options.flip && (options.flip === __1.Flip.Horizontal || options.flip === __1.Flip.Both)\n ? ['--hflip']\n : []),\n /**\n * Vertical flip\n */\n ...(options.flip && (options.flip === __1.Flip.Vertical || options.flip === __1.Flip.Both)\n ? ['--vflip']\n : []),\n /**\n * Shutter Speed\n */\n ...(options.shutter ? ['--shutter', options.shutter.toString()] : []),\n /**\n * Sharpness (-100 to 100; default 0)\n */\n ...(options.sharpness ? ['--sharpness', options.sharpness.toString()] : []),\n /**\n * Contrast (-100 to 100; default 0)\n */\n ...(options.contrast ? ['--contrast', options.contrast.toString()] : []),\n /**\n * Brightness (0 to 100; default 50)\n */\n ...(options.brightness || options.brightness === 0\n ? ['--brightness', options.brightness.toString()]\n : []),\n /**\n * Saturation (-100 to 100; default 0)\n */\n ...(options.saturation ? ['--saturation', options.saturation.toString()] : []),\n /**\n * ISO\n */\n ...(options.iso ? ['--ISO', options.iso.toString()] : []),\n /**\n * EV Compensation\n */\n ...(options.exposureCompensation ? ['--ev', options.exposureCompensation.toString()] : []),\n /**\n * Exposure Mode\n */\n ...(options.exposureMode ? ['--exposure', options.exposureMode.toString()] : []),\n /**\n * Auto White Balance Mode\n */\n ...(options.awbMode ? ['--awb', options.awbMode.toString()] : []),\n /**\n * Analog Gain\n */\n ...(options.analogGain ? ['--analoggain', options.analogGain.toString()] : []),\n /**\n * Digital Gain\n */\n ...(options.digitalGain ? ['--digitalgain', options.digitalGain.toString()] : []),\n ];\n}", "get options() {}", "function getParameters() {\n var parameters = {};\n parameters.select = $('input[name=radio-choice-2]:checked').val();\n console.log(\"Selected : \" + parameters.select);\n parameters.scan = $('input[name=radio-choice-3]:checked').val();\n console.log(\"Scan Type : \" + parameters.scan);\n parameters.true = true;\n return parameters;\n }", "get argv() {\n return this.get('rawOptions', {})\n }", "getParams() {\n const params = {};\n // Get the values for each parameter\n for (let param of this.operation.params) {\n let id = param.id\n params[id] = document.getElementById(id).value;\n }\n return params;\n }", "function getOriginalOptions ( ) {\n\t\treturn originalOptions;\n\t}", "function getOptions()\n{\n\n var mode = getVal(\"mode\")\n var normalizeX1 = getVal(\"normalizeX1\")\n var normalizeX2 = getVal(\"normalizeX2\")\n var normalizeX3 = getVal(\"normalizeX3\")\n var xRes = getVal(\"xRes\")\n var zRes = getVal(\"zRes\")\n var barchartPadding = getVal(\"barchartPadding\")\n var barSizeThreshold = getVal(\"barSizeThreshold\")\n var defaultColor = getVal(\"defaultColor\")\n var hueOffset = getVal(\"hueOffset\")\n var title = getVal(\"title\")\n var x1title = getVal(\"x1title\")\n var x2title = getVal(\"x2title\")\n var x3title = getVal(\"x3title\")\n var fraction = getVal(\"fraction\")\n var keepOldPlot = getVal(\"keepOldPlot\")\n var colorCol = getVal(\"colorCol\")\n var dataPointSize = getVal(\"dataPointSize\")\n var header = getVal(\"header\")\n var separator = getVal(\"separator\")\n var labeled = getVal(\"labeled\")\n var filterColor = getVal(\"filterColor\")\n \n return {\n mode: mode,\n normalizeX1: normalizeX1,\n normalizeX2: normalizeX2,\n normalizeX3: normalizeX3,\n xRes: xRes,\n zRes: zRes,\n barchartPadding: barchartPadding,\n barSizeThreshold: barSizeThreshold,\n defaultColor: defaultColor,\n hueOffset: hueOffset,\n title: title,\n x1title: x1title,\n x2title: x2title,\n x3title: x3title,\n fraction: fraction,\n keepOldPlot: keepOldPlot,\n colorCol: colorCol,\n dataPointSize: dataPointSize,\n header: header,\n separator: separator,\n labeled: labeled,\n filterColor: filterColor, \n }\n}", "function getQueryParameters() {\n var parameters = {};\n parameters.select = $('input[name=radio-choice-1]:checked').val();\n console.log(\"Selected : \" + parameters.select);\n parameters.query = $('input[name=search]').val();\n console.log(\"Query : \" + parameters.query);\n parameters.true = true;\n return parameters;\n }", "async function getChangingParams() {\n let algod = await initAlgod()\n\n let params = await algod.getTransactionParams().do()\n params.fee = 1000\n params.flatFee = true\n // params.genesisHash = params.genHash\n return params\n}", "function params() {\n return (modal.params || {});\n }", "function getSelectedParameters(){\n\t\n\tvar parameters = {};\n\t\n\tparameters.type = getSelectedType();\n\tparameters.player = getSelectedPlayerValues();\n\tparameters.year = getSelectedYearValues();\n\tparameters.week = getSelectedWeekValues();\n\tparameters.statName = getSelectedStatName();\n\tparameters.team = getSelectedTeamValues();\n\tparameters.multiselectPlayer = getMultiselectPlayer();\n\tparameters.multiselectYear = getMultiselectYear();\n\tparameters.multiselectWeek = getMultiselectWeek();\n\tparameters.multiselectTeam = getMultiselectTeam();\n\t\n\treturn parameters;\n}", "detectParams() {\n const options = this.options;\n const data = getDataset(this.widget);\n\n if (data.counter) {\n const counter = parseInt(data.counter, 10);\n\n if (isNaN(counter)) {\n options.counterUrl = data.counter;\n }\n else {\n options.counterNumber = counter;\n }\n }\n\n options.title = data.title || options.title;\n options.url = data.url || options.url;\n }", "function getUrlParameters(options) {\n this.parameters = {};\n this.optionsUrlParameters = {\n contextId: \"context_id\",\n getFingerprint: \"get_fingerprint\",\n imageEncoding: \"image_encoding\",\n imageScalar: \"image_scalar\",\n maxResults: \"max_results\",\n plotShape: \"plot_shape\",\n posTags: \"POStags\",\n posType: \"pos_type\",\n retinaName: \"retina_name\",\n sparsity: \"sparsity\",\n startIndex: \"start_index\",\n term: \"term\"\n };\n var that = this;\n\n // Check all possible option names if they are contained in the options object and return the corresponding URL parameters\n $.each(Object.keys(that.optionsUrlParameters), function (index, parameter) {\n if (typeof options[parameter] != \"undefined\") {\n that.parameters[that.optionsUrlParameters[parameter]] = options[parameter];\n }\n });\n return $.param(this.parameters);\n }", "function HttpParamsOptions() {}", "function HttpParamsOptions() {}", "getParamsList() {\n return Object.entries(this.params)\n // ignore non DMX until implemented. A simple filter will do for now\n // @TODO use switch case or similar\n // @TODO Handle nested DmxParam's\n .filter(([name, param]) => param instanceof DmxParam)\n .map(([name, param]) => {\n\n\n const { min = 0, max = 0, map = {}, channels } = param\n\n // handle (map|mapping) inconsistency.\n // if mapping is available we can use its keys\n // if map is used (fallback defined above) we need to prefix it with an empty string\n // {@see https://github.com/NERDDISCO/luminave/commit/e54cbaedb35d8e2ce8c858688d01a03626f78d63#diff-fbbc7eb32e6a63e1dd48789843a0192fR78}\n const mapping = param.mapping ?\n Object.keys(param.mapping) : ['', ...Object.keys(map)]\n\n return {\n min,\n max,\n name,\n channels,\n mapping,\n isRgb: param instanceof RgbParam,\n isRange: param instanceof RangeParam,\n isMapped: param instanceof MappedParam,\n isMultiRange: param instanceof MultiRangeParam,\n isHiRes: param instanceof HiResParam\n }\n })\n }", "getParams() {\n\t\tlet params = \"?\";\n\t\tparams += \"&key=\" + this.config.apiKey;\n\t\tparams += \"&locatie=\" + this.config.lat + \",\" + this.config.lon;\n\n\t\treturn params;\n\t}", "getParamsByMethodType(context) {\n\t\t/** If set config mergeParam = true at setting routes */\n\t\tif (context.params && !context.params.query && !context.params.body && !context.params.params) {\n\t\t\treturn context.params;\n\t\t}\n\t\t/** Else will check and get params via method type */\n\t\tlet params = {};\n\t\tif (context.meta.method) {\n\t\t\tswitch (context.meta.method) {\n\t\t\t\tcase \"GET\": {\n\t\t\t\t\tparams = {...context.params.query, ...context.params.params};\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"POST\" || \"PUT\" || \"DELETE\" || \"OPTIONS\": {\n\t\t\t\t\tparams = context.params.body;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (params && !_.isEmpty(params)) {\n\t\t\treturn params;\n\t\t}\n\t\t/** Try for get params if case method type is not set, merge all to a object params */\n\t\tparams = {...context.params.query, ...context.params.body, ...context.params.params};\n\t\treturn params;\n\t}", "calcExtraParams () {}", "getOptions(viewModel, className) {\n let options = {};\n let props = this.controlProperties.getProperties(className);\n\n // allows view-models to do some pre processing\n // for example, process all ak-templates\n if (viewModel.beforeOptionsBuild) {\n viewModel.beforeOptionsBuild(options);\n }\n\n for (let i = 0; i < props.length; i++) {\n let prop = props[i];\n let value = viewModel[this.util.getBindablePropertyName(prop)];\n\n if (this.util.hasValue(value)) {\n options[prop] = value;\n }\n }\n\n // allows view-models to do some post processing\n // used in ak-col to support nested columns\n if (viewModel.afterOptionsBuild) {\n viewModel.afterOptionsBuild(options);\n }\n\n return this.util.pruneOptions(options);\n }", "function getOptions () {\n return options[Math.floor(Math.random() * options.length)]\n}", "function extractBaseOption() {\n $baseOption = {};\n\n _.each($options, function (key, value) {\n $baseOption[key] = value[0];\n });\n }", "function getOptions()\n\t{\n\t\tchrome.extension.sendMessage(\"optionsRequest\", function(response)\n\t\t{\n\t\t\tpreviews = response.previews;\n\t\t\tpromoted = response.promoted;\n\t\t\twtfModule = response.wtfModule;\n\t\t\ttrendsModule = response.trendsModule;\n\n\t\t\trefresh();\n\t\t});\n\t}", "doPrepareOptions (options) {\n return Object.assign (options, {\n validRange: this.validRange\n })\n }", "function getParameters() {\n let filtersParameter = filters.val() === '' ? '' : 'filters=' + filters.val();\n\n // let parameters = '?' + filtersParameter;\n return parameters= '?' + filtersParameter;\n }", "getQuestionAndOptions (req, res) {\n const quizId = req.params.quiz_id;\n\n QuizModel.findById(quizId, EXCLUDE_OUTPUT)\n .populate('options', EXCLUDE_OUTPUT)\n .then((response) => {\n return res.json({\n status: true,\n data: response\n })\n });\n }", "function getParams() {\n if (!window.frameElement.hasAttribute('data-params')) {\n return;\n }\n params = JSON.parse(decodeURIComponent(window.frameElement.getAttribute('data-params')));\n }", "get options() {\n return { throttleDelay: this.throttleDelay, passive: this.passive };\n }", "function buildOptions (srcOptions) {\n\n var keys = ['method', 'url', 'params', 'body', 'cache', 'headers'];\n\n var result = {};\n\n keys.map(function (k) {\n\n if (srcOptions[k]) {\n result[k] = srcOptions[k];\n }\n });\n\n if (result.body) {\n if (result.headers && result.headers['Content-Type'] && result.headers['Content-Type'] === 'application/x-www-form-urlencoded') {\n result.body = serialize(result.body);\n }\n }\n\n return result;\n }", "function HttpParamsOptions() { }", "function HttpParamsOptions() { }", "function HttpParamsOptions() { }", "getParams(internal_name) {\n let widgetParams = null;\n if (this.asset.param.has(internal_name)) {\n widgetParams = Object.assign({}, this.asset.param.get(internal_name));\n }\n else {\n // temporary\n widgetParams = { internal_name: internal_name, name: TitleCase(SnakeToPascal(internal_name)) };\n }\n return widgetParams;\n }", "function getOpt() {\n opt = {\n h: parseInt(eid(\"h\").value),\n k: parseInt(eid(\"k\").value),\n H: parseInt(eid(\"H\").value),\n K: parseInt(eid(\"K\").value),\n R2: parseFloat(eid(\"R2\").value),\n R3: parseFloat(eid(\"R3\").value),\n F: parseFloat(eid(\"F\").value),\n θ: radians(parseFloat(eid(\"θ\").value)),\n ψ: radians(parseFloat(eid(\"ψ\").value)),\n φ: radians(parseFloat(eid(\"φ\").value)),\n rotation: eid(\"rotation\").value,\n interval: parseInt(eid(\"interval\").value),\n };\n}", "function getSavedOptions() {\n log('Getting saved options.');\n opt_devmode = GM_getValue(\"opt_devmode\", opt_devmode);\n debugLoggingEnabled = opt_loggingEnabled = GM_getValue(\"opt_loggingEnabled\", opt_loggingEnabled);\n opt_hidefedded = GM_getValue(\"opt_hidefedded\", opt_hidefedded);\n opt_hidefallen = GM_getValue(\"opt_hidefallen\", opt_hidefallen);\n opt_hidetravel = GM_getValue(\"opt_hidetravel\", opt_hidetravel);\n opt_showcaymans = GM_getValue(\"opt_showcaymans\", opt_showcaymans);\n opt_hidehosp = GM_getValue(\"opt_hidehosp\", opt_hidehosp);\n opt_disabled = GM_getValue(\"opt_disabled\", opt_disabled);\n }", "function fxReportInitParamValues(inst, queryobj, instCache){\n\t//avoid stale values.\n\tqueryobj.params=null;\n\t\n\tvar params=queryobj.getParams(instCache);\n\tif (angular.isDefined(inst.ParamValues) && \n\t\t\tinst.ParamValues!=null &&\n\t\t\tangular.isDefined(inst.ParamValues.paramValues) && \n\t\t\tinst.ParamValues.paramValues!=null){\n\t\t\n\t\tif (inst.ParamValues.paramValues.length==params.length){\n\t\t\t//may not necessary to sort.\n\t\t\tvar sortedparams=inst.ParamValues.paramValues.sort(function(a, b){\n\t\t\t\treturn a.index-b.index;\n\t\t\t});\n\t\t\t\n\t\t\tfor(var i=0; i<sortedparams.length; i++){\n\t\t\t\tif (params[i].getOp().howManyOperands()==1 ||params[i].getOp().howManyOperands()==2 ){\n\t\t\t\t\tif (angular.isDefined(sortedparams[i].values) && sortedparams[i].values!=null && sortedparams[i].values.length>0){\n\t\t\t\t\t\tparams[i].value=sortedparams[i].values[0];\n\t\t\t\t\t}\n\t\t\t\t} else if (params[i].getOp().howManyOperands()>2) {\n\t\t\t\t\tif (angular.isDefined(sortedparams[i].values) && sortedparams[i].values!=null && sortedparams[i].values.length>0){\n\t\t\t\t\t\tparams[i].value=sortedparams[i].values;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//do not do this, we could override the value from query\n\t\t\t\t\t\t//params[i].value=[];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tparams[i].computeValue();\n\t\t\t}\n\t\t}\n\t} else {\n\t\tinst.ParamValues={'paramValues':[]};\n\t}\n\treturn params;\n\n}", "function ReadQueryParams() {\n const urlParams = new URLSearchParams(location.search)\n\n inputBoxWidth.value = +urlParams.get(paramBoxWidth) || defaultBoxWidth\n inputBoxHeight.value = +urlParams.get(paramBoxHeight) || defaultBoxHeight\n inputBoxRadius.value = +urlParams.get(paramBoxRadius) || defaultBoxRadius\n inputBoxMargin.value = +urlParams.get(paramBoxMargin) || defaultBoxMargin\n inputBoxColor.value = urlParams.get(paramBoxColor) || defaultBoxColor\n inputBgColor.value = urlParams.get(paramBgColor) || defaultBgColor\n inputBoxShadowColor.value = urlParams.get(paramBoxShadowColor) || defaultBoxShadowColor\n inputBoxShadowX.value = +urlParams.get(paramBoxShadowX) || defaultBoxShadowX\n inputBoxShadowY.value = +urlParams.get(paramBoxShadowY) || defaultBoxShadowY\n inputBlurRadius.value = +urlParams.get(paramBlurRadius) || defaultBlurRadius\n inputSpreadRadius.value = +urlParams.get(paramSpreadRadius) || defaultSpreadRadius\n}", "function wpGetOptions (context) {\n if (typeof context.query === 'string') return loaderUtils.getOptions(context);\n return context.query;\n}", "function getOptions() {\n //\t\t\tOption.query({\n //\t\t\t\tpage\n //\t\t\t});\n }", "loadQueryParams() {\n queryParamsToFormStore(\n this.args.queryParams,\n this.formStore,\n this.sourceNode\n );\n }", "function getOptions() {\n var options = JSON.parse(localStorage.getItem(\"options\"));\n //console.log(\"read options from storage as object\");\n //console.log(\"options.ip: \" + options.ip);\n //console.log(\"options.accel: \" + options.accel);\n \n return options || {};\n}", "function wpGetOptions (context) {\n if (typeof context.query === 'string') return loaderUtils.getOptions(context);\n return context.query;\n}", "function get_parameter_values() {\n \"use strict\";\n let result = {};\n $(\".cea-parameter\").not(\"bootstrap-select\").each(function (index, element) {\n console.log(`Reading parameter: ${element.id}`);\n result[element.id] = read_value(element);\n });\n console.log(\"get_parameter_values(): result=\", result);\n return result;\n}", "function get_params() {\n return get_cookie(\"params\");\n}", "function Params() {\n return {\n // Wave shape\n wave_type: SQUARE,\n\n // Envelope\n env_attack: 0, // Attack time\n env_sustain: 0.3, // Sustain time\n env_punch: 0, // Sustain punch\n env_decay: 0.4, // Decay time\n\n // Tone\n base_freq: 0.3, // Start frequency\n freq_limit: 0, // Min frequency cutoff\n freq_ramp: 0, // Slide (SIGNED)\n freq_dramp: 0, // Delta slide (SIGNED)\n\n // Vibrato\n vib_strength: 0, // Vibrato depth\n vib_speed: 0, // Vibrato speed\n\n // Tonal change\n arp_mod: 0, // Change amount (SIGNED)\n arp_speed: 0, // Change speed\n\n // Duty (affects the timbre of SQUARE waves)\n duty: 0, // Square duty\n duty_ramp: 0, // Duty sweep (SIGNED)\n\n // Repeat\n repeat_speed: 0, // Repeat speed\n\n // Phaser\n pha_offset: 0, // Phaser offset (SIGNED)\n pha_ramp: 0, // Phaser sweep (SIGNED)\n\n // Low-pass filter\n lpf_freq: 1.0, // Low-pass filter cutoff\n lpf_ramp: 0, // Low-pass filter cutoff sweep (SIGNED)\n lpf_resonance: 0, // Low-pass filter resonance\n // High-pass filter\n hpf_freq: 0, // High-pass filter cutoff\n hpf_ramp: 0, // High-pass filter cutoff sweep (SIGNED)\n\n // Sample parameters\n sound_vol: 0.5,\n sample_rate: 44100,\n sample_size: 8\n };\n}", "getRawArgs() {\n return PARAM_ARGV || [];\n }", "getOptions() {\n return lodash_clonedeep_1.default(__classPrivateFieldGet(this, _options));\n }", "function getOpts(opts={}) {\n\tlet o = {\n\t\tdebug: opts.debug || false,\n\t\treps: opts.reps || 50,\n\t\tkCells: opts.kCells || 50,\n\t\tsamples: opts.samples || undefined,\n\t\tbucketWidth: opts.bucketWidth || 10,\n\t\thashLength: opts.hashLength || 16,\n\t\ttagType: opts.tagType || \"top\"\n\t};\n\t\n\tif (o.tagType === \"all\") {\n\t\to.hashLength = o.kCells;\n\t}\n\t\n\treturn o;\n}", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._paramMap;\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._paramMap;\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._paramMap;\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._paramMap;\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._paramMap;\n }", "getOptions(schema) {\n // loaders, loaderIndex will be defined by runLoaders\n const loader = this.loaders[this.loaderIndex];\n\n // Verbatim copy from\n // https://github.com/webpack/webpack/blob/v5.31.2/lib/NormalModule.js#L471-L508\n // except eslint/prettier differences\n // -- unfortunate result of getOptions being synchronous functions.\n\n let { options } = loader;\n\n if (typeof options === 'string') {\n if (options.substr(0, 1) === '{' && options.substr(-1) === '}') {\n try {\n options = parseJson(options);\n } catch (e) {\n throw new Error(`Cannot parse string options: ${e.message}`);\n }\n } else {\n options = querystring.parse(options, '&', '=', {\n maxKeys: 0,\n });\n }\n }\n\n // eslint-disable-next-line no-undefined\n if (options === null || options === undefined) {\n options = {};\n }\n\n if (schema) {\n let name = 'Loader';\n let baseDataPath = 'options';\n let match;\n // eslint-disable-next-line no-cond-assign\n if (schema.title && (match = /^(.+) (.+)$/.exec(schema.title))) {\n [, name, baseDataPath] = match;\n }\n validate(schema, options, {\n name,\n baseDataPath,\n });\n }\n\n return options;\n }", "function refreshParams() {\n params = { X_max: X_max, X_min: X_min, max_: max_, min_: min_ };\n }", "function getOptFromPool() {\n return pool.shift();\n }", "function getOptions() {\n\t\t\treturn JSON.parse(localStorage.getItem(\"optionsObject\"));\n\t\t}", "function getParams(k) {\n\n // returns all parameters.\n if (typeof k == 'undefined') {\n return JSON.parse(JSON.stringify(parameters));\n }\n\n return typeof parameters[k] != 'undefined' ? parameters[k].slice(0) : [];\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(p => convertToParamMap(p)));\n }\n\n return this._paramMap;\n }", "function update_params () {\n\t\tvar config = Jupyter.notebook.config;\n\t\tfor (var key in params) {\n\t\t\tif (config.data.hasOwnProperty(key)) {\n\t\t\t\tparams[key] = config.data[key];\n\t\t\t}\n\t\t}\n\t}", "static options() {\n\t\treturn {\n\t\t\tconstants: getConstants(),\n\t\t\tpresets: getPresets(),\n\t\t\tvalue: null,\n\t\t\tview: null,\n\t\t\tdidInit: (tick) => {},\n\t\t\tdidUpdate: (tick, value) => {},\n\t\t\twillDestroy: (tick) => {},\n\t\t\tdidDestroy: (tick) => {},\n\t\t\tcredits: {\n\t\t\t\tlabel: 'Powered by PQINA',\n\t\t\t\turl: 'https://pqina.nl/?ref=credits'\n\t\t\t}\n\t\t}\n\t}", "function extractQueryOptions(options) {\n var params = [];\n\n if (typeof options.pageSize !== 'undefined') {\n if (options.pageSize < 1) {\n throw new Error('PageSize can not be less then 1');\n }\n\n params.push('pageSize=' + encodeURIComponent(options.pageSize));\n }\n\n if (typeof options.offset !== 'undefined') {\n if (options.offset < 0) {\n throw new Error('Offset can not be less then 0');\n }\n\n params.push('offset=' + encodeURIComponent(options.offset));\n }\n\n if (options.sortBy) {\n if (_utils2.default.isString(options.sortBy)) {\n params.push('sortBy=' + encodeURIComponent(options.sortBy));\n } else if (_utils2.default.isArray(options.sortBy)) {\n params.push('sortBy=' + _utils2.default.encodeArrayToUriComponent(options.sortBy));\n }\n }\n\n if (options.groupBy) {\n if (_utils2.default.isString(options.groupBy)) {\n params.push('groupBy=' + encodeURIComponent(options.groupBy));\n } else if (_utils2.default.isArray(options.groupBy)) {\n params.push('groupBy=' + _utils2.default.encodeArrayToUriComponent(options.groupBy));\n }\n }\n\n if (_utils2.default.isNumber(options.relationsDepth)) {\n params.push('relationsDepth=' + options.relationsDepth);\n }\n\n if (options.relations) {\n if (_utils2.default.isArray(options.relations)) {\n var loadRelations = options.relations.length ? _utils2.default.encodeArrayToUriComponent(options.relations) : '*';\n params.push('loadRelations=' + loadRelations);\n }\n }\n\n return params.join('&');\n}", "_defaultParams(name, params) {\n const handlers = this.recognizer.handlersFor(name);\n let paramNames = [];\n for (let i = 0, len = handlers.length; i < len; i++) {\n paramNames = paramNames.concat(handlers[i].names);\n }\n params = Object.assign(pick(this.store.state.params, paramNames), params);\n this._cleanParams(params);\n return params;\n }", "get options() { return this.optionsService.options; }", "function getRuntimeParams() {\n return new Promise((resolve, reject) => {\n var response;\n multichain.getRuntimeParams({},\n (err, res) => {\n console.log(res)\n if (err == null) {\n return resolve({\n message: \"Blockchain runtime parameters\",\n response: res,\n\n });\n } else {\n console.log(err)\n return reject({\n status: 500,\n message: 'Internal Server Error !'\n });\n }\n }\n )\n })\n}", "function getParameters(data) {\n\n // Destructuring\n const { limit, offset } = data;\n\n return {\n limit,\n offset\n };\n }", "prepareParams() {\n const { filters } = this.props;\n const params = {};\n\n if (filters !== undefined) {\n // Add status filter to param\n if (filters.status !== undefined && filters.status.value !== null) {\n params.status = filters.status.value;\n }\n\n // Add customer filter to params\n if (filters.customers !== undefined && filters.customers !== null) {\n params.ownerName = Array.from(filters.customers, customer => customer.value);\n }\n }\n\n return params;\n }", "getEnvironmentParameterValues(){}", "function readParams() {\n console.log(\"we are reading the params file...\");\n const paramsRead = fs.readFileSync(paramsPath);\n return JSON.parse(paramsRead.toString());\n}", "function getUrlParams (options) {\r\n if (options.url.indexOf('?') !== -1) {\r\n options.requestParams = options.requestParams || {};\r\n var queryString = options.url.substring(options.url.indexOf('?') + 1);\r\n options.url = options.url.split('?')[0];\r\n options.requestParams = JSON.parse('{\"' + decodeURI(queryString).replace(/\"/g, '\\\\\"').replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}');\r\n }\r\n options.url = cleanUrl(options.url.split('?')[0]);\r\n return options;\r\n}", "async retrieveEnvironmentParameterValues(reload=false){\n\t\tconst loaded = this.getEnvironmentParameterValues();\n\t\tif(loaded === null || reload){\n\t\t\treturn await this.loadEnvironmentParameterValues(reload);\n\t\t}\n\t\telse{\n\t\t\treturn loaded;\n\t\t}\n\t}", "function getOptions() {\n\treturn defaultOptions;\n}", "get options() {\n return this._options;\n }", "static get params () {\n return [\n 'allow-same-version',\n 'commit-hooks',\n 'git-tag-version',\n 'json',\n 'preid',\n 'sign-git-tag',\n 'workspace',\n 'workspaces',\n ]\n }", "extractNativeOptions() {\n return __awaiter(this, void 0, void 0, function* () {\n const driver = this.context.primaryDriver;\n const { env } = driver.options;\n const options = driver.getSupportedOptions();\n if (options.length > 0) {\n this.debug('Using supported options from driver');\n const nativeOptions = {};\n options.forEach((option) => {\n nativeOptions[option] = true;\n });\n return Promise.resolve(nativeOptions);\n }\n this.debug('Extracting native options from help output');\n const { stdout } = yield this.executeCommand(driver.metadata.bin, driver.metadata.helpOption.split(' '), {\n env,\n });\n const nativeOptions = {};\n const matches = stdout.match(OPTION_PATTERN) || [];\n matches.forEach((option) => {\n // Trim trailing comma or space\n nativeOptions[option.slice(0, -1)] = true;\n });\n return nativeOptions;\n });\n }", "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 }", "_params(req, opts) {\n const body = req.body || {};\n\n if (opts.name) body.Name = opts.name;\n if (opts.session) body.Session = opts.session;\n if (opts.token) {\n body.Token = opts.token;\n delete opts.token;\n }\n if (opts.near) body.Near = opts.near;\n if (opts.template) {\n const template = utils.normalizeKeys(opts.template);\n if (template.type || template.regexp) {\n body.Template = {};\n if (template.type) body.Template.Type = template.type;\n if (template.regexp) body.Template.Regexp = template.regexp;\n }\n }\n if (opts.service) {\n const service = utils.normalizeKeys(opts.service);\n body.Service = {};\n if (service.service) body.Service.Service = service.service;\n if (service.failover) {\n const failover = utils.normalizeKeys(service.failover);\n if (typeof failover.nearestn === \"number\" || failover.datacenters) {\n body.Service.Failover = {};\n if (typeof failover.nearestn === \"number\") {\n body.Service.Failover.NearestN = failover.nearestn;\n }\n if (failover.datacenters) {\n body.Service.Failover.Datacenters = failover.datacenters;\n }\n }\n }\n if (typeof service.onlypassing === \"boolean\") {\n body.Service.OnlyPassing = service.onlypassing;\n }\n if (service.tags) body.Service.Tags = service.tags;\n }\n if (opts.dns) {\n const dns = utils.normalizeKeys(opts.dns);\n if (dns.ttl) body.DNS = { TTL: dns.ttl };\n }\n\n req.body = body;\n }", "function getPositionsFromOptions (params) {\n return Object.assign({}, ...NOTIFICATION_POSITIONS.map(key => ({ [key]: params[key] })));\n}", "getCurrentOptions() {\r\n return Object.keys(this.curr.val[this.getCurrentQuestion()]);\r\n }", "async function ParsedOptions() {\n\t\treturn await options()\n\t\t\t.then(\n\t\t\t\tasync options => {\n\t\t\t\t\tconfiguration = {};\n\n\t\t\t\t\tlet { running } = Update,\n\t\t\t\t\t\tallowed = await load(`has/${ running }`),\n\t\t\t\t\t\tpermiss = await load(`get/${ running }`);\n\n\t\t\t\t\t/* Don't expose the user's authentication information to sites */\n\t\t\t\t\tfor(let key in options)\n\t\t\t\t\t\tif(/username|password|token|api|server|url|storage|cache|proxy|client|builtin|plugin|qualit/i.test(key))\n\t\t\t\t\t\t\tif(allowed && RegExp(permiss.join('|'),'i').test(key))\n\t\t\t\t\t\t\t\tconfiguration[key] = options[key];\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t/* Do nothing */;\n\t\t\t\t\t\t// else if(/(^cache-data|paths|qualities)/i.test(key))\n\t\t\t\t\t\t//\t /* Pre-parse JSON - make sure anything accessing the data handles objects too */\n\t\t\t\t\t\t//\t configuration[key] = JSON.parse(options[key] || null);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t/* Simple copy */\n\t\t\t\t\t\t\tconfiguration[key] = options[key];\n\n\t\t\t\t\tCOMPRESS = options.UseLZW;\n\n\t\t\t\t\tif(!(CAUGHT && CAUGHT.ALL_CAUGHT)) {\n\t\t\t\t\t\tCAUGHT = options.__caught;\n\t\t\t\t\t\tCAUGHT = JSON.parse(COMPRESS? iBWT(unzip(decompress(CAUGHT))): CAUGHT);\n\t\t\t\t\t\tCAUGHT.NO_CACHE = { ...CAUGHT };\n\n\t\t\t\t\t\tCAUGHT.has = (ids) => {\n\t\t\t\t\t\t\tfor(let id in ids)\n\t\t\t\t\t\t\t\tif(!!~CAUGHT[id].indexOf(ids[id]) || !!~CAUGHT.NO_CACHE[id].indexOf(ids[id]))\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tCAUGHT.bump = async(ids) => {\n\t\t\t\t\t\t\tbumping:\n\t\t\t\t\t\t\tfor(let id in ids) {\n\t\t\t\t\t\t\t\tlet ID = id.toLowerCase().slice(0, 4),\n\t\t\t\t\t\t\t\t\tMAX = (COMPRESS? 200: 100);\n\n\t\t\t\t\t\t\t\tif(!!~CAUGHT[ID].indexOf(ids[id]))\n\t\t\t\t\t\t\t\t\tcontinue bumping;\n\n\t\t\t\t\t\t\t\tif(CAUGHT[ID].length >= MAX)\n\t\t\t\t\t\t\t\t\tCAUGHT[ID].splice(0, 1 + (CAUGHT[ID].length - MAX));\n\n\t\t\t\t\t\t\t\tCAUGHT[ID].push(ids[id]);\n\t\t\t\t\t\t\t\tCAUGHT[ID].filter(v => typeof v == 'number'? v: null);\n\t\t\t\t\t\t\t\tCAUGHT[ID] = CAUGHT[ID].slice(0, MAX);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet __caught = JSON.stringify(CAUGHT);\n\n\t\t\t\t\t\t\t__caught = (COMPRESS? compress(zip(BWT(__caught))): __caught);\n\n\t\t\t\t\t\t\tawait UTILS_STORAGE.set({ __caught }, () => configuration.__caught = __caught);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tCAUGHT.charge = async(ids) => {\n\t\t\t\t\t\t\tcharging:\n\t\t\t\t\t\t\tfor(let id in ids) {\n\t\t\t\t\t\t\t\tlet ID = id.toLowerCase().slice(0, 4);\n\n\t\t\t\t\t\t\t\tif(!!~CAUGHT.NO_CACHE[ID].indexOf(ids[id]))\n\t\t\t\t\t\t\t\t\tcontinue charging;\n\n\t\t\t\t\t\t\t\tCAUGHT.NO_CACHE[ID].push(ids[id]);\n\t\t\t\t\t\t\t\tCAUGHT.NO_CACHE[ID].filter(v => typeof v == 'number'? v: null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif(options.UseLowCache) {\n\t\t\t\t\t\t /* Add IDs to CAUGHT without updating the cache */\n\t\t\t\t\t\t /* Movies/TV Shows */\n\t\t\t\t\t\t // Charge Ombi\n\t\t\t\t\t\t if(options.usingOmbi) {\n\t\t\t\t\t\t let url = options.ombiURL,\n\t\t\t\t\t\t\t\t\tapi = `apikey=${ options.ombiToken }`;\n\n\t\t\t\t\t\t fetch(`${ url }/api/v1/Request/movie?${ api }`)\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t imdb: item.imdbId,\n\t\t\t\t\t\t tmdb: item.theMovieDbId,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\n\t\t\t\t\t\t fetch(`${ url }/api/v1/Request/tv?${ api }`)\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t imdb: item.imdbId,\n\t\t\t\t\t\t tmdb: item.theMovieDbId,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t /* Movies */\n\t\t\t\t\t\t // Charge Watcher\n\t\t\t\t\t\t if(options.usingWatcher) {\n\t\t\t\t\t\t let url = options.watcherURL,\n\t\t\t\t\t\t token = options.watcherToken,\n\t\t\t\t\t\t quality = options.watcherQualityProfileId || 'Default',\n\t\t\t\t\t\t username = options.watcherBasicAuthUsername,\n\t\t\t\t\t\t password = options.watcherBasicAuthPassword;\n\n\t\t\t\t\t\t fetch(`${ url }/api/?apikey=${ token }&mode=liststatus&quality=${ quality }`, {\n\t\t\t\t\t\t headers: {\n\t\t\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t\t\t\t 'X-Api-Key': token,\n\t\t\t\t\t\t [username? 'Authorization': 'X-Authorization']: `Basic ${ btoa(`${ username }:${ password }`) }`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t imdb: item.movies.imdbid,\n\t\t\t\t\t\t tmdb: item.movies.tmdbid,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t // Charge Radarr\n\t\t\t\t\t\t if(options.usingRadarr) {\n\t\t\t\t\t\t let url = options.radarrURL,\n\t\t\t\t\t\t token = options.radarrToken,\n\t\t\t\t\t\t username = options.radarrBasicAuthUsername,\n\t\t\t\t\t\t password = options.radarrBasicAuthPassword;\n\n\t\t\t\t\t\t fetch(`${ url }/api/movie`, {\n\t\t\t\t\t\t headers: {\n\t\t\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t\t\t\t 'X-Api-Key': token,\n\t\t\t\t\t\t [username? 'Authorization': 'X-Authorization']: `Basic ${ btoa(`${ username }:${ password }`) }`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t imdb: item.imdbId,\n\t\t\t\t\t\t tmdb: item.tmdbId,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t // Charge CouchPotato\n\t\t\t\t\t\t if(options.usingCouchPotato) {\n\t\t\t\t\t\t\t\tlet url = `${ options.couchpotatoURL }/media.list?type=movie&status=active`,\n\t\t\t\t\t\t\t\t\ttype = 'CHARGE_COUCHPOTATO',\n\t\t\t\t\t\t\t\t\tbasicAuth = options.couchpotatoBasicAuth,\n\t\t\t\t\t\t\t\t\tparseJSON = json => {\n\t\t\t\t\t\t\t\t\t\tif(json.error)\n\t\t\t\t\t\t\t\t\t\t\treturn (!json.silent && console.error('Error charging CouchPotato: ' + String(json.error), json));\n\n\t\t\t\t\t\t\t\t\t\tjson.movies.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t\t\t\t\t\t\timdb: item.info.imdb,\n\t\t\t\t\t\t tmdb: item.info.tmdb_id,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tsetTimeout(() =>\n\t\t\t\t\t\t\t\t\t\tchrome.runtime.sendMessage(\n\t\t\t\t\t\t\t\t\t\t\t{ type, url, basicAuth },\n\t\t\t\t\t\t\t\t\t\t\tresponse => parseJSON(response)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t, 10000);\n\t\t\t\t\t\t\t\t} catch(error) {\n\t\t\t\t\t\t\t\t\tawait fetch(url)\n\t\t\t\t\t\t\t\t\t\t.then(response => response.json())\n\t\t\t\t\t\t\t\t\t\t.then(json => parseJSON(json))\n\t\t\t\t\t\t\t\t\t\t.catch(error => { throw error });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t /* TV Shows */\n\t\t\t\t\t\t // Charge Sonarr\n\t\t\t\t\t\t if(options.usingSonarr) {\n\t\t\t\t\t\t let url = options.sonarrURL,\n\t\t\t\t\t\t token = options.sonarrToken,\n\t\t\t\t\t\t username = options.sonarrBasicAuthUsername,\n\t\t\t\t\t\t password = options.sonarrBasicAuthPassword;\n\n\t\t\t\t\t\t fetch(`${ url }/api/series`, {\n\t\t\t\t\t\t headers: {\n\t\t\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t\t\t\t 'X-Api-Key': token,\n\t\t\t\t\t\t [username? 'Authorization': 'X-Authorization']: `Basic ${ btoa(`${ username }:${ password }`) }`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t tvdb: item.tvdbId,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t // Charge Medusa\n\t\t\t\t\t\t if(options.usingMedusa) {\n\t\t\t\t\t\t let url = options.medusaURL,\n\t\t\t\t\t\t token = options.medusaToken,\n\t\t\t\t\t\t username = options.medusaBasicAuthUsername,\n\t\t\t\t\t\t password = options.medusaBasicAuthPassword;\n\n\t\t\t\t\t\t fetch(`${ url }/api/v2/series`, {\n\t\t\t\t\t\t headers: {\n\t\t\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t\t\t\t 'X-Api-Key': token,\n\t\t\t\t\t\t [username? 'Authorization': 'X-Authorization']: `Basic ${ btoa(`${ username }:${ password }`) }`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t json.map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t imdb: item.id.imdb,\n\t\t\t\t\t\t tvdb: item.id.tvdb,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t // Charge SickBeard\n\t\t\t\t\t\t if(options.usingSickBeard) {\n\t\t\t\t\t\t let url = options.sickBeardURL,\n\t\t\t\t\t\t token = options.sickBeardToken,\n\t\t\t\t\t\t username = options.sickBeardBasicAuthUsername,\n\t\t\t\t\t\t password = options.sickBeardBasicAuthPassword;\n\n\t\t\t\t\t\t fetch(`${ url }/api/${ token }/?cmd=shows`, {\n\t\t\t\t\t\t headers: {\n\t\t\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t\t\t\t 'X-Api-Key': token,\n\t\t\t\t\t\t [username? 'Authorization': 'X-Authorization']: `Basic ${ btoa(`${ username }:${ password }`) }`,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t })\n\t\t\t\t\t\t .then(r => r.json())\n\t\t\t\t\t\t .then(json => {\n\t\t\t\t\t\t Object.values(json.data).map(item => {\n\t\t\t\t\t\t CAUGHT.charge({\n\t\t\t\t\t\t tvdb: item.id.tvdbid,\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t });\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tCAUGHT.ALL_CAUGHT = true;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn __CONFIG__ = options;\n\t\t\t\t},\n\t\t\t\terror => {\n\t\t\t\t\tnew Notification(\n\t\t\t\t\t\t'warning',\n\t\t\t\t\t\t'Fill in missing Web to Plex options',\n\t\t\t\t\t\t15000,\n\t\t\t\t\t\tOptions\n\t\t\t\t\t);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t);\n\t}", "commonOptions() {\n let config = this.config;\n let cmd = [];\n\n if (config.datadir) {\n cmd.push(`--datadir=${config.datadir}`);\n }\n\n if (Number.isInteger(config.verbosity) && config.verbosity >= 0 && config.verbosity <= 5) {\n switch (config.verbosity) {\n case 0:\n cmd.push(\"--lvl=crit\");\n break;\n case 1:\n cmd.push(\"--lvl=error\");\n break;\n case 2:\n cmd.push(\"--lvl=warn\");\n break;\n case 3:\n cmd.push(\"--lvl=info\");\n break;\n case 4:\n cmd.push(\"--lvl=debug\");\n break;\n case 5:\n cmd.push(\"--lvl=trace\");\n break;\n default:\n cmd.push(\"--lvl=info\");\n break;\n }\n }\n\n return cmd;\n }", "get parameters(): {} {\n return {\n mean: this.mean,\n mode: this.mode,\n variance: this.variance\n };\n }\n}", "function getOptions() {\n\t\treturn defaultOptions;\n\t}" ]
[ "0.7022471", "0.6510197", "0.57947916", "0.5677672", "0.5633863", "0.5613766", "0.5612137", "0.56063175", "0.56030595", "0.5596381", "0.5594433", "0.558702", "0.55598414", "0.5553571", "0.55411255", "0.55017984", "0.5500522", "0.54437107", "0.54320693", "0.5431934", "0.5397227", "0.5389055", "0.5375168", "0.5340067", "0.53129745", "0.52932435", "0.52817816", "0.5258179", "0.52523386", "0.5250082", "0.5250082", "0.524881", "0.5244462", "0.5233437", "0.5231343", "0.52289295", "0.522632", "0.5212849", "0.5207237", "0.52043766", "0.5199918", "0.51992357", "0.5189966", "0.5184706", "0.5178982", "0.51772", "0.51772", "0.51772", "0.5163747", "0.51519454", "0.515149", "0.514611", "0.5140768", "0.51403433", "0.5134708", "0.5132864", "0.51230514", "0.51202494", "0.51120305", "0.51019454", "0.50960964", "0.50867003", "0.5086113", "0.508375", "0.5069618", "0.5069618", "0.5069618", "0.5069618", "0.5069618", "0.5054815", "0.5054147", "0.50513893", "0.50440204", "0.50421834", "0.50418836", "0.5033624", "0.5025952", "0.50187385", "0.5002068", "0.49994183", "0.49977326", "0.49826702", "0.4973196", "0.49714118", "0.4962711", "0.49592888", "0.49464986", "0.49433267", "0.49420905", "0.49358836", "0.4928146", "0.49256054", "0.49255937", "0.49248928", "0.4924097", "0.49209183", "0.4920419", "0.49197116", "0.49174222" ]
0.68530434
2
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. / Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function defaultKeyGetter(item) { return item; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onChildAppStart () {\n\n }", "get Android() {}", "onMessageStart() { }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "createStream () {\n\n }", "onComponentMount() {\n\n }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "didMount() {\n }", "requestContainerInfo() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "function bridgeAndroidAndIOS() {\r\n\r\n //ios\r\n function setupWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n return callback(WebViewJavascriptBridge);\r\n }\r\n if (window.WVJBCallbacks) {\r\n return window.WVJBCallbacks.push(callback);\r\n }\r\n window.WVJBCallbacks = [callback];\r\n var WVJBIframe = document.createElement('iframe');\r\n WVJBIframe.style.display = 'none';\r\n WVJBIframe.src = 'https://__bridge_loaded__';\r\n document.documentElement.appendChild(WVJBIframe);\r\n setTimeout(function() {\r\n document.documentElement.removeChild(WVJBIframe)\r\n }, 0)\r\n }\r\n\r\n //安卓\r\n function connectWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n callback(WebViewJavascriptBridge)\r\n } else {\r\n document.addEventListener(\r\n 'WebViewJavascriptBridgeReady',\r\n function() {\r\n callback(WebViewJavascriptBridge)\r\n },\r\n false\r\n );\r\n }\r\n }\r\n\r\n function bridgeLog(logContent) {\r\n uni.showModal({\r\n title: \"原始数据\",\r\n content: logContent,\r\n })\r\n }\r\n\r\n switch (uni.getSystemInfoSync().platform) {\r\n case 'android':\r\n connectWebViewJavascriptBridge(function(bridge) {\r\n bridge.init();\r\n bridge.registerHandler(\"GetUser\", function(data, responseCallback) {\r\n if(JSON.parse(data).guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: JSON.parse(data).guid,\r\n token: JSON.parse(data).token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: JSON.parse(data).activityID,\r\n AppCode: JSON.parse(data).AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: JSON.parse(data).Authorization,\r\n statusBarHeight: Number.parseInt(JSON.parse(data).statusBarHeight),\r\n };\r\n });\r\n\r\n })\r\n break;\r\n case 'ios':\r\n setupWebViewJavascriptBridge(function(bridge) {\r\n bridge.registerHandler('GetUser', function(data, responseCallback) {\r\n if(data.guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: data.guid,\r\n token: data.token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: data.activityID,\r\n AppCode: data.AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: data.Authorization,\r\n productID: data.productID,\r\n statusBarHeight: data.statusBarHeight,\r\n };\r\n })\r\n })\r\n break;\r\n default:\r\n console.log('运行在开发者工具上')\r\n break;\r\n }\r\n\r\n}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "constructor(speechCallback, clientId, streamId) {\n console.log(\"in gcloud\");\n const useOpus = false;\n this.clientId = clientId;\n this.streamId = streamId;\n this.isOpen = true;\n\n // Note: \n // 1) The client side detects silence and does a startStream, and endStream\n // The streamId is incremented everytime this happens, \n // so a combination of clientId + streamId can uniquely identify a stream.\n // The server will be transcribing each client's stream in parallel.\n //\n // 2) The streaming API has a limit of 5 minutes. So just before 5 minutes are up\n // there will timer that will close and reopen the stream. Any non final results will\n // we sent again to be re-transcribed,\n // The restartCounter will be incremented every time the stream is restarted. However\n // the streamId will remain the same.\n //\n // 3) Every stream will have set of results. Some results will be final and some won't be\n // After a result is final, that portion of the audio will not be transcribed again by the API\n // each final result will have resultEndTime, - this is time in seconds (and nanoseconds) \n // from the time the stream was started/restarted.\n // Results don'd have a startTime, it is implicit that the startTime is resultEndTime\n // of the last final stream, or 0 if there was no final stream before this\n // We augment the result to add this startTime\n //\n // We also keep a cumulative restartTime, which is the difference betwen the beginning of \n // stream start and begining of the most recent stream restart. And add this to \n // the startTime and endTime. This way the client is completely unaware of the internal restarts\n // \n \n // Have we started/restarted a new stream ?\n this.newStream = true;\n\n // number of times the stream has been restarted\n this.restartCounter = 0;\n\n // audio Input is any array of chunks (buffer)\n this.audioInput = [];\n this.audioInputSize = 0; // total size of all the buffers\n\n // the end time (in seconds) of the last result. \n // the End time is calculated from the beginning of start/restart stream\n this.resultEndTime = 0;\n\n // the end time of the last final result.\n this.finalEndTime = 0;\n\n // the start time (in seconds) of the current result. \n // It is calculated fom beginning of start/restart stream\n this.startTime = 0;\n \n // the time between the of beginning of start stream and the beginning of the most current restart stream.\n this.restartTime = 0;\n\n\n this.lastTranscriptWasFinal = false;\n\n this.restartTimer = null;\n\n this.config = {\n encoding: useOpus ? 'OGG_OPUS' : 'LINEAR16',\n sampleRateHertz: useOpus ? 48000 : 16000,\n languageCode: 'en_us',\n enableAutomaticPunctuation: true,\n speechContexts: [{ phrases: phrases}],\n };\n\n this.request = {\n config : this.config,\n interimResults: true,\n };\n\n this.startStreamInternal();\n }", "constructor() {\n }", "constructor(info) {\n super();\n\n _defineProperty(this, \"_peerConnectionId\", void 0);\n\n _defineProperty(this, \"_reactTag\", void 0);\n\n _defineProperty(this, \"_id\", void 0);\n\n _defineProperty(this, \"_label\", void 0);\n\n _defineProperty(this, \"_maxPacketLifeTime\", void 0);\n\n _defineProperty(this, \"_maxRetransmits\", void 0);\n\n _defineProperty(this, \"_negotiated\", void 0);\n\n _defineProperty(this, \"_ordered\", void 0);\n\n _defineProperty(this, \"_protocol\", void 0);\n\n _defineProperty(this, \"_readyState\", void 0);\n\n _defineProperty(this, \"_subscriptions\", []);\n\n _defineProperty(this, \"binaryType\", 'arraybuffer');\n\n _defineProperty(this, \"bufferedAmount\", 0);\n\n _defineProperty(this, \"bufferedAmountLowThreshold\", 0);\n\n this._peerConnectionId = info.peerConnectionId;\n this._reactTag = info.reactTag;\n this._label = info.label;\n this._id = info.id === -1 ? null : info.id; // null until negotiated.\n\n this._ordered = Boolean(info.ordered);\n this._maxPacketLifeTime = info.maxPacketLifeTime;\n this._maxRetransmits = info.maxRetransmits;\n this._protocol = info.protocol || '';\n this._negotiated = Boolean(info.negotiated);\n this._readyState = info.readyState;\n\n this._registerEvents();\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onChildAppSourceChangeRestart () {\n\n }", "constructor() {\n\n\t}", "async componentDidUpdate() {\n console.log(this.props.directory);\n //this needs to be replaced with environment variable\n const beginingUrl = \"http://10.34.1.30:8080/songs/\";\n const songLoc = this.props.directory + \"/outputlist.m3u8\";\n var hlsUrl = beginingUrl + songLoc;\n var audio = this.player;\n\n //Should this logic be loacated here??This looks hacky,\n const token = await getToken();\n let bearerTokenString = \"Bearer \" + token;\n\n if (Hls.isSupported()) {\n var hls = new Hls({\n // This configuration is required to insure that only the\n // viewer can access the content by sending a session cookie\n // to api.video service\n xhrSetup: function (xhr, url) {\n xhr.setRequestHeader(\"Authorization\", bearerTokenString);\n },\n });\n hls.loadSource(hlsUrl);\n hls.attachMedia(audio);\n hls.on(Hls.Events.MANIFEST_PARSED, function () {\n audio.play();\n });\n } else if (audio.canPlayType(\"application/vnd.apple.mpegurl\")) {\n console.log(\"Nigga we here!!\");\n audio.src = hlsUrl;\n audio.addEventListener(\"loadedmetadata\", function () {\n audio.play();\n });\n }\n }", "onMessageReceive() {}", "constructor() {\n\t}", "constructor() {\n\t}", "componentWillMount() {\n //CodePush.disallowRestart();\n //Alert.alert(\"mounted cool vite OK OK MAINTENANT CA MARCHE !!!!!\");\n/*CodePush.sync(\n{\ndeploymentKey: 'giMb817KrtTFkIuOg4i5ohnEUDyoBJvD1i-VN',\nupdateDialog: true,\ninstallMode: CodePush.InstallMode.IMMEDIATE,\n},\nthis.CodePushStatusDidChange.bind(this),\nthis.CodePushDownloadDidProgress.bind(this)\n);*/\n /* Animated.loop(\n Animated.sequence([\n Animated.timing(this.animatedValue, { toValue: 1, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n Animated.timing(this.animatedValue, { toValue: 0, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n ])).start();*/\n //this.toggleLike(); \n //CodePush.notifyApplicationReady();\n this._onLoadStart();\n }", "function version(){ return \"0.13.0\" }", "get supportStreaming() { return exists && has(WA.instantiateStreaming); }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "onChildAppRestart (/* reason */) {\n\n }", "_init(config) {\n this.name = config.name;\n this.appId = config.appid || config.appId;\n this.serverUrl = config.server_url + '/sync_xcx';\n this.autoTrackProperties = {};\n // cache commands.\n this._queue = [];\n\n if (config.isChildInstance) {\n this._state = {};\n } else {\n logger.enabled = config.enableLog;\n this.instances = []; // 子实例名称\n this._state = {\n getSystemInfo: false,\n initComplete: false,\n };\n systemInfo.getSystemInfo(() => {\n this._updateState({\n getSystemInfo: true,\n });\n });\n\n if (config.autoTrack) {\n this.autoTrack = PlatformAPI.initAutoTrackInstance(this, config);\n } else {\n var launchOptions = PlatformAPI.getAppOptions((options) => {\n if (options && options.scene) {\n this._setAutoTrackProperties({\n '#scene': options.scene,\n });\n }\n\n });\n if (launchOptions.scene) {\n this._setAutoTrackProperties({\n '#scene': launchOptions.scene,\n });\n }\n }\n }\n\n this.store = new ThinkingDataPersistence(config, () => {\n if (this.config.asyncPersistence && _.isFunction(this.config.persistenceComplete)) {\n this.config.persistenceComplete(this);\n }\n this._updateState();\n });\n }", "_addHMRClientCode(data) {\n// If we have it, grab supporting code...\n let prependage = fs.readFileSync('./lib/hmr/clientSocket.js'),\n appendage = fs.readFileSync('./lib/hmr/hmr.js')\n\n// Prepend clientSocket.js to bundle.... Append hmr runtime to bundle\n return `${prependage}${data}${appendage}`\n }", "componentDidMount() {\n this.setState({\n configuration: {\n flow: {\n name: \"sample1\",\n id: \"01\",\n components: [\n {\n type: \"http-listener\",\n id: \"http-list-01\",\n properties: {\n method: \"get\",\n port: 8000,\n path: \"http://localhost\"\n }\n },\n {\n type: \"logger\",\n id: \"logger-01\",\n properties: {\n level: \"info\"\n }\n },\n {\n type: \"file-writer\",\n id: \"file-write-01\",\n properties: {\n location: \"xx\",\n username: \"sachith\",\n password: \"\",\n filename: \"hello.txt\"\n }\n }\n ]\n }\n }\n\n });\n }", "componentWillUnmount(){\n Streaming.disconnect();\n }", "pushStart() {\n Cordova.exec(\n () => {},\n () => {},\n 'SparkProxy',\n 'pushStart',\n []);\n }", "async onReady() {\n // Initialize your adapter here\n // Subsribe to all state changes\n this.subscribeStates('*');\n this.axiosInstance = axios_1.default.create({\n baseURL: `http://${this.config.host}/api/v1/`,\n timeout: 1000\n });\n // try to ping volumio\n const connectionSuccess = await this.pingVolumio();\n if (this.config.checkConnection) {\n let interval = this.config.checkConnectionInterval;\n if (!interval || !isNumber(interval)) {\n this.log.error(`Invalid connection check interval setting. Will be set to 30s`);\n interval = 30;\n }\n this.checkConnectionInterval = setInterval(this.checkConnection, interval * 1000, this);\n }\n // get system infos\n if (connectionSuccess) {\n this.apiGet('getSystemInfo').then(sysInfo => {\n this.setStateAsync('info.id', sysInfo.id, true);\n this.setStateAsync('info.host', sysInfo.host, true);\n this.setStateAsync('info.name', sysInfo.name, true);\n this.setStateAsync('info.type', sysInfo.type, true);\n this.setStateAsync('info.serviceName', sysInfo.serviceName, true);\n this.setStateAsync('info.systemversion', sysInfo.systemversion, true);\n this.setStateAsync('info.builddate', sysInfo.builddate, true);\n this.setStateAsync('info.variant', sysInfo.variant, true);\n this.setStateAsync('info.hardware', sysInfo.hardware, true);\n });\n // get inital player state\n this.updatePlayerState();\n }\n if (this.config.subscribeToStateChanges && this.config.subscriptionPort && connectionSuccess) {\n this.log.debug('Subscription mode is activated');\n try {\n this.httpServerInstance = this.httpServer.listen(this.config.subscriptionPort);\n this.log.debug(`Server is listening on ${ip_1.default.address()}:${this.config.subscriptionPort}`);\n this.subscribeToVolumioNotifications();\n }\n catch (error) {\n this.log.error(`Starting server on ${this.config.subscriptionPort} for subscription mode failed: ${error.message}`);\n }\n }\n else if (this.config.subscribeToStateChanges && !this.config.subscriptionPort) {\n this.log.error('Subscription mode is activated, but port is not configured.');\n }\n else if (!this.config.subscribeToStateChanges && connectionSuccess) {\n this.unsubscribeFromVolumioNotifications();\n }\n this.httpServer.post('/volumiostatus', (req, res) => {\n this.onVolumioStateChange(req.body);\n res.sendStatus(200);\n });\n }", "function IbtRealTimeSJ(){/***********************************************************\n\t * @attributes\n\t ***********************************************************/var appKey;// application key\n\tvar authToken;// authentication token\n\tvar clusterUrl;// cluster URL to connect\n\tvar waitingClusterResponse;// indicates whether is waiting for a cluster response\n\tvar connectionTimeout;// connection timeout in milliseconds\n\tvar messageMaxSize;// message maximum size in bytes\n\tvar channelMaxSize;// channel maximum size in bytes\n\tvar channelsMaxSize;// maximum of channels for batchSend\n\tvar messagesBuffer;// buffer to hold the message parts\n\tvar id;// object identifier\n\tvar isConnected;// indicates whether the client object is connected\n\tvar isConnecting;// indicates whether the client object is connecting\n\tvar alreadyConnectedFirstTime;// indicates whether the client already connected for the first time\n\tvar stopReconnecting;// indicates whether the user disconnected (stop the reconnecting proccess)\n\tvar ortc;// represents the object itself\n\tvar sockjs;// socket connected to\n\tvar url;// URL to connect\n\tvar userPerms;// user permissions\n\tvar connectionMetadata;// connection metadata used to identify the client\n\tvar announcementSubChannel;// announcement subchannel\n\tvar subscribedChannels;// subscribed/subscribing channels\n\tvar lastKeepAlive;// holds the time of the last keep alive received\n\tvar invalidConnection;// indicates whether the connection is valid\n\tvar reconnectIntervalId;// id used for the reconnect interval\n\tvar reconnectStartedAt;// the time which the reconnect started\n\tvar validatedTimeoutId;// id used for the validated timeout\n\tvar validatedArrived;// indicates whether the validated message arrived\n\tvar retryingWithSsl;// indicates whether the connection is being retried with SSL\n\tvar protocol;// protocol to use\n\tvar sslSessionCookieName;// the SSL session cookie name\n\tvar sessionCookieName;// the session cookie name\n\tvar sessionId;// the session ID\n\tvar registrationId;// browser device token for push notifications\n\tvar pushPlatform;// push notifications platform\n\t/***********************************************************\n\t * @attributes initialization\n\t ***********************************************************/sslSessionCookieName=\"ortcssl\";sessionCookieName=\"ortcsession-\";connectionTimeout=5000;messageMaxSize=800;channelMaxSize=100;connectionMetadataMaxSize=256;channelsMaxSize=50;// Time in seconds\n\tvar heartbeatDefaultTime=15;// Heartbeat default interval time\n\tvar heartbeatDefaultFails=3;// Heartbeat default max fails\n\tvar heartbeatMaxTime=60;var heartbeatMinTime=10;var heartbeatMaxFails=6;var heartbeatMinFails=1;var heartbeatTime=heartbeatDefaultTime;// Heartbeat interval time\n\tvar heartbeatFails=heartbeatDefaultFails;// Heartbeat max fails\n\tvar heartbeatInterval=null;// Heartbeat interval\n\tvar heartbeatActive=false;messagesBuffer={};subscribedChannels={};isConnected=false;isConnecting=false;alreadyConnectedFirstTime=false;invalidConnection=false;waitingClusterResponse=false;validatedArrived=false;retryingWithSsl=false;ortc=this;lastKeepAlive=null;userPerms=null;reconnectStartedAt=null;protocol=undefined;pushPlatform=\"GCM\";var delegateExceptionCallback=function(ortcArg,event){if(ortcArg!==null&&ortcArg.onException!==null){ortcArg.onException(ortcArg,event);}};/***********************************************************\n\t * @properties\n\t ***********************************************************/this.getId=function(){return id;};this.setId=function(newId){id=newId;};this.getUrl=function(){return url;};this.setUrl=function(newUrl){url=newUrl;clusterUrl=null;};this.getClusterUrl=function(){return clusterUrl;};this.setClusterUrl=function(newUrl){clusterUrl=newUrl;url=null;};this.getConnectionTimeout=function(){return connectionTimeout;};this.setConnectionTimeout=function(newTimeout){connectionTimeout=newTimeout;};this.getIsConnected=function(){return isConnected&&ortc.sockjs!==null;};this.getConnectionMetadata=function(){return connectionMetadata;};this.setConnectionMetadata=function(newConnectionMetadata){connectionMetadata=newConnectionMetadata;};this.getAnnouncementSubChannel=function(){return announcementSubChannel;};this.setAnnouncementSubChannel=function(newAnnouncementSubChannel){announcementSubChannel=newAnnouncementSubChannel;};this.getProtocol=function(){return protocol;};this.setProtocol=function(newProtocol){protocol=newProtocol;};this.getSessionId=function(){return sessionId;};/*\n\t * Get heartbeat interval.\n\t */this.getHeartbeatTime=function(){return heartbeatTime;};/*\n\t * Set heartbeat interval.\n\t */this.setHeartbeatTime=function(newHeartbeatTime){if(newHeartbeatTime&&!isNaN(newHeartbeatTime)){if(newHeartbeatTime>heartbeatMaxTime||newHeartbeatTime<heartbeatMinTime){delegateExceptionCallback(ortc,`Heartbeat time is out of limits - Min: ${heartbeatMinTime} | Max: ${heartbeatMaxTime}`);}else{heartbeatTime=newHeartbeatTime;}}else{delegateExceptionCallback(ortc,`Invalid heartbeat time ${newHeartbeatTime}`);}};/*\n\t * Get how many times can the client fail the heartbeat.\n\t */this.getHeartbeatFails=function(){return heartbeatFails;};/*\n\t * Set heartbeat fails. Defines how many times can the client fail the heartbeat.\n\t */this.setHeartbeatFails=function(newHeartbeatFails){if(newHeartbeatFails&&!isNaN(newHeartbeatFails)){if(newHeartbeatFails>heartbeatMaxFails||newHeartbeatFails<heartbeatMinFails){delegateExceptionCallback(ortc,`Heartbeat fails is out of limits - Min: ${heartbeatMinFails} | Max: ${heartbeatMaxFails}`);}else{heartbeatFails=newHeartbeatFails;}}else{delegateExceptionCallback(ortc,`Invalid heartbeat fails ${newHeartbeatFails}`);}};/*\n\t * Get heart beat active.\n\t */this.getHeartbeatActive=function(){return heartbeatActive;};/*\n\t * Set heart beat active. Heart beat provides better accuracy for presence data.\n\t */this.setHeartbeatActive=function(active){heartbeatActive=active;};/***********************************************************\n\t * @events\n\t ***********************************************************/this.onConnected=null;this.onDisconnected=null;this.onSubscribed=null;this.onUnsubscribed=null;this.onException=null;this.onReconnecting=null;this.onReconnected=null;/***********************************************************\n\t * @public methods\n\t ***********************************************************//*\n\t * Connects to the gateway with the application key and authentication token.\n\t */this.connect=function(appKey,authToken){/*\n\t Sanity Checks\n\t */if(isConnected){delegateExceptionCallback(ortc,\"Already connected\");}else if(!url&&!clusterUrl){delegateExceptionCallback(ortc,\"URL and Cluster URL are null or empty\");}else if(!appKey){delegateExceptionCallback(ortc,\"Application Key is null or empty\");}else if(!authToken){delegateExceptionCallback(ortc,\"Authentication Token is null or empty\");}else if(url&&!ortcIsValidUrl(url)){delegateExceptionCallback(ortc,\"Invalid URL\");}else if(clusterUrl&&!ortcIsValidUrl(clusterUrl)){delegateExceptionCallback(ortc,\"Invalid Cluster URL\");}else if(!ortcIsValidInput(appKey)){delegateExceptionCallback(ortc,\"Application Key has invalid characters\");}else if(!ortcIsValidInput(authToken)){delegateExceptionCallback(ortc,\"Authentication Token has invalid characters\");}else if(!ortcIsValidInput(announcementSubChannel)){delegateExceptionCallback(ortc,\"Announcement Subchannel has invalid characters\");}else if(connectionMetadata&&connectionMetadata.length>connectionMetadataMaxSize){delegateExceptionCallback(ortc,\"Connection metadata size exceeds the limit of \"+connectionMetadataMaxSize+\" characters\");}else{ortc.appKey=appKey;ortc.authToken=authToken;isConnecting=true;stopReconnecting=false;validatedArrived=false;clearValidatedTimeout(self);// Read SSL session cookie\n\t//var sslConn = readCookie(sslSessionCookieName);\n\tvar sslConn=false;if(sslConn){changeUrlSsl();}if(clusterUrl&&clusterUrl!=null){clusterUrl=clusterUrl.ortcTreatUrl();clusterConnection();}else{url=url.ortcTreatUrl();ortc.sockjs=createSocketConnection(url);}//If ssl connection increase connection timeout\n\tif(clusterUrl&&clusterUrl!=null&&clusterUrl.indexOf(\"/ssl\")>=0||url&&url.indexOf(\"https\")>=0){if(!retryingWithSsl){ortc.setConnectionTimeout(30*1000);}else{if(ortc.getConnectionTimeout()<300*1000){if(ortc.getConnectionTimeout()<30*1000){ortc.setConnectionTimeout(30*1000);}else{ortc.setConnectionTimeout((ortc.getConnectionTimeout()+10)*1000);}}else{stopReconnecting=true;clearReconnectInterval();}}}if(!ortc.reconnectIntervalId&&!stopReconnecting){// Interval to reconnect\n\tortc.reconnectIntervalId=setInterval(function(){if(stopReconnecting){clearReconnectInterval();}else{var currentDateTime=new Date();if(ortc.sockjs==null&&!waitingClusterResponse){reconnectSocket();}// 35 seconds\n\tif(lastKeepAlive!=null&&lastKeepAlive+35000<new Date().getTime()){lastKeepAlive=null;// Server went down\n\tif(isConnected){disconnectSocket();}}}},ortc.getConnectionTimeout());}}};this.setNotificationConfig=function(config){config.cmd=\"config\";this.sendMessageToServiceWorker(config);};this.showNotification=function(notification){notification.cmd=\"notification\";this.sendMessageToServiceWorker(notification);};this.sendMessageToServiceWorker=function(message){return new Promise(function(resolve,reject){var messageChannel=new MessageChannel();messageChannel.port1.onmessage=function(event){if(event.data.error){reject(event.data.error);}else{resolve(event.data);}};navigator.serviceWorker.controller.postMessage(message,[messageChannel.port2]);});};/*\n\t * Subscribes to the channel so the client object can receive all messages sent to it by other clients with Notifications.\n\t */this.subscribeWithNotifications=function(channel,subscribeOnReconnected,regId,onMessageCallback){ortc.registrationId=regId;this._subscribe(channel,subscribeOnReconnected,regId,null,onMessageCallback);};/*\n\t * Subscribes to the channel so the client object can receive all messages sent that are valid according to the given filter\n\t */this.subscribeWithFilter=function(channel,subscribeOnReconnected,filter,onMessageCallback){this._subscribe(channel,subscribeOnReconnected,null,filter,onMessageCallback);};/*\n\t * Subscribes to the channel so the client object can receive all messages sent to it by other clients.\n\t */this.subscribe=function(channel,subscribeOnReconnected,onMessageCallback){this._subscribe(channel,subscribeOnReconnected,null,null,onMessageCallback);};this._subscribe=function(channel,subscribeOnReconnected,regId,filter,onMessageCallback){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribing){delegateExceptionCallback(ortc,\"Already subscribing to the channel \\\"\"+channel+\"\\\"\");}else if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed){delegateExceptionCallback(ortc,\"Already subscribed to the channel \\\"\"+channel+\"\\\"\");}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else if(!ortcIsValidBoolean(subscribeOnReconnected)){delegateExceptionCallback(ortc,\"The argument \\\"subscribeOnReconnected\\\" must be a boolean\");}else if(!ortcIsFunction(onMessageCallback)){delegateExceptionCallback(ortc,\"The argument \\\"onMessageCallback\\\" must be a function\");}else{if(ortc.sockjs!=null){var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){delegateExceptionCallback(ortc,\"No permission found to subscribe to the channel \\\"\"+channel+\"\\\"\");}else{if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=true;subscribedChannels[channel].isSubscribed=false;subscribedChannels[channel].subscribeOnReconnected=subscribeOnReconnected;subscribedChannels[channel].onMessageCallback=onMessageCallback;subscribedChannels[channel].filter=filter;}else{subscribedChannels[channel]={\"isSubscribing\":true,\"isSubscribed\":false,\"subscribeOnReconnected\":subscribeOnReconnected,\"onMessageCallback\":onMessageCallback,\"filter\":filter};}if(regId){subscribedChannels[channel].withNotifications=true;ortc.sockjs.send(\"subscribe;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+regId+\";\"+pushPlatform);}else{subscribedChannels[channel].withNotifications=false;if(filter){ortc.sockjs.send(\"subscribefilter;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+filter);}else{ortc.sockjs.send(\"subscribe;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm);}}}}}};/*\n\t * Unsubscribes from the channel so the client object stops receiving messages sent to it.\n\t */this.unsubscribe=function(channel){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(!subscribedChannels[channel]||subscribedChannels[channel]&&!subscribedChannels[channel].isSubscribed){delegateExceptionCallback(ortc,\"Not subscribed to the channel \"+channel);}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else{if(ortc.sockjs!=null){if(subscribedChannels[channel].withNotifications==true){ortc.sockjs.send(\"unsubscribe;\"+ortc.appKey+\";\"+channel+\";\"+ortc.registrationId+\";\"+pushPlatform);}else{ortc.sockjs.send(\"unsubscribe;\"+ortc.appKey+\";\"+channel);}}}};/*\n\t * Sends the message to the channel.\n\t */this.send=function(channel,message){/*\n\t Sanity Checks\n\t */if(!isConnected||ortc.sockjs==null){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(!message){delegateExceptionCallback(ortc,\"Message is null or empty\");}else if(!ortcIsString(message)){delegateExceptionCallback(ortc,\"Message must be a string\");}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else{var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){delegateExceptionCallback(ortc,\"No permission found to send to the channel \\\"\"+channel+\"\\\"\");}else{// Multi part\n\tvar messageParts=[];var messageId=generateId(8);var i;var allowedMaxSize=messageMaxSize-channel.length;for(i=0;i<message.length;i=i+allowedMaxSize){// Just one part\n\tif(message.length<=allowedMaxSize){messageParts.push(message);break;}if(message.substring(i,i+allowedMaxSize)){messageParts.push(message.substring(i,i+allowedMaxSize));}}for(var j=1;j<=messageParts.length;j++){ortc.sockjs.send(\"send;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+messageId+\"_\"+j+\"-\"+messageParts.length+\"_\"+messageParts[j-1]);}}}};/*\n\t * Sends the message to multiple channels.\n\t */this.batchSend=function(channels,message){/*\n\t Sanity Checks\n\t */channels=ortcStrToArray(channels);if(!isConnected||ortc.sockjs==null){delegateExceptionCallback(ortc,\"Not connected\");}else if(!ortcIsArray(channels)){delegateExceptionCallback(ortc,\"Channels must be a array\");}else if(!message){delegateExceptionCallback(ortc,\"Message is null or empty\");}else if(!ortcIsString(message)){delegateExceptionCallback(ortc,\"Message must be a string\");}else if(channels.length<=0){delegateExceptionCallback(ortc,\"Channels must be an array at least with one channel\");}else if(channels.length>channelsMaxSize){channels=[];delegateExceptionCallback(ortc,\"The channel maximum was reached (>\"+channelsMaxSize+\")\");}for(i=0;i<channels.length;i++){var channel=channels[i];if(channel.length>channelMaxSize){channels.splice(i,1);delegateExceptionCallback(ortc,\"Channel \"+channel+\" size exceeds the limit of \"+channelMaxSize+\" characters\");}}if(channels.length>0){var arrayHashPerm=[];for(i=0;i<channels.length;i++){var channel=channels[i];var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){channels.splice(i,1);delegateExceptionCallback(ortc,\"No permission found to send to the channel \\\"\"+channel+\"\\\"\");}else{arrayHashPerm.push(hashPerm);}}if(channels.length>0){var messageParts=[];var messageId=generateId(8);var allowedMaxSize=messageMaxSize-channels.toString().length;for(i=0;i<message.length;i=i+allowedMaxSize){// Just one part\n\tif(message.length<=allowedMaxSize){messageParts.push(message);break;}if(message.substring(i,i+allowedMaxSize)){messageParts.push(message.substring(i,i+allowedMaxSize));}}for(j=1;j<=messageParts.length;j++){ortc.sockjs.send(\"batchSend;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+JSON.stringify(channels)+\";\"+JSON.stringify(arrayHashPerm)+\";\"+messageId+\"_\"+j+\"-\"+messageParts.length+\"_\"+messageParts[j-1]);}}}};/*\n\t * Disconnects from the gateway.\n\t */this.disconnect=function(){clearReconnectInterval();stopReconnectProcess();// Clear subscribed channels\n\tsubscribedChannels={};/*\n\t Sanity Checks\n\t */if(!isConnected&&!invalidConnection){delegateExceptionCallback(ortc,\"Not connected\");}else{disconnectSocket();}};/*\n\t * Gets a value indicating whether this client object is subscribed to the channel.\n\t */this.isSubscribed=function(channel){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else{if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed){return subscribedChannels[channel].isSubscribed;}else{return false;}}};/*\n\t * Gets a json indicating the subscriptions in a channel.\n\t */this.presence=function(parameters,callback){try{var requestUrl=null,isCluster=false,appKey=ortc.appKey,authToken=ortc.authToken;if(parameters.url){requestUrl=parameters.url.ortcTreatUrl();isCluster=parameters.isCluster;appKey=parameters.applicationKey;authToken=parameters.authenticationToken;}else{if(clusterUrl&&clusterUrl!=null){requestUrl=clusterUrl;isCluster=true;}else{requestUrl=url.ortcTreatUrl();;}}getServerUrl({requestUrl:requestUrl,isCluster:isCluster,appKey:appKey},function(error,serverUrl){if(error){callback(error,null);}else{jsonp(serverUrl+\"/presence/\"+appKey+\"/\"+authToken+\"/\"+parameters.channel,callback);}});}catch(e){callback(\"Unable to get presence data\",null);}};var getServerUrl=function(parameters,callback){if(parameters.requestUrl&&parameters.isCluster){var guid=generateGuid();var queryString=\"guid=\"+generateGuid();queryString=parameters.appKey?queryString+\"&appkey=\"+parameters.appKey:queryString;loadClusterServerScript(parameters.requestUrl+\"/?\"+queryString,guid,function(clusterServerResolved,scriptGuid){if(clusterServerResolved){var resultUrl=SOCKET_SERVER;callback(null,resultUrl);}else{callback(null,\"Unable to get server from cluster\");}try{clearScripts(scriptGuid);}catch(loadError){}});}else{var resultUrl=parameters.requestUrl.ortcTreatUrl();callback(null,resultUrl);}};/*\n\t * Adds the Webspectator bootstrap script for the outmost frame on the same domain.\n\t */this.setMonetizerId=function(publicId){var tempWin;var win=tempWin=window;while(tempWin!=window.top){try{if(tempWin.frameElement){win=tempWin.parent;}}catch(e){}tempWin=tempWin.parent;}if(!win._WS_BOOT){var s=document.createElement(\"SCRIPT\");s.src=\"//wfpscripts.webspectator.com/bootstrap/ws-\"+publicId+\".js\";document.getElementsByTagName(\"head\")[0].appendChild(s);}};/***********************************************************\n\t * @private methods\n\t ***********************************************************//*\n\t * Change the current URL to use SSL\n\t */var changeUrlSsl=function(){if(!(\"ActiveXObject\"in window)){if(clusterUrl&&clusterUrl!=null){//clusterUrl = clusterUrl.replace(\"http://\", \"https://\");\n\tif(clusterUrl.indexOf(\"ssl/\")<0){var slashAtTheEnd=clusterUrl.search(/\\/([\\d.]*)\\/$/);if(slashAtTheEnd>-1){clusterUrl=clusterUrl.substring(0,slashAtTheEnd+1)+\"ssl/\"+clusterUrl.substring(slashAtTheEnd+1,clusterUrl.length);}else{clusterUrl=clusterUrl.substring(0,clusterUrl.lastIndexOf(\"/\")+1)+\"ssl/\"+clusterUrl.substring(clusterUrl.lastIndexOf(\"/\")+1);}}}else{url=url.replace(\"http://\",\"https://\");}}// Create session cookie\n\t//createSessionCookie(sslSessionCookieName, 1);\n\t};/*\n\t * Clear the reconnecting interval\n\t */var clearReconnectInterval=function(){if(ortc.reconnectIntervalId){clearInterval(ortc.reconnectIntervalId);ortc.reconnectIntervalId=null;}};/*\n\t * Clear the validated timeout\n\t */var clearValidatedTimeout=function(self){if(self.validatedTimeoutId){clearTimeout(self.validatedTimeoutId);self.validatedTimeoutId=null;}};/*\n\t * Stop the reconnecting process\n\t */var stopReconnectProcess=function(){stopReconnecting=true;alreadyConnectedFirstTime=false;};var startHeartBeatInterval=function(self){if(!self.heartbeatInterval&&heartbeatActive){self.sockjs.send(\"b\");self.heartbeatInterval=setInterval(function(){if(!heartbeatActive){stopHeartBeatInterval(self);}else{self.sockjs.send(\"b\");}},heartbeatTime*1000);}};var stopHeartBeatInterval=function(self){if(self.heartbeatInterval){clearInterval(self.heartbeatInterval);self.heartbeatInterval=null;}};/*\n\t * Creates a cookie with expiration time.\n\t */var createExpireCookie=function(name,value,minutes){var expires=\"\";if(minutes){var date=new Date();date.setTime(date.getTime()+minutes*60*1000);expires=\"; expires=\"+date.toGMTString();}document.cookie=name+\"=\"+value+expires+\"; path=/\";};/*\n\t * Creates a session cookie.\n\t */var createSessionCookie=function(name,value){document.cookie=name+\"=\"+value+\"; path=/\";};/*\n\t * Reads a cookie.\n\t */var readCookie=function(name){var nameEQ=name+\"=\";var ca=document.cookie.split(\";\");var result=null;for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==\" \"){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)==0){result=c.substring(nameEQ.length,c.length);break;}}return result;};/*\n\t * Generates an ID.\n\t */var generateId=function(size){var result=\"\";var S4=function(){return((1+Math.random())*0x10000|0).toString(16).substring(1);};for(var i=0;i<size/4;i++){result+=S4();}return result;};/*\n\t * Disconnects the socket.\n\t */var disconnectSocket=function(){stopHeartBeatInterval(ortc);reconnectStartedAt=null;isConnected=false;isConnecting=false;validatedArrived=false;retryingWithSsl=false;clearValidatedTimeout(self);if(ortc.sockjs!=null){ortc.sockjs.close();ortc.sockjs=null;}};/*\n\t * Reconnects the socket.\n\t */var reconnectSocket=function(){stopHeartBeatInterval(ortc);if(isConnecting){delegateExceptionCallback(ortc,\"Unable to connect\");}isConnecting=true;delegateReconnectingCallback(ortc);reconnectStartedAt=new Date().getTime();if(clusterUrl&&clusterUrl!=null){clusterConnection();}else{ortc.sockjs=createSocketConnection(url);}};/*\n\t * Tries a connection through the cluster gateway with the application key and authentication token.\n\t */var clusterConnection=function(){var guid=generateGuid();var queryString=\"guid=\"+generateGuid();queryString=ortc.appKey?queryString+\"&appkey=\"+ortc.appKey:queryString;loadClusterServerScript(clusterUrl+\"/?\"+queryString,guid,function(clusterServerResolved,scriptGuid){if(clusterServerResolved){url=SOCKET_SERVER;sockjs=createSocketConnection(ortc.getUrl());}try{clearScripts(scriptGuid);}catch(loadError){}});};/*\n\t * Clears the javascript scripts previously loaded into the page.\n\t */var clearScripts=function(guid){var headChildren=document.getElementsByTagName(\"head\")[0].children;var childrenToRemove=[];for(var i=0;i<headChildren.length;i++){if(headChildren[i].attributes!=null&&headChildren[i].attributes[\"ortcScriptId\"]&&headChildren[i].attributes[\"ortcScriptId\"].value==guid){childrenToRemove.push(i);}}for(var child in childrenToRemove){document.getElementsByTagName(\"head\")[0].removeChild(headChildren[childrenToRemove[child]]);}};/*\n\t * Loads the cluster server javascript script into the page.\n\t */var loadClusterServerScript=function(scriptUrl,guid,callback){var script=document.createElement(\"script\");script.type=\"text/javascript\";script.setAttribute(\"ortcScriptId\",guid);waitingClusterResponse=true;if(script.readyState){// IE\n\tscript.onreadystatechange=function(){if(script.readyState==\"loaded\"||script.readyState==\"complete\"){waitingClusterResponse=false;script.onreadystatechange=null;if(typeof SOCKET_SERVER!=\"undefined\"&&SOCKET_SERVER.indexOf(\"undefined\")<0&&SOCKET_SERVER.indexOf(\"unknown_server\")<0){callback(true,guid);}else{callback(false,guid);}}};}else{// Others\n\tscript.onload=function(){waitingClusterResponse=false;if(typeof SOCKET_SERVER!=\"undefined\"&&SOCKET_SERVER.indexOf(\"undefined\")<0&&SOCKET_SERVER.indexOf(\"unknown_server\")<0){callback(true,guid);}else{callback(false,guid);}};}script.onerror=function(){waitingClusterResponse=false;};script.src=scriptUrl;document.getElementsByTagName(\"head\")[0].appendChild(script);};/*\n\t * Generates a GUID.\n\t */var generateGuid=function(){var S4=function(){return((1+Math.random())*0x10000|0).toString(16).substring(1);};return S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4();};/*\n\t * Count the dictionary keys.\n\t */var countKeys=function(dic){var count=0;for(var i in dic){count++;}return count;};/*\n\t * Creates a socket connection.\n\t */var createSocketConnection=function(connectionUrl){var self=ortc;if(self.sockjs==null){if(navigator&&navigator.userAgent&&navigator.userAgent.indexOf(\"PlayStation Vita\")>=0){protocol=\"jsonp-polling\";}self.sockjs=new SockJS(connectionUrl+\"/broadcast\",protocol);// Timeout to receive the validated message\n\tif(!self.sslFallback){var validateTimeoutTime=5000;self.validatedTimeoutId=setTimeout(function(){self.sslFallback=true;stopReconnectProcess();disconnectSocket();invalidConnection=true;retryingWithSsl=true;if(connectionUrl.indexOf(\"https://\")>=0){// We are already using SSL, try streaming\n\tprotocol=\"xhr-streaming\";}else{protocol=undefined;}changeUrlSsl();},validateTimeoutTime);}else if(!self.xhrStreamingFallback){// The SSL fallback failed. Try xhr-streaming\n\tvar validateSslTimeoutTime=5000;self.validatedTimeoutId=setTimeout(function(){self.xhrStreamingFallback=true;stopReconnectProcess();disconnectSocket();invalidConnection=true;retryingWithSsl=true;protocol=\"xhr-streaming\";},validateSslTimeoutTime);}// Connect handler\n\tself.sockjs.onopen=function(){protocol=self.sockjs.protocol;// Update last keep alive time\n\tlastKeepAlive=new Date().getTime();// If is a reconnect do not count session\n\tif(alreadyConnectedFirstTime){sessionId=\"\";}else{// Read session cookie\n\tsessionId=readCookie(sessionCookieName+self.appKey+\"-s\");if(!sessionId){// Read expiration cookie\n\tsessionId=readCookie(sessionCookieName+self.appKey);if(!sessionId){sessionId=generateId(16);}// Create session cookie\n\tcreateSessionCookie(sessionCookieName+self.appKey+\"-s\",sessionId);// Check if session cookie was created\n\tif(!readCookie(sessionCookieName+self.appKey+\"-s\")){sessionId=\"\";}}}var heartbeatDetails=heartbeatActive?\";\"+self.getHeartbeatTime()+\";\"+self.getHeartbeatFails()+\";\":\"\";self.sockjs.send(\"validate;\"+self.appKey+\";\"+self.authToken+\";\"+(announcementSubChannel?announcementSubChannel:\"\")+\";\"+sessionId+\";\"+connectionMetadata+heartbeatDetails);};// Disconnect handler\n\tself.sockjs.onclose=function(e){// e.code=1000 - e.reason=Normal closure\n\t// e.code=1006 - e.reason=WebSocket connection broken\n\t// e.code=2000 - e.reason=All transports failed\n\tstopHeartBeatInterval(ortc);if(ortc.sockjs!=null){ortc.sockjs.close();ortc.sockjs=null;}// Clear user permissions\n\tuserPerms=null;if(e.code!=1000){if(isConnected){isConnected=false;isConnecting=false;protocol=undefined;delegateDisconnectedCallback(self);}if(!stopReconnecting){if(!reconnectStartedAt||reconnectStartedAt+connectionTimeout<new Date().getTime()){reconnectSocket();}}}else{if(!invalidConnection){isConnected=false;isConnecting=false;protocol=undefined;delegateDisconnectedCallback(self);}}if(retryingWithSsl){self.connect(self.appKey,self.authToken);retryingWithSsl=false;}invalidConnection=false;};// Receive handler\n\tself.sockjs.onmessage=function(e){// Update last keep alive time\n\tlastKeepAlive=new Date().getTime();var data=e.data;var channel=data.ch;var message=data.m;var filtered=data.f;// Multi part\n\tvar regexPattern=/^(\\w[^_]*)_{1}(\\d*)-{1}(\\d*)_{1}([\\s\\S.]*)$/;var match=regexPattern.exec(message);var messageId=null;var messageCurrentPart=1;var messageTotalPart=1;var lastPart=false;if(match&&match.length>0){if(match[1]){messageId=match[1];}if(match[2]){messageCurrentPart=match[2];}if(match[3]){messageTotalPart=match[3];}if(match[4]){message=match[4];}}if(messageId){if(!messagesBuffer[messageId]){messagesBuffer[messageId]={};}messagesBuffer[messageId][messageCurrentPart]=message;if(countKeys(messagesBuffer[messageId])==messageTotalPart){lastPart=true;}}else{lastPart=true;}if(lastPart){if(messageId){message=\"\";for(var i=1;i<=messageTotalPart;i++){message+=messagesBuffer[messageId][i];delete messagesBuffer[messageId][i];}delete messagesBuffer[messageId];}delegateMessagesCallback(self,channel,filtered,message);}};self.sockjs.onortcsubscribed=function(e){lastKeepAlive=new Date().getTime();var channel=e.data;if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;subscribedChannels[channel].isSubscribed=true;}delegateSubscribedCallback(self,channel);};self.sockjs.onortcunsubscribed=function(e){lastKeepAlive=new Date().getTime();var channel=e.data;if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribed=false;}delegateUnsubscribedCallback(self,channel);};self.sockjs.onheartbeat=function(){lastKeepAlive=new Date().getTime();};self.sockjs.onortcvalidated=function(e){var sessionExpirationTime=30;if(e.data){userPerms=e.data;}if(e.set){sessionExpirationTime=e.set;}clearValidatedTimeout(self);validatedArrived=true;retryingWithSsl=false;isConnecting=false;isConnected=true;reconnectStartedAt=null;if(sessionId){if(!readCookie(sessionCookieName+self.appKey+\"-s\")){createSessionCookie(sessionCookieName+self.appKey+\"-s\",sessionId);}if(!readCookie(sessionCookieName+self.appKey)){createExpireCookie(sessionCookieName+self.appKey,sessionId,sessionExpirationTime);}}if(alreadyConnectedFirstTime){var channelsToRemove={};// Subscribe to the previously subscribed channels\n\tfor(var key in subscribedChannels){// Subscribe again\n\tif(subscribedChannels[key].subscribeOnReconnected==true&&(subscribedChannels[key].isSubscribing||subscribedChannels[key].isSubscribed)){subscribedChannels[key].isSubscribing=true;subscribedChannels[key].isSubscribed=false;var domainChannelCharacterIndex=key.indexOf(\":\");var channelToValidate=key;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=key.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[key];}if(subscribedChannels[key].filter){self.sockjs.send(\"subscribefilter;\"+self.appKey+\";\"+self.authToken+\";\"+key+\";\"+hashPerm+\";\"+subscribedChannels[key].filter);}else{self.sockjs.send(\"subscribe;\"+self.appKey+\";\"+self.authToken+\";\"+key+\";\"+hashPerm);}}else{channelsToRemove[key]=key;}}for(var keyToRemove in channelsToRemove){delete subscribedChannels[keyToRemove];}messagesBuffer={};delegateReconnectedCallback(self);}else{alreadyConnectedFirstTime=true;delegateConnectedCallback(self);}};self.sockjs.onortcerror=function(e){lastKeepAlive=new Date().getTime();var data=e.data;var operation=data.op;var channel=data.ch;var error=data.ex?data.ex:data;delegateExceptionCallback(self,error);switch(operation){case\"validate\":if(error.indexOf(\"busy\")<0){invalidConnection=true;clearValidatedTimeout(self);retryingWithSsl=false;stopReconnectProcess();}else{clearValidatedTimeout(self);retryingWithSsl=false;}break;case\"subscribe\":if(channel&&subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;}break;case\"subscribe_maxsize\":case\"unsubscribe_maxsize\":case\"shutdown\":clearValidatedTimeout(self);retryingWithSsl=false;break;case\"send_maxsize\":if(channel&&subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;}stopReconnectProcess();break;default:break;}};}return self.sockjs;};var jsonp=function(url,callback){var head=document.head?document.head:document.getElementsByTagName(\"head\")[0];var script=document.createElement(\"script\");var guid=\"ortcJsonp\"+ +new Date();var jsonpCallTimeout=setTimeout(function(){try{callback(\"Unable to get data\",null);window[guid]=undefined;delete window[guid];head.removeChild(script);}catch(e){}},15*1000);window[guid]=function(data){clearTimeout(jsonpCallTimeout);if(data.error){callback(data.error,null);}else{callback(null,data.content);}try{window[guid]=undefined;delete window[guid];head.removeChild(script);}catch(e){}};script.setAttribute(\"src\",url+\"?callback=\"+guid);head.appendChild(script);};var delegateConnectedCallback=function(ortc){if(ortc!=null&&ortc.onConnected!=null){startHeartBeatInterval(ortc);ortc.onConnected(ortc);}};var delegateDisconnectedCallback=function(ortc){if(ortc!=null&&ortc.onDisconnected!=null){ortc.onDisconnected(ortc);}};var delegateSubscribedCallback=function(ortc,channel){if(ortc!=null&&ortc.onSubscribed!=null&&channel!=null){ortc.onSubscribed(ortc,channel);}};var delegateUnsubscribedCallback=function(ortc,channel){if(ortc!=null&&ortc.onUnsubscribed!=null&&channel!=null){ortc.onUnsubscribed(ortc,channel);}};var delegateMessagesCallback=function(ortc,channel,filtered,message){if(ortc!=null&&subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed&&subscribedChannels[channel].onMessageCallback!=null){if(filtered==null){// regular subscription\n\tsubscribedChannels[channel].onMessageCallback(ortc,channel,message);}else{// filtered subscription\n\tsubscribedChannels[channel].onMessageCallback(ortc,channel,filtered,message);}}};var delegateExceptionCallback=function(ortc,event){if(ortc!=null&&ortc.onException!=null){ortc.onException(ortc,event);}};var delegateReconnectingCallback=function(ortc){if(ortc!=null&&ortc.onReconnecting!=null){ortc.onReconnecting(ortc);}};var delegateReconnectedCallback=function(ortc){if(ortc!=null&&ortc.onReconnected!=null){startHeartBeatInterval(ortc);ortc.onReconnected(ortc);}};}", "componentDidMount() {\n //setLocalNotification();\n }", "function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\n\t\tMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n\t\t{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\t\t\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n\t\t(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n<s.length;n++)g=s[n],f==\"a.contentType\"?(h&&(h+=\",\"+g),w[g]=e[f]):a==\"view\"||a==\"segmentView\"||a==\"clicked\"||a==\"complete\"||a==\"timePlayed\"||a==\"CPM\"?(d&&(d+=\",\"+\r\n\t\tg),a==\"timePlayed\"||a==\"CPM\"?e[f]&&(w.events2+=(w.events2?\",\":\"\")+g+\"=\"+e[f]):e[f]&&(w.events2+=(w.events2?\",\":\"\")+g)):a==\"segment\"&&e[f+\"Num\"]?(h&&(h+=\",\"+g),w[g]=e[f+\"Num\"]+\":\"+e[f]):(h&&(h+=\",\"+g),w[g]=e[f])}else if(a==\"milestones\"||a==\"offsetMilestones\")f=f.substring(0,f.length-1),e[f]&&m.contextDataMapping[f+\"s\"][e[f]]&&(d&&(d+=\",\"+m.contextDataMapping[f+\"s\"][e[f]]),w.events2+=(w.events2?\",\":\"\")+m.contextDataMapping[f+\"s\"][e[f]]);e[f]&&(e[f]=0);a==\"segment\"&&e[f+\"Num\"]&&(e[f+\"Num\"]=0)}}w.linkTrackVars=\r\n\t\th;w.linkTrackEvents=d};m.g=function(w,b,c,h,d){var a={},g=(new Date).getTime()/1E3,e,f,s=m.trackVars,n=m.trackEvents,o=m.trackSeconds,p=m.trackMilestones,q=m.trackOffsetMilestones,r=m.segmentByMilestones,t=m.segmentByOffsetMilestones,k,j,l=1,i={},u;if(!m.channel)m.channel=m.s.w.location.hostname;if(a=w&&m.list&&m.list[w]?m.list[w]:0){if(a.l)o=m.adTrackSeconds,p=m.adTrackMilestones,q=m.adTrackOffsetMilestones,r=m.adSegmentByMilestones,t=m.adSegmentByOffsetMilestones;c<0&&(c=a.j==1&&a.r>0?g-a.r+a.a:\r\n\t\ta.a);a.length>0&&(c=c<a.length?c:a.length);c<0&&(c=0);a.u=c;if(a.length>0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\t\t\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f/a.length*100<e&&a.c>=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f<e&&c>=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j<k.length;j++)if(e=k[j]?parseFloat(\"\"+\r\n\t\tk[j]):0){if(a.c<e)h=j+1,d=\"M:\"+f+\"-\"+e,j=k.length;f=e}}}else if(t&&q&&(k=q.split(\",\"))){k.push(\"\"+(a.length>0?a.length:\"E\"));for(j=f=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)||k[j]==\"E\"){if(c<e||k[j]==\"E\")h=j+1,d=\"O:\"+f+\"-\"+e,j=k.length;f=e}}if(d)a.K=!0}if((d||a.e)&&d!=a.e){a.D=!0;if(!a.e)a.m=h,a.e=d;a.k>=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a<c)a.L+=c-a.a,a.f+=c-a.a;if(b<=2||b==3&&!a.j)a.B+=(b==1||b==3?\"S\":\"E\")+Math.floor(c),a.j=b==3?1:b;if(!l&&a.k>=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\t\t\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\n\t\ta.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\n\t\tb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\n\t\tb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b<w.length;b++)m.attach(w[b])};m.i(s,\"load\",m.N)}", "constructor(httpClient) {\n this.httpClient = httpClient;\n //public url_base = \"http://localhost:8080\";\n this.url_base = \"https://yaoyuan333.wm.r.appspot.com\";\n }", "function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\nMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n<s.length;n++)g=s[n],f==\"a.contentType\"?(h&&(h+=\",\"+g),w[g]=e[f]):a==\"view\"||a==\"segmentView\"||a==\"clicked\"||a==\"complete\"||a==\"timePlayed\"||a==\"CPM\"?(d&&(d+=\",\"+\r\ng),a==\"timePlayed\"||a==\"CPM\"?e[f]&&(w.events2+=(w.events2?\",\":\"\")+g+\"=\"+e[f]):e[f]&&(w.events2+=(w.events2?\",\":\"\")+g)):a==\"segment\"&&e[f+\"Num\"]?(h&&(h+=\",\"+g),w[g]=e[f+\"Num\"]+\":\"+e[f]):(h&&(h+=\",\"+g),w[g]=e[f])}else if(a==\"milestones\"||a==\"offsetMilestones\")f=f.substring(0,f.length-1),e[f]&&m.contextDataMapping[f+\"s\"][e[f]]&&(d&&(d+=\",\"+m.contextDataMapping[f+\"s\"][e[f]]),w.events2+=(w.events2?\",\":\"\")+m.contextDataMapping[f+\"s\"][e[f]]);e[f]&&(e[f]=0);a==\"segment\"&&e[f+\"Num\"]&&(e[f+\"Num\"]=0)}}w.linkTrackVars=\r\nh;w.linkTrackEvents=d};m.g=function(w,b,c,h,d){var a={},g=(new Date).getTime()/1E3,e,f,s=m.trackVars,n=m.trackEvents,o=m.trackSeconds,p=m.trackMilestones,q=m.trackOffsetMilestones,r=m.segmentByMilestones,t=m.segmentByOffsetMilestones,k,j,l=1,i={},u;if(!m.channel)m.channel=m.s.w.location.hostname;if(a=w&&m.list&&m.list[w]?m.list[w]:0){if(a.l)o=m.adTrackSeconds,p=m.adTrackMilestones,q=m.adTrackOffsetMilestones,r=m.adSegmentByMilestones,t=m.adSegmentByOffsetMilestones;c<0&&(c=a.j==1&&a.r>0?g-a.r+a.a:\r\na.a);a.length>0&&(c=c<a.length?c:a.length);c<0&&(c=0);a.u=c;if(a.length>0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f/a.length*100<e&&a.c>=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f<e&&c>=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j<k.length;j++)if(e=k[j]?parseFloat(\"\"+\r\nk[j]):0){if(a.c<e)h=j+1,d=\"M:\"+f+\"-\"+e,j=k.length;f=e}}}else if(t&&q&&(k=q.split(\",\"))){k.push(\"\"+(a.length>0?a.length:\"E\"));for(j=f=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)||k[j]==\"E\"){if(c<e||k[j]==\"E\")h=j+1,d=\"O:\"+f+\"-\"+e,j=k.length;f=e}}if(d)a.K=!0}if((d||a.e)&&d!=a.e){a.D=!0;if(!a.e)a.m=h,a.e=d;a.k>=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a<c)a.L+=c-a.a,a.f+=c-a.a;if(b<=2||b==3&&!a.j)a.B+=(b==1||b==3?\"S\":\"E\")+Math.floor(c),a.j=b==3?1:b;if(!l&&a.k>=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\na.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\nb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\nb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b<w.length;b++)m.attach(w[b])};m.i(s,\"load\",m.N)}", "create () {\r\n // Send a create-job message to the native-app.\r\n openPort();\r\n return browser.storage.local.get({ props: {} }).then(result => {\r\n // Get a cookie jar for the job.\r\n return getCookieJarForVideo(this.props.videoUrl).then(cookieJar => {\r\n state.port.postMessage({\r\n topic: 'create-job',\r\n data: {\r\n jobId: this.id,\r\n // Merge the default props and the job props.\r\n props: Object.assign({ cookieJar }, result.props, this.props)\r\n }\r\n });\r\n \r\n // Flag this job as active.\r\n this.state = 'active';\r\n \r\n // Make the icon blue because a job is running.\r\n browser.browserAction.setIcon({\r\n path: 'icons/film-blue.svg'\r\n });\r\n });\r\n });\r\n }", "supportsPlatform() {\n return true;\n }", "function FileSystemService($http, $q, $log) {\n var _directory = LocalFileSystem.PERSISTENT;\n var _fs = null;\n var _that = this;\n\n this.isInitalized = false;\n\n function errorHandler(e) {\n var msg = '';\n\n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n msg = 'QUOTA_EXCEEDED_ERR';\n break;\n case FileError.NOT_FOUND_ERR:\n msg = 'NOT_FOUND_ERR';\n break;\n case FileError.SECURITY_ERR:\n msg = 'SECURITY_ERR';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n msg = 'INVALID_MODIFICATION_ERR';\n break;\n case FileError.INVALID_STATE_ERR:\n msg = 'INVALID_STATE_ERR';\n break;\n default:\n msg = 'Unknown Error';\n break;\n };\n\n $log.error('FileSystemService: ' + msg);\n }\n\n // startup\n window.requestFileSystem(_directory, 0, function(fs){\n _fs = fs;\n _that.isInitalized = true;\n }, errorHandler);\n\n\n /**\n * Checks if file is in persistent storage\n */\n this.fileExists = function(filename) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n //var uri = _directory + \"/\" + filename;\n //return $http.get(uri);\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {}, function(fileEntry) {\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n deferred.resolve(e.target.result);\n };\n\n reader.readAsDataURL(file);\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n\n /**\n * Get File from perstistent storage\n */\n this.getFile = function(filename) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n //var uri = _directory + \"/\" + filename;\n //return $http.get(uri);\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {}, function(fileEntry) {\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n deferred.resolve(e.target.result);\n };\n\n reader.readAsDataURL(file);\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n\n /**\n * Save data into file (and create that if necessary).\n */\n this.saveFile = function(filename, data) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {create: true}, function(fileEntry) {\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function(fileWriter) {\n\n fileWriter.onwriteend = function(e) {\n $log.log('Write completed.');\n deferred.resolve();\n };\n\n fileWriter.onerror = function(e) {\n deferred.reject(e);\n $log.error('FileSystemService: write failed, ' + e.toString());\n };\n\n // Create a new Blob and write it to log.txt.\n var blob = new Blob([data], {type: 'text/plain'});\n\n fileWriter.write(blob);\n\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n}", "static initialize(app, changeLogService, deviceService, deviceFileService, deviceFileUploadService, file, httpService, localDBManagementService, localDbService, networkService, securityService) {\n if (this.initialized) {\n return;\n }\n deviceService.addStartUpService({\n serviceName: 'OfflineStartupService',\n start: () => {\n if (window['SQLitePlugin']) {\n localDBManagementService.setLogSQl((sessionStorage.getItem('wm.logSql') === 'true') || (sessionStorage.getItem('debugMode') === 'true'));\n window.logSql = (flag = true) => {\n localDBManagementService.setLogSQl(flag);\n sessionStorage.setItem('wm.logSql', flag ? 'true' : 'false');\n };\n window.executeLocalSql = (dbName, query, params) => {\n localDBManagementService.executeSQLQuery(dbName, query, params, true);\n };\n return localDBManagementService.loadDatabases().then(() => {\n changeLogService.addWorker(new IdResolver(localDBManagementService));\n changeLogService.addWorker(new ErrorBlocker(localDBManagementService));\n changeLogService.addWorker(new FileHandler());\n changeLogService.addWorker(new MultiPartParamTransformer(deviceFileService, localDBManagementService));\n new LiveVariableOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService, localDbService).add();\n new FileUploadOfflineBehaviour(changeLogService, deviceFileService, deviceFileUploadService, file, networkService, deviceFileService.getUploadDirectory()).add();\n new NamedQueryExecutionOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService).add();\n localDBManagementService.registerCallback(new UploadedFilesImportAndExportService(changeLogService, deviceFileService, localDBManagementService, file));\n changeLogService.addWorker({\n onAddCall: () => {\n if (!networkService.isConnected()) {\n networkService.disableAutoConnect();\n }\n },\n postFlush: stats => {\n if (stats.totalTaskCount > 0) {\n localDBManagementService.close()\n .catch(noop)\n .then(() => {\n location.assign(window.location.origin + window.location.pathname);\n });\n }\n }\n });\n });\n }\n return Promise.resolve();\n }\n });\n new SecurityOfflineBehaviour(app, file, deviceService, networkService, securityService).add();\n }", "constructor(){\n\t\t//console.log('API START');\n\t}", "get deviceServiceUUID() { return this._deviceServiceUUID ? this._deviceServiceUUID : 'FFE0'; }", "constructor () {\r\n\t\t\r\n\t}", "_sdkCompatibility() {\n // WebSocket\n // http://caniuse.com/#feat=websockets\n var canCreateWebSocket = 'WebSocket' in window;\n console.log('Native WebSocket capability: ' +\n canCreateWebSocket);\n\n if (!canCreateWebSocket) {\n throw new Error('No WebSocket capabilities');\n }\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x330b4067;\n this.SUBCLASS_OF_ID = 0xd3262a4a;\n\n this.phonecallsEnabled = args.phonecallsEnabled || null;\n this.defaultP2pContacts = args.defaultP2pContacts || null;\n this.preloadFeaturedStickers = args.preloadFeaturedStickers || null;\n this.ignorePhoneEntities = args.ignorePhoneEntities || null;\n this.revokePmInbox = args.revokePmInbox || null;\n this.blockedMode = args.blockedMode || null;\n this.pfsEnabled = args.pfsEnabled || null;\n this.date = args.date;\n this.expires = args.expires;\n this.testMode = args.testMode;\n this.thisDc = args.thisDc;\n this.dcOptions = args.dcOptions;\n this.dcTxtDomainName = args.dcTxtDomainName;\n this.chatSizeMax = args.chatSizeMax;\n this.megagroupSizeMax = args.megagroupSizeMax;\n this.forwardedCountMax = args.forwardedCountMax;\n this.onlineUpdatePeriodMs = args.onlineUpdatePeriodMs;\n this.offlineBlurTimeoutMs = args.offlineBlurTimeoutMs;\n this.offlineIdleTimeoutMs = args.offlineIdleTimeoutMs;\n this.onlineCloudTimeoutMs = args.onlineCloudTimeoutMs;\n this.notifyCloudDelayMs = args.notifyCloudDelayMs;\n this.notifyDefaultDelayMs = args.notifyDefaultDelayMs;\n this.pushChatPeriodMs = args.pushChatPeriodMs;\n this.pushChatLimit = args.pushChatLimit;\n this.savedGifsLimit = args.savedGifsLimit;\n this.editTimeLimit = args.editTimeLimit;\n this.revokeTimeLimit = args.revokeTimeLimit;\n this.revokePmTimeLimit = args.revokePmTimeLimit;\n this.ratingEDecay = args.ratingEDecay;\n this.stickersRecentLimit = args.stickersRecentLimit;\n this.stickersFavedLimit = args.stickersFavedLimit;\n this.channelsReadMediaPeriod = args.channelsReadMediaPeriod;\n this.tmpSessions = args.tmpSessions || null;\n this.pinnedDialogsCountMax = args.pinnedDialogsCountMax;\n this.pinnedInfolderCountMax = args.pinnedInfolderCountMax;\n this.callReceiveTimeoutMs = args.callReceiveTimeoutMs;\n this.callRingTimeoutMs = args.callRingTimeoutMs;\n this.callConnectTimeoutMs = args.callConnectTimeoutMs;\n this.callPacketTimeoutMs = args.callPacketTimeoutMs;\n this.meUrlPrefix = args.meUrlPrefix;\n this.autoupdateUrlPrefix = args.autoupdateUrlPrefix || null;\n this.gifSearchUsername = args.gifSearchUsername || null;\n this.venueSearchUsername = args.venueSearchUsername || null;\n this.imgSearchUsername = args.imgSearchUsername || null;\n this.staticMapsProvider = args.staticMapsProvider || null;\n this.captionLengthMax = args.captionLengthMax;\n this.messageLengthMax = args.messageLengthMax;\n this.webfileDcId = args.webfileDcId;\n this.suggestedLangCode = args.suggestedLangCode || null;\n this.langPackVersion = args.langPackVersion || null;\n this.baseLangPackVersion = args.baseLangPackVersion || null;\n }", "static _getName() {\n return 'ContentPlayback';\n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "start(callback){\n \n }", "onStartHeaders() {}", "async componentWillMount() {\n var _this = this\n _this.setUpUserDataFromFB()\n\n //ASK FOR CAMERA ONLT IF IS PREVIEW TRUE AND SHOWBARCODE TRUE\n if (Config.isPreview && Config.showBCScanner) {\n const { status } = await Permissions.askAsync(Permissions.CAMERA);\n this.setState({ hasCameraPermission: status === 'granted' });\n }\n\n\n\n AppEventEmitter.addListener('user.state.changes', this.alterUserState);\n if (Config.isTesterApp) {\n this.listenForUserAuth();\n } else if (Config.isPreview && !Config.isTesterApp) {\n //Load list of apps\n _this.retreiveAppDemos(\"apps\");\n }\n\n if (!Config.isPreview && !Config.isTesterApp) {\n\n //Load the data automatically, this is normal app and refister for Push notification\n this.registerForPushNotificationsAsync();\n Notifications.addListener(this._handleNotification);\n this.retreiveMeta();\n }\n\n\n await Font.loadAsync({\n //\"Material Icons\": require(\"@expo/vector-icons/fonts/MaterialIcons.ttf\"),\n //\"Ionicons\": require(\"@expo/vector-icons/fonts/Ionicons.ttf\"),\n // \"Feather\": require(\"@expo/vector-icons/fonts/Feather.ttf\"),\n 'open-sans': require('./assets/fonts/OpenSans-Regular.ttf'),\n 'lato-light': require('./assets/fonts/Lato-Light.ttf'),\n 'lato-regular': require('./assets/fonts/Lato-Regular.ttf'),\n 'lato-bold': require('./assets/fonts/Lato-Bold.ttf'),\n 'lato-black': require('./assets/fonts/Lato-Black.ttf'),\n 'roboto-medium': require('./assets/fonts/Roboto-Medium.ttf'),\n 'roboto-bold': require('./assets/fonts/Roboto-Bold.ttf'),\n 'roboto-light': require('./assets/fonts/Roboto-Light.ttf'),\n 'roboto-thin': require('./assets/fonts/Roboto-Thin.ttf'),\n\n });\n\n this.setState({ isReady: true, fontLoaded: true });\n }", "function writeHeader() {\n seekHead = createSeekHead();\n \n let\n ebmlHeader = {\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [\n {\n \"id\": 0x4286, // EBMLVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f7, // EBMLReadVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f2, // EBMLMaxIDLength\n \"data\": 4\n },\n {\n \"id\": 0x42f3, // EBMLMaxSizeLength\n \"data\": 8\n },\n {\n \"id\": 0x4282, // DocType\n \"data\": \"webm\"\n },\n {\n \"id\": 0x4287, // DocTypeVersion\n \"data\": 2\n },\n {\n \"id\": 0x4285, // DocTypeReadVersion\n \"data\": 2\n }\n ]\n },\n \n segmentInfo = {\n \"id\": 0x1549a966, // Info\n \"data\": [\n {\n \"id\": 0x2ad7b1, // TimecodeScale\n \"data\": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)\n },\n {\n \"id\": 0x4d80, // MuxingApp\n \"data\": \"webm-writer-js\",\n },\n {\n \"id\": 0x5741, // WritingApp\n \"data\": \"webm-writer-js\"\n },\n segmentDuration // To be filled in later\n ]\n },\n \n videoProperties = [\n {\n \"id\": 0xb0, // PixelWidth\n \"data\": videoWidth\n },\n {\n \"id\": 0xba, // PixelHeight\n \"data\": videoHeight\n }\n ];\n \n if (options.transparent) {\n videoProperties.push(\n {\n \"id\": 0x53C0, // AlphaMode\n \"data\": 1\n }\n );\n }\n \n let\n tracks = {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [\n {\n \"id\": 0xae, // TrackEntry\n \"data\": [\n {\n \"id\": 0xd7, // TrackNumber\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x73c5, // TrackUID\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x9c, // FlagLacing\n \"data\": 0\n },\n {\n \"id\": 0x22b59c, // Language\n \"data\": \"und\"\n },\n {\n \"id\": 0x86, // CodecID\n \"data\": \"V_VP8\"\n },\n {\n \"id\": 0x258688, // CodecName\n \"data\": \"VP8\"\n },\n {\n \"id\": 0x83, // TrackType\n \"data\": 1\n },\n {\n \"id\": 0xe0, // Video\n \"data\": videoProperties\n }\n ]\n }\n ]\n };\n \n ebmlSegment = {\n \"id\": 0x18538067, // Segment\n \"size\": -1, // Unbounded size\n \"data\": [\n seekHead,\n segmentInfo,\n tracks,\n ]\n };\n \n let\n bufferStream = new ArrayBufferDataStream(256);\n \n writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);\n blobBuffer.write(bufferStream.getAsDataArray());\n \n // Now we know where these top-level elements lie in the file:\n seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);\n seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);\n \n\t writtenHeader = true;\n }", "function AppMeasurement(){var s=this;s.version=\"1.0.3\";var w=window;if(!w.s_c_in)w.s_c_il=[],w.s_c_in=0;s._il=w.s_c_il;s._in=w.s_c_in;s._il[s._in]=s;w.s_c_in++;s._c=\"s_c\";var n=w,g,k;try{g=n.parent;for(k=n.location;g&&g.location&&k&&\"\"+g.location!=\"\"+k&&n.location&&\"\"+g.location!=\"\"+n.location&&g.location.host==k.host;)n=g,g=n.parent}catch(o){}s.za=function(s){try{console.log(s)}catch(a){}};s.ba=function(s){return\"\"+parseInt(s)==\"\"+s};s.replace=function(s,a,c){if(!s||s.indexOf(a)<0)return s;return s.split(a).join(c)};\r\ns.escape=function(b){var a,c;if(!b)return b;b=encodeURIComponent(b);for(a=0;a<7;a++)c=\"+~!*()'\".substring(a,a+1),b.indexOf(c)>=0&&(b=s.replace(b,c,\"%\"+c.charCodeAt(0).toString(16).toUpperCase()));return b};s.unescape=function(b){if(!b)return b;b=b.indexOf(\"+\")>=0?s.replace(b,\"+\",\" \"):b;try{return decodeURIComponent(b)}catch(a){}return unescape(b)};s.pa=function(){var b=w.location.hostname,a=s.fpCookieDomainPeriods,c;if(!a)a=s.cookieDomainPeriods;if(b&&!s.U&&!/^[0-9.]+$/.test(b)&&(a=a?parseInt(a):\r\n2,a=a>2?a:2,c=b.lastIndexOf(\".\"),c>=0)){for(;c>=0&&a>1;)c=b.lastIndexOf(\".\",c-1),a--;s.U=c>0?b.substring(c):b}return s.U};s.c_r=s.cookieRead=function(b){b=s.escape(b);var a=\" \"+s.d.cookie,c=a.indexOf(\" \"+b+\"=\"),e=c<0?c:a.indexOf(\";\",c);b=c<0?\"\":s.unescape(a.substring(c+2+b.length,e<0?a.length:e));return b!=\"[[B]]\"?b:\"\"};s.c_w=s.cookieWrite=function(b,a,c){var e=s.pa(),d=s.cookieLifetime,f;a=\"\"+a;d=d?(\"\"+d).toUpperCase():\"\";c&&d!=\"SESSION\"&&d!=\"NONE\"&&((f=a!=\"\"?parseInt(d?d:0):-60)?(c=new Date,c.setTime(c.getTime()+\r\nf*1E3)):c==1&&(c=new Date,f=c.getYear(),c.setYear(f+5+(f<1900?1900:0))));if(b&&d!=\"NONE\")return s.d.cookie=b+\"=\"+s.escape(a!=\"\"?a:\"[[B]]\")+\"; path=/;\"+(c&&d!=\"SESSION\"?\" expires=\"+c.toGMTString()+\";\":\"\")+(e?\" domain=\"+e+\";\":\"\"),s.cookieRead(b)==a;return 0};s.v=[];s.V=function(b,a){if(s.W)return 0;if(!s.maxDelay)s.maxDelay=250;var c=0,e=(new Date).getTime()+s.maxDelay,d=s.d.Ma,f=[\"webkitvisibilitychange\",\"visibilitychange\"];if(!d)d=s.d.Na;if(d&&d==\"prerender\"){if(!s.G){s.G=1;for(c=0;c<f.length;c++)s.d.addEventListener(f[c],\r\nfunction(){var b=s.d.Ma;if(!b)b=s.d.Na;if(b==\"visible\")s.G=0,s.delayReady()})}c=1;e=0}else s.u(\"_d\")&&(c=1);c&&(s.v.push({m:b,a:a,t:e}),s.G||setTimeout(s.delayReady,s.maxDelay));return c};s.delayReady=function(){var b=(new Date).getTime(),a=0,c;for(s.u(\"_d\")&&(a=1);s.v.length>0;){c=s.v.shift();if(a&&!c.t&&c.t>b){s.v.unshift(c);setTimeout(s.delayReady,parseInt(s.maxDelay/2));break}s.W=1;s[c.m].apply(s,c.a);s.W=0}};s.setAccount=s.sa=function(b){var a,c;if(!s.V(\"setAccount\",arguments))if(s.account=b,\r\ns.allAccounts){a=s.allAccounts.concat(b.split(\",\"));s.allAccounts=[];a.sort();for(c=0;c<a.length;c++)(c==0||a[c-1]!=a[c])&&s.allAccounts.push(a[c])}else s.allAccounts=b.split(\",\")};s.P=function(b,a,c,e,d){var f=\"\",i,j,w,q,g=0;b==\"contextData\"&&(b=\"c\");if(a){for(i in a)if(!Object.prototype[i]&&(!d||i.substring(0,d.length)==d)&&a[i]&&(!c||c.indexOf(\",\"+(e?e+\".\":\"\")+i+\",\")>=0)){w=!1;if(g)for(j=0;j<g.length;j++)i.substring(0,g[j].length)==g[j]&&(w=!0);if(!w&&(f==\"\"&&(f+=\"&\"+b+\".\"),j=a[i],d&&(i=i.substring(d.length)),\r\ni.length>0))if(w=i.indexOf(\".\"),w>0)j=i.substring(0,w),w=(d?d:\"\")+j+\".\",g||(g=[]),g.push(w),f+=s.P(j,a,c,e,w);else if(typeof j==\"boolean\"&&(j=j?\"true\":\"false\"),j){if(e==\"retrieveLightData\"&&d.indexOf(\".contextData.\")<0)switch(w=i.substring(0,4),q=i.substring(4),i){case \"transactionID\":i=\"xact\";break;case \"channel\":i=\"ch\";break;case \"campaign\":i=\"v0\";break;default:s.ba(q)&&(w==\"prop\"?i=\"c\"+q:w==\"eVar\"?i=\"v\"+q:w==\"list\"?i=\"l\"+q:w==\"hier\"&&(i=\"h\"+q,j=j.substring(0,255)))}f+=\"&\"+s.escape(i)+\"=\"+s.escape(j)}}f!=\r\n\"\"&&(f+=\"&.\"+b)}return f};s.ra=function(){var b=\"\",a,c,e,d,f,i,j,w,g=\"\",n=\"\",k=c=\"\";if(s.lightProfileID)a=s.J,(g=s.lightTrackVars)&&(g=\",\"+g+\",\"+s.ea.join(\",\")+\",\");else{a=s.e;if(s.pe||s.linkType)if(g=s.linkTrackVars,n=s.linkTrackEvents,s.pe&&(c=s.pe.substring(0,1).toUpperCase()+s.pe.substring(1),s[c]))g=s[c].Va,n=s[c].Ua;g&&(g=\",\"+g+\",\"+s.C.join(\",\")+\",\");n&&(n=\",\"+n+\",\",g&&(g+=\",events,\"));s.events2&&(k+=(k!=\"\"?\",\":\"\")+s.events2)}for(c=0;c<a.length;c++){d=a[c];f=s[d];e=d.substring(0,4);i=d.substring(4);\r\n!f&&d==\"events\"&&k&&(f=k,k=\"\");if(f&&(!g||g.indexOf(\",\"+d+\",\")>=0)){switch(d){case \"timestamp\":d=\"ts\";break;case \"dynamicVariablePrefix\":d=\"D\";break;case \"visitorID\":d=\"vid\";break;case \"pageURL\":d=\"g\";if(f.length>255)s.pageURLRest=f.substring(255),f=f.substring(0,255);break;case \"pageURLRest\":d=\"-g\";break;case \"referrer\":d=\"r\";break;case \"vmk\":case \"visitorMigrationKey\":d=\"vmt\";break;case \"visitorMigrationServer\":d=\"vmf\";s.ssl&&s.visitorMigrationServerSecure&&(f=\"\");break;case \"visitorMigrationServerSecure\":d=\r\n\"vmf\";!s.ssl&&s.visitorMigrationServer&&(f=\"\");break;case \"charSet\":d=\"ce\";break;case \"visitorNamespace\":d=\"ns\";break;case \"cookieDomainPeriods\":d=\"cdp\";break;case \"cookieLifetime\":d=\"cl\";break;case \"variableProvider\":d=\"vvp\";break;case \"currencyCode\":d=\"cc\";break;case \"channel\":d=\"ch\";break;case \"transactionID\":d=\"xact\";break;case \"campaign\":d=\"v0\";break;case \"resolution\":d=\"s\";break;case \"colorDepth\":d=\"c\";break;case \"javascriptVersion\":d=\"j\";break;case \"javaEnabled\":d=\"v\";break;case \"cookiesEnabled\":d=\r\n\"k\";break;case \"browserWidth\":d=\"bw\";break;case \"browserHeight\":d=\"bh\";break;case \"connectionType\":d=\"ct\";break;case \"homepage\":d=\"hp\";break;case \"plugins\":d=\"p\";break;case \"events\":k&&(f+=(f!=\"\"?\",\":\"\")+k);if(n){i=f.split(\",\");f=\"\";for(e=0;e<i.length;e++)j=i[e],w=j.indexOf(\"=\"),w>=0&&(j=j.substring(0,w)),w=j.indexOf(\":\"),w>=0&&(j=j.substring(0,w)),n.indexOf(\",\"+j+\",\")>=0&&(f+=(f?\",\":\"\")+i[e])}break;case \"events2\":f=\"\";break;case \"contextData\":b+=s.P(\"c\",s[d],g,d);f=\"\";break;case \"lightProfileID\":d=\r\n\"mtp\";break;case \"lightStoreForSeconds\":d=\"mtss\";s.lightProfileID||(f=\"\");break;case \"lightIncrementBy\":d=\"mti\";s.lightProfileID||(f=\"\");break;case \"retrieveLightProfiles\":d=\"mtsr\";break;case \"deleteLightProfiles\":d=\"mtsd\";break;case \"retrieveLightData\":s.retrieveLightProfiles&&(b+=s.P(\"mts\",s[d],g,d));f=\"\";break;default:s.ba(i)&&(e==\"prop\"?d=\"c\"+i:e==\"eVar\"?d=\"v\"+i:e==\"list\"?d=\"l\"+i:e==\"hier\"&&(d=\"h\"+i,f=f.substring(0,255)))}f&&(b+=\"&\"+d+\"=\"+(d.substring(0,3)!=\"pev\"?s.escape(f):f))}d==\"pev3\"&&s.g&&\r\n(b+=s.g)}return b};s.p=function(s){var a=s.tagName;if(\"\"+s.Ta!=\"undefined\"||\"\"+s.Ea!=\"undefined\"&&(\"\"+s.Ea).toUpperCase()!=\"HTML\")return\"\";a=a&&a.toUpperCase?a.toUpperCase():\"\";a==\"SHAPE\"&&(a=\"\");a&&((a==\"INPUT\"||a==\"BUTTON\")&&s.type&&s.type.toUpperCase?a=s.type.toUpperCase():!a&&s.href&&(a=\"A\"));return a};s.Y=function(s){var a=s.href?s.href:\"\",c,e,d;c=a.indexOf(\":\");e=a.indexOf(\"?\");d=a.indexOf(\"/\");if(a&&(c<0||e>=0&&c>e||d>=0&&c>d))e=s.protocol&&s.protocol.length>1?s.protocol:l.protocol?l.protocol:\r\n\"\",c=l.pathname.lastIndexOf(\"/\"),a=(e?e+\"//\":\"\")+(s.host?s.host:l.host?l.host:\"\")+(h.substring(0,1)!=\"/\"?l.pathname.substring(0,c<0?0:c)+\"/\":\"\")+a;return a};s.z=function(b){var a=s.p(b),c,e,d=\"\",f=0;if(a){c=b.protocol;e=b.onclick;if(b.href&&(a==\"A\"||a==\"AREA\")&&(!e||!c||c.toLowerCase().indexOf(\"javascript\")<0))d=s.Y(b);else if(e)d=s.replace(s.replace(s.replace(s.replace(\"\"+e,\"\\r\",\"\"),\"\\n\",\"\"),\"\\t\",\"\"),\" \",\"\"),f=2;else if(a==\"INPUT\"||a==\"SUBMIT\"){if(b.value)d=b.value;else if(b.innerText)d=b.innerText;\r\nelse if(b.textContent)d=b.textContent;f=3}else if(b.src&&a==\"IMAGE\")d=b.src;if(d)return{id:d.substring(0,100),type:f}}return 0};s.Qa=function(b){for(var a=s.p(b),c=s.z(b);b&&!c&&a!=\"BODY\";)if(b=b.parentElement?b.parentElement:b.parentNode)a=s.p(b),c=s.z(b);if(!c||a==\"BODY\")b=0;if(b&&(a=b.onclick?\"\"+b.onclick:\"\",a.indexOf(\".tl(\")>=0||a.indexOf(\".trackLink(\")>=0))b=0;return b};s.Ca=function(){var b,a,c=s.linkObject,e=s.linkType,d=s.linkURL,f,i;s.K=1;if(!c)s.K=0,c=s.j;if(c){b=s.p(c);for(a=s.z(c);c&&\r\n!a&&b!=\"BODY\";)if(c=c.parentElement?c.parentElement:c.parentNode)b=s.p(c),a=s.z(c);if(!a||b==\"BODY\")c=0;if(c){var j=c.onclick?\"\"+c.onclick:\"\";if(j.indexOf(\".tl(\")>=0||j.indexOf(\".trackLink(\")>=0)c=0}}else s.K=1;!d&&c&&(d=s.Y(c));d&&!s.linkLeaveQueryString&&(f=d.indexOf(\"?\"),f>=0&&(d=d.substring(0,f)));if(!e&&d){var g=0,n=0,k;if(s.trackDownloadLinks&&s.linkDownloadFileTypes){j=d.toLowerCase();f=j.indexOf(\"?\");i=j.indexOf(\"#\");f>=0?i>=0&&i<f&&(f=i):f=i;f>=0&&(j=j.substring(0,f));f=s.linkDownloadFileTypes.toLowerCase().split(\",\");\r\nfor(i=0;i<f.length;i++)(k=f[i])&&j.substring(j.length-(k.length+1))==\".\"+k&&(e=\"d\")}if(s.trackExternalLinks&&!e&&(j=d.toLowerCase(),s.aa(j))){if(!s.linkInternalFilters)s.linkInternalFilters=w.location.hostname;f=0;s.linkExternalFilters?(f=s.linkExternalFilters.toLowerCase().split(\",\"),g=1):s.linkInternalFilters&&(f=s.linkInternalFilters.toLowerCase().split(\",\"));if(f){for(i=0;i<f.length;i++)k=f[i],j.indexOf(k)>=0&&(n=1);n?g&&(e=\"e\"):g||(e=\"e\")}}}s.linkObject=c;s.linkURL=d;s.linkType=e;if(s.trackClickMap||\r\ns.trackInlineStats)if(s.g=\"\",c){e=s.pageName;d=1;c=c.sourceIndex;if(!e)e=s.pageURL,d=0;if(w.s_objectID)a.id=w.s_objectID,c=a.type=1;if(e&&a&&a.id&&b)s.g=\"&pid=\"+s.escape(e.substring(0,255))+(d?\"&pidt=\"+d:\"\")+\"&oid=\"+s.escape(a.id.substring(0,100))+(a.type?\"&oidt=\"+a.type:\"\")+\"&ot=\"+b+(c?\"&oi=\"+c:\"\")}};s.ta=function(){var b=s.K,a=s.linkType,c=s.linkURL,e=s.linkName;if(a&&(c||e))a=a.toLowerCase(),a!=\"d\"&&a!=\"e\"&&(a=\"o\"),s.pe=\"lnk_\"+a,s.pev1=c?s.escape(c):\"\",s.pev2=e?s.escape(e):\"\",b=1;s.abort&&(b=0);\r\nif(s.trackClickMap||s.trackInlineStats){a={};c=0;var d=s.cookieRead(\"s_sq\"),f=d?d.split(\"&\"):0,i,j,w;d=0;if(f)for(i=0;i<f.length;i++)j=f[i].split(\"=\"),e=s.unescape(j[0]).split(\",\"),j=s.unescape(j[1]),a[j]=e;e=s.account.split(\",\");if(b||s.g){b&&!s.g&&(d=1);for(j in a)if(!Object.prototype[j])for(i=0;i<e.length;i++){d&&(w=a[j].join(\",\"),w==s.account&&(s.g+=(j.charAt(0)!=\"&\"?\"&\":\"\")+j,a[j]=[],c=1));for(f=0;f<a[j].length;f++)w=a[j][f],w==e[i]&&(d&&(s.g+=\"&u=\"+s.escape(w)+(j.charAt(0)!=\"&\"?\"&\":\"\")+j+\"&u=0\"),\r\na[j].splice(f,1),c=1)}b||(c=1);if(c){d=\"\";i=2;!b&&s.g&&(d=s.escape(e.join(\",\"))+\"=\"+s.escape(s.g),i=1);for(j in a)!Object.prototype[j]&&i>0&&a[j].length>0&&(d+=(d?\"&\":\"\")+s.escape(a[j].join(\",\"))+\"=\"+s.escape(j),i--);s.cookieWrite(\"s_sq\",d)}}}return b};s.ua=function(){if(!s.Ka){var b=new Date,a=n.location,c,e,d,f=d=e=c=\"\",i=\"\",w=\"\",g=\"1.2\",k=s.cookieWrite(\"s_cc\",\"true\",0)?\"Y\":\"N\",o=\"\",p=\"\",r=0;if(b.setUTCDate&&(g=\"1.3\",r.toPrecision&&(g=\"1.5\",c=[],c.forEach))){g=\"1.6\";d=0;e={};try{d=new Iterator(e),\r\nd.next&&(g=\"1.7\",c.reduce&&(g=\"1.8\",g.trim&&(g=\"1.8.1\",Date.parse&&(g=\"1.8.2\",Object.create&&(g=\"1.8.5\")))))}catch(t){}}c=screen.width+\"x\"+screen.height;d=navigator.javaEnabled()?\"Y\":\"N\";e=screen.pixelDepth?screen.pixelDepth:screen.colorDepth;i=s.w.innerWidth?s.w.innerWidth:s.d.documentElement.offsetWidth;w=s.w.innerHeight?s.w.innerHeight:s.d.documentElement.offsetHeight;b=navigator.plugins;try{s.b.addBehavior(\"#default#homePage\"),o=s.b.Ra(a)?\"Y\":\"N\"}catch(u){}try{s.b.addBehavior(\"#default#clientCaps\"),\r\np=s.b.connectionType}catch(x){}if(b)for(;r<b.length&&r<30;){if(a=b[r].name)a=a.substring(0,100)+\";\",f.indexOf(a)<0&&(f+=a);r++}s.resolution=c;s.colorDepth=e;s.javascriptVersion=g;s.javaEnabled=d;s.cookiesEnabled=k;s.browserWidth=i;s.browserHeight=w;s.connectionType=p;s.homepage=o;s.plugins=f;s.Ka=1}};s.B={};s.loadModule=function(b,a){s.B[b]||(s[b]=w[\"AppMeasurement_Module_\"+b]?new w[\"AppMeasurement_Module_\"+b](s):{},s.B[b]=s[b]);a&&(s[b+\"_onLoad\"]=a,delayCall(b+\"_onLoad\",[s,m],1)||a(s,m))};s.u=function(b){var a,\r\nc;for(a in s.B)if(!Object.prototype[a]&&(c=s.B[a])&&c[b]&&c[b]())return 1;return 0};s.xa=function(){var b=Math.floor(Math.random()*1E13),a=s.visitorSampling,c=s.visitorSamplingGroup;c=\"s_vsn_\"+(s.visitorNamespace?s.visitorNamespace:s.account)+(c?\"_\"+c:\"\");var e=s.cookieRead(c);if(a){e&&(e=parseInt(e));if(!e){if(!s.cookieWrite(c,b))return 0;e=b}if(e%1E4>v)return 0}return 1};s.Q=function(b,a){var c,e,d,f,i,w;for(c=0;c<2;c++){e=c>0?s.R:s.e;for(d=0;d<e.length;d++)if(f=e[d],(i=b[f])||b[\"!\"+f]){if(!a&&\r\n(f==\"contextData\"||f==\"retrieveLightData\")&&s[f])for(w in s[f])i[w]||(i[w]=s[f][w]);s[f]=i}}};s.La=function(b){var a,c,e,d;for(a=0;a<2;a++){c=a>0?s.R:s.e;for(e=0;e<c.length;e++)d=c[e],b[d]=s[d],b[d]||(b[\"!\"+d]=1)}};s.oa=function(s){var a,c,e,d,f,w=0,g,n=\"\",k=\"\";if(s&&s.length>255&&(a=\"\"+s,c=a.indexOf(\"?\"),c>0&&(g=a.substring(c+1),a=a.substring(0,c),d=a.toLowerCase(),e=0,d.substring(0,7)==\"http://\"?e+=7:d.substring(0,8)==\"https://\"&&(e+=8),c=d.indexOf(\"/\",e),c>0&&(d=d.substring(e,c),f=a.substring(c),\r\na=a.substring(0,c),d.indexOf(\"google\")>=0?w=\",q,ie,start,search_key,word,kw,cd,\":d.indexOf(\"yahoo.co\")>=0&&(w=\",p,ei,\"),w&&g)))){if((s=g.split(\"&\"))&&s.length>1){for(e=0;e<s.length;e++)d=s[e],c=d.indexOf(\"=\"),c>0&&w.indexOf(\",\"+d.substring(0,c)+\",\")>=0?n+=(n?\"&\":\"\")+d:k+=(k?\"&\":\"\")+d;n&&k?g=n+\"&\"+k:k=\"\"}c=253-(g.length-k.length)-a.length;s=a+(c>0?f.substring(0,c):\"\")+\"?\"+g}return s};s.qa=function(){var b=s.cookieRead(\"s_fid\"),a=\"\",c=\"\",e;e=8;var d=4;if(!b||b.indexOf(\"-\")<0){for(b=0;b<16;b++)e=Math.floor(Math.random()*\r\ne),a+=\"0123456789ABCDEF\".substring(e,e+1),e=Math.floor(Math.random()*d),c+=\"0123456789ABCDEF\".substring(e,e+1),e=d=16;b=a+\"-\"+c}s.cookieWrite(\"s_fid\",b,1)||(b=0);return b};s.t=s.track=function(b){var a,c=new Date,e=\"s\"+Math.floor(c.getTime()/108E5)%10+Math.floor(Math.random()*1E13),d=c.getYear();d=\"t=\"+s.escape(c.getDate()+\"/\"+c.getMonth()+\"/\"+(d<1900?d+1900:d)+\" \"+c.getHours()+\":\"+c.getMinutes()+\":\"+c.getSeconds()+\" \"+c.getDay()+\" \"+c.getTimezoneOffset());if(!s.V(\"track\",arguments)){b&&(a={},s.La(a),\r\ns.Q(b));if(s.xa()&&(s.fid=s.qa(),s.Ca(),s.usePlugins&&s.doPlugins&&s.doPlugins(s),s.account)){if(!s.abort){if(s.trackOffline&&!s.timestamp)s.timestamp=Math.floor(c.getTime()/1E3);c=w.location;if(!s.pageURL)s.pageURL=c.href?c.href:c;if(!s.referrer&&!s.ia)s.referrer=n.document.referrer,s.ia=1;s.referrer=s.oa(s.referrer);s.u(\"_g\")}s.ta()&&!s.abort&&(s.ua(),d+=s.ra(),s.Ba(e,d));s.abort||s.u(\"_t\")}b&&s.Q(a,1);s.timestamp=s.linkObject=s.j=s.linkURL=s.linkName=s.linkType=w.Sa=s.pe=s.pev1=s.pev2=s.pev3=s.g=\r\n0}};s.tl=s.trackLink=function(b,a,c,e,d){s.linkObject=b;s.linkType=a;s.linkName=c;if(d)s.i=b,s.l=d;return s.track(e)};s.trackLight=function(b,a,c,e){s.lightProfileID=b;s.lightStoreForSeconds=a;s.lightIncrementBy=c;return s.track(e)};s.clearVars=function(){var b,a;for(b=0;b<s.e.length;b++)if(a=s.e[b],a.substring(0,4)==\"prop\"||a.substring(0,4)==\"eVar\"||a.substring(0,4)==\"hier\"||a.substring(0,4)==\"list\"||a==\"channel\"||a==\"events\"||a==\"eventList\"||a==\"products\"||a==\"productList\"||a==\"purchaseID\"||a==\r\n\"transactionID\"||a==\"state\"||a==\"zip\"||a==\"campaign\")s[a]=void 0};s.Ba=function(b,a){var c,e=s.trackingServer;c=\"\";var d=s.dc,f=\"sc.\",w=s.visitorNamespace;if(e){if(s.trackingServerSecure&&s.ssl)e=s.trackingServerSecure}else{if(!w)w=s.account,e=w.indexOf(\",\"),e>=0&&(w=w.Oa(0,e)),w=w.replace(/[^A-Za-z0-9]/g,\"\");c||(c=\"2o7.net\");d=d?(\"\"+d).toLowerCase():\"d1\";c==\"2o7.net\"&&(d==\"d1\"?d=\"112\":d==\"d2\"&&(d=\"122\"),f=\"\");e=w+\".\"+d+\".\"+f+c}c=s.ssl?\"https://\":\"http://\";c+=e+\"/b/ss/\"+s.account+\"/\"+(s.mobile?\"5.\":\r\n\"\")+\"1/JS-\"+s.version+(s.Ja?\"T\":\"\")+\"/\"+b+\"?AQB=1&ndh=1&\"+a+\"&AQE=1\";s.wa&&(c=c.substring(0,2047));s.ma(c);s.H()};s.ma=function(b){s.c||s.va();s.c.push(b);s.I=s.o();s.ha()};s.va=function(){s.c=s.ya();if(!s.c)s.c=[]};s.ya=function(){var b,a;if(s.M()){try{(a=w.localStorage.getItem(s.L()))&&(b=w.JSON.parse(a))}catch(c){}return b}};s.M=function(){var b=!0;if(!s.trackOffline||!s.offlineFilename||!w.localStorage||!w.JSON)b=!1;return b};s.Z=function(){var b=0;if(s.c)b=s.c.length;s.q&&b++;return b};s.H=function(){if(!s.q)if(s.$=\r\nnull,s.fa)s.I>s.A&&s.ga(s.c),s.O(500);else{var b=s.ja();if(b>0)s.O(b);else if(b=s.X())s.q=1,s.Aa(b),s.Fa(b)}};s.O=function(b){if(!s.$)b||(b=0),s.$=setTimeout(s.H,b)};s.ja=function(){var b;if(!s.trackOffline||s.offlineThrottleDelay<=0)return 0;b=s.o()-s.da;if(s.offlineThrottleDelay<b)return 0;return s.offlineThrottleDelay-b};s.X=function(){if(s.c.length>0)return s.c.shift()};s.Aa=function(b){if(s.debugTracking){var a=\"AppMeasurement Debug: \"+b;b=b.split(\"&\");var c;for(c=0;c<b.length;c++)a+=\"\\n\\t\"+\r\ns.unescape(b[c]);s.za(a)}};s.Fa=function(b){var a;a||(a=new Image);a.T=function(){try{if(s.N)clearTimeout(s.N),s.N=0;if(a.timeout)clearTimeout(a.timeout),a.timeout=0}catch(b){}};a.onload=a.Ia=function(){a.T();s.la();s.D();s.q=0;s.H()};a.onabort=a.onerror=a.na=function(){a.T();s.q&&s.c.unshift(s.ka);s.q=0;s.I>s.A&&s.ga(s.c);s.D();s.O(500)};a.onreadystatechange=function(){a.readyState==4&&(a.status==200?a.Ia():a.na())};s.da=s.o();a.src=b;if(a.abort)s.N=setTimeout(a.abort,5E3);s.ka=b;s.Pa=w[\"s_i_\"+s.replace(s.account,\r\n\",\",\"_\")]=a;if(s.useForcedLinkTracking&&s.r||s.l){if(!s.forcedLinkTrackingTimeout)s.forcedLinkTrackingTimeout=250;s.F=setTimeout(s.D,s.forcedLinkTrackingTimeout)}};s.la=function(){if(s.M()&&!(s.ca>s.A))try{w.localStorage.removeItem(s.L()),s.ca=s.o()}catch(b){}};s.ga=function(b){if(s.M()){s.ha();try{w.localStorage.setItem(s.L(),w.JSON.stringify(b)),s.A=s.o()}catch(a){}}};s.ha=function(){if(s.trackOffline){if(!s.offlineLimit||s.offlineLimit<=0)s.offlineLimit=10;for(;s.c.length>s.offlineLimit;)s.X()}};\r\ns.forceOffline=function(){s.fa=!0};s.forceOnline=function(){s.fa=!1};s.L=function(){return s.offlineFilename+\"-\"+s.visitorNamespace+s.account};s.o=function(){return(new Date).getTime()};s.aa=function(s){s=s.toLowerCase();if(s.indexOf(\"#\")!=0&&s.indexOf(\"about:\")!=0&&s.indexOf(\"javascript:\")!=0)return!0;return!1};s.setTagContainer=function(b){var a,c,e;s.Ja=b;for(a=0;a<s._il.length;a++)if((c=s._il[a])&&c._c==\"s_l\"&&c.tagContainerName==b){s.Q(c);if(c.lmq)for(a=0;a<c.lmq.length;a++)e=c.lmq[a],s.loadModule(e.n);\r\nif(c.ml)for(e in c.ml)if(s[e])for(a in b=s[e],e=c.ml[e],e)if(!Object.prototype[a]&&(typeof e[a]!=\"function\"||(\"\"+e[a]).indexOf(\"s_c_il\")<0))b[a]=e[a];if(c.mmq)for(a=0;a<c.mmq.length;a++)e=c.mmq[a],s[e.m]&&(b=s[e.m],b[e.f]&&typeof b[e.f]==\"function\"&&(e.a?b[e.f].apply(b,e.a):b[e.f].apply(b)));if(c.tq)for(a=0;a<c.tq.length;a++)s.track(c.tq[a]);c.s=s;break}};s.Util={urlEncode:s.escape,urlDecode:s.unescape,cookieRead:s.cookieRead,cookieWrite:s.cookieWrite,getQueryParam:function(b,a,c){var e;a||(a=s.pageURL?\r\ns.pageURL:w.location);c||(c=\"&\");if(b&&a&&(a=\"\"+a,e=a.indexOf(\"?\"),e>=0&&(a=c+a.substring(e+1)+c,e=a.indexOf(c+b+\"=\"),e>=0&&(a=a.substring(e+c.length+b.length+1),e=a.indexOf(c),e>=0&&(a=a.substring(0,e)),a.length>0))))return s.unescape(a);return\"\"}};s.C=[\"timestamp\",\"dynamicVariablePrefix\",\"visitorID\",\"anonymousVisitorID\",\"globalVisitorID\",\"globalLocationHint\",\"fid\",\"vmk\",\"visitorMigrationKey\",\"visitorMigrationServer\",\"visitorMigrationServerSecure\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\r\n\"fpCookieDomainPeriods\",\"cookieLifetime\",\"pageName\",\"pageURL\",\"referrer\",\"contextData\",\"currencyCode\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\",\"retrieveLightProfiles\",\"deleteLightProfiles\",\"retrieveLightData\",\"pe\",\"pev1\",\"pev2\",\"pev3\",\"pageURLRest\"];s.e=s.C.concat([\"purchaseID\",\"variableProvider\",\"channel\",\"server\",\"pageType\",\"transactionID\",\"campaign\",\"state\",\"zip\",\"events\",\"events2\",\"products\",\"tnt\"]);s.ea=[\"timestamp\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\"cookieLifetime\",\r\n\"contextData\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\"];s.J=s.ea.slice(0);s.R=[\"account\",\"allAccounts\",\"debugTracking\",\"visitor\",\"trackOffline\",\"offlineLimit\",\"offlineThrottleDelay\",\"offlineFilename\",\"usePlugins\",\"doPlugins\",\"configURL\",\"visitorSampling\",\"s.visitorSamplingGroup\",\"linkObject\",\"linkURL\",\"linkName\",\"linkType\",\"trackDownloadLinks\",\"trackExternalLinks\",\"trackClickMap\",\"trackInlineStats\",\"linkLeaveQueryString\",\"linkTrackVars\",\"linkTrackEvents\",\"linkDownloadFileTypes\",\r\n\"linkExternalFilters\",\"linkInternalFilters\",\"useForcedLinkTracking\",\"forcedLinkTrackingTimeout\",\"trackingServer\",\"trackingServerSecure\",\"ssl\",\"abort\",\"mobile\",\"dc\",\"lightTrackVars\",\"maxDelay\"];for(g=0;g<=75;g++)s.e.push(\"prop\"+g),s.J.push(\"prop\"+g),s.e.push(\"eVar\"+g),s.J.push(\"eVar\"+g),g<6&&s.e.push(\"hier\"+g),g<4&&s.e.push(\"list\"+g);g=[\"resolution\",\"colorDepth\",\"javascriptVersion\",\"javaEnabled\",\"cookiesEnabled\",\"browserWidth\",\"browserHeight\",\"connectionType\",\"homepage\",\"plugins\"];s.e=s.e.concat(g);\r\ns.C=s.C.concat(g);s.ssl=w.location.protocol.toLowerCase().indexOf(\"https\")>=0;s.charSet=\"UTF-8\";s.contextData={};s.offlineThrottleDelay=0;s.offlineFilename=\"AppMeasurement.offline\";s.da=0;s.I=0;s.A=0;s.ca=0;s.linkDownloadFileTypes=\"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";s.w=w;s.d=w.document;try{s.wa=navigator.appName==\"Microsoft Internet Explorer\"}catch(p){}s.D=function(){if(s.F)w.clearTimeout(s.F),s.F=null;s.i&&s.r&&s.i.dispatchEvent(s.r);if(s.l)if(typeof s.l==\"function\")s.l();\r\nelse if(s.i&&s.i.href)s.d.location=s.i.href;s.i=s.r=s.l=0};s.Ga=function(){s.b=s.d.body;if(s.b)if(s.k=function(b){var a,c,e,d,f;if(!(s.d&&s.d.getElementById(\"cppXYctnr\")||b&&b.Da)){if(s.S)if(s.useForcedLinkTracking)s.b.removeEventListener(\"click\",s.k,!1);else{s.b.removeEventListener(\"click\",s.k,!0);s.S=s.useForcedLinkTracking=0;return}else s.useForcedLinkTracking=0;s.j=b.srcElement?b.srcElement:b.target;try{if(s.j&&(s.j.tagName||s.j.parentElement||s.j.parentNode))if(e=s.Z(),s.track(),e<s.Z()&&s.useForcedLinkTracking&&\r\nb.target){for(d=b.target;d&&d!=s.b&&d.tagName.toUpperCase()!=\"A\"&&d.tagName.toUpperCase()!=\"AREA\";)d=d.parentNode;if(d&&(f=d.href,s.aa(f)||(f=0),c=d.target,b.target.dispatchEvent&&f&&(!c||c==\"_self\"||c==\"_top\"||c==\"_parent\"||w.name&&c==w.name))){try{a=s.d.createEvent(\"MouseEvents\")}catch(g){a=new w.MouseEvent}if(a){try{a.initMouseEvent(\"click\",b.bubbles,b.cancelable,b.view,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget)}catch(j){a=\r\n0}if(a)a.Da=1,b.stopPropagation(),b.Ha&&b.Ha(),b.preventDefault(),s.i=b.target,s.r=a}}}}catch(k){}s.j=0}},s.b&&s.b.attachEvent)s.b.attachEvent(\"onclick\",s.k);else{if(s.b&&s.b.addEventListener){if(navigator&&(navigator.userAgent.indexOf(\"WebKit\")>=0&&s.d.createEvent||navigator.userAgent.indexOf(\"Firefox/2\")>=0&&w.MouseEvent))s.S=1,s.useForcedLinkTracking=1,s.b.addEventListener(\"click\",s.k,!0);s.b.addEventListener(\"click\",s.k,!1)}}else setTimeout(setupBody,30)};s.Ga()}", "function getVersion(){return _VERSION}", "InitVsaEngine() {\n\n }", "constructor() {\n this.systemLog = false\n this.appName = '@codedungeon/messenger'\n this.logToFile = false\n this.methods = [\n 'write',\n 'critical',\n 'lblCritical',\n 'danger',\n 'lblDanger',\n 'debug',\n 'error',\n 'lblError',\n 'important',\n 'lblImportant',\n 'info',\n 'lblInfo',\n 'log',\n 'note',\n 'notice',\n 'lblNotice',\n 'status',\n 'success',\n 'lblSuccess',\n 'warn',\n 'lblWarn',\n 'warning',\n 'lblWarning'\n ]\n }", "private internal function m248() {}", "function WebSocketRpcConnection()\n{\nvar self = this;\n\nvar isNodeJs = (typeof window === \"undefined\" ? true : false);\n\nvar lib = null;\nvar SpaceifyError = null;\nvar SpaceifyUtility = null;\nvar RpcCommunicator = null;\n//var SpaceifyLogger = null;\nvar WebSocketConnection = null;\n\nif (isNodeJs)\n\t{\n\tlib = \"/var/lib/spaceify/code/\";\n\n\tSpaceifyError = require(lib + \"spaceifyerror\");\n\t//SpaceifyLogger = require(lib + \"spaceifylogger\");\n\tSpaceifyUtility = require(lib + \"spaceifyutility\");\n\tRpcCommunicator = require(lib + \"rpccommunicator\");\n\tWebSocketConnection = require(lib + \"websocketconnection\");\n\t}\nelse\n\t{\n\tlib = (window.WEBPACK_MAIN_LIBRARY ? window.WEBPACK_MAIN_LIBRARY : window);\n\n\t//SpaceifyLogger = lib.SpaceifyLogger;\n\tSpaceifyError = lib.SpaceifyError;\n\tSpaceifyUtility = lib.SpaceifyUtility;\n\tRpcCommunicator = lib.RpcCommunicator;\n\tWebSocketConnection = lib.WebSocketConnection;\n\t}\n\nvar errorc = new SpaceifyError();\nvar utility = new SpaceifyUtility();\nvar communicator = new RpcCommunicator();\nvar connection = new WebSocketConnection();\n//var logger = new SpaceifyLogger(\"WebSocketRpcConnection\");\n\nself.connect = function(options, callback)\n\t{\n\tconnection.connect(options, function(err, data)\n\t\t{\n\t\tif(!err)\n\t\t\t{\n\t\t\tcommunicator.addConnection(connection);\n\n\t\t\tif(callback)\n\t\t\t\tcallback(null, true);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif(callback)\n\t\t\t\tcallback(errorc.makeErrorObject(\"wsrpcc\", \"Failed to open WebsocketRpcConnection.\", \"WebSocketRpcConnection::connect\"), null);\n\t\t\t}\n\t\t});\n\t};\n\nself.close = function()\n\t{\n\t};\n\nself.getCommunicator = function()\n\t{\n\treturn communicator;\n\t};\n\nself.getConnection = function()\n\t{\n\treturn connection;\n\t};\n\n// Inherited methods\nself.getIsOpen = function()\n\t{\n\treturn connection.getIsOpen();\n\t}\n\nself.getIsSecure = function()\n\t{\n\treturn connection.getIsSecure();\n\t}\n\nself.getPort = function()\n\t{\n\treturn connection.getPort();\n\t}\n\nself.getId = function()\n\t{\n\treturn connection.getId();\n\t}\n\nself.connectionExists = function(connectionId)\n\t{\n\treturn communicator.connectionExists(connectionId);\n\t}\n\nself.exposeRpcMethod = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethod(name, object, method);\n\t}\n\nself.exposeRpcMethodSync = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethodSync(name, object, method);\n\t}\n\nself.callRpc = function(method, params, object, listener)\n\t{\n\treturn communicator.callRpc(method, params, object, listener, connection.getId());\n\t}\n\n// External event listeners\nself.setConnectionListener = function(listener)\n\t{\n\tcommunicator.setConnectionListener(listener);\n\t};\n\nself.setDisconnectionListener = function(listener)\n\t{\n\tcommunicator.setDisconnectionListener(listener);\n\t};\n\n}", "heartbeat () {\n }", "function _____SHARED_functions_____(){}", "onShareAppMessage() {\n\n }", "function getString(key, params) {\n var result = WEB_PLATFORM.getString(\"org_opensds_storage_devices\", key, params);\n if(result == null){\n return key;\n }else{\n return result;\n }\n }", "componentDidMount(){\n console.info(this.constructor.name+ 'Component mount process finished');\n }", "onMessage() {}", "onMessage() {}", "requestThumbnails() {\n let position = this.state.position;\n let ed = this.state.ed;\n let ts = position == 'start' ? ed.start : ed.end;\n\n this.props.socket.emit('frameSelect',{ ts: ts } );\n }", "static get tag(){return\"hal-9000\"}", "constructor(t){const e={...t};this.connectionState=new h,this.server=\"https://hub-server-2.heatgenius.co.uk\",this.username=\"\",this.signature=\"\",this.auth={header:{}},this.lastQueryTime=null,this._axios=i.a.create({}),this.logger=e.logger?e.logger:console,this.debug=!!e.debug&&e.debug}", "started() {\r\n\r\n\t}", "get EXTERNAL_API() {\n return ['setUsageMode',\n 'setBackupMode',\n 'setLocationMode',\n 'setUsageOptinHidden',\n ];\n }", "getVideoDataBuffer() {\n return this.videoDataBuffer;\n }", "addTPKLayer(){\n //<editor-fold desc=\"old code to eliminate\">\n /* if (typeof local == 'undefined') {\n\n //todo: maybe based on this url we could decide if taking the tpk from File API or form URL\n var xhrRequest = new XMLHttpRequest();\n var _this = this;\n xhrRequest.open(\"GET\", url, true);\n xhrRequest.responseType = \"blob\";\n xhrRequest.onprogress = function(evt){\n var percent = 0;\n if(/!*evt.hasOwnProperty(\"total\")*!/typeof evt[\"total\"] !== 'undefined'){\n percent = (parseFloat(evt.loaded / evt.total) * 100).toFixed(0);\n }\n else{\n percent = (parseFloat(evt.loaded / evt.totalSize) * 100).toFixed(0);\n }\n\n console.log(\"Get file via url \" + percent + \"%\");\n console.log(\"Begin downloading remote tpk file...\");\n };\n\n xhrRequest.error = function(err){\n console.log(\"ERROR retrieving TPK file: \" + err.toString());\n alert(\"There was a problem retrieve the file.\");\n };\n var __this = _this;\n xhrRequest.onload = function(oEvent) {\n if(this.status === 200) {\n console.log(\"Remote tpk download finished.\" + oEvent);\n __this.zipParser(this.response);\n }\n else{\n alert(\"There was a problem loading the file. \" + this.status + \": \" + this.statusText );\n }\n };\n xhrRequest.send();\n }\n*/\n //</editor-fold>\n if (this.get('ermesCordova').isNative()){\n\n var basemapName = this.get('parcels').get('basemapName');\n var store = cordova.file.dataDirectory;\n var fileName = basemapName;\n this.set(\"loading\", true);\n this.getBaseMapZip (store, fileName).then((binary)=>{\n if (binary!== null) {\n this.zipParser(binary);\n }\n else {\n Ember.debug(\"getBaseMapZip: error loading the zip file\");\n }\n });\n }\n\n }", "private public function m246() {}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "async onReady() {\n try {\n // Initialize your adapter here\n //Logging of adapter start\n this.log.info('start fb-checkpresence: ip-address: \"' + this.config.ipaddress + '\" - interval devices: ' + this.config.interval + ' Min.' + ' - interval members: ' + this.config.intervalFamily + ' s');\n this.log.debug('configuration user: <' + this.config.username + '>');\n this.log.debug('configuration history: <' + this.config.history + '>');\n this.log.debug('configuration dateformat: <' + this.config.dateformat + '>');\n this.log.debug('configuration familymembers: ' + JSON.stringify(this.config.familymembers));\n this.log.debug('configuration fb-devices ' + this.config.fbdevices);\n this.log.debug('configuratuion mesh info: ' + this.config.meshinfo); \n\n //decrypt fritzbox password\n const sysObj = await this.getForeignObjectAsync('system.config');\n if (sysObj && sysObj.native && sysObj.native.secret) {\n this.config.password = this.decrypt(sysObj.native.secret, this.config.password);\n } else {\n this.config.password = this.decrypt('SdoeQ85NTrg1B0FtEyzf', this.config.password);\n }\n\n //Configuration changes if needed\n let adapterObj = (await this.getForeignObjectAsync(`system.adapter.${this.namespace}`));\n let adapterObjChanged = false; //for changes\n \n //if interval <= 0 than set to 1\n if (this.config.interval <= 0) {\n adapterObj.native.interval = 1;\n adapterObjChanged = true;\n this.config.interval = 1;\n this.log.warn('interval is less than 1. Set to 1 Min.');\n }\n\n //if interval <= 0 than set to 1\n if (this.config.intervalFamily <= 9) {\n adapterObj.native.intervalFamily = 10;\n adapterObjChanged = true;\n this.config.intervalFamily = 10;\n this.log.warn('interval is less than 10. Set to 10s.');\n }\n\n //create new configuration items -> workaround for older versions\n for(let i=0;i<this.config.familymembers.length;i++){\n if (this.config.familymembers[i].useip == undefined) {\n adapterObj.native.familymembers[i].useip = false;\n adapterObj.native.familymembers[i].ipaddress = '';\n adapterObjChanged = true;\n }\n }\n\n if (adapterObjChanged === true){ //Save changes\n await this.setForeignObjectAsync(`system.adapter.${this.namespace}`, adapterObj);\n }\n\n const cfg = {\n ip: this.config.ipaddress,\n port: '49000',\n iv: this.config.interval,\n history: this.config.history,\n dateFormat: this.config.dateformat,\n uid: this.config.username,\n pwd: this.config.password,\n members: this.config.familymembers,\n wl: this.config.whitelist\n };\n \n const cron = cfg.iv * 60;\n const cronFamily = this.config.intervalFamily;\n \n const devInfo = {\n host: this.config.ipaddress,\n port: '49000',\n sslPort: null,\n uid: this.config.username,\n pwd: this.config.password\n };\n\n this.Fb = await fb.Fb.init(devInfo, this);\n if(this.Fb.services === null) {\n this.log.error('Can not get services! Adapter stops');\n this.stopAdapter();\n }\n\n //Check if services/actions are supported\n this.GETPATH = await this.Fb.chkService('X_AVM-DE_GetHostListPath', 'Hosts1', 'X_AVM-DE_GetHostListPath');\n this.GETMESHPATH = await this.Fb.chkService('X_AVM-DE_GetMeshListPath', 'Hosts1', 'X_AVM-DE_GetMeshListPath');\n this.GETBYMAC = await this.Fb.chkService('GetSpecificHostEntry', 'Hosts1', 'GetSpecificHostEntry');\n this.GETBYIP = await this.Fb.chkService('X_AVM-DE_GetSpecificHostEntryByIP', 'Hosts1', 'X_AVM-DE_GetSpecificHostEntryByIP');\n this.GETPORT = await this.Fb.chkService('GetSecurityPort', 'DeviceInfo1', 'GetSecurityPort');\n this.GETEXTIP = await this.Fb.chkService('GetInfo', 'WANPPPConnection1', 'GetInfo');\n if ( this.GETEXTIP == false) this.GETEXTIP = await this.Fb.chkService('GetInfo', 'WANIPConnection1', 'GetInfo');\n this.SETENABLE = await this.Fb.chkService('SetEnable', 'WLANConfiguration3', 'SetEnable');\n this.WLAN3INFO = await this.Fb.chkService('GetInfo', 'WLANConfiguration3', 'WLANConfiguration3-GetInfo');\n this.DEVINFO = await this.Fb.chkService('GetInfo', 'DeviceInfo1', 'DeviceInfo1-GetInfo');\n this.DISALLOWWANACCESSBYIP = await this.Fb.chkService('DisallowWANAccessByIP', 'X_AVM-DE_HostFilter', 'DisallowWANAccessByIP');\n this.GETWANACCESSBYIP = await this.Fb.chkService('GetWANAccessByIP', 'X_AVM-DE_HostFilter', 'GetWANAccessByIP');\n this.REBOOT = await this.Fb.chkService('Reboot', 'DeviceConfig1', 'Reboot');\n \n //const test = await Fb.soapAction(Fb, '/upnp/control/deviceconfig', 'urn:dslforum-org:service:DeviceConfig:1', 'X_AVM-DE_CreateUrlSID', null);\n\n //Create global objects\n await obj.createGlobalObjects(this, this.HTML+this.HTML_END, this.HTML_GUEST+this.HTML_END, this.enabled);\n await obj.createMemberObjects(this, cfg, this.HTML_HISTORY + this.HTML_END, this.enabled);\n\n //create Fb devices\n if (this.GETPATH != null && this.GETPATH == true && this.config.fbdevices == true){\n const items = await this.Fb.getDeviceList(this, cfg, this.Fb);\n if (items != null){\n let res = await obj.createFbDeviceObjects(this, items, this.enabled);\n if (res === true) this.log.info('createFbDeviceObjects finished successfully');\n res = await obj.createMeshObjects(this, items, 0, this.enabled); //create channel 0 as default interface\n if (res === true) this.log.info('createMeshObjects finished successfully');\n }else{\n this.log.error('createFbDeviceObjects -> ' + \"can't read devices from fritzbox! Adapter stops\");\n adapterObj = await this.getForeignObjectAsync(`system.adapter.${this.namespace}`);\n adapterObj.common.enabled = false; // Adapter ausschalten\n await this.setForeignObjectAsync(`system.adapter.${this.namespace}`, adapterObj);\n }\n await this.resyncFbObjects(items);\n }\n\n // states changes inside the adapters namespace are subscribed\n if (this.SETENABLE === true && this.WLAN3INFO === true) this.subscribeStates(`${this.namespace}` + '.guest.wlan');\n if (this.DISALLOWWANACCESSBYIP === true && this.GETWANACCESSBYIP === true) this.subscribeStates(`${this.namespace}` + '.fb-devices.*.disabled'); \n if (this.REBOOT === true) this.subscribeStates(`${this.namespace}` + '.reboot'); \n\n //get uuid for transaction\n //const sSid = await Fb.soapAction(Fb, '/upnp/control/deviceconfig', urn + 'DeviceConfig:1', 'X_GenerateUUID', null);\n //const uuid = sSid['NewUUID'].replace('uuid:', '');\n this.loop(10, 55, cronFamily, cron, cfg);\n } catch (error) {\n this.showError('onReady: ' + error);\n }\n }", "async onReady() {\n // Initialize your adapter here\n\n this.setState(\"info.connection\", false, true);\n // Reset the connection indicator during startup\n this.type = \"VW\";\n this.country = \"DE\";\n this.clientId = \"9496332b-ea03-4091-a224-8c746b885068%40apps_vw-dilab_com\";\n this.xclientId = \"38761134-34d0-41f3-9a73-c4be88d7d337\";\n this.scope = \"openid%20profile%20mbb%20email%20cars%20birthdate%20badge%20address%20vin\";\n this.redirect = \"carnet%3A%2F%2Fidentity-kit%2Flogin\";\n this.xrequest = \"de.volkswagen.carnet.eu.eremote\";\n this.responseType = \"id_token%20token%20code\";\n this.xappversion = \"5.1.2\";\n this.xappname = \"eRemote\";\n if (this.config.type === \"id\") {\n this.type = \"Id\";\n this.country = \"DE\";\n this.clientId = \"a24fba63-34b3-4d43-b181-942111e6bda8@apps_vw-dilab_com\";\n this.xclientId = \"\";\n this.scope = \"openid profile badge cars dealers birthdate vin\";\n this.redirect = \"weconnect://authenticated\";\n this.xrequest = \"com.volkswagen.weconnect\";\n this.responseType = \"code id_token token\";\n this.xappversion = \"\";\n this.xappname = \"\";\n }\n if (this.config.type === \"skoda\") {\n this.type = \"Skoda\";\n this.country = \"CZ\";\n this.clientId = \"7f045eee-7003-4379-9968-9355ed2adb06%40apps_vw-dilab_com\";\n this.xclientId = \"28cd30c6-dee7-4529-a0e6-b1e07ff90b79\";\n this.scope = \"openid%20profile%20phone%20address%20cars%20email%20birthdate%20badge%20dealers%20driversLicense%20mbb\";\n this.redirect = \"skodaconnect%3A%2F%2Foidc.login%2F\";\n this.xrequest = \"cz.skodaauto.connect\";\n this.responseType = \"code%20id_token\";\n this.xappversion = \"3.2.6\";\n this.xappname = \"cz.skodaauto.connect\";\n }\n if (this.config.type === \"seat\") {\n this.type = \"Seat\";\n this.country = \"ES\";\n this.clientId = \"50f215ac-4444-4230-9fb1-fe15cd1a9bcc@apps_vw-dilab_com\";\n this.xclientId = \"9dcc70f0-8e79-423a-a3fa-4065d99088b4\";\n this.scope = \"openid profile mbb cars birthdate nickname address phone\";\n this.redirect = \"seatconnect://identity-kit/login\";\n this.xrequest = \"cz.skodaauto.connect\";\n this.responseType = \"code%20id_token\";\n this.xappversion = \"1.1.29\";\n this.xappname = \"SEATConnect\";\n }\n if (this.config.type === \"audi\") {\n this.type = \"Audi\";\n this.country = \"DE\";\n this.clientId = \"09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com\";\n this.xclientId = \"77869e21-e30a-4a92-b016-48ab7d3db1d8\";\n this.scope = \"address profile badge birthdate birthplace nationalIdentifier nationality profession email vin phone nickname name picture mbb gallery openid\";\n this.redirect = \"myaudi:///\";\n this.xrequest = \"de.myaudi.mobile.assistant\";\n this.responseType = \"token%20id_token\";\n // this.responseType = \"code\";\n this.xappversion = \"3.22.0\";\n this.xappname = \"myAudi\";\n }\n if (this.config.type === \"go\") {\n this.type = \"\";\n this.country = \"\";\n this.clientId = \"ac42b0fa-3b11-48a0-a941-43a399e7ef84@apps_vw-dilab_com\";\n this.xclientId = \"\";\n this.scope = \"openid%20profile%20address%20email%20phone\";\n this.redirect = \"vwconnect%3A%2F%2Fde.volkswagen.vwconnect%2Foauth2redirect%2Fidentitykit\";\n this.xrequest = \"\";\n this.responseType = \"code\";\n this.xappversion = \"\";\n this.xappname = \"\";\n }\n if (this.config.interval === 0) {\n this.log.info(\"Interval of 0 is not allowed reset to 1\");\n this.config.interval = 1;\n }\n this.login()\n .then(() => {\n this.log.debug(\"Login successful\");\n this.setState(\"info.connection\", true, true);\n this.getPersonalData()\n .then(() => {\n this.getVehicles()\n .then(() => {\n if (this.config.type !== \"go\") {\n this.vinArray.forEach((vin) => {\n if (this.config.type === \"id\") {\n this.getIdStatus(vin).catch(() => {\n this.log.error(\"get id status Failed\");\n });\n } else {\n this.getHomeRegion(vin)\n .catch(() => {\n this.log.debug(\"get home region Failed\");\n })\n .finally(() => {\n this.getVehicleData(vin).catch(() => {\n this.log.error(\"get vehicle data Failed\");\n });\n this.getVehicleRights(vin).catch(() => {\n this.log.error(\"get vehicle rights Failed\");\n });\n this.requestStatusUpdate(vin)\n .finally(() => {\n this.statesArray.forEach((state) => {\n this.getVehicleStatus(vin, state.url, state.path, state.element, state.element2, state.element3, state.element4).catch(() => {\n this.log.debug(\"error while getting \" + state.url);\n });\n });\n })\n .catch(() => {\n this.log.error(\"status update Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Error getting home region\");\n });\n }\n });\n }\n\n this.updateInterval = setInterval(() => {\n if (this.config.type === \"go\") {\n this.getVehicles();\n return;\n } else if (this.config.type === \"id\") {\n this.vinArray.forEach((vin) => {\n this.getIdStatus(vin).catch(() => {\n this.log.error(\"get id status Failed\");\n this.refreshIDToken().catch(() => {});\n });\n this.getWcData();\n });\n return;\n } else {\n this.vinArray.forEach((vin) => {\n this.statesArray.forEach((state) => {\n this.getVehicleStatus(vin, state.url, state.path, state.element, state.element2).catch(() => {\n this.log.debug(\"error while getting \" + state.url);\n });\n });\n });\n }\n }, this.config.interval * 60 * 1000);\n\n if (this.config.forceinterval > 0) {\n this.fupdateInterval = setInterval(() => {\n if (this.config.type === \"go\") {\n this.getVehicles();\n return;\n }\n this.vinArray.forEach((vin) => {\n this.requestStatusUpdate(vin).catch(() => {\n this.log.error(\"force status update Failed\");\n });\n });\n }, this.config.forceinterval * 60 * 1000);\n }\n })\n .catch(() => {\n this.log.error(\"Get Vehicles Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"get personal data Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Login Failed\");\n });\n this.subscribeStates(\"*\");\n }", "started () {}", "_specializedInitialisation()\r\n\t{\r\n\t\tLogger.log(\"Specialisation for service AVTransport\", LogType.Info);\r\n\t\tvar relativeTime = this.getVariableByName(\"RelativeTimePosition\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!relativeTime)\r\n\t\t\trelativeTime = this.getVariableByName(\"A_ARG_TYPE_GetPositionInfo_RelTime\");\r\n\t\tvar transportState = this.getVariableByName(\"TransportState\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!transportState)\r\n\t\t\ttransportState = this.getVariableByName(\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\");\r\n\r\n\t\tif (transportState)\r\n\t\t{\r\n\t\t\ttransportState.on('updated', (variable, newVal) =>\r\n\t\t\t{\r\n\t\t\t\tLogger.log(\"On transportStateUpdate : \" + newVal, LogType.DEBUG);\r\n\t\t\t\tvar actPosInfo = this.getActionByName(\"GetPositionInfo\");\r\n\t\t\t\tvar actMediaInfo = this.getActionByName(\"GetMediaInfo\");\r\n\t\t\t\t/*\r\n\t\t\t\t“STOPPED” R\r\n\t\t\t\t“PLAYING” R\r\n\t\t\t\t“TRANSITIONING” O\r\n\t\t\t\t”PAUSED_PLAYBACK” O\r\n\t\t\t\t“PAUSED_RECORDING” O\r\n\t\t\t\t“RECORDING” O\r\n\t\t\t\t“NO_MEDIA_PRESENT”\r\n\t\t\t\t */\r\n\t\t\t\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this._intervalUpdateRelativeTime)\r\n\t\t\t\t\t\tclearInterval(this._intervalUpdateRelativeTime);\r\n\t\t\t\t\tif (newVal == \"PLAYING\" || newVal == \"RECORDING\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t} );\r\n\t\t\t\t\t\t//Déclenche la maj toutes les 4 secondes\r\n\t\t\t\t\t\tthis._intervalUpdateRelativeTime = setInterval(() =>{\r\n\t\t\t\t\t\t\t\t//Logger.log(\"On autoUpdate\", LogType.DEBUG);\r\n\t\t\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t}\t);\r\n\t\t\t\t\t\t\t}, 4000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//else if (newVal == \"STOPPED\" || newVal == \"PAUSED_PLAYBACK\" || newVal == \"PAUSED_RECORDING\" || newVal == \"NO_MEDIA_PRESENT\")\r\n\t\t\t\t//{\r\n\t\t\t\t//\r\n\t\t\t\t//}\r\n\t\t\t\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\r\n\t\t\t\tif (newVal == \"TRANSITIONING\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{InstanceID: 0}\t);\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{InstanceID: 0} );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newVal == \"STOPPED\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t});\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{\tInstanceID: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}", "loadComponent(nodeURI, baseURI, callback_async /* nodeDescriptor */, errback_async /* errorMessage */) { // TODO: turn this into a generic xhr loader exposed as a kernel function?\n\n let self = this;\n\n if (nodeURI == self.kutility.protoNodeURI) {\n\n callback_async(self.kutility.protoNodeDescriptor);\n\n } else if (nodeURI.match(RegExp(\"^data:application/json;base64,\"))) {\n\n // Primarly for testing, parse one specific form of data URIs. We need to parse\n // these ourselves since Chrome can't load data URIs due to cross origin\n // restrictions.\n\n callback_async(JSON.parse(atob(nodeURI.substring(29)))); // TODO: support all data URIs\n\n } else {\n\n self.virtualTime.suspend(\"while loading \" + nodeURI); // suspend the queue\n\n let fetchUrl = self.remappedURI(nodeURI, baseURI);\n let dbName = fetchUrl.split(\".\").join(\"_\");\n\n const parseComp = function (f) {\n\n let result = JSON.parse(f);\n\n let nativeObject = result;\n // console.log(nativeObject);\n\n if (nativeObject) {\n callback_async(nativeObject);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n\n } else {\n\n self.logger.warnx(\"loadComponent\", \"error loading\", nodeURI + \":\", error);\n errback_async(error);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n }\n\n }\n\n\n //var fileName = \"\";\n // let userDB = _LCSDB.user(_LCS_WORLD_USER.pub); \n if (dbName.includes(\"proxy\")) {\n //userDB = await window._LCS_SYS_USER.get('proxy').then();\n let proxyDB = self.proxy ? _LCSDB.user(self.proxy) : _LCSDB.user(_LCS_WORLD_USER.pub);\n let fileName = dbName + '_json';\n let dbNode = proxyDB.get('proxy').get(fileName);\n let nodeProm = new Promise(res => dbNode.once(res));\n\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n\n } else {\n var worldName = dbName.split('/')[1];\n var fileName = dbName.split('/')[2];\n //+ '_json';\n\n if (!fileName) {\n worldName = self.helpers.appPath\n fileName = dbName + '_json';\n } else {\n fileName = fileName + '_json';\n }\n\n let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName);\n\n let nodeProm = new Promise(res => dbNode.once(res))\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n }\n\n //console.log(source);\n\n //userDB.get(fileName).once(async function(res) {\n\n\n\n\n // }, {wait: 1000})\n }\n\n }", "async onReady() {\n // Initialize your adapter here\n await this.setObjectNotExistsAsync('speed', {\n type: 'channel',\n common: {\n name: 'speed'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.download', {\n type: 'state',\n common: {\n name: 'download',\n role: 'info.status',\n type: 'number',\n desc: 'Download speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.upload', {\n type: 'state',\n common: {\n name: 'upload',\n role: 'info.status',\n type: 'number',\n desc: 'Upload speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.ping', {\n type: 'state',\n common: {\n name: 'ping',\n role: 'info.status',\n type: 'number',\n desc: 'Ping Latency',\n def: 0,\n read: true,\n write: false,\n unit: 'ms',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.progress', {\n type: 'state',\n common: {\n name: 'progress',\n role: 'info.status',\n type: 'number',\n desc: 'Progress',\n def: 0,\n read: true,\n write: false,\n unit: '%',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.speedcheck', {\n type: 'state',\n common: {\n name: 'Run speed test',\n type: 'boolean',\n read: true,\n role: 'button',\n write: true,\n def: false\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress', {\n type: 'channel',\n common: {\n name: 'speed'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.download', {\n type: 'state',\n common: {\n name: 'download',\n role: 'info.status',\n type: 'number',\n desc: 'Download speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.upload', {\n type: 'state',\n common: {\n name: 'upload',\n role: 'info.status',\n type: 'number',\n desc: 'Upload speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.ping', {\n type: 'state',\n common: {\n name: 'ping',\n role: 'info.status',\n type: 'number',\n desc: 'Ping Latency',\n def: 0,\n read: true,\n write: false,\n unit: 'ms',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.progress', {\n type: 'state',\n common: {\n name: 'progress',\n role: 'info.status',\n type: 'number',\n desc: 'Progress',\n def: 0,\n read: true,\n write: false,\n unit: '%',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.speedcheck', {\n type: 'state',\n common: {\n name: 'Run speed test',\n type: 'boolean',\n read: true,\n role: 'button',\n write: true,\n def: false\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info', {\n type: 'channel',\n common: {\n name: 'Information'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info.externalip', {\n type: 'state',\n common: {\n name: 'External IP',\n role: 'info.status',\n type: 'string',\n desc: 'External IP',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info.internalip', {\n type: 'state',\n common: {\n name: 'Internal IP',\n role: 'info.status',\n type: 'string',\n desc: 'Internal IP',\n read: true,\n write: false,\n },\n native: {},\n });\n this.subscribeStates('*');\n await this.setStateAsync('info.connection', { val: true, ack: true });\n // let result = await this.checkPasswordAsync('admin', 'iobroker');\n // this.log.info('check user admin pw iobroker: ' + result);\n // result = await this.checkGroupAsync('admin', 'admin');\n // this.log.info('check group user admin group admin: ' + result);\n if (this.config.polltime > 1) {\n this.log.info('Checking internet speed every ' + this.config.polltime + ' minutes');\n } else {\n this.log.info('Checking internet speed every ' + this.config.polltime + ' minute');\n }\n await this.start(this.config.polltime);\n }", "enqueue() {\n\n }", "started() { }", "onBrowserStart(browser) {\n\n }", "getPort2() {\n return 0;\n }", "requestReceived(request,response){\n if(this.config.log){\n const logData={\n method : request.method,\n url : request.url,\n headers : request.headers\n };\n\n this.config.logFunction(\n logData\n );\n }\n\n let uri = url.parse(request.url);\n uri.protocol='http';\n uri.host=uri.hostname=request.headers.host;\n uri.port=80;\n uri.query=querystring.parse(uri.query);\n\n if(request.connection.encrypted){\n uri.protocol='https';\n uri.port=443;\n }\n\n (\n function(){\n if(!uri.host){\n return;\n }\n const host=uri.host.split(':');\n\n if(!host[1]){\n return;\n }\n uri.host=uri.hostname=host[0];\n uri.port=host[1];\n }\n )();\n\n for(let key in uri){\n if(uri[key]!==null){\n continue;\n }\n uri[key]='';\n }\n\n request.uri=uri;\n\n if(\n this.onRawRequest(\n request,\n response,\n completeServing.bind(this)\n )\n ){\n return;\n };\n\n uri=uri.pathname;\n\n if (uri=='/'){\n uri=`/${this.config.server.index}`;\n }\n\n let hostname= [];\n\n if (request.headers.host !== undefined){\n hostname = request.headers.host.split(':');\n }\n\n let root = this.config.root;\n\n if(this.config.verbose){\n console.log(`${this.config.logID} REQUEST ###\\n\\n`,\n request.headers,'\\n',\n uri,'\\n\\n',\n hostname,'\\n\\n'\n );\n }\n\n if(this.config.domain!='0.0.0.0' && hostname.length > 0 && hostname[0]!=this.config.domain){\n if(!this.config.domains[hostname[0]]){\n if(this.config.verbose){\n console.log(`${this.config.logID} INVALID HOST ###\\n\\n`);\n }\n this.serveFile(hostname[0],false,response);\n return;\n }\n root=this.config.domains[hostname[0]];\n }\n\n\n if(this.config.verbose){\n console.log(`${this.config.logID} USING ROOT : ${root}###\\n\\n`);\n }\n\n if(uri.slice(-1)=='/'){\n uri+=this.config.server.index;\n }\n\n request.url=uri;\n request.serverRoot=root;\n\n request.body='';\n\n request.on(\n 'data',\n function(chunk){\n request.body+=chunk;\n }.bind(this)\n ).on(\n 'end',\n function(){\n if(this.config.verbose){\n console.log(`###REQUEST BODY :\n ${request.body}\n ###\n `);\n }\n\n requestBodyComplete.bind(this,request,response)();\n }.bind(this)\n );\n }", "function OnChannelOpen()\n{\n}", "connect() {\n throw new Error(\n 'The Message Bus is not currently supported in browser environments'\n );\n }", "constructor() {\n throw new Error('Not implemented');\n }", "constructor() {\n this._connectionResolver = new pip_services3_components_node_1.ConnectionResolver();\n this._maxKeySize = 250;\n this._maxExpiration = 2592000;\n this._maxValue = 1048576;\n this._poolSize = 5;\n this._reconnect = 10000;\n this._timeout = 5000;\n this._retries = 5;\n this._failures = 5;\n this._retry = 30000;\n this._remove = false;\n this._idle = 5000;\n this._client = null;\n }", "componentDidMount()\n {\n\n }", "function OfflineStreamProcessor(config) {\n config = config || {};\n var context = this.context;\n var eventBus = config.eventBus;\n var events = config.events;\n var errors = config.errors;\n var debug = config.debug;\n var constants = config.constants;\n var settings = config.settings;\n var dashConstants = config.dashConstants;\n var manifestId = config.id;\n var type = config.type;\n var streamInfo = config.streamInfo;\n var errHandler = config.errHandler;\n var mediaPlayerModel = config.mediaPlayerModel;\n var abrController = config.abrController;\n var playbackController = config.playbackController;\n var adapter = config.adapter;\n var dashMetrics = config.dashMetrics;\n var baseURLController = config.baseURLController;\n var timelineConverter = config.timelineConverter;\n var bitrate = config.bitrate;\n var offlineStoreController = config.offlineStoreController;\n var completedCb = config.callbacks && config.callbacks.completed;\n var progressCb = config.callbacks && config.callbacks.progression;\n var instance, logger, mediaInfo, indexHandler, representationController, fragmentModel, updating, downloadedSegments, isInitialized, segmentsController, isStopped;\n\n function setup() {\n resetInitialSettings();\n logger = debug.getLogger(instance);\n segmentsController = Object(_dash_controllers_SegmentsController__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(context).create({\n events: events,\n eventBus: eventBus,\n streamInfo: streamInfo,\n timelineConverter: timelineConverter,\n dashConstants: dashConstants,\n segmentBaseController: config.segmentBaseController,\n type: type\n });\n indexHandler = Object(_dash_DashHandler__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(context).create({\n streamInfo: streamInfo,\n type: type,\n timelineConverter: timelineConverter,\n dashMetrics: dashMetrics,\n mediaPlayerModel: mediaPlayerModel,\n baseURLController: baseURLController,\n errHandler: errHandler,\n settings: settings,\n // boxParser: boxParser,\n eventBus: eventBus,\n events: events,\n debug: debug,\n requestModifier: Object(_streaming_utils_RequestModifier__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(context).getInstance(),\n dashConstants: dashConstants,\n constants: constants,\n segmentsController: segmentsController,\n urlUtils: Object(_streaming_utils_URLUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).getInstance()\n });\n representationController = Object(_dash_controllers_RepresentationController__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(context).create({\n streamInfo: streamInfo,\n type: type,\n abrController: abrController,\n dashMetrics: dashMetrics,\n playbackController: playbackController,\n timelineConverter: timelineConverter,\n dashConstants: dashConstants,\n events: events,\n eventBus: eventBus,\n errors: errors,\n segmentsController: segmentsController\n });\n fragmentModel = Object(_streaming_models_FragmentModel__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(context).create({\n streamInfo: streamInfo,\n dashMetrics: dashMetrics,\n fragmentLoader: Object(_streaming_FragmentLoader__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(context).create({\n dashMetrics: dashMetrics,\n mediaPlayerModel: mediaPlayerModel,\n errHandler: errHandler,\n requestModifier: Object(_streaming_utils_RequestModifier__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(context).getInstance(),\n settings: settings,\n eventBus: eventBus,\n events: events,\n errors: errors,\n constants: constants,\n dashConstants: dashConstants,\n urlUtils: Object(_streaming_utils_URLUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).getInstance()\n }),\n debug: debug,\n eventBus: eventBus,\n events: events\n });\n eventBus.on(events.STREAM_REQUESTING_COMPLETED, onStreamRequestingCompleted, instance);\n eventBus.on(events.FRAGMENT_LOADING_COMPLETED, onFragmentLoadingCompleted, instance);\n }\n\n function initialize(_mediaInfo) {\n mediaInfo = _mediaInfo;\n indexHandler.initialize(false);\n updateRepresentation(mediaInfo);\n }\n\n function isInitRequest(request) {\n return request.type === 'InitializationSegment';\n }\n\n function onFragmentLoadingCompleted(e) {\n if (e.sender !== fragmentModel) {\n return;\n }\n\n if (e.request !== null) {\n var isInit = isInitRequest(e.request);\n var suffix = isInit ? 'init' : e.request.index;\n var fragmentName = e.request.representationId + '_' + suffix;\n offlineStoreController.storeFragment(manifestId, fragmentName, e.response).then(function () {\n if (!isInit) {\n // store current index and downloadedSegments number\n offlineStoreController.setRepresentationCurrentState(manifestId, e.request.representationId, {\n index: e.request.index,\n downloaded: downloadedSegments\n });\n }\n });\n }\n\n if (e.error && e.request.serviceLocation && !isStopped) {\n fragmentModel.executeRequest(e.request);\n } else {\n downloadedSegments++;\n download();\n }\n }\n\n function onStreamRequestingCompleted(e) {\n if (e.fragmentModel !== fragmentModel) {\n return;\n }\n\n logger.info(\"[\".concat(manifestId, \"] Stream is complete\"));\n stop();\n completedCb();\n }\n\n function getRepresentationController() {\n return representationController;\n }\n\n function getRepresentationId() {\n return representationController.getCurrentRepresentation().id;\n }\n /**\n * Stops download of fragments\n * @memberof OfflineStreamProcessor#\n */\n\n\n function stop() {\n if (isStopped) {\n return;\n }\n\n isStopped = true;\n }\n\n function removeExecutedRequestsBeforeTime(time) {\n if (fragmentModel) {\n fragmentModel.removeExecutedRequestsBeforeTime(time);\n }\n }\n /**\n * Execute init request for the represenation\n * @memberof OfflineStreamProcessor#\n */\n\n\n function getInitRequest() {\n if (!representationController.getCurrentRepresentation()) {\n return null;\n }\n\n return indexHandler.getInitRequest(getMediaInfo(), representationController.getCurrentRepresentation());\n }\n /**\n * Get next request\n * @memberof OfflineStreamProcessor#\n */\n\n\n function getNextRequest() {\n return indexHandler.getNextSegmentRequest(getMediaInfo(), representationController.getCurrentRepresentation());\n }\n /**\n * Start download\n * @memberof OfflineStreamProcessor#\n */\n\n\n function start() {\n if (representationController) {\n if (!representationController.getCurrentRepresentation()) {\n throw new Error('Start denied to OfflineStreamProcessor');\n }\n\n isStopped = false;\n offlineStoreController.getRepresentationCurrentState(manifestId, representationController.getCurrentRepresentation().id).then(function (state) {\n if (state) {\n indexHandler.setCurrentIndex(state.index);\n downloadedSegments = state.downloaded;\n }\n\n download();\n })[\"catch\"](function () {\n // start from beginining\n download();\n });\n }\n }\n /**\n * Performs download of fragment according to type\n * @memberof OfflineStreamProcessor#\n */\n\n\n function download() {\n if (isStopped) {\n return;\n }\n\n if (isNaN(representationController.getCurrentRepresentation())) {\n var request = null;\n\n if (!isInitialized) {\n request = getInitRequest();\n isInitialized = true;\n } else {\n request = getNextRequest(); // update progression : done here because availableSegmentsNumber is done in getNextRequest from dash handler\n\n updateProgression();\n }\n\n if (request) {\n logger.info(\"[\".concat(manifestId, \"] download request : \").concat(request.url));\n fragmentModel.executeRequest(request);\n } else {\n logger.info(\"[\".concat(manifestId, \"] no request to be downloaded\"));\n }\n }\n }\n /**\n * Update representation\n * @param {Object} mediaInfo - mediaInfo\n * @memberof OfflineStreamProcessor#\n */\n\n\n function updateRepresentation(mediaInfo) {\n updating = true;\n var voRepresentations = adapter.getVoRepresentations(mediaInfo); // get representation VO according to id.\n\n var quality = voRepresentations.findIndex(function (representation) {\n return representation.id === bitrate.id;\n });\n\n if (type !== constants.VIDEO && type !== constants.AUDIO && type !== constants.TEXT) {\n updating = false;\n return;\n }\n\n representationController.updateData(null, voRepresentations, type, mediaInfo.isFragmented, quality);\n }\n\n function isUpdating() {\n return updating;\n }\n\n function getType() {\n return type;\n }\n\n function getMediaInfo() {\n return mediaInfo;\n }\n\n function getAvailableSegmentsNumber() {\n return representationController.getCurrentRepresentation().availableSegmentsNumber + 1; // do not forget init segment\n }\n\n function updateProgression() {\n if (progressCb) {\n progressCb(instance, downloadedSegments, getAvailableSegmentsNumber());\n }\n }\n\n function resetInitialSettings() {\n isInitialized = false;\n downloadedSegments = 0;\n updating = false;\n }\n /**\n * Reset\n * @memberof OfflineStreamProcessor#\n */\n\n\n function reset() {\n resetInitialSettings();\n indexHandler.reset();\n eventBus.off(events.STREAM_REQUESTING_COMPLETED, onStreamRequestingCompleted, instance);\n eventBus.off(events.FRAGMENT_LOADING_COMPLETED, onFragmentLoadingCompleted, instance);\n }\n\n instance = {\n initialize: initialize,\n getMediaInfo: getMediaInfo,\n getRepresentationController: getRepresentationController,\n removeExecutedRequestsBeforeTime: removeExecutedRequestsBeforeTime,\n getType: getType,\n getRepresentationId: getRepresentationId,\n isUpdating: isUpdating,\n start: start,\n stop: stop,\n getAvailableSegmentsNumber: getAvailableSegmentsNumber,\n reset: reset\n };\n setup();\n return instance;\n}", "constructor() {\r\n }", "constructor() {\n\t\t// ...\n\t}", "static get STATUS() {\n return 0;\n }", "onReady() {\n return __awaiter(this, void 0, void 0, function* () {\n this.logger = new log_1.ioBrokerLogger(this.log);\n yield this.setObjectNotExistsAsync(\"verify_code\", {\n type: \"state\",\n common: {\n name: \"2FA verification code\",\n type: \"number\",\n role: \"state\",\n read: true,\n write: true,\n },\n native: {},\n });\n yield this.setObjectNotExistsAsync(\"info\", {\n type: \"channel\",\n common: {\n name: \"info\"\n },\n native: {},\n });\n yield this.setObjectNotExistsAsync(\"info.connection\", {\n type: \"state\",\n common: {\n name: \"Global connection\",\n type: \"boolean\",\n role: \"indicator.connection\",\n read: true,\n write: false,\n },\n native: {},\n });\n yield this.setStateAsync(\"info.connection\", { val: false, ack: true });\n yield this.setObjectNotExistsAsync(\"info.push_connection\", {\n type: \"state\",\n common: {\n name: \"Push notification connection\",\n type: \"boolean\",\n role: \"indicator.connection\",\n read: true,\n write: false,\n },\n native: {},\n });\n // Remove old states of previous adapter versions\n try {\n const schedule_modes = yield this.getStatesAsync(\"*.schedule_mode\");\n Object.keys(schedule_modes).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const push_notifications = yield this.getStatesAsync(\"push_notification.*\");\n Object.keys(push_notifications).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n yield this.delObjectAsync(\"push_notification\");\n }\n catch (error) {\n }\n try {\n const last_camera_url = yield this.getStatesAsync(\"*.last_camera_url\");\n Object.keys(last_camera_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const captured_pic_url = yield this.getStatesAsync(\"*.captured_pic_url\");\n Object.keys(captured_pic_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const person_identified = yield this.getStatesAsync(\"*.person_identified\");\n Object.keys(person_identified).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const last_captured_pic_url = yield this.getStatesAsync(\"*.last_captured_pic_url\");\n Object.keys(last_captured_pic_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const last_captured_pic_html = yield this.getStatesAsync(\"*.last_captured_pic_html\");\n Object.keys(last_captured_pic_html).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n // End\n // Reset event states if necessary (for example because of an unclean exit)\n yield this.initializeEvents(types_1.CameraStateID.PERSON_DETECTED);\n yield this.initializeEvents(types_1.CameraStateID.MOTION_DETECTED);\n yield this.initializeEvents(types_1.DoorbellStateID.RINGING);\n yield this.initializeEvents(types_1.IndoorCameraStateID.CRYING_DETECTED);\n yield this.initializeEvents(types_1.IndoorCameraStateID.SOUND_DETECTED);\n yield this.initializeEvents(types_1.IndoorCameraStateID.PET_DETECTED);\n try {\n if (fs.statSync(this.persistentFile).isFile()) {\n const fileContent = fs.readFileSync(this.persistentFile, \"utf8\");\n this.persistentData = JSON.parse(fileContent);\n }\n }\n catch (err) {\n this.logger.debug(\"No stored data from last exit found.\");\n }\n //TODO: Temporary Test to be removed!\n /*await this.setObjectNotExistsAsync(\"test_button\", {\n type: \"state\",\n common: {\n name: \"Test button\",\n type: \"boolean\",\n role: \"button\",\n read: false,\n write: true,\n },\n native: {},\n });\n this.subscribeStates(\"test_button\");\n await this.setObjectNotExistsAsync(\"test_button2\", {\n type: \"state\",\n common: {\n name: \"Test button2\",\n type: \"boolean\",\n role: \"button\",\n read: false,\n write: true,\n },\n native: {},\n });\n this.subscribeStates(\"test_button2\");*/\n // END\n this.subscribeStates(\"verify_code\");\n const systemConfig = yield this.getForeignObjectAsync(\"system.config\");\n let countryCode = undefined;\n let languageCode = undefined;\n if (systemConfig) {\n countryCode = i18n_iso_countries_1.getAlpha2Code(systemConfig.common.country, \"en\");\n if (i18n_iso_languages_1.isValid(systemConfig.common.language))\n languageCode = systemConfig.common.language;\n }\n try {\n const adapter_info = yield this.getForeignObjectAsync(`system.adapter.${this.namespace}`);\n if (adapter_info && adapter_info.common && adapter_info.common.version) {\n if (this.persistentData.version !== adapter_info.common.version) {\n const currentVersion = Number.parseFloat(utils_1.removeLastChar(adapter_info.common.version, \".\"));\n const previousVersion = this.persistentData.version !== \"\" && this.persistentData.version !== undefined ? Number.parseFloat(utils_1.removeLastChar(this.persistentData.version, \".\")) : 0;\n this.logger.debug(`Handling of adapter update - currentVersion: ${currentVersion} previousVersion: ${previousVersion}`);\n if (previousVersion < currentVersion) {\n yield utils_1.handleUpdate(this, this.logger, previousVersion);\n this.persistentData.version = adapter_info.common.version;\n this.writePersistentData();\n }\n }\n }\n }\n catch (error) {\n this.logger.error(`Handling of adapter update - Error:`, error);\n }\n this.eufy = new EufySecurityAPI.EufySecurity(this, this.logger, countryCode, languageCode);\n this.eufy.on(\"stations\", (stations) => this.handleStations(stations));\n this.eufy.on(\"devices\", (devices) => this.handleDevices(devices));\n this.eufy.on(\"push message\", (messages) => this.handlePushNotification(messages));\n this.eufy.on(\"connect\", () => this.onConnect());\n this.eufy.on(\"close\", () => this.onClose());\n this.eufy.on(\"livestream start\", (station, device, url) => this.onStartLivestream(station, device, url));\n this.eufy.on(\"livestream stop\", (station, device) => this.onStopLivestream(station, device));\n this.eufy.on(\"push connect\", () => this.onPushConnect());\n this.eufy.on(\"push close\", () => this.onPushClose());\n const api = this.eufy.getApi();\n if (this.persistentData.api_base && this.persistentData.api_base != \"\") {\n this.logger.debug(`Load previous api_base: ${this.persistentData.api_base}`);\n api.setAPIBase(this.persistentData.api_base);\n }\n if (this.persistentData.login_hash && this.persistentData.login_hash != \"\") {\n this.logger.debug(`Load previous login_hash: ${this.persistentData.login_hash}`);\n if (utils_1.md5(`${this.config.username}:${this.config.password}`) != this.persistentData.login_hash) {\n this.logger.info(`Authentication properties changed, invalidate saved cloud token.`);\n this.persistentData.cloud_token = \"\";\n this.persistentData.cloud_token_expiration = 0;\n this.persistentData.api_base = \"\";\n }\n }\n else {\n this.persistentData.cloud_token = \"\";\n this.persistentData.cloud_token_expiration = 0;\n }\n if (this.persistentData.cloud_token && this.persistentData.cloud_token != \"\") {\n this.logger.debug(`Load previous token: ${this.persistentData.cloud_token} token_expiration: ${this.persistentData.cloud_token_expiration}`);\n api.setToken(this.persistentData.cloud_token);\n api.setTokenExpiration(new Date(this.persistentData.cloud_token_expiration));\n }\n if (!this.persistentData.openudid || this.persistentData.openudid == \"\") {\n this.persistentData.openudid = utils_1.generateUDID();\n this.logger.debug(`Generated new openudid: ${this.persistentData.openudid}`);\n }\n api.setOpenUDID(this.persistentData.openudid);\n if (!this.persistentData.serial_number || this.persistentData.serial_number == \"\") {\n this.persistentData.serial_number = utils_1.generateSerialnumber(12);\n this.logger.debug(`Generated new serial_number: ${this.persistentData.serial_number}`);\n }\n api.setSerialNumber(this.persistentData.serial_number);\n yield this.eufy.logon();\n });\n }", "function AppMeasurement(r){var a=this;a.version=\"2.8.2\";var k=window;k.s_c_in||(k.s_c_il=[],k.s_c_in=0);a._il=k.s_c_il;a._in=k.s_c_in;a._il[a._in]=a;k.s_c_in++;a._c=\"s_c\";var p=k.AppMeasurement.Xb;p||(p=null);var n=k,m,s;try{for(m=n.parent,s=n.location;m&&m.location&&s&&\"\"+m.location!=\"\"+s&&n.location&&\"\"+m.location!=\"\"+n.location&&m.location.host==s.host;)n=m,m=n.parent}catch(u){}a.F=function(a){try{console.log(a)}catch(b){}};a.Oa=function(a){return\"\"+parseInt(a)==\"\"+a};a.replace=function(a,b,d){return!a||\r\n0>a.indexOf(b)?a:a.split(b).join(d)};a.escape=function(c){var b,d;if(!c)return c;c=encodeURIComponent(c);for(b=0;7>b;b++)d=\"+~!*()'\".substring(b,b+1),0<=c.indexOf(d)&&(c=a.replace(c,d,\"%\"+d.charCodeAt(0).toString(16).toUpperCase()));return c};a.unescape=function(c){if(!c)return c;c=0<=c.indexOf(\"+\")?a.replace(c,\"+\",\" \"):c;try{return decodeURIComponent(c)}catch(b){}return unescape(c)};a.Fb=function(){var c=k.location.hostname,b=a.fpCookieDomainPeriods,d;b||(b=a.cookieDomainPeriods);if(c&&!a.Ga&&!/^[0-9.]+$/.test(c)&&\r\n(b=b?parseInt(b):2,b=2<b?b:2,d=c.lastIndexOf(\".\"),0<=d)){for(;0<=d&&1<b;)d=c.lastIndexOf(\".\",d-1),b--;a.Ga=0<d?c.substring(d):c}return a.Ga};a.c_r=a.cookieRead=function(c){c=a.escape(c);var b=\" \"+a.d.cookie,d=b.indexOf(\" \"+c+\"=\"),f=0>d?d:b.indexOf(\";\",d);c=0>d?\"\":a.unescape(b.substring(d+2+c.length,0>f?b.length:f));return\"[[B]]\"!=c?c:\"\"};a.c_w=a.cookieWrite=function(c,b,d){var f=a.Fb(),e=a.cookieLifetime,g;b=\"\"+b;e=e?(\"\"+e).toUpperCase():\"\";d&&\"SESSION\"!=e&&\"NONE\"!=e&&((g=\"\"!=b?parseInt(e?e:0):-60)?\r\n(d=new Date,d.setTime(d.getTime()+1E3*g)):1==d&&(d=new Date,g=d.getYear(),d.setYear(g+5+(1900>g?1900:0))));return c&&\"NONE\"!=e?(a.d.cookie=a.escape(c)+\"=\"+a.escape(\"\"!=b?b:\"[[B]]\")+\"; path=/;\"+(d&&\"SESSION\"!=e?\" expires=\"+d.toUTCString()+\";\":\"\")+(f?\" domain=\"+f+\";\":\"\"),a.cookieRead(c)==b):0};a.Cb=function(){var c=a.Util.getIeVersion();\"number\"===typeof c&&10>c&&(a.unsupportedBrowser=!0,a.rb(a,function(){}))};a.rb=function(a,b){for(var d in a)a.hasOwnProperty(d)&&\"function\"===typeof a[d]&&(a[d]=b)};\r\na.L=[];a.ja=function(c,b,d){if(a.Ha)return 0;a.maxDelay||(a.maxDelay=250);var f=0,e=(new Date).getTime()+a.maxDelay,g=a.d.visibilityState,h=[\"webkitvisibilitychange\",\"visibilitychange\"];g||(g=a.d.webkitVisibilityState);if(g&&\"prerender\"==g){if(!a.ka)for(a.ka=1,d=0;d<h.length;d++)a.d.addEventListener(h[d],function(){var c=a.d.visibilityState;c||(c=a.d.webkitVisibilityState);\"visible\"==c&&(a.ka=0,a.delayReady())});f=1;e=0}else d||a.p(\"_d\")&&(f=1);f&&(a.L.push({m:c,a:b,t:e}),a.ka||setTimeout(a.delayReady,\r\na.maxDelay));return f};a.delayReady=function(){var c=(new Date).getTime(),b=0,d;for(a.p(\"_d\")?b=1:a.za();0<a.L.length;){d=a.L.shift();if(b&&!d.t&&d.t>c){a.L.unshift(d);setTimeout(a.delayReady,parseInt(a.maxDelay/2));break}a.Ha=1;a[d.m].apply(a,d.a);a.Ha=0}};a.setAccount=a.sa=function(c){var b,d;if(!a.ja(\"setAccount\",arguments))if(a.account=c,a.allAccounts)for(b=a.allAccounts.concat(c.split(\",\")),a.allAccounts=[],b.sort(),d=0;d<b.length;d++)0!=d&&b[d-1]==b[d]||a.allAccounts.push(b[d]);else a.allAccounts=\r\nc.split(\",\")};a.foreachVar=function(c,b){var d,f,e,g,h=\"\";e=f=\"\";if(a.lightProfileID)d=a.P,(h=a.lightTrackVars)&&(h=\",\"+h+\",\"+a.oa.join(\",\")+\",\");else{d=a.g;if(a.pe||a.linkType)h=a.linkTrackVars,f=a.linkTrackEvents,a.pe&&(e=a.pe.substring(0,1).toUpperCase()+a.pe.substring(1),a[e]&&(h=a[e].Vb,f=a[e].Ub));h&&(h=\",\"+h+\",\"+a.H.join(\",\")+\",\");f&&h&&(h+=\",events,\")}b&&(b=\",\"+b+\",\");for(f=0;f<d.length;f++)e=d[f],(g=a[e])&&(!h||0<=h.indexOf(\",\"+e+\",\"))&&(!b||0<=b.indexOf(\",\"+e+\",\"))&&c(e,g)};a.r=function(c,\r\nb,d,f,e){var g=\"\",h,l,k,q,m=0;\"contextData\"==c&&(c=\"c\");if(b){for(h in b)if(!(Object.prototype[h]||e&&h.substring(0,e.length)!=e)&&b[h]&&(!d||0<=d.indexOf(\",\"+(f?f+\".\":\"\")+h+\",\"))){k=!1;if(m)for(l=0;l<m.length;l++)h.substring(0,m[l].length)==m[l]&&(k=!0);if(!k&&(\"\"==g&&(g+=\"&\"+c+\".\"),l=b[h],e&&(h=h.substring(e.length)),0<h.length))if(k=h.indexOf(\".\"),0<k)l=h.substring(0,k),k=(e?e:\"\")+l+\".\",m||(m=[]),m.push(k),g+=a.r(l,b,d,f,k);else if(\"boolean\"==typeof l&&(l=l?\"true\":\"false\"),l){if(\"retrieveLightData\"==\r\nf&&0>e.indexOf(\".contextData.\"))switch(k=h.substring(0,4),q=h.substring(4),h){case \"transactionID\":h=\"xact\";break;case \"channel\":h=\"ch\";break;case \"campaign\":h=\"v0\";break;default:a.Oa(q)&&(\"prop\"==k?h=\"c\"+q:\"eVar\"==k?h=\"v\"+q:\"list\"==k?h=\"l\"+q:\"hier\"==k&&(h=\"h\"+q,l=l.substring(0,255)))}g+=\"&\"+a.escape(h)+\"=\"+a.escape(l)}}\"\"!=g&&(g+=\"&.\"+c)}return g};a.usePostbacks=0;a.Ib=function(){var c=\"\",b,d,f,e,g,h,l,k,q=\"\",m=\"\",n=e=\"\";if(a.lightProfileID)b=a.P,(q=a.lightTrackVars)&&(q=\",\"+q+\",\"+a.oa.join(\",\")+\r\n\",\");else{b=a.g;if(a.pe||a.linkType)q=a.linkTrackVars,m=a.linkTrackEvents,a.pe&&(e=a.pe.substring(0,1).toUpperCase()+a.pe.substring(1),a[e]&&(q=a[e].Vb,m=a[e].Ub));q&&(q=\",\"+q+\",\"+a.H.join(\",\")+\",\");m&&(m=\",\"+m+\",\",q&&(q+=\",events,\"));a.events2&&(n+=(\"\"!=n?\",\":\"\")+a.events2)}if(a.visitor&&a.visitor.getCustomerIDs){e=p;if(g=a.visitor.getCustomerIDs())for(d in g)Object.prototype[d]||(f=g[d],\"object\"==typeof f&&(e||(e={}),f.id&&(e[d+\".id\"]=f.id),f.authState&&(e[d+\".as\"]=f.authState)));e&&(c+=a.r(\"cid\",\r\ne))}a.AudienceManagement&&a.AudienceManagement.isReady()&&(c+=a.r(\"d\",a.AudienceManagement.getEventCallConfigParams()));for(d=0;d<b.length;d++){e=b[d];g=a[e];f=e.substring(0,4);h=e.substring(4);g||(\"events\"==e&&n?(g=n,n=\"\"):\"marketingCloudOrgID\"==e&&a.visitor&&(g=a.visitor.marketingCloudOrgID));if(g&&(!q||0<=q.indexOf(\",\"+e+\",\"))){switch(e){case \"customerPerspective\":e=\"cp\";break;case \"marketingCloudOrgID\":e=\"mcorgid\";break;case \"supplementalDataID\":e=\"sdid\";break;case \"timestamp\":e=\"ts\";break;case \"dynamicVariablePrefix\":e=\r\n\"D\";break;case \"visitorID\":e=\"vid\";break;case \"marketingCloudVisitorID\":e=\"mid\";break;case \"analyticsVisitorID\":e=\"aid\";break;case \"audienceManagerLocationHint\":e=\"aamlh\";break;case \"audienceManagerBlob\":e=\"aamb\";break;case \"authState\":e=\"as\";break;case \"pageURL\":e=\"g\";255<g.length&&(a.pageURLRest=g.substring(255),g=g.substring(0,255));break;case \"pageURLRest\":e=\"-g\";break;case \"referrer\":e=\"r\";break;case \"vmk\":case \"visitorMigrationKey\":e=\"vmt\";break;case \"visitorMigrationServer\":e=\"vmf\";a.ssl&&\r\na.visitorMigrationServerSecure&&(g=\"\");break;case \"visitorMigrationServerSecure\":e=\"vmf\";!a.ssl&&a.visitorMigrationServer&&(g=\"\");break;case \"charSet\":e=\"ce\";break;case \"visitorNamespace\":e=\"ns\";break;case \"cookieDomainPeriods\":e=\"cdp\";break;case \"cookieLifetime\":e=\"cl\";break;case \"variableProvider\":e=\"vvp\";break;case \"currencyCode\":e=\"cc\";break;case \"channel\":e=\"ch\";break;case \"transactionID\":e=\"xact\";break;case \"campaign\":e=\"v0\";break;case \"latitude\":e=\"lat\";break;case \"longitude\":e=\"lon\";break;\r\ncase \"resolution\":e=\"s\";break;case \"colorDepth\":e=\"c\";break;case \"javascriptVersion\":e=\"j\";break;case \"javaEnabled\":e=\"v\";break;case \"cookiesEnabled\":e=\"k\";break;case \"browserWidth\":e=\"bw\";break;case \"browserHeight\":e=\"bh\";break;case \"connectionType\":e=\"ct\";break;case \"homepage\":e=\"hp\";break;case \"events\":n&&(g+=(\"\"!=g?\",\":\"\")+n);if(m)for(h=g.split(\",\"),g=\"\",f=0;f<h.length;f++)l=h[f],k=l.indexOf(\"=\"),0<=k&&(l=l.substring(0,k)),k=l.indexOf(\":\"),0<=k&&(l=l.substring(0,k)),0<=m.indexOf(\",\"+l+\",\")&&(g+=\r\n(g?\",\":\"\")+h[f]);break;case \"events2\":g=\"\";break;case \"contextData\":c+=a.r(\"c\",a[e],q,e);g=\"\";break;case \"lightProfileID\":e=\"mtp\";break;case \"lightStoreForSeconds\":e=\"mtss\";a.lightProfileID||(g=\"\");break;case \"lightIncrementBy\":e=\"mti\";a.lightProfileID||(g=\"\");break;case \"retrieveLightProfiles\":e=\"mtsr\";break;case \"deleteLightProfiles\":e=\"mtsd\";break;case \"retrieveLightData\":a.retrieveLightProfiles&&(c+=a.r(\"mts\",a[e],q,e));g=\"\";break;default:a.Oa(h)&&(\"prop\"==f?e=\"c\"+h:\"eVar\"==f?e=\"v\"+h:\"list\"==\r\nf?e=\"l\"+h:\"hier\"==f&&(e=\"h\"+h,g=g.substring(0,255)))}g&&(c+=\"&\"+e+\"=\"+(\"pev\"!=e.substring(0,3)?a.escape(g):g))}\"pev3\"==e&&a.e&&(c+=a.e)}a.na&&(c+=\"&lrt=\"+a.na,a.na=null);return c};a.D=function(a){var b=a.tagName;if(\"undefined\"!=\"\"+a.$b||\"undefined\"!=\"\"+a.Qb&&\"HTML\"!=(\"\"+a.Qb).toUpperCase())return\"\";b=b&&b.toUpperCase?b.toUpperCase():\"\";\"SHAPE\"==b&&(b=\"\");b&&((\"INPUT\"==b||\"BUTTON\"==b)&&a.type&&a.type.toUpperCase?b=a.type.toUpperCase():!b&&a.href&&(b=\"A\"));return b};a.Ka=function(a){var b=k.location,\r\nd=a.href?a.href:\"\",f,e,g;f=d.indexOf(\":\");e=d.indexOf(\"?\");g=d.indexOf(\"/\");d&&(0>f||0<=e&&f>e||0<=g&&f>g)&&(e=a.protocol&&1<a.protocol.length?a.protocol:b.protocol?b.protocol:\"\",f=b.pathname.lastIndexOf(\"/\"),d=(e?e+\"//\":\"\")+(a.host?a.host:b.host?b.host:\"\")+(\"/\"!=d.substring(0,1)?b.pathname.substring(0,0>f?0:f)+\"/\":\"\")+d);return d};a.M=function(c){var b=a.D(c),d,f,e=\"\",g=0;return b&&(d=c.protocol,f=c.onclick,!c.href||\"A\"!=b&&\"AREA\"!=b||f&&d&&!(0>d.toLowerCase().indexOf(\"javascript\"))?f?(e=a.replace(a.replace(a.replace(a.replace(\"\"+\r\nf,\"\\r\",\"\"),\"\\n\",\"\"),\"\\t\",\"\"),\" \",\"\"),g=2):\"INPUT\"==b||\"SUBMIT\"==b?(c.value?e=c.value:c.innerText?e=c.innerText:c.textContent&&(e=c.textContent),g=3):\"IMAGE\"==b&&c.src&&(e=c.src):e=a.Ka(c),e)?{id:e.substring(0,100),type:g}:0};a.Yb=function(c){for(var b=a.D(c),d=a.M(c);c&&!d&&\"BODY\"!=b;)if(c=c.parentElement?c.parentElement:c.parentNode)b=a.D(c),d=a.M(c);d&&\"BODY\"!=b||(c=0);c&&(b=c.onclick?\"\"+c.onclick:\"\",0<=b.indexOf(\".tl(\")||0<=b.indexOf(\".trackLink(\"))&&(c=0);return c};a.Pb=function(){var c,b,d=a.linkObject,\r\nf=a.linkType,e=a.linkURL,g,h;a.pa=1;d||(a.pa=0,d=a.clickObject);if(d){c=a.D(d);for(b=a.M(d);d&&!b&&\"BODY\"!=c;)if(d=d.parentElement?d.parentElement:d.parentNode)c=a.D(d),b=a.M(d);b&&\"BODY\"!=c||(d=0);if(d&&!a.linkObject){var l=d.onclick?\"\"+d.onclick:\"\";if(0<=l.indexOf(\".tl(\")||0<=l.indexOf(\".trackLink(\"))d=0}}else a.pa=1;!e&&d&&(e=a.Ka(d));e&&!a.linkLeaveQueryString&&(g=e.indexOf(\"?\"),0<=g&&(e=e.substring(0,g)));if(!f&&e){var m=0,q=0,n;if(a.trackDownloadLinks&&a.linkDownloadFileTypes)for(l=e.toLowerCase(),\r\ng=l.indexOf(\"?\"),h=l.indexOf(\"#\"),0<=g?0<=h&&h<g&&(g=h):g=h,0<=g&&(l=l.substring(0,g)),g=a.linkDownloadFileTypes.toLowerCase().split(\",\"),h=0;h<g.length;h++)(n=g[h])&&l.substring(l.length-(n.length+1))==\".\"+n&&(f=\"d\");if(a.trackExternalLinks&&!f&&(l=e.toLowerCase(),a.Na(l)&&(a.linkInternalFilters||(a.linkInternalFilters=k.location.hostname),g=0,a.linkExternalFilters?(g=a.linkExternalFilters.toLowerCase().split(\",\"),m=1):a.linkInternalFilters&&(g=a.linkInternalFilters.toLowerCase().split(\",\")),g))){for(h=\r\n0;h<g.length;h++)n=g[h],0<=l.indexOf(n)&&(q=1);q?m&&(f=\"e\"):m||(f=\"e\")}}a.linkObject=d;a.linkURL=e;a.linkType=f;if(a.trackClickMap||a.trackInlineStats)a.e=\"\",d&&(f=a.pageName,e=1,d=d.sourceIndex,f||(f=a.pageURL,e=0),k.s_objectID&&(b.id=k.s_objectID,d=b.type=1),f&&b&&b.id&&c&&(a.e=\"&pid=\"+a.escape(f.substring(0,255))+(e?\"&pidt=\"+e:\"\")+\"&oid=\"+a.escape(b.id.substring(0,100))+(b.type?\"&oidt=\"+b.type:\"\")+\"&ot=\"+c+(d?\"&oi=\"+d:\"\")))};a.Jb=function(){var c=a.pa,b=a.linkType,d=a.linkURL,f=a.linkName;b&&(d||\r\nf)&&(b=b.toLowerCase(),\"d\"!=b&&\"e\"!=b&&(b=\"o\"),a.pe=\"lnk_\"+b,a.pev1=d?a.escape(d):\"\",a.pev2=f?a.escape(f):\"\",c=1);a.abort&&(c=0);if(a.trackClickMap||a.trackInlineStats||a.ActivityMap){var b={},d=0,e=a.cookieRead(\"s_sq\"),g=e?e.split(\"&\"):0,h,l,k,e=0;if(g)for(h=0;h<g.length;h++)l=g[h].split(\"=\"),f=a.unescape(l[0]).split(\",\"),l=a.unescape(l[1]),b[l]=f;f=a.account.split(\",\");h={};for(k in a.contextData)k&&!Object.prototype[k]&&\"a.activitymap.\"==k.substring(0,14)&&(h[k]=a.contextData[k],a.contextData[k]=\r\n\"\");a.e=a.r(\"c\",h)+(a.e?a.e:\"\");if(c||a.e){c&&!a.e&&(e=1);for(l in b)if(!Object.prototype[l])for(k=0;k<f.length;k++)for(e&&(g=b[l].join(\",\"),g==a.account&&(a.e+=(\"&\"!=l.charAt(0)?\"&\":\"\")+l,b[l]=[],d=1)),h=0;h<b[l].length;h++)g=b[l][h],g==f[k]&&(e&&(a.e+=\"&u=\"+a.escape(g)+(\"&\"!=l.charAt(0)?\"&\":\"\")+l+\"&u=0\"),b[l].splice(h,1),d=1);c||(d=1);if(d){e=\"\";h=2;!c&&a.e&&(e=a.escape(f.join(\",\"))+\"=\"+a.escape(a.e),h=1);for(l in b)!Object.prototype[l]&&0<h&&0<b[l].length&&(e+=(e?\"&\":\"\")+a.escape(b[l].join(\",\"))+\r\n\"=\"+a.escape(l),h--);a.cookieWrite(\"s_sq\",e)}}}return c};a.Kb=function(){if(!a.Tb){var c=new Date,b=n.location,d,f,e=f=d=\"\",g=\"\",h=\"\",l=\"1.2\",k=a.cookieWrite(\"s_cc\",\"true\",0)?\"Y\":\"N\",m=\"\",p=\"\";if(c.setUTCDate&&(l=\"1.3\",(0).toPrecision&&(l=\"1.5\",c=[],c.forEach))){l=\"1.6\";f=0;d={};try{f=new Iterator(d),f.next&&(l=\"1.7\",c.reduce&&(l=\"1.8\",l.trim&&(l=\"1.8.1\",Date.parse&&(l=\"1.8.2\",Object.create&&(l=\"1.8.5\")))))}catch(r){}}d=screen.width+\"x\"+screen.height;e=navigator.javaEnabled()?\"Y\":\"N\";f=screen.pixelDepth?\r\nscreen.pixelDepth:screen.colorDepth;g=a.w.innerWidth?a.w.innerWidth:a.d.documentElement.offsetWidth;h=a.w.innerHeight?a.w.innerHeight:a.d.documentElement.offsetHeight;try{a.b.addBehavior(\"#default#homePage\"),m=a.b.Zb(b)?\"Y\":\"N\"}catch(s){}try{a.b.addBehavior(\"#default#clientCaps\"),p=a.b.connectionType}catch(t){}a.resolution=d;a.colorDepth=f;a.javascriptVersion=l;a.javaEnabled=e;a.cookiesEnabled=k;a.browserWidth=g;a.browserHeight=h;a.connectionType=p;a.homepage=m;a.Tb=1}};a.Q={};a.loadModule=function(c,\r\nb){var d=a.Q[c];if(!d){d=k[\"AppMeasurement_Module_\"+c]?new k[\"AppMeasurement_Module_\"+c](a):{};a.Q[c]=a[c]=d;d.kb=function(){return d.qb};d.sb=function(b){if(d.qb=b)a[c+\"_onLoad\"]=b,a.ja(c+\"_onLoad\",[a,d],1)||b(a,d)};try{Object.defineProperty?Object.defineProperty(d,\"onLoad\",{get:d.kb,set:d.sb}):d._olc=1}catch(f){d._olc=1}}b&&(a[c+\"_onLoad\"]=b,a.ja(c+\"_onLoad\",[a,d],1)||b(a,d))};a.p=function(c){var b,d;for(b in a.Q)if(!Object.prototype[b]&&(d=a.Q[b])&&(d._olc&&d.onLoad&&(d._olc=0,d.onLoad(a,d)),d[c]&&\r\nd[c]()))return 1;return 0};a.Mb=function(){var c=Math.floor(1E13*Math.random()),b=a.visitorSampling,d=a.visitorSamplingGroup,d=\"s_vsn_\"+(a.visitorNamespace?a.visitorNamespace:a.account)+(d?\"_\"+d:\"\"),f=a.cookieRead(d);if(b){b*=100;f&&(f=parseInt(f));if(!f){if(!a.cookieWrite(d,c))return 0;f=c}if(f%1E4>b)return 0}return 1};a.R=function(c,b){var d,f,e,g,h,l;for(d=0;2>d;d++)for(f=0<d?a.Ca:a.g,e=0;e<f.length;e++)if(g=f[e],(h=c[g])||c[\"!\"+g]){if(!b&&(\"contextData\"==g||\"retrieveLightData\"==g)&&a[g])for(l in a[g])h[l]||\r\n(h[l]=a[g][l]);a[g]=h}};a.Ya=function(c,b){var d,f,e,g;for(d=0;2>d;d++)for(f=0<d?a.Ca:a.g,e=0;e<f.length;e++)g=f[e],c[g]=a[g],b||c[g]||(c[\"!\"+g]=1)};a.Eb=function(a){var b,d,f,e,g,h=0,l,k=\"\",m=\"\";if(a&&255<a.length&&(b=\"\"+a,d=b.indexOf(\"?\"),0<d&&(l=b.substring(d+1),b=b.substring(0,d),e=b.toLowerCase(),f=0,\"http://\"==e.substring(0,7)?f+=7:\"https://\"==e.substring(0,8)&&(f+=8),d=e.indexOf(\"/\",f),0<d&&(e=e.substring(f,d),g=b.substring(d),b=b.substring(0,d),0<=e.indexOf(\"google\")?h=\",q,ie,start,search_key,word,kw,cd,\":\r\n0<=e.indexOf(\"yahoo.co\")&&(h=\",p,ei,\"),h&&l)))){if((a=l.split(\"&\"))&&1<a.length){for(f=0;f<a.length;f++)e=a[f],d=e.indexOf(\"=\"),0<d&&0<=h.indexOf(\",\"+e.substring(0,d)+\",\")?k+=(k?\"&\":\"\")+e:m+=(m?\"&\":\"\")+e;k&&m?l=k+\"&\"+m:m=\"\"}d=253-(l.length-m.length)-b.length;a=b+(0<d?g.substring(0,d):\"\")+\"?\"+l}return a};a.eb=function(c){var b=a.d.visibilityState,d=[\"webkitvisibilitychange\",\"visibilitychange\"];b||(b=a.d.webkitVisibilityState);if(b&&\"prerender\"==b){if(c)for(b=0;b<d.length;b++)a.d.addEventListener(d[b],\r\nfunction(){var b=a.d.visibilityState;b||(b=a.d.webkitVisibilityState);\"visible\"==b&&c()});return!1}return!0};a.fa=!1;a.J=!1;a.ub=function(){a.J=!0;a.j()};a.da=!1;a.V=!1;a.pb=function(c){a.marketingCloudVisitorID=c;a.V=!0;a.j()};a.ga=!1;a.W=!1;a.vb=function(c){a.visitorOptedOut=c;a.W=!0;a.j()};a.aa=!1;a.S=!1;a.$a=function(c){a.analyticsVisitorID=c;a.S=!0;a.j()};a.ca=!1;a.U=!1;a.bb=function(c){a.audienceManagerLocationHint=c;a.U=!0;a.j()};a.ba=!1;a.T=!1;a.ab=function(c){a.audienceManagerBlob=c;a.T=\r\n!0;a.j()};a.cb=function(c){a.maxDelay||(a.maxDelay=250);return a.p(\"_d\")?(c&&setTimeout(function(){c()},a.maxDelay),!1):!0};a.ea=!1;a.I=!1;a.za=function(){a.I=!0;a.j()};a.isReadyToTrack=function(){var c=!0,b=a.visitor,d,f,e;a.fa||a.J||(a.eb(a.ub)?a.J=!0:a.fa=!0);if(a.fa&&!a.J)return!1;b&&b.isAllowed()&&(a.da||a.marketingCloudVisitorID||!b.getMarketingCloudVisitorID||(a.da=!0,a.marketingCloudVisitorID=b.getMarketingCloudVisitorID([a,a.pb]),a.marketingCloudVisitorID&&(a.V=!0)),a.ga||a.visitorOptedOut||\r\n!b.isOptedOut||(a.ga=!0,a.visitorOptedOut=b.isOptedOut([a,a.vb]),a.visitorOptedOut!=p&&(a.W=!0)),a.aa||a.analyticsVisitorID||!b.getAnalyticsVisitorID||(a.aa=!0,a.analyticsVisitorID=b.getAnalyticsVisitorID([a,a.$a]),a.analyticsVisitorID&&(a.S=!0)),a.ca||a.audienceManagerLocationHint||!b.getAudienceManagerLocationHint||(a.ca=!0,a.audienceManagerLocationHint=b.getAudienceManagerLocationHint([a,a.bb]),a.audienceManagerLocationHint&&(a.U=!0)),a.ba||a.audienceManagerBlob||!b.getAudienceManagerBlob||(a.ba=\r\n!0,a.audienceManagerBlob=b.getAudienceManagerBlob([a,a.ab]),a.audienceManagerBlob&&(a.T=!0)),c=a.da&&!a.V&&!a.marketingCloudVisitorID,b=a.aa&&!a.S&&!a.analyticsVisitorID,d=a.ca&&!a.U&&!a.audienceManagerLocationHint,f=a.ba&&!a.T&&!a.audienceManagerBlob,e=a.ga&&!a.W,c=c||b||d||f||e?!1:!0);a.ea||a.I||(a.cb(a.za)?a.I=!0:a.ea=!0);a.ea&&!a.I&&(c=!1);return c};a.o=p;a.u=0;a.callbackWhenReadyToTrack=function(c,b,d){var f;f={};f.zb=c;f.yb=b;f.wb=d;a.o==p&&(a.o=[]);a.o.push(f);0==a.u&&(a.u=setInterval(a.j,\r\n100))};a.j=function(){var c;if(a.isReadyToTrack()&&(a.tb(),a.o!=p))for(;0<a.o.length;)c=a.o.shift(),c.yb.apply(c.zb,c.wb)};a.tb=function(){a.u&&(clearInterval(a.u),a.u=0)};a.mb=function(c){var b,d,f=p,e=p;if(!a.isReadyToTrack()){b=[];if(c!=p)for(d in f={},c)f[d]=c[d];e={};a.Ya(e,!0);b.push(f);b.push(e);a.callbackWhenReadyToTrack(a,a.track,b);return!0}return!1};a.Gb=function(){var c=a.cookieRead(\"s_fid\"),b=\"\",d=\"\",f;f=8;var e=4;if(!c||0>c.indexOf(\"-\")){for(c=0;16>c;c++)f=Math.floor(Math.random()*f),\r\nb+=\"0123456789ABCDEF\".substring(f,f+1),f=Math.floor(Math.random()*e),d+=\"0123456789ABCDEF\".substring(f,f+1),f=e=16;c=b+\"-\"+d}a.cookieWrite(\"s_fid\",c,1)||(c=0);return c};a.t=a.track=function(c,b){var d,f=new Date,e=\"s\"+Math.floor(f.getTime()/108E5)%10+Math.floor(1E13*Math.random()),g=f.getYear(),g=\"t=\"+a.escape(f.getDate()+\"/\"+f.getMonth()+\"/\"+(1900>g?g+1900:g)+\" \"+f.getHours()+\":\"+f.getMinutes()+\":\"+f.getSeconds()+\" \"+f.getDay()+\" \"+f.getTimezoneOffset());a.visitor&&a.visitor.getAuthState&&(a.authState=\r\na.visitor.getAuthState());a.p(\"_s\");a.mb(c)||(b&&a.R(b),c&&(d={},a.Ya(d,0),a.R(c)),a.Mb()&&!a.visitorOptedOut&&(a.analyticsVisitorID||a.marketingCloudVisitorID||(a.fid=a.Gb()),a.Pb(),a.usePlugins&&a.doPlugins&&a.doPlugins(a),a.account&&(a.abort||(a.trackOffline&&!a.timestamp&&(a.timestamp=Math.floor(f.getTime()/1E3)),f=k.location,a.pageURL||(a.pageURL=f.href?f.href:f),a.referrer||a.Za||(f=a.Util.getQueryParam(\"adobe_mc_ref\",null,null,!0),a.referrer=f||void 0===f?void 0===f?\"\":f:n.document.referrer),\r\na.Za=1,a.referrer=a.Eb(a.referrer),a.p(\"_g\")),a.Jb()&&!a.abort&&(a.visitor&&!a.supplementalDataID&&a.visitor.getSupplementalDataID&&(a.supplementalDataID=a.visitor.getSupplementalDataID(\"AppMeasurement:\"+a._in,a.expectSupplementalData?!1:!0)),a.Kb(),g+=a.Ib(),a.ob(e,g),a.p(\"_t\"),a.referrer=\"\"))),c&&a.R(d,1));a.abort=a.supplementalDataID=a.timestamp=a.pageURLRest=a.linkObject=a.clickObject=a.linkURL=a.linkName=a.linkType=k.s_objectID=a.pe=a.pev1=a.pev2=a.pev3=a.e=a.lightProfileID=0};a.Ba=[];a.registerPreTrackCallback=\r\nfunction(c){for(var b=[],d=1;d<arguments.length;d++)b.push(arguments[d]);\"function\"==typeof c?a.Ba.push([c,b]):a.debugTracking&&a.F(\"DEBUG: Non function type passed to registerPreTrackCallback\")};a.hb=function(c){a.xa(a.Ba,c)};a.Aa=[];a.registerPostTrackCallback=function(c){for(var b=[],d=1;d<arguments.length;d++)b.push(arguments[d]);\"function\"==typeof c?a.Aa.push([c,b]):a.debugTracking&&a.F(\"DEBUG: Non function type passed to registerPostTrackCallback\")};a.gb=function(c){a.xa(a.Aa,c)};a.xa=function(c,\r\nb){if(\"object\"==typeof c)for(var d=0;d<c.length;d++){var f=c[d][0],e=c[d][1];e.unshift(b);if(\"function\"==typeof f)try{f.apply(null,e)}catch(g){a.debugTracking&&a.F(g.message)}}};a.tl=a.trackLink=function(c,b,d,f,e){a.linkObject=c;a.linkType=b;a.linkName=d;e&&(a.l=c,a.A=e);return a.track(f)};a.trackLight=function(c,b,d,f){a.lightProfileID=c;a.lightStoreForSeconds=b;a.lightIncrementBy=d;return a.track(f)};a.clearVars=function(){var c,b;for(c=0;c<a.g.length;c++)if(b=a.g[c],\"prop\"==b.substring(0,4)||\r\n\"eVar\"==b.substring(0,4)||\"hier\"==b.substring(0,4)||\"list\"==b.substring(0,4)||\"channel\"==b||\"events\"==b||\"eventList\"==b||\"products\"==b||\"productList\"==b||\"purchaseID\"==b||\"transactionID\"==b||\"state\"==b||\"zip\"==b||\"campaign\"==b)a[b]=void 0};a.tagContainerMarker=\"\";a.ob=function(c,b){var d=a.ib()+\"/\"+c+\"?AQB=1&ndh=1&pf=1&\"+(a.ya()?\"callback=s_c_il[\"+a._in+\"].doPostbacks&et=1&\":\"\")+b+\"&AQE=1\";a.hb(d);a.fb(d);a.X()};a.ib=function(){var c=a.jb();return\"http\"+(a.ssl?\"s\":\"\")+\"://\"+c+\"/b/ss/\"+a.account+\"/\"+\r\n(a.mobile?\"5.\":\"\")+(a.ya()?\"10\":\"1\")+\"/JS-\"+a.version+(a.Sb?\"T\":\"\")+(a.tagContainerMarker?\"-\"+a.tagContainerMarker:\"\")};a.ya=function(){return a.AudienceManagement&&a.AudienceManagement.isReady()||0!=a.usePostbacks};a.jb=function(){var c=a.dc,b=a.trackingServer;b?a.trackingServerSecure&&a.ssl&&(b=a.trackingServerSecure):(c=c?(\"\"+c).toLowerCase():\"d1\",\"d1\"==c?c=\"112\":\"d2\"==c&&(c=\"122\"),b=a.lb()+\".\"+c+\".2o7.net\");return b};a.lb=function(){var c=a.visitorNamespace;c||(c=a.account.split(\",\")[0],c=c.replace(/[^0-9a-z]/gi,\r\n\"\"));return c};a.Xa=/{(%?)(.*?)(%?)}/;a.Wb=RegExp(a.Xa.source,\"g\");a.Db=function(c){if(\"object\"==typeof c.dests)for(var b=0;b<c.dests.length;++b){var d=c.dests[b];if(\"string\"==typeof d.c&&\"aa.\"==d.id.substr(0,3))for(var f=d.c.match(a.Wb),e=0;e<f.length;++e){var g=f[e],h=g.match(a.Xa),k=\"\";\"%\"==h[1]&&\"timezone_offset\"==h[2]?k=(new Date).getTimezoneOffset():\"%\"==h[1]&&\"timestampz\"==h[2]&&(k=a.Hb());d.c=d.c.replace(g,a.escape(k))}}};a.Hb=function(){var c=new Date,b=new Date(6E4*Math.abs(c.getTimezoneOffset()));\r\nreturn a.k(4,c.getFullYear())+\"-\"+a.k(2,c.getMonth()+1)+\"-\"+a.k(2,c.getDate())+\"T\"+a.k(2,c.getHours())+\":\"+a.k(2,c.getMinutes())+\":\"+a.k(2,c.getSeconds())+(0<c.getTimezoneOffset()?\"-\":\"+\")+a.k(2,b.getUTCHours())+\":\"+a.k(2,b.getUTCMinutes())};a.k=function(a,b){return(Array(a+1).join(0)+b).slice(-a)};a.ua={};a.doPostbacks=function(c){if(\"object\"==typeof c)if(a.Db(c),\"object\"==typeof a.AudienceManagement&&\"function\"==typeof a.AudienceManagement.isReady&&a.AudienceManagement.isReady()&&\"function\"==typeof a.AudienceManagement.passData)a.AudienceManagement.passData(c);\r\nelse if(\"object\"==typeof c&&\"object\"==typeof c.dests)for(var b=0;b<c.dests.length;++b){var d=c.dests[b];\"object\"==typeof d&&\"string\"==typeof d.c&&\"string\"==typeof d.id&&\"aa.\"==d.id.substr(0,3)&&(a.ua[d.id]=new Image,a.ua[d.id].alt=\"\",a.ua[d.id].src=d.c)}};a.fb=function(c){a.i||a.Lb();a.i.push(c);a.ma=a.C();a.Va()};a.Lb=function(){a.i=a.Nb();a.i||(a.i=[])};a.Nb=function(){var c,b;if(a.ta()){try{(b=k.localStorage.getItem(a.qa()))&&(c=k.JSON.parse(b))}catch(d){}return c}};a.ta=function(){var c=!0;a.trackOffline&&\r\na.offlineFilename&&k.localStorage&&k.JSON||(c=!1);return c};a.La=function(){var c=0;a.i&&(c=a.i.length);a.q&&c++;return c};a.X=function(){if(a.q&&(a.B&&a.B.complete&&a.B.G&&a.B.wa(),a.q))return;a.Ma=p;if(a.ra)a.ma>a.O&&a.Ta(a.i),a.va(500);else{var c=a.xb();if(0<c)a.va(c);else if(c=a.Ia())a.q=1,a.Ob(c),a.Rb(c)}};a.va=function(c){a.Ma||(c||(c=0),a.Ma=setTimeout(a.X,c))};a.xb=function(){var c;if(!a.trackOffline||0>=a.offlineThrottleDelay)return 0;c=a.C()-a.Ra;return a.offlineThrottleDelay<c?0:a.offlineThrottleDelay-\r\nc};a.Ia=function(){if(0<a.i.length)return a.i.shift()};a.Ob=function(c){if(a.debugTracking){var b=\"AppMeasurement Debug: \"+c;c=c.split(\"&\");var d;for(d=0;d<c.length;d++)b+=\"\\n\\t\"+a.unescape(c[d]);a.F(b)}};a.nb=function(){return a.marketingCloudVisitorID||a.analyticsVisitorID};a.Z=!1;var t;try{t=JSON.parse('{\"x\":\"y\"}')}catch(w){t=null}t&&\"y\"==t.x?(a.Z=!0,a.Y=function(a){return JSON.parse(a)}):k.$&&k.$.parseJSON?(a.Y=function(a){return k.$.parseJSON(a)},a.Z=!0):a.Y=function(){return null};a.Rb=function(c){var b,\r\nd,f;a.nb()&&2047<c.length&&(\"undefined\"!=typeof XMLHttpRequest&&(b=new XMLHttpRequest,\"withCredentials\"in b?d=1:b=0),b||\"undefined\"==typeof XDomainRequest||(b=new XDomainRequest,d=2),b&&(a.AudienceManagement&&a.AudienceManagement.isReady()||0!=a.usePostbacks)&&(a.Z?b.Da=!0:b=0));!b&&a.Wa&&(c=c.substring(0,2047));!b&&a.d.createElement&&(0!=a.usePostbacks||a.AudienceManagement&&a.AudienceManagement.isReady())&&(b=a.d.createElement(\"SCRIPT\"))&&\"async\"in b&&((f=(f=a.d.getElementsByTagName(\"HEAD\"))&&f[0]?\r\nf[0]:a.d.body)?(b.type=\"text/javascript\",b.setAttribute(\"async\",\"async\"),d=3):b=0);b||(b=new Image,b.alt=\"\",b.abort||\"undefined\"===typeof k.InstallTrigger||(b.abort=function(){b.src=p}));b.Sa=Date.now();b.Fa=function(){try{b.G&&(clearTimeout(b.G),b.G=0)}catch(a){}};b.onload=b.wa=function(){b.Sa&&(a.na=Date.now()-b.Sa);a.gb(c);b.Fa();a.Bb();a.ha();a.q=0;a.X();if(b.Da){b.Da=!1;try{a.doPostbacks(a.Y(b.responseText))}catch(d){}}};b.onabort=b.onerror=b.Ja=function(){b.Fa();(a.trackOffline||a.ra)&&a.q&&\r\na.i.unshift(a.Ab);a.q=0;a.ma>a.O&&a.Ta(a.i);a.ha();a.va(500)};b.onreadystatechange=function(){4==b.readyState&&(200==b.status?b.wa():b.Ja())};a.Ra=a.C();if(1==d||2==d){var e=c.indexOf(\"?\");f=c.substring(0,e);e=c.substring(e+1);e=e.replace(/&callback=[a-zA-Z0-9_.\\[\\]]+/,\"\");1==d?(b.open(\"POST\",f,!0),b.send(e)):2==d&&(b.open(\"POST\",f),b.send(e))}else if(b.src=c,3==d){if(a.Pa)try{f.removeChild(a.Pa)}catch(g){}f.firstChild?f.insertBefore(b,f.firstChild):f.appendChild(b);a.Pa=a.B}b.G=setTimeout(function(){b.G&&\r\n(b.complete?b.wa():(a.trackOffline&&b.abort&&b.abort(),b.Ja()))},5E3);a.Ab=c;a.B=k[\"s_i_\"+a.replace(a.account,\",\",\"_\")]=b;if(a.useForcedLinkTracking&&a.K||a.A)a.forcedLinkTrackingTimeout||(a.forcedLinkTrackingTimeout=250),a.ia=setTimeout(a.ha,a.forcedLinkTrackingTimeout)};a.Bb=function(){if(a.ta()&&!(a.Qa>a.O))try{k.localStorage.removeItem(a.qa()),a.Qa=a.C()}catch(c){}};a.Ta=function(c){if(a.ta()){a.Va();try{k.localStorage.setItem(a.qa(),k.JSON.stringify(c)),a.O=a.C()}catch(b){}}};a.Va=function(){if(a.trackOffline){if(!a.offlineLimit||\r\n0>=a.offlineLimit)a.offlineLimit=10;for(;a.i.length>a.offlineLimit;)a.Ia()}};a.forceOffline=function(){a.ra=!0};a.forceOnline=function(){a.ra=!1};a.qa=function(){return a.offlineFilename+\"-\"+a.visitorNamespace+a.account};a.C=function(){return(new Date).getTime()};a.Na=function(a){a=a.toLowerCase();return 0!=a.indexOf(\"#\")&&0!=a.indexOf(\"about:\")&&0!=a.indexOf(\"opera:\")&&0!=a.indexOf(\"javascript:\")?!0:!1};a.setTagContainer=function(c){var b,d,f;a.Sb=c;for(b=0;b<a._il.length;b++)if((d=a._il[b])&&\"s_l\"==\r\nd._c&&d.tagContainerName==c){a.R(d);if(d.lmq)for(b=0;b<d.lmq.length;b++)f=d.lmq[b],a.loadModule(f.n);if(d.ml)for(f in d.ml)if(a[f])for(b in c=a[f],f=d.ml[f],f)!Object.prototype[b]&&(\"function\"!=typeof f[b]||0>(\"\"+f[b]).indexOf(\"s_c_il\"))&&(c[b]=f[b]);if(d.mmq)for(b=0;b<d.mmq.length;b++)f=d.mmq[b],a[f.m]&&(c=a[f.m],c[f.f]&&\"function\"==typeof c[f.f]&&(f.a?c[f.f].apply(c,f.a):c[f.f].apply(c)));if(d.tq)for(b=0;b<d.tq.length;b++)a.track(d.tq[b]);d.s=a;break}};a.Util={urlEncode:a.escape,urlDecode:a.unescape,\r\ncookieRead:a.cookieRead,cookieWrite:a.cookieWrite,getQueryParam:function(c,b,d,f){var e,g=\"\";b||(b=a.pageURL?a.pageURL:k.location);d=d?d:\"&\";if(!c||!b)return g;b=\"\"+b;e=b.indexOf(\"?\");if(0>e)return g;b=d+b.substring(e+1)+d;if(!f||!(0<=b.indexOf(d+c+d)||0<=b.indexOf(d+c+\"=\"+d))){e=b.indexOf(\"#\");0<=e&&(b=b.substr(0,e)+d);e=b.indexOf(d+c+\"=\");if(0>e)return g;b=b.substring(e+d.length+c.length+1);e=b.indexOf(d);0<=e&&(b=b.substring(0,e));0<b.length&&(g=a.unescape(b));return g}},getIeVersion:function(){if(document.documentMode)return document.documentMode;\r\nfor(var a=7;4<a;a--){var b=document.createElement(\"div\");b.innerHTML=\"\\x3c!--[if IE \"+a+\"]><span></span><![endif]--\\x3e\";if(b.getElementsByTagName(\"span\").length)return a}return null}};a.H=\"supplementalDataID timestamp dynamicVariablePrefix visitorID marketingCloudVisitorID analyticsVisitorID audienceManagerLocationHint authState fid vmk visitorMigrationKey visitorMigrationServer visitorMigrationServerSecure charSet visitorNamespace cookieDomainPeriods fpCookieDomainPeriods cookieLifetime pageName pageURL customerPerspective referrer contextData currencyCode lightProfileID lightStoreForSeconds lightIncrementBy retrieveLightProfiles deleteLightProfiles retrieveLightData\".split(\" \");\r\na.g=a.H.concat(\"purchaseID variableProvider channel server pageType transactionID campaign state zip events events2 products audienceManagerBlob tnt\".split(\" \"));a.oa=\"timestamp charSet visitorNamespace cookieDomainPeriods cookieLifetime contextData lightProfileID lightStoreForSeconds lightIncrementBy\".split(\" \");a.P=a.oa.slice(0);a.Ca=\"account allAccounts debugTracking visitor visitorOptedOut trackOffline offlineLimit offlineThrottleDelay offlineFilename usePlugins doPlugins configURL visitorSampling visitorSamplingGroup linkObject clickObject linkURL linkName linkType trackDownloadLinks trackExternalLinks trackClickMap trackInlineStats linkLeaveQueryString linkTrackVars linkTrackEvents linkDownloadFileTypes linkExternalFilters linkInternalFilters useForcedLinkTracking forcedLinkTrackingTimeout trackingServer trackingServerSecure ssl abort mobile dc lightTrackVars maxDelay expectSupplementalData usePostbacks registerPreTrackCallback registerPostTrackCallback AudienceManagement\".split(\" \");\r\nfor(m=0;250>=m;m++)76>m&&(a.g.push(\"prop\"+m),a.P.push(\"prop\"+m)),a.g.push(\"eVar\"+m),a.P.push(\"eVar\"+m),6>m&&a.g.push(\"hier\"+m),4>m&&a.g.push(\"list\"+m);m=\"pe pev1 pev2 pev3 latitude longitude resolution colorDepth javascriptVersion javaEnabled cookiesEnabled browserWidth browserHeight connectionType homepage pageURLRest marketingCloudOrgID\".split(\" \");a.g=a.g.concat(m);a.H=a.H.concat(m);a.ssl=0<=k.location.protocol.toLowerCase().indexOf(\"https\");a.charSet=\"UTF-8\";a.contextData={};a.offlineThrottleDelay=\r\n0;a.offlineFilename=\"AppMeasurement.offline\";a.Ra=0;a.ma=0;a.O=0;a.Qa=0;a.linkDownloadFileTypes=\"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";a.w=k;a.d=k.document;try{if(a.Wa=!1,navigator){var v=navigator.userAgent;if(\"Microsoft Internet Explorer\"==navigator.appName||0<=v.indexOf(\"MSIE \")||0<=v.indexOf(\"Trident/\")&&0<=v.indexOf(\"Windows NT 6\"))a.Wa=!0}}catch(x){}a.ha=function(){a.ia&&(k.clearTimeout(a.ia),a.ia=p);a.l&&a.K&&a.l.dispatchEvent(a.K);a.A&&(\"function\"==typeof a.A?a.A():\r\na.l&&a.l.href&&(a.d.location=a.l.href));a.l=a.K=a.A=0};a.Ua=function(){a.b=a.d.body;a.b?(a.v=function(c){var b,d,f,e,g;if(!(a.d&&a.d.getElementById(\"cppXYctnr\")||c&&c[\"s_fe_\"+a._in])){if(a.Ea)if(a.useForcedLinkTracking)a.b.removeEventListener(\"click\",a.v,!1);else{a.b.removeEventListener(\"click\",a.v,!0);a.Ea=a.useForcedLinkTracking=0;return}else a.useForcedLinkTracking=0;a.clickObject=c.srcElement?c.srcElement:c.target;try{if(!a.clickObject||a.N&&a.N==a.clickObject||!(a.clickObject.tagName||a.clickObject.parentElement||\r\na.clickObject.parentNode))a.clickObject=0;else{var h=a.N=a.clickObject;a.la&&(clearTimeout(a.la),a.la=0);a.la=setTimeout(function(){a.N==h&&(a.N=0)},1E4);f=a.La();a.track();if(f<a.La()&&a.useForcedLinkTracking&&c.target){for(e=c.target;e&&e!=a.b&&\"A\"!=e.tagName.toUpperCase()&&\"AREA\"!=e.tagName.toUpperCase();)e=e.parentNode;if(e&&(g=e.href,a.Na(g)||(g=0),d=e.target,c.target.dispatchEvent&&g&&(!d||\"_self\"==d||\"_top\"==d||\"_parent\"==d||k.name&&d==k.name))){try{b=a.d.createEvent(\"MouseEvents\")}catch(l){b=\r\nnew k.MouseEvent}if(b){try{b.initMouseEvent(\"click\",c.bubbles,c.cancelable,c.view,c.detail,c.screenX,c.screenY,c.clientX,c.clientY,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,c.button,c.relatedTarget)}catch(m){b=0}b&&(b[\"s_fe_\"+a._in]=b.s_fe=1,c.stopPropagation(),c.stopImmediatePropagation&&c.stopImmediatePropagation(),c.preventDefault(),a.l=c.target,a.K=b)}}}}}catch(n){a.clickObject=0}}},a.b&&a.b.attachEvent?a.b.attachEvent(\"onclick\",a.v):a.b&&a.b.addEventListener&&(navigator&&(0<=navigator.userAgent.indexOf(\"WebKit\")&&\r\na.d.createEvent||0<=navigator.userAgent.indexOf(\"Firefox/2\")&&k.MouseEvent)&&(a.Ea=1,a.useForcedLinkTracking=1,a.b.addEventListener(\"click\",a.v,!0)),a.b.addEventListener(\"click\",a.v,!1))):setTimeout(a.Ua,30)};a.Cb();a.ac||(r?a.setAccount(r):a.F(\"Error, missing Report Suite ID in AppMeasurement initialization\"),a.Ua(),a.loadModule(\"ActivityMap\"))}" ]
[ "0.47174537", "0.4658246", "0.45285463", "0.45032862", "0.44835344", "0.44350168", "0.4382653", "0.43627265", "0.43324777", "0.4301593", "0.42541128", "0.42418656", "0.4221815", "0.42179117", "0.41816333", "0.41801563", "0.41795337", "0.417805", "0.4176735", "0.41745046", "0.4172715", "0.416532", "0.4140857", "0.4140857", "0.4125978", "0.41207212", "0.41181394", "0.41115952", "0.41091898", "0.41079316", "0.41062677", "0.41049024", "0.41027054", "0.41022694", "0.410083", "0.4095065", "0.40917927", "0.40812904", "0.40807405", "0.40791658", "0.40771678", "0.40754294", "0.40733093", "0.407272", "0.40688023", "0.40591353", "0.40538645", "0.40534827", "0.4049118", "0.40481293", "0.40477178", "0.40440556", "0.40431336", "0.4041285", "0.40409878", "0.4040742", "0.4034237", "0.40251347", "0.4021832", "0.401967", "0.40185636", "0.40154555", "0.40134138", "0.40127307", "0.40119314", "0.40104625", "0.40068188", "0.40068188", "0.40059087", "0.4004625", "0.3991457", "0.3990997", "0.39907634", "0.39872354", "0.3983524", "0.39815342", "0.39802438", "0.39802438", "0.39802438", "0.39799574", "0.39766735", "0.39765778", "0.39743623", "0.39739642", "0.39738163", "0.39735964", "0.396918", "0.3966224", "0.39611036", "0.39610842", "0.3960728", "0.3956596", "0.39565182", "0.39551875", "0.3950826", "0.39456856", "0.3944749", "0.39428768", "0.39405105", "0.39404854", "0.39403772" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function LineDraw(ctor) { this._ctor = ctor || LineGroup; this.group = new graphic.Group(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "function getImplementation( cb ){\n\n }", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53492224", "0.48935446", "0.48514137", "0.48082927", "0.47720826", "0.4744996", "0.47347993", "0.47019523", "0.46926585", "0.46926585", "0.46730793", "0.46452278", "0.46379203", "0.46256977", "0.4618543", "0.45818752", "0.45806864", "0.45742333", "0.4568166", "0.45616665", "0.45558366", "0.4549164", "0.45481402", "0.45447382", "0.4537214", "0.4522665", "0.451785", "0.4497493", "0.44942656", "0.4484697", "0.4472648", "0.44683102", "0.4465637", "0.44581723", "0.44557354", "0.4454013", "0.44524705", "0.44436827", "0.44380364", "0.4427005", "0.44242096", "0.44237852", "0.44070554", "0.44050547", "0.44050547", "0.44050547", "0.4404598", "0.4393088", "0.43767613", "0.43684104", "0.43635124", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43511948", "0.43502447", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43443355", "0.43417493", "0.43380377", "0.43350744", "0.43350744", "0.4332956", "0.43327877" ]
0.0
-1
probably be fetched by multiple times. So we cache the result. axis is created each time during a ec process, so we do not need to clear cache.
function getListCache(axis, prop) { // Because key can be funciton, and cache size always be small, we use array cache. return inner(axis)[prop] || (inner(axis)[prop] = []); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function axis_old_camera(result)\n{\n console.log(\"axis_old_camera\")\n console.log(result);\n}", "get axes() {\n if (this._axes === null) {\n let coll = new IgrAxisCollection();\n let inner = coll._innerColl;\n inner.addListener((sender, e) => {\n switch (e.action) {\n case NotifyCollectionChangedAction.Add:\n this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));\n break;\n case NotifyCollectionChangedAction.Remove:\n this._axesAdapter.removeManualItemAt(e.oldStartingIndex);\n break;\n case NotifyCollectionChangedAction.Replace:\n this._axesAdapter.removeManualItemAt(e.oldStartingIndex);\n this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));\n break;\n case NotifyCollectionChangedAction.Reset:\n this._axesAdapter.clearManualItems();\n break;\n }\n });\n this._axes = coll;\n }\n return this._axes;\n }", "searchAxisByJuncEnv () {\n let got = false;\n while (!got) {\n this.generateAxis(false);\n got = this.searchJunctionEnvelopes();\n }\n }", "get axis() {\n return {\n index: this.$index,\n columns: this.$columns\n };\n }", "get axis() {\n\t\treturn this.__axis;\n\t}", "function processOneAxisValue(feed)\r\n {\r\n var dataset = [];\r\n var i, j, k;\r\n var measureData;\r\n if (feed.values.length <= 0){\r\n return dataset;\r\n }\r\n if (hasMND && !bMNDOnColor)\r\n {\r\n for(j = 0; j < feed.values[0].rows.length; ++j)\r\n { \r\n measureData = new Array(feed.values.length * feed.values[0].rows[0].length);\r\n for(k = 0; k < feed.values[0].rows[0].length; ++k)\r\n {\r\n for(i = 0 ; i < feed.values.length; ++i)\r\n {\r\n var dataPoint = {};\r\n dataPoint.val = feed.values[i].rows[j][k].val;\r\n dataPoint.ctx = feed.values[i].rows[j][k].ctx;\r\n dataPoint.info = feed.values[i].rows[j][k].info;\r\n if(bMNDInner){\r\n measureData[k * feed.values.length + i] = dataPoint;\r\n } else {\r\n measureData[i * feed.values[0].rows[0].length + k] = dataPoint; \r\n }\r\n }\r\n }\r\n dataset.push(measureData);\r\n } \r\n }\r\n else // MND on Region color or no MND\r\n {\r\n dataset = new Array(feed.values.length * feed.values[0].rows.length);\r\n\r\n for(i = 0 ; i < feed.values.length; ++i)\r\n {\r\n for(j = 0; j < feed.values[0].rows.length; ++j)\r\n { \r\n measureData = feed.values[i].rows[j];\r\n if(!hasMND || !bMNDInner){\r\n dataset[i * feed.values[0].rows.length + j] = measureData;\r\n } else {\r\n dataset[j * feed.values.length + i] = measureData;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return dataset;\r\n }", "function SAPAxis() {\n\n this.numElements = 0;\n this.bufferSize = 256;\n this.elements = [];\n this.elements.length = this.bufferSize;\n this.stack = new Float32Array(64);\n}", "setAxisDataMap() {\n this.axisDataMap = this._createAxesData();\n }", "get Axis() {\n let sampleData = this.chart.data[0];\n let size = sampleData.length;\n\n return d3.svg\n .axis()\n .scale(this.chart.xScale)\n .orient('bottom')\n .tickFormat(getDate().long)\n .tickValues(getBestTickValues(sampleData));\n }", "function getResult(){\r\n\t\r\n\td3.select(\"svg\").remove();\r\n\tif (processDone) {\r\n //return some variables\r\n\t\t \r\n\t\t for(var key in Obj_Fetch)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tvar temp_var={};\r\n\t\t\t\t\t\ttemp_var.cancertype=key;\r\n\t\t\t\t\t\ttemp_var.male=Obj_Fetch[key].MALE;\r\n\t\t\t\t\t\ttemp_var.female=Obj_Fetch[key].FEMALE;\r\n\t\t\t\t\t\tfetch_data_array.push(temp_var);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\taddScatterPlot(fetch_data_array);\r\n\t\t\t\t\t\tconsole.log(fetch_data_array);\r\n\r\n } else {\r\n setTimeout(getResult, 250);\r\n }\r\n }", "function onChartAfterGetAxes() {\n var _this = this;\n var options = this.options;\n this.colorAxis = [];\n if (options.colorAxis) {\n options.colorAxis = splat(options.colorAxis);\n options.colorAxis.forEach(function (axisOptions, i) {\n axisOptions.index = i;\n new ColorAxisClass(_this, axisOptions); // eslint-disable-line no-new\n });\n }\n }", "renderAxis() {\n const axis = d3.svg.axis()\n .scale(this.props.scale)\n .orient(this.props.orientation)\n .tickFormat(this.props.tickFormat)\n .innerTickSize(this.props.innerTickSize)\n .outerTickSize(this.props.outerTickSize)\n .tickPadding(this.props.tickPadding);\n\n d3.select(this.node).call(axis);\n }", "get Axis() {\n throw new Error('axis must be implemented in derived classes');\n }", "constructor() {\n this.entities = [];\n this.objectsAxisX = [];\n this.objectsAxisY = [];\n this.objectsAxisZ = [];\n }", "function collect(ecModel, api) {\n\t var result = {\n\t /**\n\t * key: makeKey(axis.model)\n\t * value: {\n\t * axis,\n\t * coordSys,\n\t * axisPointerModel,\n\t * triggerTooltip,\n\t * involveSeries,\n\t * snap,\n\t * seriesModels,\n\t * seriesDataCount\n\t * }\n\t */\n\t axesInfo: {},\n\t seriesInvolved: false,\n\t\n\t /**\n\t * key: makeKey(coordSys.model)\n\t * value: Object: key makeKey(axis.model), value: axisInfo\n\t */\n\t coordSysAxesInfo: {},\n\t coordSysMap: {}\n\t };\n\t collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\t\n\t result.seriesInvolved && collectSeriesInfo(result, ecModel);\n\t return result;\n\t }", "function xTicksval()\r\n{\r\n\tvar arrxTicks = new Array();\r\n\tcurrentGraphXval = new graphXObject(\"\" , 0);\t\t\t\t\t\t\r\n\tarrxTicks.push(currentGraphXval);\r\n\t\r\n\tfor (var i = 1; i<= intTurnNO ; i++ )\r\n\t{\r\n\t\tcurrentGraphXval = new graphXObject(objSystemDate[i-1] , i);\t\t\t\t\t\t\r\n\t\tarrxTicks.push(currentGraphXval);\r\n\t}\r\n\treturn arrxTicks;\r\n}", "render() {\n var chartDataSet = [],\n newData = {labels: this.props.xAxis};\n \n if(this.props.data.length > 0) {\n\n let rawData = this.props.data;\n\n for(let i = 0 ; i < rawData.length; i++) {\n const stock = getChartDataSet(\n rawData[i].symbol, \n getStockTypeArr(rawData[i].data, this.props.stockType), \n rawData[i].info.color)\n chartDataSet.push(stock)\n }\n newData.datasets = chartDataSet;\n }\n \n return (\n <div id=\"stockchart\" className=\"left\">\n <Line data={newData} options={chartOption.op1}/>\n </div>\n )\n \n }", "function updateXAxis() {\n\t if(showXAxis) {\n\t g.select('.nv-focus .nv-x.nv-axis')\n\t .attr('transform', 'translate(0,' + availableHeight + ')')\n\t .transition()\n\t .duration(duration)\n\t .call(xAxis)\n\t ;\n\t }\n\t }", "function CacheEl() {\n \n }", "function initResult() {\n var series = [],\n i = 0\n while (i < NUMBER_OF_SERIES) {\n series.push({\n codingType: 0,\n codingTable: 0,\n resolution: null,\n uncompressSamples: []\n })\n i += 1\n }\n return {\n batch_counter: 0,\n batch_relative_timestamp: 0,\n series: series\n }\n}", "getAxisMotionValue(axis) {\n const dragKey = \"_drag\" + axis.toUpperCase();\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, (props.initial ? props.initial[axis] : undefined) || 0);\n }", "fetchData() {\n axios.get(`${URL_BASE}/${this.symbol}/batch?types=quote,news,chart&last=5&range=1m&token=${API_TOKEN}`)\n .then((response) => {\n const symbol = this.symbol.toUpperCase();\n const dataToStore = {\n chart: {\n [this.interval]: response.data.chart\n },\n news: response.data.news,\n quote: response.data.quote,\n time: Date.now()\n };\n store.set(symbol, dataToStore);\n })\n .catch((error) => {\n console.log(error);\n })\n .finally(() => {\n new ChartBox('#singlestock-chart-container', this.symbol);\n new KeyStats('#singlestock-keystats-container', this.symbol);\n new News('#singlestock-news-container', [this.symbol], this.symbol);\n })\n }", "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .attr('transform', 'translate(0,' + availableHeight + ')')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .attr('transform', 'translate(0,' + availableHeight + ')')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "generateAxis (ini=false) {\n if (this.givenAxis) {\n return;\n }\n // clear\n if (this.axis) {\n this.axis.dispose();\n }\n this.axisPoints2D = [];\n this.axisPoints = [];\n\n if (this.axisClosed) {\n this.axis = this.buildClosedAxis(ini);\n } else {\n this.axis = this.buildOpenAxis(ini);\n }\n this.sculpture.axis = this.axis;\n }", "function groupSeriesByAxis(ecModel){var result=[];var axisList=[];ecModel.eachSeriesByType('boxplot',function(seriesModel){var baseAxis=seriesModel.getBaseAxis();var idx=zrUtil.indexOf(axisList,baseAxis);if(idx < 0){idx = axisList.length;axisList[idx] = baseAxis;result[idx] = {axis:baseAxis,seriesModels:[]};}result[idx].seriesModels.push(seriesModel);});return result;}", "changeAxis() {\n this.showAxis = !this.showAxis;\n }", "function createAxis() {\n\n function Axis() {}\n\n const privateStorageBlueprint = {\n enumerable: false,\n value: { x: 0, y: 0, z: 0 },\n };\n\n Object.defineProperties(Axis.prototype, {\n x: {\n enumerable: true,\n get: function () { return this._.x; },\n set: function (newValue) {\n this._.x = newValue;\n updateCssTransformProp();\n },\n },\n\n y: {\n enumerable: true,\n get: function () { return this._.y; },\n set: function (newValue) {\n this._.y = newValue;\n updateCssTransformProp();\n },\n },\n\n z: {\n enumerable: true,\n get: function () { return this._.z; },\n set: function (newValue) {\n this._.z = newValue;\n updateCssTransformProp();\n },\n }\n });\n\n return Object.defineProperty(new Axis(), '_', privateStorageBlueprint);\n }", "function getAllResult(){\r\n\t\r\n\tif (processDone) {\r\n for(var key in Obj_Fetch)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tvar temp_var={};\r\n\t\t\t\t\t\ttemp_var.cancertype=key;\r\n\t\t\t\t\t\ttemp_var.male=Obj_Fetch[key].MALE;\r\n\t\t\t\t\t\ttemp_var.female=Obj_Fetch[key].FEMALE;\r\n\t\t\t\t\t\tfetch_data_array.push(temp_var);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\taddAllScatterPlot(fetch_data_array);\r\n\t\t\t\t\t\t\r\n } else {\r\n setTimeout(getResult, 250);\r\n }\r\n }", "function onAxisAfterRender() {\n let axis = this, resizer = axis.resizer, resizerOptions = axis.options.resize, enabled;\n if (resizerOptions) {\n enabled = resizerOptions.enabled !== false;\n if (resizer) {\n // Resizer present and enabled\n if (enabled) {\n // Update options\n resizer.init(axis, true);\n // Resizer present, but disabled\n }\n else {\n // Destroy the resizer\n resizer.destroy();\n }\n }\n else {\n // Resizer not present and enabled\n if (enabled) {\n // Add new resizer\n axis.resizer = new AxisResizer(axis);\n }\n // Resizer not present and disabled, so do nothing\n }\n }\n}", "_invalidateCache() {\n this._cxPackedKey = [];\n this._cxPacked = [];\n }", "function XY( key, axis ){\n\t\tvar AX = 0;\n\t\tvar obj =$('#'+divId+' .'+key)[0];\n\t\t\t\t\n\t\tif( obj.offsetParent ){\n\t\t\twhile( obj.offsetParent ){\n\t\t\t\tif( axis==\"x\" ) \n\t\t\t\t\tAX += obj.offsetLeft;\n\t\t\t\telse\n\t\t\t\t\tAX += obj.offsetTop;\n\t\t\t\tobj = obj.offsetParent;\n\t\t\t}\n\t\t}\n\t\telse if( obj.x ){\n\t\t\tif( axis==\"x\" ) \t\n\t\t\t\tAX += obj.x;\n\t\t\telse\n\t\t\t\tAX += obj.y;\n\t\t}\n\n\t\treturn AX;\n\t}", "function drawAxis(self) {\r\n ////DRAW MAIN AXIS\r\n //Draw grid lines\r\n geometry = new THREE.Geometry();\r\n let material = new THREE.LineBasicMaterial( { color: '#'+self.data.graphColor } );\r\n let scale = self.el.getAttribute('plot').scale;\r\n geometry.vertices.push(new THREE.Vector3( 0, 0, scale[2]) );\r\n geometry.vertices.push(new THREE.Vector3( 0, 0, 0) );\r\n geometry.vertices.push(new THREE.Vector3( 0, scale[1], 0) );\r\n geometry.vertices.push(new THREE.Vector3( 0, 0, 0) );\r\n geometry.vertices.push(new THREE.Vector3( scale[0], 0, 0) );\r\n var grid = new THREE.Line(geometry, material);\r\n //add axis lines to sceneEl\r\n let el = self.el;\r\n el.setObject3D('axis', grid);\r\n el.getObject3D('axis').visible = self.data.enableAxis;\r\n}", "function reset_axis() {\n\n svg.transition().duration(500)\n .select(\".x.axis\")\n .call(phy_xAxis);\n\n d3.selectAll(\".emotion_dot\").classed(\"filtered\",false);\n d3.selectAll(\".list_item\").classed(\"filtered\",false);\n list_filteredIds =[];\n\n filter_f();\n\n}", "function createAxis() {\n for (var i = 0; i < picArray.length; i++) {\n titleArray.push(picArray[i].title);\n clickArray.push(picArray[i].clicked);\n viewArray.push(picArray[i].viewed);\n }\n}", "function interpretAxis(axis, dim) {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}", "function interpretAxis(axis, dim) {\n while (axis < 0) {\n axis += dim;\n }\n return axis;\n}", "getData(mainIdx) {\n this.setState({ fetchInProgress: true });\n let mainCompanyVal = this.props.state.mainShares[mainIdx].value;\n let companies = `codes=${mainCompanyVal}`;\n let peers = this.props.state.paramAnalysis.peers\n ? this.props.state.paramAnalysis.peers\n : [];\n for (let i = 0; i < peers.length; i++) {\n let peerVal = peers[i].value;\n companies += `&codes=${peerVal}`;\n }\n console.log(companies);\n //axios.get(`${BI_API_ROOT_URL}/api/das/${companies}`).then(response => {\n axios\n .get(`${BI_API_ROOT_URL}${this.props.dataApi}/${companies}`)\n .then(response => {\n console.log(\"ChartContainer -> get data from service: \");\n console.log(response.data);\n let data;\n if (this.props.qtrType) {\n data = this.props.prepData(response.data, this.props.qtrType);\n } else {\n data = this.props.prepData(response.data);\n }\n console.log(\"ChartContainer -> converted data: \");\n console.log(data);\n this.setState({ fetchInProgress: false, data });\n });\n }", "transform() {\n let xaxis = [];\n const xaxisIndex = 0;\n for (let row of this.raw) {\n xaxis.push(row[xaxisIndex]);\n }\n xaxis.shift();\n console.log(`Horizontal axis: ${xaxis}`);\n \n let series = [];\n /* series is an array storing the data series to be rendered.\n * Each element of an array is an object: { seriesName: 'SERIES NAME', data: [ numbers of the series ] }\n */\n let seriesIndex = [];\n \n // Find indices from series name, store them into seriesIndex[]\n if (Array.isArray(this.selected))\n this.selected.map( (seriesName) => seriesIndex.push(this.header.indexOf(seriesName) + 1));\n // +1? this.header has the first element stripped. As we will use this index to retrieve the data in this.raw, we need to add back 1.\n else\n seriesIndex.push(this.header.indexOf(this.selected) + 1);\n \n // Extract data from raw, store them into series[]\n seriesIndex.map ( (seriesI) => {\n series.push({ seriesName: this.header[seriesI - 1], data: [] }); // -1 to retrieve series name from this.header\n if (!this.activeChartDefinition.scatterTransform) {\n // Extract data for general charts\n this.raw.map( (row) => {\n series[series.length - 1].data.push(row[seriesI]);\n })\n }\n else {\n // Extract data for scatter charts\n this.raw.map( (row, i) => {\n series[series.length - 1].data.push({ x: xaxis[i - 1], y: row[seriesI] })\n })\n }\n series[series.length - 1].data.shift();\n } );\n \n console.log(series);\n \n return { xaxis, series };\n }", "function getData(axis){\n // import data and reshape for presentation \n return new Promise(function(resolve, reject){\n d3.csv(axis.dataPath, function(data) {\n var returnData = [];\n console.log('>> returnData.length 1: '+returnData.length); \n console.log('>> importing data from '+axis.dataPath);\n data.forEach(function(d) {\n d[axis.y] = +d[axis.y];\n d[axis.x] = axis.parseTime(d[axis.x]); // time\n returnData.push(d); \n });\n console.log('>> returnData.length 2: '+returnData.length);\n console.log(data[0]); \n console.log(data); \n if(returnData.length>0){\n resolve(returnData);\n } else {\n reject(\"ERROR! Promise failed.\");\n }\n }); \n }); \n}", "function groupSeriesByAxis(ecModel) {\n\t var result = [];\n\t var axisList = [];\n\t ecModel.eachSeriesByType('boxplot', function (seriesModel) {\n\t var baseAxis = seriesModel.getBaseAxis();\n\t var idx = indexOf(axisList, baseAxis);\n\t\n\t if (idx < 0) {\n\t idx = axisList.length;\n\t axisList[idx] = baseAxis;\n\t result[idx] = {\n\t axis: baseAxis,\n\t seriesModels: []\n\t };\n\t }\n\t\n\t result[idx].seriesModels.push(seriesModel);\n\t });\n\t return result;\n\t }", "noFeatureElementsInAxis() {}", "noFeatureElementsInAxis() {}", "numericalMapping(axis) {\n const solver = this.solver;\n const state = this.plotSegment.state;\n const props = this.plotSegment.object.properties;\n const attrs = state.attributes;\n const dataIndices = state.dataRowIndices;\n const table = this.getTableContext();\n switch (axis) {\n case \"x\":\n {\n const data = props.xData;\n if (data.type == \"numerical\") {\n const [x1, x2] = solver.attrs(attrs, [this.x1Name, this.x2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (1 - t) * props.marginX1 - t * props.marginX2, [[1 - t, x1], [t, x2]], [[1, solver.attr(markState.attributes, \"x\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [x1, x2, gapX] = solver.attrs(attrs, [\n this.x1Name,\n this.x2Name,\n \"gapX\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapX(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginX1 -\n (i + 0.5) * props.marginX2, [\n [i + 0.5, x2],\n [data.categories.length - i - 0.5, x1],\n [-data.categories.length / 2 + i + 0.5, gapX]\n ], [\n [\n data.categories.length,\n solver.attr(markState.attributes, \"x\")\n ]\n ]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, x, x1);\n }\n break;\n case \"y\": {\n const data = props.yData;\n if (data.type == \"numerical\") {\n const [y1, y2] = solver.attrs(attrs, [this.y1Name, this.y2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (t - 1) * props.marginY2 + t * props.marginY1, [[1 - t, y1], [t, y2]], [[1, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [y1, y2, gapY] = solver.attrs(attrs, [\n this.y1Name,\n this.y2Name,\n \"gapY\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapY(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginY1 -\n (i + 0.5) * props.marginY2, [\n [i + 0.5, y2],\n [data.categories.length - i - 0.5, y1],\n [-data.categories.length / 2 + i + 0.5, gapY]\n ], [[data.categories.length, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, y, y2);\n }\n }\n }", "createAxes () {\n }", "function getAxis(axis){\n\t\treturn d3.svg.axis()\n\t\t \t\t.scale(axis)\n\t\t \t\t.tickPadding(3)\n\t\t \t\t.ticks(d3.time.years, year_apart);\n\t}", "function sharingAxis() {\n\n\n angular.forEach(dqFactory.completeness.variables, function (variable) {\n if(variable.state.selected) {\n\n //console.log(\"sharingAxis: \", xWidth);\n\n //historical bar chart, sharing x\n var optionSharingX = {\n chart: {\n type: 'historicalBarChart',\n height: 150,\n width: xWidth,\n margin: {\n //top: 20,\n right: 20,\n bottom: 65,\n left: 75\n },\n x: function (d) {\n return d[0];\n },\n y: function (d) {\n //return d[1] / 100000;\n return d[1]\n },\n showValues: true,\n valueFormat: function (d) {\n return d3.format(',.0f')(d);\n },\n duration: 100,\n\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameX + \"</td>\" +\n \"<td class='x-value'>\" + series.key + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>Missing: </td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.0f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + variable.name + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n },\n\n\n\n\n //xAxis: {\n // axisLabel: $rootScope.gv.stpX,\n // tickFormat: function (d) {\n // return d3.format('.0f')(d);\n // //return d3.time.format('%x')(new Date(d))\n // },\n // ticks: 8,\n // rotateLabels: 30,\n // showMaxMin: true\n //},\n xDomain: $scope.optionPlot.chart.xDomain,\n xAxis: $scope.optionPlot.chart.xAxis,\n yAxis: {\n axisLabel: variable.name,\n axisLabelDistance: -10,\n tickFormat: function (d) {\n return d3.format(',.0f')(d);\n }\n },\n multibar: {\n height: 1\n },\n // useInteractiveGuideline: true,\n // tooltip: {\n // keyFormatter: function (d) {\n // //$log.debug(d);\n // return \"(\".concat(variable.name).concat(\", # missing): \").concat(d);\n // //return d3.time.format('%x')(new Date(d));\n // }\n // },\n zoom: {\n enabled: false,\n scaleExtent: [1, 10],\n useFixedDomain: false,\n useNiceScale: false,\n horizontalOff: false,\n verticalOff: false,\n unzoomEventType: 'dblclick.zoom'\n }\n }\n };\n //console.log(\"xDomain: \", $scope.optionPlot.chart.xDomain);\n //optionSharingX.chart.xDomain = $scope.optionPlot.chart.xDomain;\n //optionSharingX.chart.width = xWidth;\n //console.log(variable.name, \" width: \", optionSharingX.chart.width);\n\n //optionSharingX.chart.width = document.getElementById(\"onlyMainPlotAndBottom\").offsetWidth;//$scope.optionPlot.chart.width;\n\n //optionSharingX.chart.yDomain = $scope.optionPlot.chart.yDomain;\n //console.log(\"plot width: \", $scope.optionPlot.chart.width);\n //optionSharingX.chart.width = $scope.optionPlot.chart.width;\n\n //horizontal bar chart, sharing y\n var optionSharingY = {\n chart: {\n type: 'multiBarHorizontalChart',\n height: $scope.optionPlot.chart.height,\n width: 80,\n margin: {\n left: 0\n },\n x: function (d) {\n return d.label;\n },\n y: function (d) {\n return d.value;\n },\n showControls: false,\n showValues: false,\n showLegend: false,\n showXAxis: false,\n duration: 500,\n xAxis: {showMaxMin: false},\n yAxis: {\n //axisLabel: 'Values',\n tickFormat: function (d) {\n return d3.format(',.0f')(d);\n }\n },\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameY + \"</td>\" +\n \"<td class='x-value'>\" + e.value + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>Missing: </td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.0f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + variable.name + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n },\n multibar: {\n stacked: false\n }\n },\n title: {\n enable: true,\n text: variable.name,\n className: \"h5\"\n },\n subtitle: {\n enable: true,\n text: \"#missing\",\n class: {\n textAlign: \"center\"\n }\n }\n };\n\n var optionCategorical = {\n chart: {\n type: 'scatterChart',\n height: $scope.optionPlot.chart.height,\n color: dqFactory.completeness.colorRange.present, //d3.scale.category10().range(), //TODO\n scatter: {\n onlyCircles: false\n },\n showDistX: false,\n showDistY: false,\n showLegend: true,\n\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameX + \"</td>\" +\n \"<td class='x-value'>\" + e.value + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameY + \"</td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.2f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + series.key + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n\n },\n\n xAxis: {\n axisLabel: $scope.nameX,\n tickFormat: function (d) {\n return d3.format('.0f')(d);\n },\n ticks: 8\n },\n yAxis: {\n axisLabel: $scope.nameY,\n tickFormat: function (d) {\n return d3.format(',.2f')(d);\n },\n axisLabelDistance: -5\n },\n zoom: {\n //NOTE: All attributes below are optional\n enabled: false,\n scaleExtent: [1, 10],\n useFixedDomain: false,\n useNiceScale: false,\n horizontalOff: false,\n verticalOff: false\n //unzoomEventType: 'dblclick.zoom'\n }\n },\n title: {\n enable: true,\n text: variable.name,\n className: \"h5\"\n },\n subtitle: {\n enable: true,\n text: \"Categories for the \"\n .concat(variable.name)\n .concat(\" variable, related to the \")\n .concat(dqFactory.completeness.numericalPlot.nameX)\n .concat(\" vs \")\n .concat(dqFactory.completeness.numericalPlot.nameY)\n .concat(\" plot\"),\n class: {\n textAlign: \"left\"\n },\n className: \"h5\"\n }\n };\n optionCategorical.chart.xDomain = $scope.optionPlot.chart.xDomain;\n //console.log(\"categorical range: \", optionCategorical.chart.xDomain);\n optionCategorical.chart.yDomain = $scope.optionPlot.chart.yDomain;\n\n\n var dataSharingX = completenessOfVariableRespectX(variable.name, $scope.nameX);\n var dataSharingY = completenessOfVariableRespectY(variable.name, $scope.nameY);\n\n //var dataCategorical = [];\n //if(variable.state.isCategorical)\n var dataCategorical = completenessCategorical(variable.name);\n\n variable.optionSharingX = optionSharingX;\n variable.dataSharingX = dataSharingX;\n\n variable.optionSharingY = optionSharingY;\n variable.dataSharingY = dataSharingY;\n\n variable.optionCategorical = optionCategorical;\n variable.dataCategorical = dataCategorical;\n\n }\n });\n\n\n }", "function eachAxis(handler) {\n return [handler(\"x\"), handler(\"y\")];\n}", "function eachAxis(handler) {\n return [handler(\"x\"), handler(\"y\")];\n}", "function eachAxis(handler) {\n return [handler(\"x\"), handler(\"y\")];\n}", "function eachAxis(handler) {\n return [handler(\"x\"), handler(\"y\")];\n}", "getOptions() {\n let grids = []\n let xAxies = []\n let yAxies = []\n let series = []\n \n let sampleRate = store.getState().sampleRate\n let keysArray = Object.keys(this.state.eegData)\n // Remove deleted keys\n keysArray = keysArray.filter((key) => {\n return !this.removedAxies.includes(key);\n });\n\n // Layout configuration\n function generateGridTops(grid_height, num_grids) {\n // Returns an array of the top value for each\n // grid to be represented by keysArray\n let padding = 4\n let render_limits = [0+padding, 100-padding]\n let jump_width = (100 - 2*padding) / num_grids\n var list = [];\n for (var i = render_limits[0]; i <= render_limits[1]; i += jump_width) {\n let adjusted_top = i - (grid_height / 2) \n list.push(Math.ceil(adjusted_top));\n }\n return list\n }\n let height = 40\n let topsList = generateGridTops(height, keysArray.length)\n\n keysArray.forEach((key) => {\n let i = keysArray.indexOf(key)\n let grid_top = topsList[i] + \"%\"\n\n grids.push({\n id: key,\n left: '10%',\n right: '2%',\n top: grid_top,\n height: height + \"%\",\n show: true,\n name: key,\n tooltip: {\n show: false,\n trigger: 'axis',\n showDelay: 25\n },\n containLabel: false, // Help grids aligned by axis\n borderWidth: 0\n })\n\n xAxies.push({\n id: key,\n name: key,\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[key].length).keys()],\n type: 'category',\n gridIndex: i,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: (i == keysArray.length - 1), // Only show on last grid\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return (this.bufferStartIndex + parseInt(value)) / sampleRate\n }\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: true,\n interval: sampleRate - 1,\n },\n // Trigger event means you can click on name to register event\n triggerEvent: true,\n nameLocation: 'start',\n })\n\n // let scaleMax = new MyMaths().roundToNextDigit(Math.max(...this.state.eegData[key]))\n let scaleMax = 1\n let scaleMin = -scaleMax\n\n yAxies.push({\n id: key,\n type: 'value',\n gridIndex: i,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n // Programatically scale min/max\n min: scaleMin,\n max: scaleMax\n })\n\n // Add a line config to series object\n series.push({\n name: key,\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0.5,\n color: 'black',\n },\n gridIndex: i,\n yAxisIndex: i,\n xAxisIndex: i,\n smooth: false,\n sampling: 'lttb',\n\n data: this.state.eegData[key],\n })\n })\n\n /**\n * Configure backsplash grid for highlights and such\n * Adds a grid at backsplashGridIndex that takes full height\n * Adds an xAxis identical to the others\n * Adds a series of 0s meant to be undisplayed,\n * just for markAreas to be applied to\n */\n let timestampFormatter = (value) => {\n let secs = ((value + this.bufferStartIndex) / sampleRate) + this.time_adjustment_secs\n var date = new Date(0);\n date.setSeconds(secs);\n return date.toISOString().substr(11, 8);\n }\n\n this.backsplashGridIndex = keysArray.length\n let backsplashGridIndex = this.backsplashGridIndex\n let configureBacksplashGrid = () => {\n if (backsplashGridIndex == 0) {\n // Catch before data loads in\n return\n }\n let arbitraryKey = keysArray[0]\n\n grids.push({\n left: '10%',\n right: '4%',\n top: '0%',\n bottom: '4%',\n show: false,\n containLabel: false, // Help grids aligned by axis\n })\n yAxies.push({\n type: 'value',\n gridIndex: backsplashGridIndex,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n min: -1e-3,\n max: 1e-3,\n })\n xAxies.push({\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[arbitraryKey].length).keys()],\n type: 'category',\n gridIndex: backsplashGridIndex,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: true,\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return timestampFormatter(value)\n }\n },\n axisLine: {\n show: false,\n },\n })\n series.push({\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0,\n color: '#00000000',\n },\n gridIndex: backsplashGridIndex,\n yAxisIndex: backsplashGridIndex,\n xAxisIndex: backsplashGridIndex,\n sampling: 'lttb',\n \n name: 'backSplashSeries',\n \n data: new Array(this.state.eegData[arbitraryKey].length).fill(0),\n })\n }\n configureBacksplashGrid()\n\n /**\n * \n * The actual configuration for the chart\n * Loads in all of the previously filled grids, xAxies, yAxies, and series\n * \n */\n let options = {\n // Use the values configured above\n grid: grids,\n xAxis: xAxies,\n yAxis: yAxies,\n series: series,\n\n // Other Configuration options\n animation: false,\n\n tooltip: {\n show: false,\n },\n\n // toolbox hidden\n toolbox: {\n orient: 'vertical',\n show: false,\n },\n\n // Brush allows for selection that gets turned into markAreas\n brush: {\n toolbox: ['lineX', 'keep'],\n xAxisIndex: backsplashGridIndex\n },\n\n dataZoom: [\n {\n show: false,\n xAxisIndex: Object.keys(series),\n type: 'slider',\n bottom: '2%',\n startValue: this.dz_start,\n endValue: this.dz_end,\n preventDefaultMouseMove: true,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n },\n {\n yAxisIndex: Object.keys(series),\n type: 'slider',\n top: '45%',\n filterMode: 'none',\n show: false,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n\n id: 'eegGain',\n start: 50 - this.yZoom,\n end: 50 + this.yZoom,\n },{\n type: 'inside',\n yAxisIndex: Object.keys(series),\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n }\n ],\n }\n\n return options\n }", "function onAxisDestroy(e) {\n if (!e.keepEvents && this.resizer) {\n this.resizer.destroy();\n }\n}", "function updateXAxis() {\n\t if(showXAxis) {\n\t g.select('.nv-focus .nv-x.nv-axis')\n\t .transition()\n\t .duration(duration)\n\t .call(xAxis)\n\t ;\n\t }\n\t }", "function axisProvider(){\n\t/*\n\t * setAxisContainer(svg);\n\t * setXScale(makeLinearScale([0,width],[0,d3.max(data, function(d) { return d.x; })]));\n\t * setYScale(makeLinearScale([height,0],[0,d3.max(data, function(d) { return d.y; })]));\n\t * draw()\n\t * */\n\tvar axisProviderImpl = {\n\t\t\theight \t: 0,\n\t\t\twidth\t: 0,\n\t\t\tsvg\t\t: null,\n\t\t\txScale\t: null,\n\t\t\tyScale\t: null,\n\t\t\txAxis\t: null,\n\t\t\txGrid\t: null,\n\t\t\tyAxis\t: null,\n\t\t\tyGrid\t: null,\n\t\t\tdrawXGrid: true,\n\t\t\tdrawYGrid: true,\n\t\t\tdrawGrid: true,\n\t\t\txScaleOrient : \"bottom\",\n\t\t\tyScaleOrient : \"left\",\n\t\t\txTitle:\"\",\n\t\t\tyTitle:\"\",\n\t\t\ttitle:\"\",\n\t\t\tticks\t: 10,\n\t\t\tgridTicks : 10,\n\t\t\ttickFormat:\",r\",\n\t\t\tsetAxisContainer: function(svg){\n\t\t\t\tif(!isDefined(svg) || isNull(svg)){\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\tthis.height = svg.attr(\"height\");\n\t\t\t\tthis.width = svg.attr(\"width\");\n\t\t\t\tthis.svg\t= svg;\n\t\t\t},\n\t\t\tmakeLinearScale : function(range,domain){\n\t\t\t\treturn d3.scale.linear().range(range).domain(domain).nice();\n\t\t\t},\n\t\t\tsetXScale\t: function(xScale){\n\t\t\t\tthis.xScale = xScale;\n\t\t\t\tthis.xAxis = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.xGrid = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).tickSize(-this.height, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tsetYScale\t:function(yScale){\n\t\t\t\tthis.yScale = yScale;\n\t\t\t\tthis.yAxis = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.yGrid = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).tickSize(-this.width, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tdraw\t: function(){\n\t\t\t\tconsole.log(\"Drawing Axis.\");\n\t\t\t\tthis.clear();\n\t\t\t\tif(this.drawGrid && this.drawYGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").call(this.yGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").call(this.yAxis);\n\t\t\t\t//Y axis title\n\t\t\t\tthis.svg.append(\"g\")\n\t\t\t\t.attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t\t .text(this.yTitle)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",-((this.height/2)))\n\t\t\t .attr(\"y\",-30);\n\t\t\t\t\n\t\t\t\tif(this.drawGrid && this.drawXGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xAxis);\n\t\t\t\t//X axis title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"transform\", \"translate(0,\" + this.height + \")\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .text(this.xTitle)\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",30);\n\t\t\t //chart Title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"chartTitle\")\n\t\t\t .text(this.title)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",0);\n\t\t\t},\n\t\t\tclear : function(){\n\t\t\t\tthis.svg.selectAll(\".grid\").remove();\n\t\t\t\tthis.svg.selectAll(\".axis\").remove();\n\t\t\t\tthis.svg.selectAll(\".axisLabel\").remove();\n\t\t\t}\n\t};\n\t\n\tthis.$get = function(){\n\t\treturn axisProviderImpl;\n\t};\n}", "function configureOneAxe(axisName, inputChartDef, c3Axes) {\r\n var axisMap = inputChartDef.axisMap;\r\n if (!axisMap) {\r\n return;\r\n }\r\n var series = axisMap[axisName];\r\n if (!series) {\r\n return;\r\n }\r\n for (var _i = 0, series_1 = series; _i < series_1.length; _i++) {\r\n var seriesConfig = series_1[_i];\r\n c3Axes[seriesConfig.series] = axisName;\r\n }\r\n}", "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "function updateXAxis() {\n if(showXAxis) {\n g.select('.nv-focus .nv-x.nv-axis')\n .transition()\n .duration(duration)\n .call(xAxis)\n ;\n }\n }", "function getOrCreateTickCache(element, context) {\n\t\tvar cache = element.data('alphaSynthTickCache');\n if(!cache) {\n playerTickUpdateCache(element, context);\n cache = element.data('alphaSynthTickCache');\n }\n\t\treturn cache;\t\t\n\t}", "function getAxisTimes() {\n var endUTC = 0;\n var startUTC = 0;\n $('div#charts > div').each(function() {\n\t var s_id = $(this).attr('data-sensorid');\n\t var chartIndex = $(\"#\"+s_id+\"-chart\").data('highchartsChart');\n\t //\t console.log('chartindex is' + chartIndex);\n\t if (typeof chartIndex === 'number') {\n\t\t// This is a real chart\n\t\tvar thisChart = Highcharts.charts[chartIndex];\n\t\tvar thisXAxis = thisChart.xAxis[0].getExtremes();\n\t\tstartUTC = thisXAxis.min;\n\t\tendUTC = thisXAxis.max;\n\t\t// We found one, quit out of the loop\n\t\treturn false;\n\t }\n\t});\n // console.log('endUTC = ' + endUTC);\n\n // If this is still 0, there were no charts to get data from.\n // Use the time range button selection on the graphs web page\n if (endUTC < 1) {\n\tvar graph_limits = getDataTimes();\n\tstartUTC = makeDate(graph_limits.starttime).getTime();\n\tendUTC = makeDate(graph_limits.endtime).getTime();\n }\n return {starttime: startUTC, endtime: endUTC};\n}", "function getXPixelAxis(val) {\n\t\treturn (getGraphWidth() / size * val) + ((width - xOffset) / size) / 2 + xOffset;\n\t}", "update_axis(){\n this.x.domain([this.parent.year0, this.parent.year0 - this.parent.window])\n this.axis_x.transition()\n .ease(d3.easeLinear)\n .duration(this.parent.speed)\n .call(this.axis_bottom)\n }", "function calculateScales(keepAxis) {\n //get min and max values\n maxTaskLength = d3.max(diagram.data, function (d) { return d[currentSerie.sourceField].toString().length; });\n tasks = e.getUniqueValues(diagram.data, currentSerie.sourceField);\n groups = e.getUniqueValues(diagram.data, currentSerie.groupField);\n\n //set domain info\n timeDomainStart = d3.min(diagram.data, function (d) { return new Date(d[startDateField]); });\n timeDomainEnd = d3.max(diagram.data, function (d) { return new Date(d[endDateField]); });\n dateDiff = timeDomainEnd.diff(timeDomainStart);\n\n //set axis formatting via date diff\n if (dateDiff > 365) {\n //set axis formatting\n axisFormatting = d3.utcFormat('%e-%b-%Y');\n } else {\n if (dateDiff < 1) {\n //set axis formatting\n axisFormatting = d3.utcFormat('%X');\n } else {\n //set axis formatting\n axisFormatting = d3.utcFormat('%b-%e');\n }\n }\n\n //calculate margins\n autoMargin = ((diagram.yAxis.labelFontSize / 2) * (maxTaskLength + 1)) + diagram.yAxis.labelFontSize;\n margin.left = diagram.margin.left + autoMargin;\n margin.right = diagram.margin.right;\n margin.top = diagram.margin.top;\n margin.bottom = diagram.margin.bottom;\n\n //set dimension\n width = diagram.plot.width - diagram.plot.left - diagram.plot.right - margin.left - margin.right;\n height = diagram.plot.height - diagram.plot.top - diagram.plot.bottom - margin.top - margin.bottom;\n\n //caclulate tick count\n maxAxisLength = axisFormatting(timeDomainEnd).length;\n singleAxisWidth = (((diagram.xAxis.labelFontSize / 2) * (maxAxisLength)) + diagram.xAxis.labelFontSize);\n autoTickCount = Math.floor(width / singleAxisWidth);\n\n //create scales\n xScale = d3.scaleUtc().domain([timeDomainStart, timeDomainEnd]).range([0, width]).clamp(true);\n yScale = d3.scaleBand().domain(tasks).range([height - margin.top - margin.bottom, 0]).padding(0.1);\n\n //create axes\n xAxis = d3.axisBottom().scale(xScale).ticks(autoTickCount / 2).tickFormat(axisFormatting);\n yAxis = d3.axisLeft().scale(yScale).tickSize(0);\n\n if (currentSerie.labelFontSize === 'auto')\n currentSerie.labelFontSize = 11;\n }", "updateChart() {\r\n this.alpaca.getAccount().then((resp) => {\r\n this.chart.data.datasets[0].data.push({\r\n t: new Date(),\r\n y: resp.equity\r\n });\r\n this.chart.update();\r\n });\r\n this.updateOrders(); // Updates positions and orders in case any changed were made\r\n this.updatePositions();\r\n }", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function resetAxis(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}", "function grabTableData2() {\n var cache1 = CacheService.getDocumentCache();\n var dataForChart = (cache1.get('rankData'));\n// var testValue = JSON.parse(dataForChart);\n// Logger.log('return:' + testValue);\n return dataForChart;\n }// grabTableData2() function end", "function autoSetAxis(ctx, axis) {\n\t/* get the user specified axis range */\n\tlet xLeftValue = idName('x-left-value').value;\n\tlet xRightValue = idName('x-right-value').value;\n\tlet yLeftValue = idName('y-left-value').value;\n\tlet yRightValue = idName('y-right-value').value;\n\n\tsetAxis(ctx, axis, canvasWidth, canvasHeight, xLeftValue,\n\t\txRightValue, yLeftValue, yRightValue);\n}", "function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n\t var encode = {};\n\t var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\t\n\t if (!datasetModel || !coordDimensions) {\n\t return encode;\n\t }\n\t\n\t var encodeItemName = [];\n\t var encodeSeriesName = [];\n\t var ecModel = seriesModel.ecModel;\n\t var datasetMap = innerGlobalModel(ecModel).datasetMap;\n\t var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n\t var baseCategoryDimIndex;\n\t var categoryWayValueDimStart;\n\t coordDimensions = coordDimensions.slice();\n\t each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n\t var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n\t name: coordDimInfoLoose\n\t };\n\t\n\t if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n\t baseCategoryDimIndex = coordDimIdx;\n\t categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n\t }\n\t\n\t encode[coordDimInfo.name] = [];\n\t });\n\t var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n\t categoryWayDim: categoryWayValueDimStart,\n\t valueWayDim: 0\n\t }); // TODO\n\t // Auto detect first time axis and do arrangement.\n\t\n\t each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n\t var coordDimName = coordDimInfo.name;\n\t var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\t\n\t if (baseCategoryDimIndex == null) {\n\t var start = datasetRecord.valueWayDim;\n\t pushDim(encode[coordDimName], start, count);\n\t pushDim(encodeSeriesName, start, count);\n\t datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n\t // especially when encode x y specified.\n\t // consider: when mutiple series share one dimension\n\t // category axis, series name should better use\n\t // the other dimsion name. On the other hand, use\n\t // both dimensions name.\n\t } // In category way, the first category axis.\n\t else if (baseCategoryDimIndex === coordDimIdx) {\n\t pushDim(encode[coordDimName], 0, count);\n\t pushDim(encodeItemName, 0, count);\n\t } // In category way, the other axis.\n\t else {\n\t var start = datasetRecord.categoryWayDim;\n\t pushDim(encode[coordDimName], start, count);\n\t pushDim(encodeSeriesName, start, count);\n\t datasetRecord.categoryWayDim += count;\n\t }\n\t });\n\t\n\t function pushDim(dimIdxArr, idxFrom, idxCount) {\n\t for (var i = 0; i < idxCount; i++) {\n\t dimIdxArr.push(idxFrom + i);\n\t }\n\t }\n\t\n\t function getDataDimCountOnCoordDim(coordDimInfo) {\n\t var dimsDef = coordDimInfo.dimsDef;\n\t return dimsDef ? dimsDef.length : 1;\n\t }\n\t\n\t encodeItemName.length && (encode.itemName = encodeItemName);\n\t encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n\t return encode;\n\t }", "function chart() {\n\n var _data = _models.epos.dims.dummy.top(Infinity);\n \n function render() {\n chtBasic = new CHART.EposBasic(_uid + '-charts-basic', _data);\n }\n \n function update() {\n chtBasic.reload(_data);\n }\n \n return { render : render, update : update };\n }", "function getYaxisInstantReport(){\n\n var db = getDatabase();\n var rs = \"\";\n db.transaction(function(tx) {\n rs = tx.executeSql('select r.current_amount from category c left join category_report_current r where r.id_category = c.id');\n }\n );\n\n var expenses = [];\n for(var i =0;i < rs.rows.length;i++) {\n expenses.push(rs.rows.item(i).current_amount);\n }\n\n return expenses;\n }", "function cbfunc(yqlResult) {\n\t\t\t\tvar count = yqlResult.query.count;\n\t\t\t\tif (count > 0) {\n\t\t\t\t\tenableStreaming = false;\n\t\t\t\t\tvar quotes = yqlResult.query.results.quote;\n\t\t\t\t\tquotes.reverse();\n\t\t\t\t\tconvertYahooResults(quotes);\n\t\t\t\t\tstxx.newChart($$(\"symbol\").value, quotes);\n\t\t\t\t}\n\t\t\t}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "function collect(ecModel, api) {\n var result = {\n /**\n * key: makeKey(axis.model)\n * value: {\n * axis,\n * coordSys,\n * axisPointerModel,\n * triggerTooltip,\n * involveSeries,\n * snap,\n * seriesModels,\n * seriesDataCount\n * }\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\n * key: makeKey(coordSys.model)\n * value: Object: key makeKey(axis.model), value: axisInfo\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}", "update(elementCache, viewport, data) {\n\n let width = viewport.clientWidth;\n let height = 150;\n this.setViewPortSVGSize(elementCache.svg, width, height);\n\n let { axis: xAxis, scale: xScale } = this.createXAxis(data, width); \n this.formatAxis(elementCache.axisG, height, xAxis, xScale);\n\n this.renderElements(this.data, xScale, elementCache.chartG);\n }", "function getResultDetailed(){\r\n\t\r\n\tif (processDone) {\r\n \r\n\t\t for(var key in Obj_Fetch)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\tvar temp_var={};\r\n\t\t\t\t\t\ttemp_var.cancertypedetailed=key;\r\n\t\t\t\t\t\ttemp_var.male=Obj_Fetch[key].MALE;\r\n\t\t\t\t\t\ttemp_var.female=Obj_Fetch[key].FEMALE;\r\n\t\t\t\t\t\tfetch_data_array.push(temp_var);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\taddScatterPlotDetailed(fetch_data_array);\r\n\t\t\t\t\t\tconsole.log(fetch_data_array);\r\n\r\n } else {\r\n setTimeout(getResult, 250);\r\n }\r\n }", "function configureOneAxis(axisName, inputChartDef, c3Axis) {\r\n var axisMap = inputChartDef.axisMap;\r\n if (!axisMap) {\r\n return;\r\n }\r\n c3Axis[axisName] = { show: false };\r\n var axisDef = inputChartDef.plotConfig[axisName];\r\n var c3AxisDef = c3Axis[axisName];\r\n var series = axisMap[axisName];\r\n if (!series) {\r\n return;\r\n }\r\n if (Array.isArray(series)) {\r\n series.forEach(function (seriesConfig) {\r\n configureOneSeries(seriesConfig, inputChartDef, axisDef, c3AxisDef);\r\n });\r\n }\r\n else {\r\n configureOneSeries(series, inputChartDef, axisDef, c3AxisDef);\r\n }\r\n}", "function extractXS(axisName, inputChartDef, xs) {\r\n var axisMap = inputChartDef.axisMap;\r\n if (!axisMap) {\r\n return;\r\n }\r\n var series = axisMap[axisName];\r\n if (!series) {\r\n return;\r\n }\r\n for (var _i = 0, series_2 = series; _i < series_2.length; _i++) {\r\n var seriesConfig = series_2[_i];\r\n var ySeriesName = seriesConfig.series;\r\n if (xs[ySeriesName]) {\r\n return; // Already set.\r\n }\r\n if (seriesConfig.x) {\r\n xs[ySeriesName] = seriesConfig.x.series; // X explicitly associated with Y.\r\n }\r\n else if (inputChartDef.axisMap && inputChartDef.axisMap.x) {\r\n xs[ySeriesName] = inputChartDef.axisMap.x.series; // Default X.\r\n }\r\n }\r\n}", "function update_axis(newScale){\n chart.select(\".vertical.axis\").\n transition()\n .call(vertical_axis.scale(newScale));\n }", "function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel || !coordDimensions) {\n return encode;\n }\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var ecModel = seriesModel.ecModel;\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n var baseCategoryDimIndex;\n var categoryWayValueDimStart;\n coordDimensions = coordDimensions.slice();\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* each */ \"k\"])(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n var coordDimInfo = Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* isObject */ \"z\"])(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n name: coordDimInfoLoose\n };\n\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n baseCategoryDimIndex = coordDimIdx;\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n }\n\n encode[coordDimInfo.name] = [];\n });\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: categoryWayValueDimStart,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_1__[/* each */ \"k\"])(coordDimensions, function (coordDimInfo, coordDimIdx) {\n var coordDimName = coordDimInfo.name;\n var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\n if (baseCategoryDimIndex == null) {\n var start = datasetRecord.valueWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when mutiple series share one dimension\n // category axis, series name should better use\n // the other dimsion name. On the other hand, use\n // both dimensions name.\n } // In category way, the first category axis.\n else if (baseCategoryDimIndex === coordDimIdx) {\n pushDim(encode[coordDimName], 0, count);\n pushDim(encodeItemName, 0, count);\n } // In category way, the other axis.\n else {\n var start = datasetRecord.categoryWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.categoryWayDim += count;\n }\n });\n\n function pushDim(dimIdxArr, idxFrom, idxCount) {\n for (var i = 0; i < idxCount; i++) {\n dimIdxArr.push(idxFrom + i);\n }\n }\n\n function getDataDimCountOnCoordDim(coordDimInfo) {\n var dimsDef = coordDimInfo.dimsDef;\n return dimsDef ? dimsDef.length : 1;\n }\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}", "_notifyUpdate(object) {\n\n if ( this.cache ) {\n\n // Iterate over every dimension - if caching is enabled then run through dimension key and add to the cache\n _.forEach(this.dimensions, (dimension) => {\n\n if ( dimension._framefetch_config.cache ) {\n\n let dimensionKey = dimension._framefetch_config.dimensionKey(object)\n\n dimension.clear(dimensionKey).prime(dimensionKey, object)\n\n }\n\n })\n\n }\n\n }", "function getChartValues(cord){\r\n\taxisType = $(\"#\"+cord+\"AxisList\").val();\r\n\r\n\tif(axisType == \"time\"){\r\n\t\ttimeSelection = $('#time'+cord+'AxisList').val();\r\n\t\t\r\n\t\tif(timeSelection == \"Years\"){\r\n\t\t\ttimeSelectionId = 1; \t\t\t\t// for Years\r\n\t\t}\r\n\t\telse if(timeSelection == \"Seasons\"){\r\n\t\t\ttimeSelectionId = 2; \t\t\t\t// for Seasons\r\n\t\t}\r\n\t\telse if(timeSelection == \"Months\"){\r\n\t\t\ttimeSelectionId = 3; \t\t\t\t// for Months\r\n\t\t}\r\n\t\telse if(timeSelection == \"Weeks\"){\r\n\t\t\ttimeSelectionId = 4; \t\t\t\t// for Weeks\r\n\t\t}\r\n\t\telse if(timeSelection == \"Days\"){\r\n\t\t\ttimeSelectionId = 5; \t\t\t\t// for Days\r\n\t\t}\r\n\t}else if(axisType == \"space\"){\r\n\t\tspaceSelection = $('#space'+cord+'AxisList').val();\r\n\t\t\r\n\t\tif(spaceSelection == \"Latitude/Longitude\"){\r\n\t\t\tspaceSelectionId = 1; \t\t\t\t// for Latitude/Longitude\r\n\t\t}\r\n\t\telse if(spaceSelection == \"Districts\"){\r\n\t\t\tspaceSelectionId = 2; \t\t\t\t// for Seasons\r\n\t\t}\r\n\t}else if(axisType == \"noOfEvents\"){\r\n\t\tnoOfEventsCat = $('#noOfEventsCat'+cord+'AxisList').val();\r\n\t\tnoOfEventsSubCat = $('#noOfEventsSubCat'+cord+'AxisList').val();\r\n\t}\r\n\telse if(axisType == \"noOfPart\"){\r\n\t\tnoOfPartCat = $('#noOfPartCat'+cord+'AxisList').val();\r\n\t\tnoOfPartSubCat = $('#noOfPartSubCat'+cord+'AxisList').val();\r\n\t}\r\n\telse if(axisType == \"catSubCat\"){\r\n\t\tcatSubCatCat = $('#catSubCatCat'+cord+'AxisList').val();\r\n\t\tcatSubCatSubCat = $('#catSubCatSubCat'+cord+'AxisList').val();\r\n\t}\r\n}", "function toggleAxis(axis){\n\n }", "function toggleAxis(axis){\n\n }", "function create$2(ecModel, api) {\n\t var singles = [];\n\t ecModel.eachComponent('singleAxis', function (axisModel, idx) {\n\t var single = new Single(axisModel, ecModel, api);\n\t single.name = 'single_' + idx;\n\t single.resize(axisModel, api);\n\t axisModel.coordinateSystem = single;\n\t singles.push(single);\n\t });\n\t ecModel.eachSeries(function (seriesModel) {\n\t if (seriesModel.get('coordinateSystem') === 'singleAxis') {\n\t var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n\t seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\n\t }\n\t });\n\t return singles;\n\t }", "function getXaxisInstantReport(){\n\n var db = getDatabase();\n var rs = \"\";\n\n db.transaction(function(tx) {\n rs = tx.executeSql('SELECT cat_name FROM category');\n }\n );\n /* build the array */\n var categoryNames = [];\n for(var i =0;i < rs.rows.length;i++) {\n categoryNames.push(rs.rows.item(i).cat_name);\n }\n\n return categoryNames;\n }", "getColumnMetrics() {\n const swapAxes = () => {\n for (const series of this.chart.series) {\n const xAxis = series.xAxis;\n series.xAxis = series.yAxis;\n series.yAxis = xAxis;\n }\n };\n swapAxes();\n const metrics = super.getColumnMetrics();\n swapAxes();\n return metrics;\n }" ]
[ "0.5536096", "0.549356", "0.53217316", "0.52446747", "0.52361155", "0.5233653", "0.515395", "0.51246244", "0.5050672", "0.5034768", "0.4985576", "0.49759856", "0.49518067", "0.49134618", "0.49048334", "0.49028695", "0.48955682", "0.48922464", "0.4891089", "0.48861334", "0.48799434", "0.48675", "0.48491436", "0.48491436", "0.48465505", "0.48356384", "0.4834576", "0.4826211", "0.48180062", "0.48064774", "0.4798412", "0.47972363", "0.4796923", "0.4788621", "0.47741467", "0.4770987", "0.4770987", "0.47489676", "0.4747188", "0.4746733", "0.47370014", "0.4736806", "0.4736806", "0.47346443", "0.47223833", "0.4720185", "0.47180662", "0.47138715", "0.47138715", "0.47138715", "0.47138715", "0.470977", "0.47067478", "0.46991268", "0.46853426", "0.46824095", "0.4671195", "0.4671195", "0.4669358", "0.46328965", "0.46316528", "0.4629202", "0.46196213", "0.46089837", "0.46003708", "0.46003708", "0.46003708", "0.46003708", "0.45884088", "0.45793355", "0.4578481", "0.45780697", "0.45629334", "0.45618087", "0.45613378", "0.45613378", "0.45613378", "0.45613378", "0.45613378", "0.45613378", "0.45613378", "0.45613378", "0.45613378", "0.4547862", "0.45429304", "0.4540729", "0.4529242", "0.45212498", "0.45135778", "0.4512555", "0.45106405", "0.45053104", "0.45053104", "0.45033193", "0.449206", "0.44906917" ]
0.4491439
98
Calculate interval for category axis ticks and labels. To get precise result, at least one of `getRotate` and `isHorizontal` should be implemented in axis.
function calculateCategoryInterval(axis) { var params = fetchAutoCategoryIntervalCalculationParams(axis); var labelFormatter = makeLabelFormatter(axis); var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI; var ordinalScale = axis.scale; var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization: // avoid generating a long array by `getTicks` // in large category data case. var tickCount = ordinalScale.count(); if (ordinalExtent[1] - ordinalExtent[0] < 1) { return 0; } var step = 1; // Simple optimization. Empirical value: tick count should less than 40. if (tickCount > 40) { step = Math.max(1, Math.floor(tickCount / 40)); } var tickValue = ordinalExtent[0]; var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); var unitW = Math.abs(unitSpan * Math.cos(rotation)); var unitH = Math.abs(unitSpan * Math.sin(rotation)); var maxW = 0; var maxH = 0; // Caution: Performance sensitive for large category data. // Consider dataZoom, we should make appropriate step to avoid O(n) loop. for (; tickValue <= ordinalExtent[1]; tickValue += step) { var width = 0; var height = 0; // Not precise, do not consider align and vertical align // and each distance from axis line yet. var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number width = rect.width * 1.3; height = rect.height * 1.3; // Min size, void long loop. maxW = Math.max(maxW, width, 7); maxH = Math.max(maxH, height, 7); } var dw = maxW / unitW; var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity. isNaN(dw) && (dw = Infinity); isNaN(dh) && (dh = Infinity); var interval = Math.max(0, Math.floor(Math.min(dw, dh))); var cache = inner(axis.model); var axisExtent = axis.getExtent(); var lastAutoInterval = cache.lastAutoInterval; var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window, // otherwise the calculated interval might jitter when the zoom // window size is close to the interval-changing size. // For example, if all of the axis labels are `a, b, c, d, e, f, g`. // The jitter will cause that sometimes the displayed labels are // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1). if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical // point is not the same when zooming in or zooming out. && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not // be used. Otherwise some hiden labels might not be shown again. && cache.axisExtend0 === axisExtent[0] && cache.axisExtend1 === axisExtent[1]) { interval = lastAutoInterval; } // Only update cache if cache not used, otherwise the // changing of interval is too insensitive. else { cache.lastTickCount = tickCount; cache.lastAutoInterval = interval; cache.axisExtend0 = axisExtent[0]; cache.axisExtend1 = axisExtent[1]; } return interval; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n\n return interval;\n}", "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n\n return interval;\n}", "function calculateCategoryInterval(axis) {\n\t var params = fetchAutoCategoryIntervalCalculationParams(axis);\n\t var labelFormatter = makeLabelFormatter(axis);\n\t var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n\t var ordinalScale = axis.scale;\n\t var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n\t // avoid generating a long array by `getTicks`\n\t // in large category data case.\n\t\n\t var tickCount = ordinalScale.count();\n\t\n\t if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n\t return 0;\n\t }\n\t\n\t var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\t\n\t if (tickCount > 40) {\n\t step = Math.max(1, Math.floor(tickCount / 40));\n\t }\n\t\n\t var tickValue = ordinalExtent[0];\n\t var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n\t var unitW = Math.abs(unitSpan * Math.cos(rotation));\n\t var unitH = Math.abs(unitSpan * Math.sin(rotation));\n\t var maxW = 0;\n\t var maxH = 0; // Caution: Performance sensitive for large category data.\n\t // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\t\n\t for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n\t var width = 0;\n\t var height = 0; // Not precise, do not consider align and vertical align\n\t // and each distance from axis line yet.\n\t\n\t var rect = getBoundingRect(labelFormatter({\n\t value: tickValue\n\t }), params.font, 'center', 'top'); // Magic number\n\t\n\t width = rect.width * 1.3;\n\t height = rect.height * 1.3; // Min size, void long loop.\n\t\n\t maxW = Math.max(maxW, width, 7);\n\t maxH = Math.max(maxH, height, 7);\n\t }\n\t\n\t var dw = maxW / unitW;\n\t var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\t\n\t isNaN(dw) && (dw = Infinity);\n\t isNaN(dh) && (dh = Infinity);\n\t var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n\t var cache = inner$4(axis.model);\n\t var axisExtent = axis.getExtent();\n\t var lastAutoInterval = cache.lastAutoInterval;\n\t var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n\t // otherwise the calculated interval might jitter when the zoom\n\t // window size is close to the interval-changing size.\n\t // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n\t // The jitter will cause that sometimes the displayed labels are\n\t // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\t\n\t if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n\t // point is not the same when zooming in or zooming out.\n\t && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n\t // be used. Otherwise some hiden labels might not be shown again.\n\t && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n\t interval = lastAutoInterval;\n\t } // Only update cache if cache not used, otherwise the\n\t // changing of interval is too insensitive.\n\t else {\n\t cache.lastTickCount = tickCount;\n\t cache.lastAutoInterval = interval;\n\t cache.axisExtent0 = axisExtent[0];\n\t cache.axisExtent1 = axisExtent[1];\n\t }\n\t\n\t return interval;\n\t }", "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = contain_text[\"e\" /* getBoundingRect */](labelFormatter({\n value: tickValue\n }), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hiden labels might not be shown again.\n && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtent0 = axisExtent[0];\n cache.axisExtent1 = axisExtent[1];\n }\n\n return interval;\n}", "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Polar is also calculated in assumptive linear layout here.\n // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n\n return interval;\n}", "function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n} // Can be null|'auto'|number|function", "function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}", "function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}", "function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}", "function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}", "addTicksAndLabels() {\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = Math.round(that._range / parseFloat((ticksFrequency.toString()))),\n ticksDistance = trackLength / tickscount,\n min = parseFloat(that._drawMin),\n max = parseFloat(that._drawMax);\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n\n //handling specific case\n if (that.logarithmicScale && min < 0 && min !== -1) {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n }\n else {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency) + parseFloat(ticksFrequency));\n }\n\n distanceModifier = second - first;\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n distanceModifier = first - second;\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier / ticksFrequency * ticksDistance;\n\n if (second.toString() !== that._drawMax.toString() && distanceFromFirstToSecond < trackLength) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = firstLabelSize < distanceFromFirstToSecond;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n ticks += this.addMinorTicks(normalLayout);\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n }", "addGaugeTicksAndLabels() {\n const that = this.context,\n numericProcessor = this,\n maxLabelHeight = Math.max(that._tickIntervalHandler.labelsSize.minLabelSize, that._tickIntervalHandler.labelsSize.maxLabelSize),\n majorStep = that._majorTicksInterval,\n minorStep = that._minorTicksInterval,\n majorTickValues = {},\n distance = that._distance,\n radius = that._measurements.radius,\n majorTickWidth = radius - distance.majorTickDistance,\n minorTickWidth = radius - distance.minorTickDistance;\n let drawMajor, drawMinor, addLabel, currentAngle, angleAtMin, angleAtMax;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawMajor = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n\n drawMinor = function (value) {\n that._drawTick(numericProcessor.getAngleByValue(value, true), minorTickWidth, 'minor');\n };\n }\n else {\n drawMajor = function () { };\n drawMinor = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n addLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n addLabel = function () { };\n }\n\n if (!that.inverted) {\n angleAtMin = that.endAngle;\n angleAtMax = that.startAngle;\n }\n else {\n angleAtMin = that.startAngle;\n angleAtMax = that.endAngle;\n }\n\n // first major tick and label\n currentAngle = numericProcessor.getAngleByValue(that._drawMin, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMin] = true;\n addLabel(currentAngle, that.min, false);\n\n let second = that._drawMin - numericProcessor.getPreciseModulo(that._drawMin, majorStep),\n firstMinTick;\n\n if (that._drawMin >= 0) {\n second += majorStep;\n }\n\n // determines the value at the first minor tick\n for (let i = second; i >= that._drawMin; i = i - minorStep) {\n firstMinTick = i;\n }\n\n // second major tick and label\n currentAngle = numericProcessor.getAngleByValue(second, false);\n drawMajor(currentAngle);\n majorTickValues[second] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMin, numericProcessor.getAngleByValue(second, false, true)) / 360) > maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(second), second < that._drawMax);\n }\n\n let i;\n // middle major ticks and labels\n for (i = second + majorStep; i < that._drawMax - majorStep; i += majorStep) {\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i] = true;\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (majorTickValues[i] === undefined && i <= that._drawMax) {\n // second-to-last major tick and label\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, numericProcessor.getAngleByValue(i, false, true)) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (that._normalizedStartAngle !== that.endAngle) {\n // last major tick and label\n currentAngle = numericProcessor.getAngleByValue(that._drawMax, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMax] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, angleAtMin) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, that.max, false);\n }\n }\n }\n\n // minor ticks\n if (!that.logarithmicScale) {\n for (let j = firstMinTick; j < that._drawMax; j += minorStep) {\n if (majorTickValues[j]) {\n continue; // does not plot minor ticks over major ones\n }\n drawMinor(j);\n }\n }\n else {\n this.drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor);\n }\n }", "_calculateTickAndLabelDistance() {\n const that = this,\n measurements = that._measurements;\n\n if (that.scalePosition === 'none') {\n that._plotLabels = false;\n that._plotTicks = false;\n\n measurements.innerRadius = measurements.radius;\n\n return { majorTickDistance: 0, minorTickDistance: 0, labelDistance: 0, needleDistance: 0, trackDistance: 0 };\n }\n\n const labelsSize = that._tickIntervalHandler.labelsSize,\n labelSizeCoefficient = that._largestLabelSize || Math.max(labelsSize.minLabelSize, labelsSize.minLabelOtherSize, labelsSize.maxLabelSize, labelsSize.maxLabelOtherSize);\n let majorTickDistance = 1,\n minorTickDistance,\n labelDistance,\n needleDistance,\n trackDistance = 0;\n\n that._largestLabelSize = labelSizeCoefficient;\n\n if (that.scalePosition === 'outside') {\n majorTickDistance = labelSizeCoefficient;\n minorTickDistance = majorTickDistance + measurements.majorTickSize - measurements.minorTickSize;\n labelDistance = 0;\n }\n\n if (that.analogDisplayType === 'needle') {\n if (that.scalePosition === 'outside') {\n needleDistance = majorTickDistance + measurements.majorTickSize;\n }\n else {\n needleDistance = majorTickDistance + measurements.majorTickSize + labelSizeCoefficient;\n }\n\n if (that.ticksVisibility === 'none') {\n labelDistance = 0;\n needleDistance -= measurements.majorTickSize;\n }\n if (that.labelsVisibility === 'none') {\n needleDistance -= labelSizeCoefficient;\n if (that.scalePosition === 'outside') {\n majorTickDistance -= labelSizeCoefficient;\n minorTickDistance -= labelSizeCoefficient;\n }\n }\n }\n else {\n if (that.labelsVisibility === 'none' && that.ticksVisibility === 'none') {\n trackDistance = 0;\n }\n else {\n if (that.scalePosition === 'outside') {\n if (that.ticksPosition === 'scale') {\n if (that.labelsVisibility === 'none') {\n majorTickDistance = 1;\n minorTickDistance = 1 + measurements.majorTickSize - measurements.minorTickSize;\n }\n if (that.ticksVisibility !== 'none') {\n trackDistance = majorTickDistance + measurements.majorTickSize + 2;\n }\n else {\n trackDistance = labelSizeCoefficient;\n }\n }\n else {\n if (that.labelsVisibility !== 'none') {\n minorTickDistance = minorTickDistance - (measurements.trackWidth + measurements.trackBorderWidth) / 4;\n trackDistance = majorTickDistance - 1;\n }\n else {\n majorTickDistance = 1;\n minorTickDistance = (measurements.trackWidth + measurements.trackBorderWidth) / 4 + 1;\n trackDistance = 0;\n }\n }\n }\n else {\n if (that.ticksPosition === 'scale') {\n majorTickDistance = measurements.trackWidth + 1.5 * measurements.trackBorderWidth + 2;\n if (that.ticksVisibility === 'none') {\n labelDistance = majorTickDistance;\n }\n }\n else {\n minorTickDistance = (measurements.trackWidth + measurements.trackBorderWidth) / 4 + 1;\n }\n }\n }\n }\n\n if (minorTickDistance === undefined) {\n minorTickDistance = majorTickDistance;\n }\n\n if (labelDistance === undefined) {\n labelDistance = majorTickDistance + measurements.majorTickSize;\n }\n\n measurements.innerRadius = measurements.radius - labelDistance;\n\n delete that._plotLabels;\n delete that._plotTicks;\n delete that._equalToHalfRadius;\n if (that.scalePosition === 'inside') {\n if (measurements.innerRadius < labelSizeCoefficient) {\n that._plotLabels = false;\n\n if (that.ticksPosition === 'scale') {\n if (that.analogDisplayType !== 'needle' && measurements.innerRadius < measurements.majorTickSize) {\n that._plotTicks = false;\n }\n }\n else {\n that._equalToHalfRadius = true;\n measurements.innerRadius = measurements.radius / 2;\n }\n }\n }\n else if (measurements.radius - trackDistance - measurements.trackBorderWidth < measurements.trackWidth) {\n measurements.trackWidth = measurements.radius - trackDistance - measurements.trackBorderWidth;\n measurements.lineSize = measurements.trackWidth + measurements.trackBorderWidth;\n if (that.ticksPosition === 'track') {\n measurements.majorTickSize = measurements.lineSize;\n measurements.minorTickSize = measurements.majorTickSize / 2;\n minorTickDistance = majorTickDistance + (measurements.majorTickSize - measurements.minorTickSize) / 2;\n }\n }\n\n return { majorTickDistance: majorTickDistance, minorTickDistance: minorTickDistance, labelDistance: labelDistance, needleDistance: needleDistance, trackDistance: trackDistance };\n }", "_calculateTickInterval() {\n const that = this,\n intervals = that._tickIntervalHandler.getInterval('radial', that._drawMin, that._drawMax, that.$.container, that.logarithmicScale);\n\n if (intervals.major !== that._majorTicksInterval) {\n that._intervalHasChanged = true;\n that._majorTicksInterval = intervals.major;\n }\n else {\n that._intervalHasChanged = true;\n }\n\n that._minorTicksInterval = intervals.minor;\n\n if (that.mode === 'date') {\n that._calculateDateInterval(intervals.major);\n }\n }", "_calculateTickInterval() {\n const that = this;\n let intervals = that._tickIntervalHandler.getInterval('linear', that._drawMin, that._drawMax, that.$.track, that.logarithmicScale);\n\n if (intervals.major !== that._majorTicksInterval) {\n that._intervalHasChanged = true;\n that._majorTicksInterval = intervals.major;\n }\n else {\n that._intervalHasChanged = true;\n }\n\n that._minorTicksInterval = intervals.minor;\n\n if (that.mode === 'date') {\n that._calculateDateInterval(intervals.major);\n }\n }", "addGaugeTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n numericProcessor = this,\n maxLabelHeight = Math.max(that._tickIntervalHandler.labelsSize.minLabelSize, that._tickIntervalHandler.labelsSize.maxLabelSize),\n majorStep = that._majorTicksInterval,\n minorStep = that._minorTicksInterval,\n majorTickValues = {},\n distance = that._distance,\n radius = that._measurements.radius,\n majorTickWidth = radius - distance.majorTickDistance,\n minorTickWidth = radius - distance.minorTickDistance,\n bigDrawMin = new JQX.Utilities.BigNumber(that._drawMin),\n bigDrawMax = new JQX.Utilities.BigNumber(that._drawMax);\n let drawMajor, drawMinor, addLabel, currentAngle, angleAtMin, angleAtMax;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawMajor = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n\n drawMinor = function (value) {\n that._drawTick(numericProcessor.getAngleByValue(value, true), minorTickWidth, 'minor');\n };\n }\n else {\n drawMajor = function () { };\n drawMinor = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n addLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n addLabel = function () { };\n }\n\n if (!that.inverted) {\n angleAtMin = that.endAngle;\n angleAtMax = that.startAngle;\n }\n else {\n angleAtMin = that.startAngle;\n angleAtMax = that.endAngle;\n }\n\n // first major tick and label\n currentAngle = numericProcessor.getAngleByValue(bigDrawMin, false);\n drawMajor(currentAngle);\n majorTickValues[that._drawMin.toString()] = true;\n addLabel(currentAngle, that.min, false);\n\n let second = bigDrawMin.subtract(bigDrawMin.mod(majorStep)),\n firstMinTick;\n\n if (bigDrawMin.compare(0) !== -1) {\n second = second.add(majorStep);\n }\n\n // determines the value at the first minor tick\n for (let i = new JQX.Utilities.BigNumber(second); i.compare(bigDrawMin) !== -1; i = i.subtract(minorStep)) {\n firstMinTick = i;\n }\n\n // second major tick and label\n currentAngle = numericProcessor.getAngleByValue(second, false);\n drawMajor(currentAngle);\n majorTickValues[second.toString()] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMin, numericProcessor.getAngleByValue(second, false, true)) / 360) > maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(second), second.compare(bigDrawMax) === -1);\n }\n\n let i;\n // middle major ticks and labels\n for (i = second.add(majorStep); i.compare(bigDrawMax.subtract(majorStep)) === -1; i = i.add(majorStep)) {\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i.toString()] = true;\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (majorTickValues[i.toString()] === undefined && i.compare(bigDrawMax) !== 1) {\n // second-to-last major tick and label\n currentAngle = numericProcessor.getAngleByValue(i, false);\n drawMajor(currentAngle);\n majorTickValues[i.toString()] = true;\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, numericProcessor.getAngleByValue(i, false, true)) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, this.getActualValue(i), true);\n }\n\n if (that._normalizedStartAngle !== that.endAngle) {\n // last major tick and label\n currentAngle = numericProcessor.getAngleByValue(bigDrawMax, false);\n drawMajor(currentAngle);\n if (2 * Math.PI * that._measurements.innerRadius * (this._getAngleDifference(angleAtMax, angleAtMin) / 360) >= maxLabelHeight) {\n addLabel(currentAngle, that.max, false);\n }\n }\n }\n\n if (that.mode === 'date') {\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n return;\n }\n\n // minor ticks\n if (!that.logarithmicScale) {\n for (let j = firstMinTick; j.compare(bigDrawMax) === -1; j = j.add(minorStep)) {\n if (majorTickValues[j.toString()]) {\n continue; // does not plot minor ticks over major ones\n }\n drawMinor(j);\n }\n }\n else {\n this.drawGaugeLogarithmicScaleMinorTicks(majorTickValues, majorStep, drawMinor);\n }\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "addTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = this.round(new JQX.Utilities.BigNumber(that._range).divide(ticksFrequency)),\n ticksDistance = trackLength / tickscount,\n min = new JQX.Utilities.BigNumber(that._drawMin),\n max = new JQX.Utilities.BigNumber(that._drawMax);\n\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n second = ticksFrequency.add(first.subtract(first.mod(ticksFrequency)));\n distanceModifier = second.subtract(first);\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = first.subtract(first.mod(ticksFrequency));\n distanceModifier = first.subtract(second);\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier.divide(ticksFrequency).multiply(ticksDistance);\n\n if (second.compare(that.max) !== 0 && distanceFromFirstToSecond.compare(trackLength) < 0) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = distanceFromFirstToSecond.compare(firstLabelSize) > 0;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n if (that.mode !== 'date') {\n ticks += this.addMinorTicks(normalLayout);\n }\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "_setTicksAndInterval() {\n const that = this;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n //Set the New Format here\n let minLabel = that._formatLabel(that.min),\n maxLabel = that._formatLabel(that.max);\n\n //gets the range with the new min/max\n that._getRange();\n\n //creates a new tickIntervalHandler instance\n that._tickIntervalHandler = new JQX.Utilities.TickIntervalHandler(that, minLabel, maxLabel, 'jqx-label', that._settings.size, that.scaleType === 'integer', that.logarithmicScale);\n\n //re-arranges the layout\n that._layout();\n\n if (!that.customInterval) {\n // calculates the tickInterval\n that._calculateTickInterval();\n\n if (that._dateInterval) {\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n else {\n // Add the ticks and labels\n that._numericProcessor.addTicksAndLabels();\n }\n }\n else {\n if (that.mode === 'date') {\n that._calculateTickInterval()\n }\n\n // custom ticks\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n }", "niceScale (yMin, yMax, ticks = 10) {\n if ((yMin === Number.MIN_VALUE && yMax === 0) || (!Utils.isNumber(yMin) && !Utils.isNumber(yMax))) {\n // when all values are 0\n yMin = 0\n yMax = 1\n ticks = 1\n let justRange = this.justRange(yMin, yMax, ticks)\n return justRange\n }\n\n // Calculate Min amd Max graphical labels and graph\n // increments. The number of ticks defaults to\n // 10 which is the SUGGESTED value. Any tick value\n // entered is used as a suggested value which is\n // adjusted to be a 'pretty' value.\n //\n // Output will be an array of the Y axis values that\n // encompass the Y values.\n let result = []\n // If yMin and yMax are identical, then\n // adjust the yMin and yMax values to actually\n // make a graph. Also avoids division by zero errors.\n if (yMin === yMax) {\n yMin = yMin - 10 // some small value\n yMax = yMax + 10 // some small value\n }\n // Determine Range\n let range = yMax - yMin\n let tiks = ticks + 1\n // Adjust ticks if needed\n if (tiks < 2) {\n tiks = 2\n } else if (tiks > 2) {\n tiks -= 2\n }\n\n // Get raw step value\n let tempStep = range / tiks\n // Calculate pretty step value\n\n let mag = Math.floor(this.log10(tempStep))\n let magPow = Math.pow(10, mag)\n let magMsd = parseInt(tempStep / magPow)\n let stepSize = magMsd * magPow\n\n // build Y label array.\n // Lower and upper bounds calculations\n let lb = stepSize * Math.floor(yMin / stepSize)\n let ub = stepSize * Math.ceil((yMax / stepSize))\n // Build array\n let val = lb\n while (1) {\n result.push(val)\n val += stepSize\n if (val > ub) { break }\n }\n\n // TODO: need to remove this condition below which makes this function tightly coupled with w.\n if (this.w.config.yaxis[0].max === undefined &&\n this.w.config.yaxis[0].min === undefined) {\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n } else {\n result = []\n let v = yMin\n result.push(v)\n let valuesDivider = Math.abs(yMax - yMin) / ticks\n for (let i = 0; i <= ticks - 1; i++) {\n v = v + valuesDivider\n result.push(v)\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n }\n }", "function calculateTicks(axis, axisOptions){\n\t\t\taxis.ticks = [];\t\n\t\t\tif(axisOptions.ticks){\n\t\t\t\tvar ticks = axisOptions.ticks;\n\t\n\t\t\t\tif(Object.isFunction(ticks)){\n\t\t\t\t\tticks = ticks({ min: axis.min, max: axis.max });\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Clean up the user-supplied ticks, copy them over.\n\t\t\t\t */\n\t\t\t\tfor(var i = 0, v, label; i < ticks.length; ++i){\n\t\t\t\t\tvar t = ticks[i];\n\t\t\t\t\tif(typeof(t) == 'object'){\n\t\t\t\t\t\tv = t[0];\n\t\t\t\t\t\tlabel = (t.length > 1) ? t[1] : axisOptions.tickFormatter(v);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tv = t;\n\t\t\t\t\t\tlabel = axisOptions.tickFormatter(v);\n\t\t\t\t\t}\n\t\t\t\t\taxis.ticks[i] = { v: v, label: label };\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t/**\n\t\t\t\t * Round to nearest multiple of tick size.\n\t\t\t\t */\n\t\t\t\tvar start = axis.tickSize * Math.ceil(axis.min / axis.tickSize);\n\t\t\t\t/**\n\t\t\t\t * Then spew out all possible ticks.\n\t\t\t\t */\n\t\t\t\tfor(i = 0; start + i * axis.tickSize <= axis.max; ++i){\n\t\t\t\t\tv = start + i * axis.tickSize;\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Round (this is always needed to fix numerical instability).\n\t\t\t\t\t */\n\t\t\t\t\tvar decimals = axisOptions.tickDecimals;\n\t\t\t\t\tif(decimals == null) decimals = 1 - Math.floor(Math.log(axis.tickSize) / Math.LN10);\n\t\t\t\t\tif(decimals < 0) decimals = 0;\n\t\t\t\t\t\n\t\t\t\t\tv = v.toFixed(decimals);\n\t\t\t\t\taxis.ticks.push({ v: v, label: axisOptions.tickFormatter(v) });\n\t\t\t\t}\n\t\t\t}\n\t\t}", "_calcLabelTicks(startDate, endDate, groups) {\n let offset = -Math.ceil((new Date().getTimezoneOffset()) / 60);\n // Calculated intervall length\n let unitTime = this._calcBiggestTimeUnitDifference(startDate, endDate);\n let interval = Math.ceil(unitTime.difference / groups);\n let labels = [];\n\n for (let n = 0; n < groups - 1; n++) {\n labels.push(this._formatDate(new Date(unitTime.startDate.getTime() + interval * n), offset) + \"\\n - \\n\" + this._formatDate(new Date(unitTime.startDate.getTime() + interval * (n + 1)), offset));\n }\n labels.push(this._formatDate(new Date(unitTime.startDate.getTime() + interval * (groups - 1)), offset) + \"\\n - \\n\" + this._formatDate(new Date(unitTime.endDate.getTime()), offset));\n\n return {label: labels, interval: interval, startDate: unitTime.startDate, endDate: unitTime.endDate};\n }", "function tickCount() {\n if (width <= 530) {\n xAxis.ticks(5);\n yAxis.ticks(5);\n }\n else {\n xAxis.ticks(10);\n yAxis.ticks(10);\n } \n }", "addGaugeCustomTicks() {\n const numericProcessor = this,\n that = numericProcessor.context,\n distance = that._distance,\n majorTickWidth = that._measurements.radius - distance.majorTickDistance;\n let drawTick, drawLabel;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawTick = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n }\n else {\n drawTick = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n drawLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n drawLabel = function () { };\n }\n\n function createTickAndLabel(i) {\n const currentLabel = that.customTicks[i],\n value = numericProcessor.createDescriptor(currentLabel),\n angle = numericProcessor.getAngleByValue(value, true),\n middle = i > 0 && i < that.customTicks.length - 1;\n\n drawTick(angle);\n drawLabel(angle, currentLabel, middle);\n }\n\n for (let i = that.customTicks.length - 1; i >= 0; i--) {\n createTickAndLabel(i);\n }\n }", "_calcLabelTicks(startDate, endDate, groups) {\n let offset = -Math.ceil((new Date().getTimezoneOffset()) / 60);\n // Calculated intervall length\n let unitTime = this._calcBiggestTimeUnitDifference(startDate, endDate);\n let interval = Math.ceil(unitTime.difference / groups);\n let labels = [];\n\n // Create labels for each group\n for (let n = 0; n < groups - 1; n++) {\n labels.push([\n this._formatDate(new Date(unitTime.startDate.getTime() + interval * n), offset),\n new Date(unitTime.startDate.getTime() + interval * n).toUTCString()\n ]);\n }\n // Add end date as last lable\n labels.push([\n this._formatDate(new Date(unitTime.endDate.getTime()), offset),\n new Date(unitTime.endDate.getTime()).toUTCString()\n ]);\n\n // Return object\n return {label: labels, interval: interval, startDate: unitTime.startDate, endDate: unitTime.endDate};\n }", "function m_cantTicksPosibles() {\n var width = +d3.select('#' + chart.element.id + \" svg .c3-zoom-rect\").attr(\"width\");\n width = +width.toFixed();\n\n var dateWidth = 85; // 85 es aproximadamente por exceso el ancho que toma una fecha\n // c3-axis c3-axis-x tener estas clases en cuanta para tomar el tamano de la fecha generico\n\n var cant_ticks = width / dateWidth;\n return +cant_ticks.toFixed();\n}", "function ticks({startAngle, endAngle, value}) {\n const k = (endAngle - startAngle) / value;\n return d3.range(0, value, tickStep).map(value => {\n return {value, angle: value * k + startAngle};\n });\n }", "niceScale(yMin, yMax, diff, index = 0, ticks = 10) {\n const w = this.w\n const NO_MIN_MAX_PROVIDED =\n (this.w.config.yaxis[index].max === undefined &&\n this.w.config.yaxis[index].min === undefined) ||\n this.w.config.yaxis[index].forceNiceScale\n if (\n (yMin === Number.MIN_VALUE && yMax === 0) ||\n (!Utils.isNumber(yMin) && !Utils.isNumber(yMax)) ||\n (yMin === Number.MIN_VALUE && yMax === -Number.MAX_VALUE)\n ) {\n // when all values are 0\n yMin = 0\n yMax = ticks\n let linearScale = this.linearScale(yMin, yMax, ticks)\n return linearScale\n }\n\n if (yMin > yMax) {\n // if somehow due to some wrong config, user sent max less than min,\n // adjust the min/max again\n console.warn('yaxis.min cannot be greater than yaxis.max')\n yMax = yMin + 0.1\n } else if (yMin === yMax) {\n // If yMin and yMax are identical, then\n // adjust the yMin and yMax values to actually\n // make a graph. Also avoids division by zero errors.\n yMin = yMin === 0 ? 0 : yMin - 0.5 // some small value\n yMax = yMax === 0 ? 2 : yMax + 0.5 // some small value\n }\n\n // Calculate Min amd Max graphical labels and graph\n // increments. The number of ticks defaults to\n // 10 which is the SUGGESTED value. Any tick value\n // entered is used as a suggested value which is\n // adjusted to be a 'pretty' value.\n //\n // Output will be an array of the Y axis values that\n // encompass the Y values.\n let result = []\n\n // Determine Range\n let range = Math.abs(yMax - yMin)\n\n if (\n range < 1 &&\n NO_MIN_MAX_PROVIDED &&\n (w.config.chart.type === 'candlestick' ||\n w.config.series[index].type === 'candlestick' ||\n w.globals.isRangeData)\n ) {\n /* fix https://github.com/apexcharts/apexcharts.js/issues/430 */\n yMax = yMax * 1.01\n }\n\n let tiks = ticks + 1\n // Adjust ticks if needed\n if (tiks < 2) {\n tiks = 2\n } else if (tiks > 2) {\n tiks -= 2\n }\n\n // Get raw step value\n let tempStep = range / tiks\n // Calculate pretty step value\n\n let mag = Math.floor(Utils.log10(tempStep))\n let magPow = Math.pow(10, mag)\n let magMsd = parseInt(tempStep / magPow)\n let stepSize = magMsd * magPow\n\n // build Y label array.\n // Lower and upper bounds calculations\n let lb = stepSize * Math.floor(yMin / stepSize)\n let ub = stepSize * Math.ceil(yMax / stepSize)\n // Build array\n let val = lb\n\n if (NO_MIN_MAX_PROVIDED && diff > 6) {\n while (1) {\n result.push(val)\n val += stepSize\n if (val > ub) {\n break\n }\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n } else {\n result = []\n let v = yMin\n result.push(v)\n let valuesDivider = Math.abs(yMax - yMin) / ticks\n for (let i = 0; i <= ticks; i++) {\n v = v + valuesDivider\n result.push(v)\n }\n\n if (result[result.length - 2] >= yMax) {\n result.pop()\n }\n\n return {\n result,\n niceMin: result[0],\n niceMax: result[result.length - 1]\n }\n }\n }", "addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency) {\n const that = this.context;\n\n let majorTicks = '', majorLabels = '', valuePlusExponent;\n\n for (let i = 1; i < tickscount; i++) {\n let number = distanceFromFirstToSecond.add(i * ticksDistance), value;\n\n if (normalLayout) {\n value = ticksFrequency.multiply(i).add(distanceModifier.add(new JQX.Utilities.BigNumber(that._drawMin)));\n }\n else {\n value = new JQX.Utilities.BigNumber(that._drawMax).subtract(distanceModifier).subtract(ticksFrequency.multiply(i));\n\n // if the value of the penultimate is 0 we add the exponent to accurately calculate its size\n if (i === tickscount - 1 && value.compare(0) === 0) {\n that._numberRenderer.numericValue = that._tickIntervalHandler.nearestPowerOfTen;\n valuePlusExponent = that._numberRenderer.bigNumberToExponent(1);\n }\n }\n if (value.compare(that._drawMax) !== 0) {\n let htmlValue = that._formatLabel(value.toString()),\n plot = true;\n\n that._labelDummy.innerHTML = valuePlusExponent ? valuePlusExponent : htmlValue;\n let dimensionValue = that._labelDummy[that._settings.size];\n\n if (number.add(dimensionValue).compare(tickscount * ticksDistance) >= 0) { // + 5 is an experimental value\n plot = false; // does not plot the second to last label if it intersects with the last one\n }\n\n const currentTickAndLabel = this._addMajorTickAndLabel(htmlValue, undefined, plot, value, true);\n\n majorTicks += currentTickAndLabel.tick;\n majorLabels += currentTickAndLabel.label;\n }\n }\n return { tick: majorTicks, label: majorLabels };\n }", "function tickCount() {\n if (width <= 500) {\n xAxis.ticks(5);\n yAxis.ticks(5);\n }\n else {\n xAxis.ticks(10);\n yAxis.ticks(10);\n }\n }", "function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var shift = ticksCoords[1].coord - ticksCoords[0].coord;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 2;\n var tickCategoryInterval = tickCategoryInterval || 0; // Avoid split a single data item when odd interval.\n\n if (tickCategoryInterval % 2 > 0) {\n ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);\n }\n });\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1];\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n return inverse ? a > b : a < b;\n }\n}", "function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var shift = ticksCoords[1].coord - ticksCoords[0].coord;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 2;\n var tickCategoryInterval = tickCategoryInterval || 0; // Avoid split a single data item when odd interval.\n\n if (tickCategoryInterval % 2 > 0) {\n ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);\n }\n });\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1];\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n return inverse ? a > b : a < b;\n }\n}", "function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var shift = ticksCoords[1].coord - ticksCoords[0].coord;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 2;\n var tickCategoryInterval = tickCategoryInterval || 0; // Avoid split a single data item when odd interval.\n\n if (tickCategoryInterval % 2 > 0) {\n ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2);\n }\n });\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1];\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n return inverse ? a > b : a < b;\n }\n}", "function tickCount() {\n if (displayWidth <= 500) {\n xAxis.ticks(5);\n yAxis.ticks(5);\n } else {\n xAxis.ticks(10);\n yAxis.ticks(10);\n }\n }", "_addMajorTickAndLabel(htmlValue, labelSize, plot, value, middle) {\n const that = this.context,\n leftOrTop = that._settings.leftOrTop,\n offset = this.valueToPx(value);\n\n let currentTick = '',\n currentLabel = '';\n\n if (parseInt(offset) > parseInt(that._measurements.trackLength)) {\n return { tick: currentTick, label: currentLabel };\n }\n\n if (that.logarithmicScale) {\n htmlValue = that._formatLabel(Math.pow(10, value));\n }\n\n if (that.nodeName.toLowerCase() === 'jqx-tank' || that._intervalHasChanged) {\n let tickIntervalLabelSize = that._tickIntervalHandler.labelsSize;\n\n if (middle) {\n that._labelDummy.innerHTML = htmlValue;\n\n let tickPosition = this.valueToPx(value),\n maxPosition = this.valueToPx(that._drawMax),\n minPosition = this.valueToPx(that._drawMin),\n labelSize = that._labelDummy[that._settings.size],\n labelOtherSize = that.orientation === 'vertical' ? that._labelDummy.offsetWidth : that._labelDummy.offsetHeight,\n distanceToMin = (labelSize + tickIntervalLabelSize.minLabelSize) / 2,\n distanceToMax = (labelSize + tickIntervalLabelSize.maxLabelSize) / 2;\n\n that._normalLayout ?\n plot = (tickPosition + distanceToMax < maxPosition) && (tickPosition - distanceToMin > minPosition) :\n plot = (tickPosition - distanceToMax > maxPosition) && (tickPosition + distanceToMin < minPosition);\n\n if (labelOtherSize > this._longestLabelSize) {\n this._longestLabelSize = labelOtherSize;\n }\n\n }\n else {\n this._longestLabelSize = Math.max(tickIntervalLabelSize.minLabelOtherSize, tickIntervalLabelSize.maxLabelOtherSize, this._longestLabelSize);\n }\n }\n\n that._tickValues.push(value);\n\n currentTick = '<div style=\"' + leftOrTop + ': ' + offset + 'px;\" class=\"jqx-tick\"></div>';\n\n if (plot !== false) {\n if (labelSize === undefined) {\n that._labelDummy.innerHTML = htmlValue;\n labelSize = that._labelDummy[that._settings.size];\n }\n const labelOffset = offset - labelSize / 2;\n\n currentLabel += '<div class=\"jqx-label' + (middle ? ' jqx-label-middle' : '') + '\" style=\"' + leftOrTop + ': ' + labelOffset + 'px;\">' + htmlValue + '</div>';\n }\n\n return { tick: currentTick, label: currentLabel };\n }", "function getYAxisTickCount(areaWidth) {\n //set tick count to 10\n let tickCount = 10,\n maxValueRatio = getMaxYValue();\n\n //set max value ratio\n if (diagram.maxMeasureValue)\n maxValueRatio = diagram.maxMeasureValue;\n\n //attach text\n tempTextSVG = diagramG.append('text')\n .style('font-size', diagram.yAxis.labelFontSize + 'px')\n .style('color', diagram.yAxis.labelFontColor)\n .style('font-family', diagram.yAxis.labelFontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', diagram.yAxis.labelFontStyle == 'bold' ? 'normal' : diagram.yAxis.labelFontStyle)\n .style('font-weight', diagram.yAxis.labelFontStyle == 'bold' ? 'bold' : 'normal')\n .text(e.formatNumber(maxValueRatio, diagram.yAxis.labelFormat));\n\n //get offset for x axis value\n tempXAxisSVGOffset = tempTextSVG.node().getBoundingClientRect();\n\n //remove svg text for x axis\n tempTextSVG.remove();\n\n //check whether the axis tick count is auto\n if (diagram.yAxis.tickCount === 'auto') {\n //set tick count\n tickCount = Math.ceil(areaWidth / tempXAxisSVGOffset.width) - 1;\n } else {\n //set manuel tick count\n tickCount = parseInt(diagram.yAxis.tickCount);\n }\n\n if (tickCount > 10)\n tickCount = 10;\n\n //return updated tick count\n return 5;//e.closestPower(Math.ceil(tickCount));\n }", "function primaryLabelInterval(pxPerSec) {\n var retval = 1;\n /*\n if (pxPerSec >= 25 * 100) {\n retval = 100;\n } else if (pxPerSec >= 25 * 40) {\n retval = 40;\n } else if (pxPerSec >= 25 * 10) {\n retval = 100;\n } else if (pxPerSec >= 25 * 4) {\n retval = 40;\n } else if (pxPerSec >= 25) {\n retval = 1;\n } else if (pxPerSec * 5 >= 25) {\n retval = 5;\n } else if (pxPerSec * 15 >= 25) {\n retval = 15;\n } else {\n retval = Math.ceil(0.5 / pxPerSec) * 60;\n } */\n if (pxPerSec >= 600) {\n retval = 5;\n }\n else if (pxPerSec >= 500) {\n retval = 7;\n }\n else if (pxPerSec >= 400) {\n retval = 8;\n }\n else if (pxPerSec >= 300) {\n retval = 10;\n }\n return retval;\n}", "addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency) {\n const that = this.context;\n\n let majorTicks = '', majorLabels = '';\n\n for (let i = 1; i < tickscount; i++) {\n let number = i * ticksDistance + distanceFromFirstToSecond,\n value;\n\n if (normalLayout) {\n value = parseFloat(that._drawMin) + ticksFrequency * i + distanceModifier;\n }\n else {\n value = parseFloat(that._drawMax) - ticksFrequency * i - distanceModifier;\n }\n if (value.toString() !== that._drawMax.toString()) {\n let htmlValue = that._formatLabel(value.toString()),\n plot = true;\n\n that._labelDummy.innerHTML = htmlValue;\n let dimensionValue = that._labelDummy[that._settings.size];\n\n if (number + dimensionValue >= tickscount * ticksDistance) { // + 32 is an Experimental value\n plot = false;\n }\n const currentTickAndLabel = this._addMajorTickAndLabel(htmlValue, undefined, plot, value, true);\n\n majorTicks += currentTickAndLabel.tick;\n majorLabels += currentTickAndLabel.label;\n }\n }\n return { tick: majorTicks, label: majorLabels };\n }", "function getSmartTicks(val) {\n // Base step between nearby two ticks\n var step = Math.pow(10, Math.trunc(val).toString().length - 1);\n\n // Modify steps either: 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000...\n if (val / step < 2) {\n step = step / 5;\n } else if (val / step < 5) {\n step = step / 2;\n }\n\n // Add one more step if the last tick value is the same as the max value\n // If you don't want to add, remove \"+1\"\n var slicesCount = Math.ceil((val + 1) / step);\n\n return {\n endPoint: slicesCount * step,\n count: Math.min(10, slicesCount), //show max 10 ticks\n };\n }", "function updateXTickCount() {\n // console.log(\"data -> \" + JSON.stringify(data));\n // console.log(\"data.length -> \" + data.length);\n // console.log(\"(.77 * window.innerWidth - 280) / 15 -> \" + (.77 * window.innerWidth - 280) / 15);\n // console.log((Math.floor(data.length / ((.77 * window.innerWidth - 280) / 15))) - 1);\n setXTickInterval((Math.floor(data.length / ((.77 * window.innerWidth - 280) / 15))) - 1);\n }", "ticks (count = 7) {\n const domain = this.getDomain()\n\n return ticks(domain[0], domain[domain.length - 1], count)\n }", "function calculateRange(axis, axisOptions){\n\t\t\tvar min = axisOptions.min != null ? axisOptions.min : axis.datamin;\n\t\t\tvar max = axisOptions.max != null ? axisOptions.max : axis.datamax;\t\n\t\t\tif(max - min == 0.0){\n\t\t\t\tvar widen = (max == 0.0) ? 1.0 : 0.01;\n\t\t\t\tmin -= widen;\n\t\t\t\tmax += widen;\n\t\t\t}\t\t\t\n\t\t\taxis.tickSize = getTickSize(axisOptions.noTicks, min, max, axisOptions.tickDecimals);\n\t\t\t\t\n\t\t\t/**\n\t\t\t * Autoscaling.\n\t\t\t */\n\t\t\tvar margin;\n\t\t\tif(axisOptions.min == null){\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Add a margin.\n\t\t\t\t */\n\t\t\t\tmargin = axisOptions.autoscaleMargin;\n\t\t\t\tif(margin != 0){\n\t\t\t\t\tmin -= axis.tickSize * margin;\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * Make sure we don't go below zero if all values are positive.\n\t\t\t\t\t */\n\t\t\t\t\tif(min < 0 && axis.datamin >= 0) min = 0;\t\t\t\t\n\t\t\t\t\tmin = axis.tickSize * Math.floor(min / axis.tickSize);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(axisOptions.max == null){\n\t\t\t\tmargin = axisOptions.autoscaleMargin;\n\t\t\t\tif(margin != 0){\n\t\t\t\t\tmax += axis.tickSize * margin;\n\t\t\t\t\tif(max > 0 && axis.datamax <= 0) max = 0;\t\t\t\t\n\t\t\t\t\tmax = axis.tickSize * Math.ceil(max / axis.tickSize);\n\t\t\t\t}\n\t\t\t}\n\t\t\taxis.min = min;\n\t\t\taxis.max = max;\n\t\t}", "function computeLabelInterval(slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) {\n labelInterval = createDuration(STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = wholeDivideDurations(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n }", "get intervals()\n\t{\n\t\treturn {\n\t\t\tpx: \t\t\t\t1.00,\n\t\t\tem: \t\t\t\t0.01,\n\t\t\trem: \t\t\t\t0.01,\n\t\t\tdefault: \t\t0.00\n\t\t}\n\t}", "function primaryLabelInterval(pxPerSec) {\n\tvar retval = 1;\n\tif (pxPerSec >= 25 * 100) {\n\t\tretval = 10;\n\t} else if (pxPerSec >= 25 * 40) {\n\t\tretval = 4;\n\t} else if (pxPerSec >= 25 * 10) {\n\t\tretval = 10;\n\t} else if (pxPerSec >= 25 * 4) {\n\t\tretval = 4;\n\t} else if (pxPerSec >= 25) {\n\t\tretval = 1;\n\t} else if (pxPerSec * 5 >= 25) {\n\t\tretval = 5;\n\t} else if (pxPerSec * 15 >= 25) {\n\t\tretval = 15;\n\t} else {\n\t\tretval = Math.ceil(0.5 / pxPerSec) * 60;\n\t}\n\treturn retval;\n}", "getCoercedValue(value, useDrawVariables, logarithmicGauge) {\n const that = this.context;\n\n if (!that.coerce) {\n return value;\n }\n\n let normalScale = !that.logarithmicScale,\n minValue, maxValue;\n\n if (that.customInterval) {\n const customTicks = that.customTicks;\n\n if (customTicks.length === 0) {\n return value;\n }\n\n normalScale = normalScale || logarithmicGauge;\n\n if (useDrawVariables !== false) {\n minValue = parseFloat(that._drawMin);\n }\n else {\n minValue = that._minObject;\n }\n\n let difference = Math.abs(minValue - value),\n closestValue = minValue;\n\n for (let i = 0; i < customTicks.length; i++) {\n const currentTickObject = this.createDescriptor(customTicks[i]),\n currentTickValue = normalScale ? currentTickObject : Math.log10(currentTickObject),\n currentDifference = Math.abs(currentTickValue - value);\n\n if (currentDifference < difference) {\n difference = currentDifference;\n closestValue = currentTickValue;\n }\n }\n\n return closestValue;\n }\n\n if (useDrawVariables !== false) {\n minValue = parseFloat(that._drawMin);\n maxValue = parseFloat(that._drawMax);\n }\n else {\n minValue = parseFloat(that.min);\n maxValue = parseFloat(that.max);\n }\n\n let noMin = value - minValue,\n remainder = this.getPreciseModulo(noMin, parseFloat(that.interval)),\n coef = this.roundCoefficient;\n\n if (remainder === 0) {\n return value;\n }\n\n if (this.roundCoefficient === 0) {\n coef = 12;\n }\n\n let lowerValue = parseFloat((noMin - remainder).toFixed(coef)),\n greaterValue = lowerValue + parseFloat(that.interval);\n\n if (((that.max - that.min) <= parseFloat(that.interval)) && normalScale) {\n let min = minValue,\n max = maxValue;\n\n return value >= min + (max - min) / 2 ? max : min;\n }\n\n if (Math.abs(noMin - lowerValue) < Math.abs(noMin - greaterValue)) {\n return lowerValue + minValue;\n }\n else {\n const biggerValue = greaterValue + minValue;\n\n return biggerValue > maxValue ? lowerValue + minValue : biggerValue;\n }\n }", "function renderTickNumbers() {\n var labelSpacing = largeTickSpacing * renderAttrs.tickSpacing.largeIntervalsPerText,\n tickCoord, labelIndex, minLabelIndex, maxLabelIndex,\n labelValue, tickNumber,\n labelOffset = renderAttrs.majorTickLength + 3;\n\n // Determine range of x and y values to render (cf. CoordSysKind_RenderProc())\n // Use ~~ to efficiently truncate to integer\n // (cf. http://stackoverflow.com/questions/4055633/what-does-do-in-javascript)\n /*jslint bitwise:true */\n minLabelIndex = ~~((renderMin - originAlongAxisCoord) / labelSpacing) - 1;\n maxLabelIndex = ~~((renderMax - originAlongAxisCoord) / labelSpacing) + 1;\n // Note that we render one additional label on each end just in case.\n // Desktop GSP heuristically determines the maximum label size and then\n // only renders an additional label if it's within half the maximum extent.\n // We bypass that level of optimization until it is deemed worthwhile.\n \n ctx.font = defaultFontSpec;\n ctx.textAlign = 'left';\n\n for (labelIndex = minLabelIndex; labelIndex <= maxLabelIndex; ++labelIndex) {\n if( labelIndex !== 0) {\n var largeTickIndex = labelIndex * renderAttrs.tickSpacing.largeIntervalsPerText;\n tickCoord = originAlongAxisCoord + labelIndex * labelSpacing;\n labelValue = labelIndex * labelSpacing / renderAttrs.unitPixels;\n \n // Polar coordinates, vertical axis can affect sign\n if( renderAttrs.isPolar) {\n largeTickIndex = Math.abs( largeTickIndex);\n labelValue = Math.abs( labelValue);\n }\n else if( renderAttrs.orientation === 'vertical') {\n largeTickIndex = -largeTickIndex;\n labelValue = -labelValue;\n }\n \n // Format the tick number/label appropriately\n tickNumber = formatTickNumber( largeTickIndex, labelValue);\n \n // Render the tick number/label next to its associated tick\n renderTickNumber( tickNumber, tickCoord, labelOffset);\n }\n }\n }", "_initTickIntervalHandler() {\n const that = this;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n const minLabel = that._formatLabel(that.min, false),\n maxLabel = that._formatLabel(that.max, false);\n\n that._tickIntervalHandler = new JQX.Utilities.TickIntervalHandler(that, minLabel, maxLabel, 'jqx-label', that._settings.size, that.scaleType === 'integer', that.logarithmicScale);\n }", "elapsed_days(){\n return this.ticks / TICKS_PER_DAY; \n }", "function axisBeforePadding() {\n var _this = this;\n var axisLength = this.len,\n chart = this.chart,\n isXAxis = this.isXAxis,\n dataKey = isXAxis ? 'xData' : 'yData',\n min = this.min,\n range = this.max - min;\n var pxMin = 0,\n pxMax = axisLength,\n transA = axisLength / range,\n hasActiveSeries;\n // Handle padding on the second pass, or on redraw\n this.series.forEach(function (series) {\n if (series.bubblePadding &&\n (series.visible || !chart.options.chart.ignoreHiddenSeries)) {\n // Correction for #1673\n _this.allowZoomOutside = true;\n hasActiveSeries = true;\n var data = series[dataKey];\n if (isXAxis) {\n (series.onPoint || series).getRadii(0, 0, series);\n if (series.onPoint) {\n series.radii = series.onPoint.radii;\n }\n }\n if (range > 0) {\n var i = data.length;\n while (i--) {\n if (isNumber(data[i]) &&\n _this.dataMin <= data[i] &&\n data[i] <= _this.max) {\n var radius = series.radii && series.radii[i] || 0;\n pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);\n pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);\n }\n }\n }\n }\n });\n // Apply the padding to the min and max properties\n if (hasActiveSeries && range > 0 && !this.logarithmic) {\n pxMax -= axisLength;\n transA *= (axisLength +\n Math.max(0, pxMin) - // #8901\n Math.min(pxMax, axisLength)) / axisLength;\n [\n ['min', 'userMin', pxMin],\n ['max', 'userMax', pxMax]\n ].forEach(function (keys) {\n if (typeof pick(_this.options[keys[0]], _this[keys[1]]) === 'undefined') {\n _this[keys[0]] += keys[2] / transA;\n }\n });\n }\n }", "function getTicks() {\n\t\tconst Data = getData();\n\t\tif (Data.length <= 5) {\n\t\t\treturn Data.length;\n\t\t}\n\t\treturn parseInt(Data.length / 5, 10);\n\t}", "get ticks() {\n return this._clock.ticks;\n }", "getIntervalCount(){\n return this.root ? this.root.getIntervalCount() : 0;\n }", "_calculateDateInterval(majorTicksInterval) {\n const that = this,\n timeParts = {\n month: '2628000000000000000000000000000',\n day: '86400000000000000000000000000',\n hour: '3600000000000000000000000000',\n minute: '60000000000000000000000000',\n second: '1000000000000000000000000'\n };\n let part = 'year',\n bigNumberTimePart = new JQX.Utilities.BigNumber('31536000000000000000000000000000'),\n difference = bigNumberTimePart.subtract(majorTicksInterval).abs(),\n range = new JQX.Utilities.BigNumber(that.min).subtract(that.max).abs(),\n projectedNumberOfTicks = range.divide(majorTicksInterval).toString();\n\n if (projectedNumberOfTicks < 2) {\n majorTicksInterval = range.divide(3);\n }\n\n for (let timePart in timeParts) {\n if (timeParts.hasOwnProperty(timePart)) {\n const currentBigNumberTimePart = new JQX.Utilities.BigNumber(timeParts[timePart]),\n currentDifference = currentBigNumberTimePart.subtract(majorTicksInterval).abs();\n\n if (currentDifference.compare(difference) === -1) {\n part = timePart;\n bigNumberTimePart = currentBigNumberTimePart;\n difference = currentDifference;\n }\n else {\n break;\n }\n }\n }\n\n if (part === 'second') {\n that._numberRenderer.numericValue = parseFloat(majorTicksInterval);\n\n if (that._numberRenderer.numericValue < 1000) {\n that._dateIncrementMethod = 'addYoctoseconds';\n that._dateIntervalNumber = 1;\n return;\n }\n\n let scientificPrefix = that._numberRenderer.toScientific(10);\n\n scientificPrefix = scientificPrefix.charAt(scientificPrefix.length - 1);\n\n that._dateIncrementMethod = that._unitToMethod[scientificPrefix];\n that._dateIntervalNumber = Math.pow(10, that._numericProcessor.prefixesToPowers[scientificPrefix]);\n return;\n }\n\n that._dateInterval = true;\n\n const calculatedInterval = !that.customInterval;\n let customTicks, numberOfTimeParts, toAdd;\n\n if (calculatedInterval) {\n customTicks = [new JQX.Utilities.BigNumber(that.min)];\n numberOfTimeParts = range.divide(bigNumberTimePart).toString();\n toAdd = Math.max(1, Math.floor(numberOfTimeParts / projectedNumberOfTicks));\n }\n\n switch (part) {\n case 'year':\n if (calculatedInterval) {\n for (let i = that._minDate.year() + toAdd; i < that._maxDate.year(); i += toAdd) {\n customTicks.push(new JQX.Utilities.BigNumber(new JQX.Utilities.DateTime(i, 1, 1).getTimeStamp()));\n }\n }\n\n that._dateIncrementMethod = 'addYears';\n break;\n case 'month':\n if (calculatedInterval) {\n for (let i = new JQX.Utilities.DateTime(that._minDate.year(), that._minDate.month() + toAdd, 1);\n i.compare(that._maxDate) === -1; i.addMonths(toAdd, false)) {\n customTicks.push(new JQX.Utilities.BigNumber(i.getTimeStamp()));\n }\n }\n\n that._dateIncrementMethod = 'addMonths';\n break;\n case 'day':\n if (calculatedInterval) {\n for (let i = new JQX.Utilities.DateTime(that._minDate.year(), that._minDate.month(), that._minDate.day() + toAdd);\n i.compare(that._maxDate) === -1; i.addDays(toAdd, false)) {\n customTicks.push(new JQX.Utilities.BigNumber(i.getTimeStamp()));\n }\n }\n\n that._dateIncrementMethod = 'addDays';\n that._dateIntervalNumber = 86400000000000000000000000000;\n break;\n case 'hour':\n if (calculatedInterval) {\n for (let i = new JQX.Utilities.DateTime(that._minDate.year(), that._minDate.month(), that._minDate.day(), that._minDate.hour() + toAdd);\n i.compare(that._maxDate) === -1; i.addHours(toAdd, false)) {\n customTicks.push(new JQX.Utilities.BigNumber(i.getTimeStamp()));\n }\n }\n\n that._dateIncrementMethod = 'addHours';\n that._dateIntervalNumber = 3600000000000000000000000000;\n break;\n case 'minute':\n if (calculatedInterval) {\n for (let i = new JQX.Utilities.DateTime(that._minDate.year(), that._minDate.month(), that._minDate.day(), that._minDate.hour(), that._minDate.minute() + toAdd);\n i.compare(that._maxDate) === -1; i.addMinutes(toAdd, false)) {\n customTicks.push(new JQX.Utilities.BigNumber(i.getTimeStamp()));\n }\n }\n\n that._dateIncrementMethod = 'addMinutes';\n that._dateIntervalNumber = 60000000000000000000000000;\n break;\n }\n\n if (calculatedInterval) {\n if (customTicks[customTicks.length - 1].compare(that.max) === -1) {\n customTicks.push(new JQX.Utilities.BigNumber(that.max));\n }\n\n that.customTicks = customTicks;\n }\n }", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n var ilen = UNITS.length;\n var i, unit;\n\n for (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n unit = UNITS[i];\n\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n }", "function addTicks(parent, config, data) {\n var ticks = parent.selectAll('g.ticks')\n .data(config.x.ticks(config.ticks))\n .enter()\n .append('svg:g')\n .attr('transform', function (d, i) { return formatString('translate({0}, 0)', config.left + config.x(d)); });\n ticks.append('svg:line')\n .attr('class', 'tick')\n .attr('y1', config.top)\n .attr('y2', config.bottom);\n ticks.append('svg:text')\n .attr('class', 'tickval')\n .attr('y', config.top)\n .attr('dy', -5)\n .text(config.x.tickFormat(config.ticks));\n\n return ticks;\n }", "_getMeasurements() {\n const that = this,\n measurements = that._measurements,\n measureLabel = document.createElement('div');\n let minLabel, maxLabel, minLabelWidth, maxLabelWidth, minLabelHeight, maxLabelHeight;\n\n measureLabel.className = 'jqx-label';\n measureLabel.style.position = 'absolute';\n measureLabel.style.visibility = 'hidden';\n that.$.svgContainer.appendChild(measureLabel);\n\n if (that.selection === 'hour') {\n minLabel = '1';\n maxLabel = '23';\n\n that.max = 12;\n that._drawMax = '12';\n that._range = 12;\n }\n else {\n minLabel = '00';\n maxLabel = '55';\n\n that.max = 60;\n that._drawMax = '60';\n that._range = 60;\n }\n\n measureLabel.innerHTML = minLabel;\n minLabelWidth = measureLabel.offsetWidth;\n minLabelHeight = measureLabel.offsetHeight;\n measureLabel.innerHTML = maxLabel;\n maxLabelWidth = measureLabel.offsetWidth;\n maxLabelHeight = measureLabel.offsetHeight;\n\n that._largestLabelSize = Math.max(minLabelWidth, minLabelHeight, maxLabelWidth, maxLabelHeight);\n that._tickIntervalHandler.labelsSize.minLabelSize = minLabelHeight;\n that._tickIntervalHandler.labelsSize.maxLabelSize = maxLabelHeight;\n\n const measureElementStyle = window.getComputedStyle(measureLabel);\n\n measurements.fontSize = measureElementStyle.fontSize;\n measurements.fontFamily = measureElementStyle.fontFamily;\n measurements.fontWeight = measureElementStyle.fontWeight;\n measurements.fontStyle = measureElementStyle.fontStyle;\n that.$.svgContainer.removeChild(measureLabel);\n }", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(scale, ticks, minUnit, min, max) {\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function getTickLabelUV(ax) {\n var ticklabelposition = ax.ticklabelposition || '';\n var has = function (str) {\n return ticklabelposition.indexOf(str) !== -1;\n };\n var isTop = has('top');\n var isLeft = has('left');\n var isRight = has('right');\n var isBottom = has('bottom');\n var isInside = has('inside');\n var isAligned = isBottom || isLeft || isTop || isRight;\n\n // early return\n if (!isAligned && !isInside) return [0, 0];\n var side = ax.side;\n var u = isAligned ? (ax.tickwidth || 0) / 2 : 0;\n var v = TEXTPAD;\n var fontSize = ax.tickfont ? ax.tickfont.size : 12;\n if (isBottom || isTop) {\n u += fontSize * CAP_SHIFT;\n v += (ax.linewidth || 0) / 2;\n }\n if (isLeft || isRight) {\n u += (ax.linewidth || 0) / 2;\n v += TEXTPAD;\n }\n if (isInside && side === 'top') {\n v -= fontSize * (1 - CAP_SHIFT);\n }\n if (isLeft || isTop) u = -u;\n if (side === 'bottom' || side === 'right') v = -v;\n return [isAligned ? u : 0, isInside ? v : 0];\n}", "_ticksToUnits(ticks) {\n return ftom(super._ticksToUnits(ticks));\n }", "function labelXcalc(d,i){\n var tickAngle = d + 90;\n var tickAngleRad = dToR(tickAngle);\n var absXCorr = opt.labelFontSize * (tickLabelText[i].length - minLabelLength) / 2;\n var xCorr = opt.outerTicks ? absXCorr : - absXCorr;\n var x1 = originX + labelStart * Math.cos(tickAngleRad)+xCorr;\n return x1\n }", "function _default() {\n\n\tfunction axisX(selection, x) {\n\t\tselection.attr(\"transform\", function (d) {\n\t\t\treturn \"translate(\" + Math.ceil(x(d) + tickOffset) + \", 0)\";\n\t\t});\n\t}\n\n\tfunction axisY(selection, y) {\n\t\tselection.attr(\"transform\", function (d) {\n\t\t\treturn \"translate(0,\" + Math.ceil(y(d)) + \")\";\n\t\t});\n\t}\n\n\tfunction scaleExtent(domain) {\n\t\tvar start = domain[0],\n\t\t stop = domain[domain.length - 1];\n\n\n\t\treturn start < stop ? [start, stop] : [stop, start];\n\t}\n\n\tfunction generateTicks(scale) {\n\t\tvar ticks = [];\n\n\t\tif (scale.ticks) return scale.ticks.apply(scale, tickArguments ? (0, _util.toArray)(tickArguments) : []).map(function (v) {\n\t\t\t\treturn (\n\t\t\t\t\t// round the tick value if is number\n\t\t\t\t\t/(string|number)/.test(typeof v === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(v)) && !isNaN(v) ? Math.round(v * 10) / 10 : v\n\t\t\t\t);\n\t\t\t});\n\n\t\tfor (var domain = scale.domain(), i = Math.ceil(domain[0]); i < domain[1]; i++) ticks.push(i);\n\n\t\treturn ticks.length > 0 && ticks[0] > 0 && ticks.unshift(ticks[0] - (ticks[1] - ticks[0])), ticks;\n\t}\n\n\tfunction copyScale() {\n\t\tvar newScale = scale.copy();\n\n\t\tif (params.isCategory || !newScale.domain().length) {\n\t\t\tvar domain = scale.domain();\n\n\t\t\tnewScale.domain([domain[0], domain[1] - 1]);\n\t\t}\n\n\t\treturn newScale;\n\t}\n\n\tfunction textFormatted(v) {\n\t\t// to round float numbers from 'binary floating point'\n\t\t// https://en.wikipedia.org/wiki/Double-precision_floating-point_format\n\t\t// https://stackoverflow.com/questions/17849101/laymans-explanation-for-why-javascript-has-weird-floating-math-ieee-754-stand\n\t\tvar value = /\\d+\\.\\d+0{5,}\\d$/.test(v) ? +(v + \"\").replace(/0+\\d$/, \"\") : v,\n\t\t formatted = tickFormat ? tickFormat(value) : value;\n\n\n\t\treturn (0, _util.isDefined)(formatted) ? formatted : \"\";\n\t}\n\n\tfunction transitionise(selection) {\n\t\treturn params.withoutTransition ? selection.interrupt() : selection.transition(transition);\n\t}\n\n\tfunction axis(g) {\n\t\tg.each(function () {\n\n\t\t\t// this should be called only when category axis\n\t\t\tfunction splitTickText(d, maxWidthValue) {\n\n\t\t\t\tfunction split(splitted, text) {\n\t\t\t\t\tspaceIndex = undefined;\n\n\t\t\t\t\tfor (var i = 1; i < text.length; i++)\n\n\t\t\t\t\t// if text width gets over tick width, split by space index or current index\n\t\t\t\t\tif (text.charAt(i) === \" \" && (spaceIndex = i), subtext = text.substr(0, i + 1), textWidth = sizeFor1Char.w * subtext.length, maxWidth < textWidth) return split(splitted.concat(text.substr(0, spaceIndex || i)), text.slice(spaceIndex ? spaceIndex + 1 : i));\n\n\t\t\t\t\treturn splitted.concat(text);\n\t\t\t\t}\n\n\t\t\t\tvar tickText = textFormatted(d),\n\t\t\t\t maxWidth = maxWidthValue,\n\t\t\t\t subtext = void 0,\n\t\t\t\t spaceIndex = void 0,\n\t\t\t\t textWidth = void 0;\n\t\t\t\treturn Object.prototype.toString.call(tickText) === \"[object Array]\" ? tickText : ((!maxWidth || maxWidth <= 0) && (maxWidth = isVertical ? 95 : params.isCategory ? Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12 : 110), split([], tickText + \"\"));\n\t\t\t}\n\n\t\t\tfunction tspanDy(d, i) {\n\t\t\t\tvar dy = sizeFor1Char.h;\n\n\t\t\t\treturn i === 0 && (dy = orient === \"left\" || orient === \"right\" ? -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3) : \".71em\"), dy;\n\t\t\t}\n\n\t\t\tfunction tickSize(d) {\n\t\t\t\tvar tickPosition = scale(d) + (tickCentered ? 0 : tickOffset);\n\n\t\t\t\treturn range[0] < tickPosition && tickPosition < range[1] ? 6 : 0;\n\t\t\t}\n\n\t\t\tvar g = (0, _d3Selection.select)(this);\n\n\t\t\taxis.g = g;\n\n\n\t\t\tvar scale0 = this.__chart__ || scale,\n\t\t\t scale1 = copyScale();\n\t\t\tthis.__chart__ = scale1;\n\n\n\t\t\t// count of tick data in array\n\t\t\tvar ticks = tickValues || generateTicks(scale1),\n\t\t\t tick = g.selectAll(\".tick\").data(ticks, scale1),\n\t\t\t tickEnter = tick.enter().insert(\"g\", \".domain\").attr(\"class\", \"tick\").style(\"opacity\", \"1\"),\n\t\t\t tickExit = tick.exit().remove();\n\n\t\t\t// update selection\n\n\n\t\t\t// enter selection\n\n\n\t\t\t// MEMO: No exit transition. The reason is this transition affects max tick width calculation because old tick will be included in the ticks.\n\t\t\ttick = tickEnter.merge(tick);\n\n\n\t\t\tvar tickUpdate = transitionise(tick).style(\"opacity\", \"1\"),\n\t\t\t tickTransform = void 0,\n\t\t\t tickX = void 0,\n\t\t\t tickY = void 0,\n\t\t\t range = scale.rangeExtent ? scale.rangeExtent() : scaleExtent((params.orgXScale || scale).range()),\n\t\t\t path = g.selectAll(\".domain\").data([0]),\n\t\t\t pathUpdate = path.enter().append(\"path\").attr(\"class\", \"domain\").merge(transitionise(path));\n\n\t\t\t// update selection - data join\n\n\n\t\t\t// enter + update selection\n\t\t\ttickEnter.append(\"line\"), tickEnter.append(\"text\");\n\n\n\t\t\tvar lineEnter = tickEnter.select(\"line\"),\n\t\t\t lineUpdate = tickUpdate.select(\"line\"),\n\t\t\t textEnter = tickEnter.select(\"text\"),\n\t\t\t textUpdate = tickUpdate.select(\"text\");\n\t\t\tparams.isCategory ? (tickOffset = Math.ceil((scale1(1) - scale1(0)) / 2), tickX = tickCentered ? 0 : tickOffset, tickY = tickCentered ? tickOffset : 0) : (tickX = 0, tickOffset = tickX);\n\n\n\t\t\tvar tspan = void 0,\n\t\t\t sizeFor1Char = _getSizeFor1Char(g.select(\".tick\")),\n\t\t\t counts = [],\n\t\t\t tickLength = Math.max(6, 0) + 3,\n\t\t\t isVertical = orient === \"left\" || orient === \"right\",\n\t\t\t text = tick.select(\"text\");tspan = text.selectAll(\"tspan\").data(function (d, index) {\n\t\t\t\tvar split = params.tickMultiline ? splitTickText(d, params.tickWidth) : (0, _util.isArray)(textFormatted(d)) ? textFormatted(d).concat() : [textFormatted(d)];\n\n\t\t\t\treturn counts[index] = split.length, split.map(function (splitted) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\tsplitted: splitted\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}), tspan.exit().remove(), tspan = tspan.enter().append(\"tspan\").merge(tspan).text(function (d) {\n\t\t\t\treturn d.splitted;\n\t\t\t});\n\n\n\t\t\tvar rotate = params.tickTextRotate;\n\n\t\t\tif (orient === \"bottom\" ? (tickTransform = axisX, lineEnter.attr(\"y2\", 6), textEnter.attr(\"y\", 9), lineUpdate.attr(\"x1\", tickX).attr(\"x2\", tickX).attr(\"y2\", tickSize), textUpdate.attr(\"x\", 0).attr(\"y\", function (r) {\n\t\t\t\treturn r ? 11.5 - 2.5 * (r / 15) * (r > 0 ? 1 : -1) : 9;\n\t\t\t}(rotate)).style(\"text-anchor\", function (r) {\n\t\t\t\treturn r ? r > 0 ? \"start\" : \"end\" : \"middle\";\n\t\t\t}(rotate)).attr(\"transform\", function (r) {\n\t\t\t\treturn r ? \"rotate(\" + r + \")\" : \"\";\n\t\t\t}(rotate)), tspan.attr(\"x\", 0).attr(\"dy\", tspanDy).attr(\"dx\", function (r) {\n\t\t\t\treturn r ? 8 * Math.sin(Math.PI * (r / 180)) : 0;\n\t\t\t}(rotate)), pathUpdate.attr(\"d\", \"M\" + range[0] + \",\" + outerTickSize + \"V0H\" + range[1] + \"V\" + outerTickSize)) : orient === \"top\" ? (tickTransform = axisX, lineEnter.attr(\"y2\", -6), textEnter.attr(\"y\", -9), lineUpdate.attr(\"x2\", 0).attr(\"y2\", -6), textUpdate.attr(\"x\", 0).attr(\"y\", -9), text.style(\"text-anchor\", \"middle\"), tspan.attr(\"x\", 0).attr(\"dy\", \"0em\"), pathUpdate.attr(\"d\", \"M\" + range[0] + \",\" + -outerTickSize + \"V0H\" + range[1] + \"V\" + -outerTickSize)) : orient === \"left\" ? (tickTransform = axisY, lineEnter.attr(\"x2\", -6), textEnter.attr(\"x\", -9), lineUpdate.attr(\"x2\", -6).attr(\"y1\", tickY).attr(\"y2\", tickY), textUpdate.attr(\"x\", -9).attr(\"y\", tickOffset), text.style(\"text-anchor\", \"end\"), tspan.attr(\"x\", -9).attr(\"dy\", tspanDy), pathUpdate.attr(\"d\", \"M\" + -outerTickSize + \",\" + range[0] + \"H0V\" + range[1] + \"H\" + -outerTickSize)) : orient === \"right\" ? (tickTransform = axisY, lineEnter.attr(\"x2\", 6), textEnter.attr(\"x\", 9), lineUpdate.attr(\"x2\", 6).attr(\"y2\", 0), textUpdate.attr(\"x\", 9).attr(\"y\", 0), text.style(\"text-anchor\", \"start\"), tspan.attr(\"x\", 9).attr(\"dy\", tspanDy), pathUpdate.attr(\"d\", \"M\" + outerTickSize + \",\" + range[0] + \"H0V\" + range[1] + \"H\" + outerTickSize)) : void 0, params.tickTitle && textUpdate.append && textUpdate.append(\"title\").each(function (index) {\n\t\t\t\t(0, _d3Selection.select)(this).text(params.tickTitle[index]);\n\t\t\t}), scale1.bandwidth) {\n\t\t\t\tvar x = scale1,\n\t\t\t\t dx = x.bandwidth() / 2;\n\t\t\t\tscale0 = function (d) {\n\t\t\t\t\treturn x(d) + dx;\n\t\t\t\t}, scale1 = scale0;\n\t\t\t} else scale0.bandwidth ? scale0 = scale1 : tickExit.call(tickTransform, scale1);\n\n\t\t\ttickEnter.call(tickTransform, scale0), tickUpdate.call(tickTransform, scale1);\n\t\t});\n\t}\n\n\tvar params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n\t scale = (0, _d3Scale.scaleLinear)(),\n\t orient = \"bottom\",\n\t outerTickSize = params.withOuterTick ? 6 : 0,\n\t tickValues = null,\n\t tickFormat = void 0,\n\t tickArguments = void 0,\n\t tickOffset = 0,\n\t tickCulling = !0,\n\t tickCentered = void 0,\n\t transition = void 0,\n\t _getSizeFor1Char = function getSizeFor1Char(tick) {\n\t\t// default size for one character\n\t\tvar size = {\n\t\t\th: 11.5,\n\t\t\tw: 5.5\n\t\t};\n\n\t\treturn tick.empty() || tick.select(\"text\").text(\"0\").call(function (el) {\n\t\t\tvar box = el.node().getBBox(),\n\t\t\t h = box.height,\n\t\t\t w = box.width;\n\t\t\th && w && (size.h = h, size.w = w), el.text(\"\");\n\t\t}), _getSizeFor1Char = function getSizeFor1Char() {\n\t\t\treturn size;\n\t\t}, size;\n\t};\n\n\treturn axis.scale = function (x) {\n\t\treturn arguments.length ? (scale = x, axis) : scale;\n\t}, axis.orient = function (x) {\n\t\treturn arguments.length ? (orient = x in {\n\t\t\ttop: 1,\n\t\t\tright: 1,\n\t\t\tbottom: 1,\n\t\t\tleft: 1\n\t\t} ? x + \"\" : \"bottom\", axis) : orient;\n\t}, axis.tickFormat = function (format) {\n\t\treturn arguments.length ? (tickFormat = format, axis) : tickFormat;\n\t}, axis.tickCentered = function (isCentered) {\n\t\treturn arguments.length ? (tickCentered = isCentered, axis) : tickCentered;\n\t}, axis.tickOffset = function () {\n\t\treturn tickOffset;\n\t}, axis.tickInterval = function (size) {\n\t\tvar interval = void 0;\n\n\t\tif (params.isCategory) interval = tickOffset * 2;else {\n\t\t\tvar length = axis.g.select(\"path.domain\").node().getTotalLength() - outerTickSize * 2;\n\n\t\t\tinterval = length / (size || axis.g.selectAll(\"line\").size());\n\t\t}\n\n\t\treturn interval === Infinity ? 0 : interval;\n\t}, axis.ticks = function () {\n\t\tfor (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\n\t\treturn args.length ? (tickArguments = (0, _util.toArray)(args), axis) : tickArguments;\n\t}, axis.tickCulling = function (culling) {\n\t\treturn arguments.length ? (tickCulling = culling, axis) : tickCulling;\n\t}, axis.tickValues = function (x) {\n\t\tif ((0, _util.isFunction)(x)) tickValues = function () {\n\t\t\t\treturn x(scale.domain());\n\t\t\t};else {\n\t\t\tif (!arguments.length) return tickValues;\n\n\t\t\ttickValues = x;\n\t\t}\n\n\t\treturn this;\n\t}, axis.setTransition = function (t) {\n\t\treturn transition = t, this;\n\t}, axis;\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n var duration = moment.duration(moment(max).diff(moment(min)));\n var ilen = UNITS.length;\n var i, unit;\n\n for (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n unit = UNITS[i];\n if (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n return unit;\n }\n }\n\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: d.value\n };\n });\n }", "get colliderWidth () {\n\t\tlet leftMostX = this.isSignMagnitude ? this.signLabel.x : ZERO;\n\t\tlet rightMostX = this.textLabel.x + this.textLabel.width;\n\t\treturn rightMostX - leftMostX;\n\t}", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v / 1000 + \"k\"\n };\n });\n}", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v / 1000 + \"k\"\n };\n });\n}", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle)/ (d.value );\n return d3.range(0, d.value, 1).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 1 ? null : v \n };\n });\n}", "dpi () {\n return this.chart.width / this.interval.width * this.zoom.value;\n }", "get swingSubdivision() {\n return new TicksClass(this.context, this._swingTicks).toNotation();\n }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1000).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: labels[d.index]\n };\n });\n }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 10).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v\n };\n });\n}//groupTicks", "function niceAxisNumbering(amin, amax, ntick) {\n var nfrac; // number of fractional digits to show\n var d; // tick mark spacing\n var graphmin, graphmax;\n var range, x;\n var axisValues = [];\n\n if (amin>0 && amin/amax < 0.5) amin = 0; // My fudge, to show origin when appropriate.\n\n range = niceNum(amax-amin, false);\n d = niceNum(range/(ntick-1), true);\n graphmin = Math.floor(amin/d)*d;\n graphmax = Math.ceil(amax/d)*d;\n nfrac = Math.max(-Math.floor(log10(d)),0);\n \n \n for (x=graphmin; x<=graphmax+0.5*d; x+=d) {\n axisValues.push(x);\n }\n return axisValues;\n}", "function decorateInterval(interval) {\n\t var esInterval = calcEsInterval(interval);\n\t interval.esValue = esInterval.value;\n\t interval.esUnit = esInterval.unit;\n\t interval.expression = esInterval.expression;\n\t interval.overflow = duration > interval ? moment.duration(interval - duration) : false;\n\n\t var prettyUnits = moment.normalizeUnits(esInterval.unit);\n\t if (esInterval.value === 1) {\n\t interval.description = prettyUnits;\n\t } else {\n\t interval.description = esInterval.value + ' ' + prettyUnits + 's';\n\t }\n\n\t return interval;\n\t }", "function groupTicks(d) {\n var k = (d.endAngle - d.startAngle) / d.value;\n return d3.range(0, d.value, 1).map(function(v, i) {\n return {\n angle: v * k + d.startAngle,\n label: i % 5 ? null : v + \"%\"\n };\n });\n}", "function getLinearTickPositions(arr,$maxPart,$cfg) {\n \tvar scale = $cfg && $cfg.scale ? parseFloat($cfg.scale) :1\n\n\t\tif(isNaN(scale)){\n\t\t\tscale = 1\n\t\t}\n // var max = arrayMax(arr);\n var max = Math.max.apply(null,arr)\n var initMax = max\n max *= scale\n // var min = arrayMin(arr);\n var min = Math.min.apply(null,arr) \n\n if(min==max){\n \tif(max>=0){\n \t\tmin= 0\n \t\t// min= Math.round(max/2);\n \t}\n \telse{\n \t\tmin=max*2;\n \t}\n }\n\n var length = max - min;\n if (length) {\n \tvar tempmin = min //保证min>0的时候不会出现负数\n \tmin -= length * 0.05;\n // S.log(min +\":\"+ tempmin)\n if(min<0 && tempmin>=0){\n \tmin=0\n }\n max += length * 0.05;\n }\n \n var tickInterval = (max - min) * 72 / 365;\n var magnitude = Math.pow(10, Math.floor(Math.log(tickInterval) / Math.LN10));\n\n tickInterval = normalizeTickInterval(tickInterval, magnitude);\n\n var pos,\n lastPos,\n roundedMin = correctFloat(Math.floor(min / tickInterval) * tickInterval),\n roundedMax = correctFloat(Math.ceil(max / tickInterval) * tickInterval),\n tickPositions = [];\n\n // Populate the intermediate values\n pos = roundedMin;\n while (pos <= roundedMax) {\n\n // Place the tick on the rounded value\n tickPositions.push(pos);\n\n // Always add the raw tickInterval, not the corrected one.\n pos = correctFloat(pos + tickInterval) \n\n // If the interval is not big enough in the current min - max range to actually increase\n // the loop variable, we need to break out to prevent endless loop. Issue #619\n if (pos === lastPos) {\n break;\n }\n\n // Record the last value\n lastPos = pos;\n }\n if(tickPositions.length >= 3){\n \tif(tickPositions[tickPositions.length - 2] >= initMax){\n\t\t\t\ttickPositions.pop()\n\t\t\t}\n }\n return tickPositions;\n }", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}", "function determineUnitForFormatting(ticks, minUnit, min, max) {\n\tvar duration = moment.duration(moment(max).diff(moment(min)));\n\tvar ilen = UNITS.length;\n\tvar i, unit;\n\n\tfor (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {\n\t\tunit = UNITS[i];\n\t\tif (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {\n\t\t\treturn unit;\n\t\t}\n\t}\n\n\treturn UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}" ]
[ "0.7746507", "0.7746507", "0.7739931", "0.7715091", "0.77078474", "0.6546765", "0.64099866", "0.64099866", "0.64099866", "0.64099866", "0.62500155", "0.5976774", "0.58163536", "0.5799666", "0.57894534", "0.57893443", "0.56676996", "0.55825084", "0.5572562", "0.555126", "0.5525152", "0.5475056", "0.54395187", "0.5420106", "0.53805655", "0.530576", "0.529554", "0.52385783", "0.52189463", "0.5160026", "0.5160026", "0.5160026", "0.51391476", "0.50866294", "0.50680345", "0.50366825", "0.5032012", "0.50230044", "0.49987614", "0.49577957", "0.49555194", "0.49300587", "0.48956224", "0.4858534", "0.4855173", "0.48480904", "0.48393494", "0.48390913", "0.48270002", "0.48023283", "0.4800383", "0.47845885", "0.4784056", "0.47703835", "0.47573704", "0.47540265", "0.47503036", "0.47503036", "0.47503036", "0.47503036", "0.47503036", "0.47503036", "0.4741712", "0.47274622", "0.47044012", "0.46709943", "0.46532947", "0.46513158", "0.46448785", "0.464346", "0.464346", "0.46342868", "0.4633869", "0.4631378", "0.46297", "0.46286544", "0.46215808", "0.46080396", "0.45917144", "0.45831177", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055", "0.45827055" ]
0.7746507
2
It is time consuming for large category data.
function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) { var ordinalScale = axis.scale; var labelFormatter = makeLabelFormatter(axis); var result = []; zrUtil.each(ordinalScale.getTicks(), function (tickValue) { var rawLabel = ordinalScale.getLabel(tickValue); if (categoryInterval(tickValue, rawLabel)) { result.push(onlyTick ? tickValue : { formattedLabel: labelFormatter(tickValue), rawLabel: rawLabel, tickValue: tickValue }); } }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "parseUniqueCategories(dataSet) {\n return dataSet.businesses.reduce((accum, business) => {\n business.categories.forEach((item) => {\n if (!(accum.findIndex(ele => ele.displayTitle === item[0]) + 1)) {\n const newObject = {\n displayTitle: item[0],\n imageUrl: business.image_url,\n };\n accum.push(newObject);\n }\n });\n return accum;\n }, []);\n }", "get categoryMapping() {\n let categoryMapping = {};\n this.domain.forEach(d => {\n this.currentCategories.forEach(f => {\n if (f.categories.includes(d.toString())) {\n categoryMapping[d] = f.name;\n }\n });\n });\n return categoryMapping;\n }", "categ(state,data)\n {\n return state.category=data\n }", "function prepareCategories(data) {\n const newCategory = {\n 'parent_id': parseInt(data['Parent ID']) || 0,\n 'name': data['Category Name'],\n 'description': data['Category Description'],\n 'sort_order': parseInt(data['Sort Order']) || 0,\n 'page_title': data['Page Title'],\n 'meta_keywords': [data['Meta Keywords']],\n 'meta_description': data['Meta Description'],\n 'image_url': data['Category Image URL'],\n 'is_visible': yesNoToBoolean(data['Category Visible']) || true,\n 'search_keywords': data['Search Keywords'],\n 'default_product_sort': data['Default Product Sort'] || 'use_store_settings'\n };\n if (data['Category URL'] && data['Custom URL']) {\n newCategory['custom_url'] = {\n 'url': data['Category URL'],\n 'is_customized': yesNoToBoolean(data['Custom URL'])\n };\n }\n \n return categoryArray.push(newCategory);\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 }", "fetchCategory(category) {\n\t\t\t\tthis.reset();\n\n\t\t\t\tfor (let i = 1; i <= 10; i++) {\n\t\t\t\t\tthis.add({\n\t\t\t\t\t\tnumber: i,\n\t\t\t\t\t\tcategory: category ? category : 'sports',\n\t\t\t\t\t\tisHidden: i !== 1\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}", "transformCategoriesData(categories) {\n let categoriesTransformed = categories.map(category => { \n return category.categories\n })\n\n return categoriesTransformed\n}", "get categoryValues() {\n let mapped = {};\n\n for (id of this.__document.categoryValues) {\n mapped[id] = (__document.categoryValues[id] || []).map(\n entry => new CategoryValue(entry)\n );\n }\n\n return mapped;\n }", "function countCategoryTweets(data) {\n data.forEach( function(item) {\n switch(item.category){\n case 'democratic presidential candidates': return Data.categories[0].count++\n case 'republican presidential candidates': return Data.categories[1].count++\n case 'journalists and other media figures': return Data.categories[2].count++\n case 'television shows': return Data.categories[3].count++\n case 'republican politicians': return Data.categories[4].count++\n case 'places': return Data.categories[5].count++\n case 'other people': return Data.categories[6].count++\n case 'other': return Data.categories[7].count++\n case 'media organizations': return Data.categories[8].count++\n case 'groups and political organizations': return Data.categories[9].count++\n case 'democratic politicians': return Data.categories[10].count++\n case 'celebrities': return Data.categories[11].count++\n }\n })\n sortingFunction()\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())}", "async getAllActiveCategories() {\n\n const token = localStorage.getItem('token');\n \n await axios.get(`http://${config.host}:${config.port}/university/`, {\n headers:\n {\n token: token\n \n }\n }).then(res => {\n this.setState({\n \n categoryArray: res.data.data\n\n\n \n })\n\n for (let index = 0; index < this.state.categoryArray.length; index++) {\n \n this.state.labels.push(this.state.categoryArray[index].name);\n LabelArray[index]=(this.state.categoryArray[index].name).toString();\n \n \n \n\n }\n \n\n this.getProductsCountByCategory();\n \n \n }).catch(err => {\n console.log(err);\n \n \n })\n \n }", "function loadCategoryStatsData(data) {\n category_stats = data;\n}", "function success_getAllCategories(r) {\n productBO.cacheAllCategories=r;\n }", "getUniqueCategory() {\n //itereate over list of entries using map\n //callback function makes array of unique tags based on the tag array\n //return newly created array\n\n var data = this.data;\n\n\n //parse out all tags\n var uniqueTags = data.reduce(function(prev, curr) {\n console.log(\"prev vs curr\", prev, curr);\n return [...prev, ...curr.photo_tags];\n }, ''); \n\n console.log(\"unique tags:\", uniqueTags);\n //remove duplicates\n var dedupedTags = uniqueTags.filter(function(item, pos, self) {\n //console.log(\"item vs pos\", item, pos);\n return self.indexOf(item) == pos;\n });\n\n //covert all entries to lower case \n dedupedTags = dedupedTags.map(function(x){ console.log(\"while deduping:\",x.title); return x.title.toLowerCase() });\n\n //return sorted array\n this.sortedTags = dedupedTags.sort();\n\n }", "function readCategories(filePath)\r\n{\r\n let categories = {};\r\n let srcCategories = fs.readFileSync(filePath, 'utf-8');\r\n srcCategories = srcCategories.toString().split('|||||');\r\n\r\n // Re-index subcategories by their main category\r\n srcCategories.forEach(function(category, index) {\r\n if (category) {\r\n category = JSON.parse(category);\r\n if (/no/i.test(category.name)) {\r\n categories.nmg = category;\r\n } else {\r\n categories.mg = category;\r\n }\r\n }\r\n });\r\n\r\n return categories;\r\n}", "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 }", "function getCategories() {\n const apicall = 'http://localhost:3010/api/events/categories';\n fetch(apicall, {\n method: 'GET',\n }).then((response) => {\n if (!response.ok) {\n if (response.status === 401) {\n throw response;\n }\n }\n return response.json();\n }).then((json) => {\n setCategoryList(json);\n json.map((category1) =>\n // attach to category state\n setCategories({...categories, [category1.category]: false}),\n );\n })\n .catch((error) => {\n console.log(error);\n });\n }", "async getCategories(_, __, context) {\n try {\n let categories = await Category.find().sort({ createdAt: -1 });\n return categories;\n\n // newArr = [];\n\n // for (let cat of categories) {\n // newArr.push({ category: cat });\n // }\n // return newArr;\n\n // return [ {category} ];\n } catch (err) {\n throw new Error(err);\n }\n }", "async getCategories() {\n //get categories from API\n const res = await axios.get('https://jservice.io/api/categories?count=100')\n\n //categories to be returned.\n let result = []\n\n //keeps track of which categories have already been selected to avoid duplicated.\n let categoriesTracker = []\n \n //Select 6 random categories\n let numberOfElementsSelected = 0\n while (numberOfElementsSelected < 6) {\n let randomNumber = Math.floor(Math.random() * res.data.length)\n if (!categoriesTracker.includes(randomNumber)) {\n // get id of random category picked\n let catId = res.data[randomNumber].id\n\n //get category data and check if if has more than at least 6 Q&A for 6 rows.\n let cluesCount = await axios.get(`https://jservice.io/api/category?id=${catId}`)\n\n //if Category has at least 6 Q and A then add to categories to be returned.\n if (cluesCount.data.clues.length > 5) {\n categoriesTracker.push(randomNumber)\n let temp = res.data.slice(randomNumber, randomNumber+1)\n result.push(temp[0])\n numberOfElementsSelected++\n }\n \n }\n }\n \n return result;\n }", "function loadCategories() {\n\t\tlet categories = new wp.api.collections.Categories()\n\n\t\tcategories.fetch().done( () => {\n\t\t\tconsole.log(categories);\n\t\t\t\t//clearCategories();\n\t\t\t\tcategories.each( category => loadCategory( category.attributes ) );\n\t\t});\n\t}", "function loadCategories() {\n\tjQuery.post(\n\t\tgetConnectorURL(),\n\t\t{\n\t\t\taction: 'get_categories'\n\t\t},\n\t\tfunction(result) {\n\t\t\tcategories = result.categories;\n\n\t\t\tdb.transaction(\n\t\t\t\tfunction (tx) {\n\t\t\t\t\ttx.executeSql(\"DROP TABLE IF EXISTS categories\");\n\t\t\t\t\ttx.executeSql(\"CREATE TABLE IF NOT EXISTS categories(categoryid INTEGER, category TEXT)\");\n\n\t\t\t\t\tfor (i in categories) {\n\t\t\t\t\t\tconsole.log(categories[i].category);\n\t\t\t\t\t\ttx.executeSql(\"INSERT INTO categories(category) VALUES ('\"+dbEscape(categories[i]['category'])+\"')\");\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tdbError,\n\t\t\t\tdbSuccess\n\t\t\t)\n\t\t},\n\t\t'jsonp'\n\t)\t\n}", "constructor() {\n\t\tthis.categories = [];\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 }", "function createGameCategories(){\n\tGameCategories = new Set();\n\tGames.map(game => game.categories).flat().forEach(function(subcategory){\n\t\tGameCategories.add(subcategory);\n\t});\n\tGameCategories = Array.from(GameCategories); //turn the set into an array\n}", "function getCategoryFilterItems(){\n var tempFilterArray = [];\n for(i=0; i<blog.rawData.length; i++){\n tempFilterArray.push(blog.rawData[i].category);\n }\n // console.log(tempFilterArray);\n return tempFilterArray;\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 }", "async function getcategaries() {\n const response = await fetch(\"http://localhost:8000/api/categaries\");\n const body = await response.json();\n console.log(\"response from api : \", body);\n setCategories(\n body.plantCategories.map(({ category, id }) => ({\n label: category,\n value: id,\n }))\n );\n }", "function 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 }", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "function fetchCategoriesForSelect() {\n fetchOperations.fetchCategories().then(forEachCategory);\n }", "function initCategories(axList) {\n for(var i = 0; i < axList.length; i++) {\n axList[i]._categories = axList[i]._initialCategories.slice();\n\n // Build the lookup map for initialized categories\n axList[i]._categoriesMap = {};\n for(var j = 0; j < axList[i]._categories.length; j++) {\n axList[i]._categoriesMap[axList[i]._categories[j]] = j;\n }\n }\n}", "function initCategories(axList) {\n for(var i = 0; i < axList.length; i++) {\n axList[i]._categories = axList[i]._initialCategories.slice();\n\n // Build the lookup map for initialized categories\n axList[i]._categoriesMap = {};\n for(var j = 0; j < axList[i]._categories.length; j++) {\n axList[i]._categoriesMap[axList[i]._categories[j]] = j;\n }\n }\n}", "async function getCategory(catId) {\n let categoryObjResponse= await axios.get(`http://jservice.io/api/category`, {params: {id: catId}})\n categoryObj = {\n title: categoryObjResponse.data.title,\n clues: categoryObjResponse.data.clues,\n showing: null\n };\n return categoryObj;\n}", "get categories() {\n return this.data.categories ? getCategories(this.data.categories) : [];\n }", "function GetCategory(categoryId) {\n const [category, setCategory] = useState('');\n const url = \"/api/categories/\"+categoryId;\n useEffect(() => {\n const requestCategory = async () => {\n const response = await fetch(url);\n const { data } = await response.json();\n const att = await data.attributes;\n const cat = await att.category;\n setCategory(cat);\n };\n requestCategory();\n }, []);\n\n return category;\n}", "function fetchCategories(){\n return fetch(catURL)\n .then(resp => resp.json())\n .then(categories=>{\n categoryData = categories\n displayCategories(categories)\n })\n}", "async function getCategoryIds() {\n let listOfCategories= await axios.get(`http://jservice.io/api/categories`, {params: {count: 100}})\n for(let category of listOfCategories.data){\n categories.push(category.id);\n }\n arrayShuffle(categories);\n categories.splice(6);\n return categories;\n}", "function getDocCategories() {\n if (utils.isEmptyObj(masterData.getMasterData())) {\n var request = masterData.fetchMasterData();\n $q.all([request]).then(function (values) {\n self.documentCategories = values[0].documents_cat;\n self.docModel.category = values[0].documents_cat[0];\n })\n } else {\n self.documentCategories = masterData.getMasterData().documents_cat;\n self.docModel.category = masterData.getMasterData().documents_cat[0];\n }\n }", "getCategories3() {\n this.config.getWithUrl(this.config.url + '/wp-json/wp/v2/categories/19').then((data) => {\n if (this.page2 == 1) {\n this.categories = [];\n }\n this.categories = data;\n // console.log(data.data.length);\n if (data.length == 0) { // if we get less than 10 products then infinite scroll will de disabled\n //this.shared.toast(\"All Categories Loaded!\");\n this.getRandomImage();\n }\n else\n this.getCategories3();\n }, function (response) {\n // console.log(\"Error while loading categories from the server\");\n // console.log(response);\n });\n }", "@computed get getAllCategories() {\n return this.categoryIds.map((categoryId) => this.categoryData.byId[categoryId]);\n }", "makeEmptyCategory() {\n return {\n parent_id: 1,\n is_visible: false,\n name: '',\n description: '',\n picture_filename: '',\n ordering: 0,\n };\n }", "getPChartData(){\n const categoryData = [];\n this.state.categories.map((category) => {\n categoryData.push(category.category);\n return categoryData;\n })\n\n const expenseData = {\n 'Rent': 0,\n 'Mortgage': 0,\n 'Loans': 0,\n 'Utilities': 0,\n 'Restaurants': 0,\n 'Groceries': 0,\n 'Entertainment': 0,\n 'Travel': 0,\n 'Vacation': 0,\n 'Miscellaneous': 0\n };\n\n // const expenseData = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n\n //changed date to to months with its year so we can separate the information between years.\n this.state.expenses.map((expense) => {\n const currDate = this.state.currentYear + this.state.currentMonth;\n const dbDate = expense.expense_date.slice(0,7).split('-');\n\n //combinedDB adds month and year together creating total month and year. and if total month and year is the same as expense year and date then we push.\n const combineDb = dbDate[0] + dbDate[1] + '';\n\n if (currDate === combineDb && expense.category_id === 1) {\n expenseData.Rent += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 2) {\n expenseData.Mortgage += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 3) {\n expenseData.Loans += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 4) {\n expenseData.Utilities += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 5) {\n expenseData.Restaurants += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 6) {\n expenseData.Groceries += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 7) {\n expenseData.Entertainment += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 8) {\n expenseData.Travel += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 9) {\n expenseData.Vacation += expense.amount\n }\n if (currDate === combineDb && expense.category_id === 10) {\n expenseData.Miscellaneous += expense.amount\n }\n return expenseData;\n })\n\n this.setState({\n pieChartData:{\n labels: categoryData,\n datasets:[\n {\n label:'Category',\n data: [\n expenseData.Rent,\n expenseData.Mortgage,\n expenseData.Loans,\n expenseData.Utilities,\n expenseData.Restaurants,\n expenseData.Grociers,\n expenseData.Entertainment,\n expenseData.Travel,\n expenseData.Vacation,\n expenseData.Miscellaneous\n ],\n backgroundColor:[\n 'rgba(255, 99, 132, 0.6)',\n 'rgba(54, 162, 235, 0.6)',\n 'rgba(255, 206, 86, 0.6)',\n 'rgba(75, 192, 192, 0.6)',\n 'rgba(153, 102, 255, 0.6)',\n 'rgba(255, 159, 64, 0.6)',\n 'green',\n 'blue',\n 'orange',\n 'grey',\n ]\n }\n ]\n }\n });\n }", "function formatData(data, searchTerm) {\n const keywords = countNouns(data, dictionary, searchTerm);\n const nodes = [];\n const links = [];\n \n let categoryId = data.length + 2;\n\n data.forEach((datum, idx) => {\n let category = categorize(datum, keywords)//return the category name \n //find if the category already exists\n let categoryExists\n nodes.forEach(item => {\n if (category && item && item.name === category.name) {\n categoryExists = item \n }});\n\n //decide if a new categry needs to be made \n if(categoryExists){\n // debugger\n links.push({\n source: categoryExists.id,\n target: idx + 2,\n })\n\n } else if (category){\n category.id = categoryId && categoryId++\n\n nodes.push(category)\n\n links.push({\n source: 1,\n target: category.id\n } , {\n source: category.id,\n target: idx + 2,\n })\n } else {\n links.push({\n source: 1,\n target:idx + 2\n })\n }\n\n \n nodes.push({\n id: idx + 2,\n type: 'information',\n name: datum.title,\n link: datum.link,\n snippet: datum.snippet\n })\n \n \n \n \n });\n// links between central node and categories\n\n// links between categories and children\n\n//nodes for the categories\n\n\n nodes.unshift({\n id: 1,\n name: searchTerm,\n type: 'root',\n\n // link: '',\n })\n\n // const links = data.map((datum, idx) => {\n // return {\n \n // }\n // });\n\n return {\n nodes,\n links,\n }\n}", "async _fetchOrCreateCategory() {\n const categoryUuid = CategoryImportJobParams.getCategoryUuid(this.params)\n if (categoryUuid) {\n return CategoryManager.fetchCategoryAndLevelsByUuid(\n {\n surveyId: this.surveyId,\n categoryUuid,\n draft: true,\n includeValidation: false,\n },\n this.tx\n )\n }\n\n const category = Category.newCategory({\n [Category.keysProps.name]: CategoryImportJobParams.getCategoryName(this.params),\n })\n return CategoryManager.insertCategory({ user: this.user, surveyId: this.surveyId, category, system: true }, this.tx)\n }", "getAllCategories() {\n axios\n .get('/api/categories')\n .then(res =>\n this.setState({\n categoriesList: res.data,\n }))\n .then(() => {\n this.getCategoryInfo(this.state.categoriesList[1]._id);\n })\n .then(() => {})\n .catch(err => console.log(err));\n }", "function prepareCategories() {\n var categories = {},\n page,\n pagesData;\n\n // iterator to build categories\n for (page in pages) {\n pagesData = pages[page].data;\n\n if (pages.hasOwnProperty(page) && pagesData.title !== undefined) {\n // check if already defined with category or not\n if(categories[pagesData.category] === undefined){\n categories[pagesData.category] = { list: [] };\n }\n\n // build pages list for each category\n listItemsforCategory(categories[pagesData.category], pagesData);\n }\n }\n\n // return the categories\n return categories;\n }", "extractCategoriesFromItems(allItems) {\n let categories = [];\n let unique = {};\n\n for (let prop in allItems) {\n // Check the \"category\" first.\n if (typeof(unique[allItems[prop].category]) == \"undefined\" && \n allItems[prop].category) {\n categories.push(allItems[prop].category);\n }\n unique[allItems[prop].category] = 0;\n } \n // 'All' category is always present as the first.\n categories.unshift(PlaceList.all);\n return categories;\n }", "async readCategories() {\n let response = await fetch(url + 'get/categories');\n let data = await response.json();\n return data\n }", "function loadCategory() {\n $.ajax({\n url: 'allCategory',\n type: 'GET',\n success: function(data) {\n $('#dataTableExample1').html(data);\n }\n });\n }", "async getCategories (offset) {\n const response = await fetch(`http://jservice.io/api/categories?count=100&offset=${offset}`)\n const json = response.json()\n return json\n }", "function getCategory(){\n var deferred = $q.defer();\n\n $http({\n url: API_ENDPOINT + APIPATH.category,\n method: 'GET'\n })\n .then(function (data) {\n deferred.resolve(data);\n },function(data){\n deferred.resolve(data);\n $mdToast.show(\n $mdToast.simple()\n .textContent('Sorry! Unable to show categories')\n .position('top')\n .hideDelay(5000)\n );\n })\n\n return deferred.promise;\n }", "function categoryArray(data, value, array) {\r\n for (var i = 0, iLen=data.length; i<iLen; i++) {\r\n if(data[i].category === value) {\r\n array.push(data[i]);\r\n }\r\n }\r\n }", "function nCategory(t){this.category=new category(t),this.built=!1,this.build=null}", "updateCategory(state, data) {\n const ind = findIndex(state.categories, (r) => {\n return r.id === data.id\n })\n\n const category = state.categories[ind]\n\n for (const prop in data) {\n category[prop] = data[prop]\n }\n }", "function getCategory()\n{\n\tvar category = new Array([111,'server'], [222,'switcher'], [333,'storage'], [444,'workstation']);\n\treturn category;\n}", "function getCategory(count) {\n\t \tlet category = links[count].category;\n\n\t\t\taxios.get(links[count].link)\n\t\t\t.then(function(response) {\n\n\t\t\t\tvar $ = cheerio.load(response.data);\n\n\t\t\t\tgetClasses($, count).then(function(response){\n\n\t\t\t\t\tlet classes = response;\n\n\t\t\t\t\tfor (var i = 0; i < classes.length; i++) {\n\t\t\t\t\t\tclasses[i].category = category;\n\t\t\t\t\t};\n\n\t\t\t\t\t// console.log(classes);\n\n\t\t\t\t\tdb.Class.create(classes)\n\t\t\t \t.then(function(dbArticle) {\n\t\t\t \t// View the added result in the console\n\t\t\t \tconsole.log(dbArticle);\n\t\t\t \t})\n\t\t\t \t.catch(function(err) {\n\t\t\t \t\tconsole.log(\"------------------------------------------------------------------------------\");\n\t\t\t \t\tconsole.log(err);\n\t\t\t \t});\n\t\t\t\t\n\t\t\t\t\t//if there are items left, do it again, otherwise send the data\n\t\t\t\t\t\n\t\t\t\t});\n\n\t\t\t\tcount++;\n\t\t\t\tif (count < links.length) {\n\t\t\t\t\tgetCategory(count);\n\t\t\t\t} else {\n\t\t\t\t\tres.json(links);\n\t\t\t\t}\n\n\n\t \t})\n\t \t.catch(function(err) {\n\t \t\tconsole.log(err);\n\t \t\tres.json(err);\n\t \t})\n\t }", "getCategories() {\n return this.$node.attr('data-category').split(/\\s*,\\s*/g);\n }", "get Categories() {\n const { categories, handleCategoryClick } = this.props;\n return categories.map((category, index) => (\n <TouchableOpacity\n style={styles.InnerWrapper}\n key={`category-item-${index}`}\n onPress={() => handleCategoryClick(category)}\n >\n <View style={styles.innerCard}>\n <Image\n source={category.photo}\n resizeMode=\"contain\"\n source={{ uri: `${BASE_API_URL}${category.icon}` }}\n style={styles.image}\n />\n <Text style={styles.listingType}>{category.name}</Text>\n </View>\n </TouchableOpacity>\n ));\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 }", "retrieveCategories() {\n return call(`${this.__url__}/categories`, {\n headers: {\n 'Content-Type': 'application/json'\n },\n timeout: this.__timeout__\n })\n }", "async getAllCategories() {\n const data = await this.get('jokes/categories');\n return data;\n }", "getCategories() {\n return ['Snacks', 'MainDishes', 'Desserts', 'SideDishes', 'Smoothies', 'Pickles', 'Dhal', 'General']\n }", "mapUserCategories(category) {\n let rating;\n switch (category.score) {\n case PRODUCTIVITY_SCORES.unrated:\n rating = 'Unrated';\n break;\n case PRODUCTIVITY_SCORES.unproductive:\n rating = 'Unproductive';\n break;\n case PRODUCTIVITY_SCORES.neutral:\n rating = 'Neutral';\n break;\n default:\n rating = 'Productive';\n }\n\n return {\n name: category.name,\n rating,\n total: humanizeDuration(category.total),\n entity: category.entity === 2 ? 'app' : 'web',\n };\n }", "componentDidMount() {\n axios.get(\"http://localhost:5000/prodCategories\").then((response) => {\n if (response.data.length > 0) {\n this.setState({\n categories: response.data.map((catg) => catg.category),\n category: response.data[0].category\n });\n }\n });\n }", "function createCategoryMap(postCategories) {\n var categoriesMap = {};\n postCategories.map((c) => (categoriesMap[c.id] = c));\n return categoriesMap;\n}", "async function getCategoryIds() {\n let response = await axios.get(`https://jservice.io/api/categories`, {\n params: {\n count: 100\n }\n });\n let catIds = response.data.map((result) => result.id);\n return _.sampleSize(catIds, Cat_count);\n}", "static async getCategoryIds() {\n let response = await axios.get(`${BASE_URL}/categories`, {\n params: {\n count: \"100\",\n offset: Math.floor(Math.random() * (500 - 1) + 1) // RNG to vary offset between each request\n }\n });\n\n // Lodash selects 6 random categories\n let randomCategories = _.sampleSize(response.data, CATEGORY_COUNT)\n\n // make new array with only the category IDs\n let categoryIds = randomCategories.map((catObj) => {\n return catObj.id;\n });\n\n return categoryIds;\n }", "function processData() {\n\tif (this.status == 200) { // 200 stands for we received a file\n\t\tcurrJSON = JSON.parse(this.responseText);\n\t\t// add vector for all category names (before filtering)\n \n var category_list = d3.set();\n for (var i=0; i<currJSON.length; i++) {\n\t\t\t category_list.add(currJSON[i].category);\n\t\t}\n \n \tif(dimension == \"class\"){\n\t\t\tcategory_domain = ['other','Non-Matriculated', 'Grad', '5th year', 'Senior', 'Junior', 'Sophomore', 'Freshman'];\n\t\t\tconsole.log(category_domain);\n \t\tcolor.domain(category_domain);\n \t}\n\t\telse if (dimension == \"spcl_prog_text\"){\n\t\t\tcategory_domain = [\"None\", \"ADM SAI\", \"ATHLETICS\", \"ATHLETICS-EOP\", \"EOP\", \"EOP Special Programs\", \"INTL/RES.TUIT.ELIG\", \"RESTRICTED ELIGIBLTY\", \"SP ATHLETICS\", \"STAFF/FAC EXEMPT\", \"UNDERGRAD EXCHANGE\", \"UNIV EXT\", \"WA ST CLASS EMPT\", \"WWAMI\"];\n\t\t\tcolor.domain(category_domain);\n\t\t}\n else if (dimension==\"subject\"){\n \t// hacky sort to intelligently group categories together\n \t// category_domain = category_list.values().sort();\n \tvar languages = [];\n \tvar stem = [];\n \tvar other = [];\n \tfor (var i = 0; i < category_list.values().length; i++) {\n \t\tvar category = category_list.values()[i];\n \t\n \t\n\n \t\t//Languages\n\n \t\tif ( category == \"Arabic\" \n \t\t\t|| category == \"Chinese\" \n \t\t\t|| category == \"French\"\n \t\t\t|| category == \"Japanese\"\n \t\t\t|| category == \"Korean\"\n \t\t\t|| category == \"Spanish\"\n \t\t\t|| category == \"Swedish\") {\n \t\t\t\n \t\t\tlanguages.push(category);\n \t\t}\n\n \t\t//STEM\n \t\telse if(category == \"Bio\" \n \t\t\t|| category == \"CSE\" \n \t\t\t|| category == \"Chem\"\n \t\t\t|| category == \"Math\"\n \t\t\t|| category == \"Physics\"\n \t\t\t|| category == \"Stats\") {\n \t\t\tstem.push(category);\n \t\t}\n\n \t\t//other\n \t\telse {\n \t\t\tother.push(category);\n \t\t\t//alert(other);\n \t\t}\n \t};\n \t// category_domain = [];\n \t// category_domain = category_domain.concat(languages.sort());\n \t// category_domain = category_domain.concat(stem.sort());\n \t// category_domain = category_domain.concat(other.sort());\n \t// console.log(category_domain);\n\t\t\tcategory_domain = [\"Arabic\", \"French\", \"Spanish\",\n\t\t\t\t\t\t \t \"Chinese\", \"Korean\", \"Japanese\", \n\t\t\t\t\t\t \t \"Bio\", \"Chem\", \"Physics\", \n\t\t\t\t\t\t \t \"CSE\", \"Math\", \"Stats\", \"ECON\"].reverse();\n \t// manually control the colors\n \tcolor = d3.scale.ordinal()\n\t\t\t\t\t\t .domain([\"Arabic\", \"French\", \"Spanish\",\n\t\t\t\t\t\t \t \"Chinese\", \"Korean\", \"Japanese\",\n\t\t\t\t\t\t \t \"Bio\", \"Chem\", \"Physics\", \n\t\t\t\t\t\t \t \"CSE\", \"Math\", \"Stats\", \"ECON\"])\n\t\t\t\t\t\t .range(['#3182bd', '#6baed6', '#9ecae1', \n\t\t\t\t\t\t \t '#756bb1', '#9e9ac8', '#bcbddc',\n\t\t\t\t\t\t \t '#31a354', '#74c476', '#a1d99b', \n\t\t\t\t\t\t \t '#e6550d', '#fd8d3c', '#fdae6b','#fdd0a2']);\n \t\n }\n else {\n \t // handle the numerical category\n\t // if(dimension == 'class'){\n\t\t\t\t// category_domain = category_list.values().sort(\n\t\t\t\t// \tfunction(a, b) {\n\t\t\t\t// \t return b - a;\n\t\t\t\t// \t});\n\t // }else{\n\t \tcategory_domain = category_list.values().sort();\n\t // }\n \tcolor.domain(category_domain);\n }\n \n \n\t}\n\t// handle redrawing of existing bar chart\n\tif (document.getElementById(\"barplot_svg\")) {\n\t\t//TODO is this actually doing anything? - kd\n\t\tbarplot.init();\n\t\tlineplot.init(7);\n\t}\n}", "function addCategory(category) {\n categories[category] = []\n originals[category] = []\n}", "ngOnInit() {\n this.allCategories = [];\n this.DBCategories = [];\n this.categoryService.getAllCategories().subscribe(c => {\n this.DBCategories = c;\n this.setCategories(c);\n });\n }", "function getFormattedData(data) {\n let result = {\n children: []\n }\n\n for (let category in data) {\n\n let temp = {\"Name\": category, \"Count\": data[category]};\n result.children.push(temp);\n }\n\n result.children = result.children.filter(function (e) {\n return valid_categories.indexOf(e.Name) > -1;\n });\n\n return result;\n}", "async getCategories () {\n this.setState({categories: await CategoryService.getAll()})\n }", "async getCategoryIds() {\n try {\n if (this.totalCategories.length === 0) {\n const promises = []\n for (let x = 0; x < 5; x++) {\n promises.push(axios.get(`https://jservice.io/api/categories?count=100&offset=${x}00`));\n }\n const fulfilled = await Promise.all(promises);\n for (let response of fulfilled) {\n for (let item of response.data) {\n this.totalCategories.push(item);\n }\n }\n \n }\n\n for (let x = 0; x < this.width; x++) {\n const ranId = Math.floor(Math.random() * (this.totalCategories.length - 1))\n if (this.idList.indexOf(this.totalCategories[ranId].id) === -1){\n this.idList.push(this.totalCategories[ranId].id);\n }\n }\n } catch (e) {\n alert('Failed to get IDs!')\n } \n }", "getCategoryData(categoryType) {\n let clause = '';\n clause = this.valuesObj.channelValue;\n clause += '_' + this.valuesObj.caseType;\n clause += '_' + this.valuesObj.businessArea;\n if (this.valuesObj.caseStage) {\n clause += '_' + this.valuesObj.caseStage\n }\n if (categoryType === 'Primary') {\n clause += '_' + 'Primary';\n } else if (categoryType === 'Secondary') {\n clause += '_' + 'Secondary' + '_' + this.valuesObj.primaryCategoryValue;\n } else if (categoryType === 'Tertiary') {\n clause += '_' + 'Tertiary' + '_' + this.valuesObj.primaryCategoryValue + '_' + this.valuesObj.secondaryCategoryValue;\n }\n fetchCategoryData({\n queryFilter: clause\n }).then(result => {\n // This part is covered to fetch and display the Picklist values for Service type\n if (categoryType === 'Primary') {\n this.primaryCategoryOptions = [];\n if (result && result.length > 0) {\n this.primcategoryData = result;\n this.emptyCategory();\n this.primaryCategoryOptions.push({\n label: '-- None --',\n value: ''\n });\n this.isSecondaryCategoryDisabled = true;\n for (let i = 0; i < result.length; i++) {\n if (result[i].Type__c === 'Primary') {\n this.isPrimaryCategoryDisabled = false;\n this.primaryCategoryOptions.push({\n label: result[i].Name,\n value: result[i].Id\n });\n }\n if (this.sourceCmp === 'EW Calculator' && result[i].Name === 'EW') {\n this.valuesObj.primaryCategoryValue = result[i].Id;\n this.valuesObj.primaryCategoryName = result[i].Name;\n } else if (this.sourceCmp === 'MCP Calculator' && result[i].Name === 'MCP') {\n this.valuesObj.primaryCategoryValue = result[i].Id;\n this.valuesObj.primaryCategoryName = result[i].Name;\n }\n }\n\n this.isSpinnerShow = false;\n } else {\n this.isSpinnerShow = false;\n }\n } else if (categoryType === 'Secondary') {\n this.secondaryCategoryOptions = [];\n if (result && result.length > 0) {\n this.valuesObj.secondaryCategoryValue = '';\n this.valuesObj.secondaryCategoryName = '';\n this.seconcategoryData = result;\n this.secondaryCategoryOptions.push({\n label: '-- None --',\n value: ''\n });\n for (let i = 0; i < result.length; i++) {\n if (result[i].Type__c === 'Secondary') {\n this.isSecondaryCategoryDisabled = false;\n this.secondaryCategoryOptions.push({\n label: result[i].Name,\n value: result[i].Id\n });\n }\n }\n } else {\n this.isSecondaryCategoryDisabled = true;\n this.isTertiaryCategoryDisabled = true;\n this.valuesObj.secondaryCategoryValue = '';\n this.valuesObj.secondaryCategoryName = '';\n this.valuesObj.tertiaryCategoryValue = '';\n this.valuesObj.tertiaryCategoryName = '';\n }\n } else if (categoryType === 'Tertiary') {\n this.tertiaryCategoryOptions = [];\n if (result && result.length > 0) {\n this.valuesObj.tertiaryCategoryValue = '';\n this.valuesObj.tertiaryCategoryName = '';\n this.tertiarycategoryData = result;\n this.tertiaryCategoryOptions.push({\n label: '-- None --',\n value: ''\n });\n for (let i = 0; i < result.length; i++) {\n if (result[i].Type__c === 'Tertiary') {\n this.isTertiaryCategoryDisabled = false;\n this.tertiaryCategoryOptions.push({\n label: result[i].Name,\n value: result[i].Id\n });\n }\n }\n } else {\n this.isTertiaryCategoryDisabled = true;\n this.valuesObj.tertiaryCategoryValue = '';\n this.valuesObj.tertiaryCategoryName = '';\n }\n }\n this.isSpinnerShow = false;\n }).catch(error => {\n this.error = error;\n this.isSpinnerShow = false;\n });\n }", "constructor() {\n /**\n * Array of subcategories. Can be empty.\n * @member {Array.<module:models/Category>} categories\n */\n this.categories = undefined\n\n /**\n * The localized description of the category.\n * @member {String} description\n */\n this.description = undefined\n\n /**\n * The id of the category.\n * @member {String} id\n */\n this.id = undefined\n\n /**\n * The URL to the category image.\n * @member {String} image\n */\n this.image = undefined\n\n /**\n * The localized name of the category.\n * @member {String} name\n */\n this.name = undefined\n\n /**\n * The localized page description of the category.\n * @member {String} page_description\n */\n this.page_description = undefined\n\n /**\n * The localized page keywords of the category.\n * @member {String} page_keywords\n */\n this.page_keywords = undefined\n\n /**\n * The localized page title of the category.\n * @member {String} page_title\n */\n this.page_title = undefined\n\n /**\n * The id of the parent category.\n * @member {String} parent_category_id\n */\n this.parent_category_id = undefined\n\n /**\n * The URL to the category thumbnail.\n * @member {String} thumbnail\n */\n this.thumbnail = undefined\n }", "findCanonicalsAndCategories(viralTweets) {\n let headCanonicals = ['-- TOTS --', '-- AMB CANÒNIC --', '-- GENÈRICS --']\n let headCategories = ['-- TOTS --', '-- AMB CATEGORIA --', '-- GENÈRICS --']\n let foundCanonicals = []\n let foundCategories = []\n viralTweets.forEach((tweet) => {\n if (!isInArray(foundCategories, tweet.category)) {\n if (tweet.category !== 'genèric') {\n foundCategories.push(tweet.category)\n }\n }\n if (tweet.canonical_name !== 'genèric') {\n let canonical_entry = tweet.canonical_name + ' (' + tweet.category + ')'\n if (!isInArray(foundCanonicals, canonical_entry)) {\n foundCanonicals.push(canonical_entry)\n }\n }\n })\n\n foundCanonicals.sort()\n foundCategories.sort()\n this.setState({\n canonicalNamesFound: headCanonicals.concat(foundCanonicals),\n dictionaryCategoriesFound: headCategories.concat(foundCategories)\n })\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 }", "function categoryTable() { }", "componentDidMount() {\n /** if the categoryData is already set then we don't need to fetch.*/ \n if(this.props.categoryData.length === 0) {\n fetch('http://jservice.io/api/categories?count=20')\n .then(response => response.json())\n .then(json => {\n this.props.setCategories(json);\n this.fetchData();\n });\n } \n }", "static category(req, dynamoDb, callback) {\n const params = {\n TableName: process.env.POSTS_TABLE,\n FilterExpression: 'category = :val',\n ExpressionAttributeValues: {\n ':val': req.query.category\n }\n };\n dynamoDb.scan(params, function (err, data) {\n if (err) {\n console.error(err);\n callback('render', 'error', {error: err});\n } else {\n let posts = data.Items.filter(p => !p.staging);\n posts.map(p => {\n p.content = markdown.render(p.content);\n p.title = markdown.renderInline(p.title);\n });\n posts.sort((a, b) => {\n return new Date(b.published_on) - new Date(a.published_on);\n });\n let left = posts.slice(0, data.Count / 2);\n let center = posts.slice(data.Count / 2);\n callback('render', 'posts/subindex', {heading: req.query.category,\n left: left, center: center});\n }\n });\n }", "function addProductCategory(){\r\n\t var categoryId = 0;\r\n\t var categoryName,categoryOptions ;\r\n\r\n\t productCategoriesArray.push(new ProductCategory(categoryId,categoryName,categoryOptions));\r\n iterateProductCategoriesArray();\r\n }", "loadFacetInfo() {\n const helper = algoliasearchHelper(client, indexName, {\n facets: [\"food_type\"]\n });\n\n helper.on(\"result\", content => {\n this.setState({\n categories: content.getFacetValues(\"food_type\", {\n sortBy: [\"count:desc\"]\n })\n });\n });\n helper.setQueryParameter(\"hitsPerPage\", 5000).search();\n }", "async function fetchData() {\n const result = await fetch('/pets/categories');\n setPetCategories(result);\n setIsLoaded(true);\n }", "function fetchAllCategorisedColumnSet() {\n\tlet categorisedColumnsSet = new Set();\n\tvar json = fetchParsedJson();\n\tfor(var i = 0 ; i < json.length; i++){\n\t\tfor (var key in json[i]) {\n\t\t\tvar columnName = key;\n\t\t\tvar columnValue = json[i][key];\n\t\t\tif((columnName != null && columnName != '') && isNaN(columnValue)){\n\t\t\t\tcategorisedColumnsSet.add(columnName);\n\t\t\t} else if(categorisedColumnsSet.size == json[i].length){\n\t\t\t\treturn categorisedColumnsSet;\n\t\t\t}\n\t\t}\t\n\t}\t\t\n\treturn categorisedColumnsSet;\n}", "setCategories(cat) {\n for (let c of cat) {\n this.allCategories.push({\n id: c.id,\n title: c.title,\n toggle: false\n });\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 }", "function getCategoryAffinity(ideaData)\n{\n //Find all categories and ideaKeys present in data\n var metaData = getMetaData(ideaData)\n var ideaKeys = metaData.ideaKeys;\n var categories = metaData.categories;\n\n //Create raw empty matrix\n var rawEmptyMatrix = createEmptyMatrix(ideaKeys.length, categories.length);\n\n // Create Category Weight Matrix\n var categoryWeightMatrix = createCategoryMatrix(ideaKeys, categories, rawEmptyMatrix);\n\n // Populate Category Weight Matrix\n categoryWeightMatrix = populateCategoryMatrix(ideaData, categoryWeightMatrix);\n \n //Normalize Category Weight Matrix\n var normalizedCategoryWeightMatrix = normalizeMatrix(categoryWeightMatrix, categoryWeightMatrix.categories.length);\n\n //Create pair-wise afinity matrix for category membership\n var rawAffinityMatrix = populatePairwiseAffinityMatrix(categoryWeightMatrix, normalizedCategoryWeightMatrix);\n\n var categoryAffinityMatrix = createCategoryAffinityMatrix(ideaKeys, rawAffinityMatrix);\n return categoryAffinityMatrix;\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}", "async function getCategoryIds() {\n const url = `https://jservice.io//api/random?count=${NUM_CATEGORIES*3}`\n let results = await axios.get(url,{timeout:4000}).catch((err)=>console.log(err));\n let totalIds=results.data.map((clue)=>clue.category_id)\n let ids=[]\n while(true){\n if(ids.length===NUM_CATEGORIES)break;\n let id = totalIds[Math.floor(Math.random()*(totalIds.length+1))];\n if(!ids.includes(id) && id){\n ids.push(id);\n }\n }\n return ids;\n}", "function Category(category_data) {\r\n $.extend(this, category_data);\r\n }", "function getCategories() {\n\tvar categories = getCatDisponibility() + \" \" + getCatCategory() + \" \" + getCatCountries();\n\t\n\treturn categories;\n}", "function categorify(cat) {\n var ret;\n if(typeof cat == \"string\")\n ret = cat\n ;\n else ret = d3.entries(cat) // Overview pseudo-phase\n .filter(function(e) { return e.value === \"Yes\"; })\n .map(function(k) { return k.key.trim(); })\n [0]\n ;\n return ret || \"Not Applicable\";\n } // categorify()", "function createPatternCategories(){\n\tPatternCategories = new Set();\n\tPatterns.map(pattern => pattern.Categories).flat().forEach(function(subcategory){\n\t\tPatternCategories.add(subcategory);\n\t});\n\tPatternCategories = Array.from(PatternCategories);\n}", "function crearObjetoCategorias(xml){\n \n //array con las categorias\n var arrCategory=[];\n //coger los datos del xml que nos interesan (name e id)\n var categoria=xml.getElementsByTagName(\"category\");\n //variables \n var nombre;\n \n for(var i=0; i<categoria.length; i++){ //se recorren las categorias\n\n nombre=categoria[i].getElementsByTagName(\"name\")[0].childNodes[0].nodeValue; //se coga el nombre de la categoria\n \n var objetoCategoria = new datosCategorias(nombre);\n arrCategory.push(objetoCategoria);\n } \n return arrCategory; //array nombre categoria\n}", "function getCategories(){\n return _categoryProducts;\n}", "function categoryExists(category) {\n return originals[category] != null\n}", "function category(a) {\n\t // test at most 1000 points\n\t var inc = Math.max(1, (a.length - 1) / 1000),\n\t curvenums = 0,\n\t curvecats = 0,\n\t ai;\n\t\n\t for(var i = 0; i < a.length; i += inc) {\n\t ai = cleanDatum(a[Math.round(i)]);\n\t if(isNumeric(ai)) curvenums++;\n\t else if(typeof ai === 'string' && ai !== '' && ai !== 'None') curvecats++;\n\t }\n\t\n\t return curvecats > curvenums * 2;\n\t}", "function buildCategories() {\n const selectCategories = {};\n\n for (let i = 0; i < skills.length; i++) {\n const category = skills[i].category;\n // Make array for each category\n if (!selectCategories[category]) {\n selectCategories[category] = [];\n }\n\n let skill = skills[i];\n if (skill.comp === 1) {\n selectCategories[category].push({\n 'value': i,\n 'label': skill.name,\n // Custom attrs on Select Options\n 'tariff': skill.tariff.toFixed(1),\n 'startPosition': skill.startPosition,\n 'endPosition': skill.endPosition,\n 'makeDim': false\n });\n }\n }\n return selectCategories;\n}", "getCategory(_parameters) {\n\t\treturn new Category(_parameters);\n\t}", "function createCatCities(newCatIndex){\n //Done with all new Categories\n if(newCatIndex>=data.NewCategories.length){\n console.log(\"---------\"+data.Manufacturer+\"-----DONE with all new categories\");\n callback();\n return;\n }\n executeView(\"SELECT RAW records from records where docType=$1 and Manufacturer=$2 and ProductCategory=$3\",[\"MfrProCat\",data.Manufacturer,data.NewCategories[newCatIndex]],function(mfrProCatSearchRes){\n if(mfrProCatSearchRes.error || mfrProCatSearchRes.length == 0){\n if(mfrProCatSearchRes.error){\n console.log(mfrProCatSearchRes);\n }else{\n console.log(data.Manufacturer+\" ****NOT RELATED**** \"+data.NewCategories[newCatIndex]);\n };\n //if Not processing next record\n createCatCities(newCatIndex+1);\n return;\n }\n mfrCatRecord=mfrProCatSearchRes[0];\n //Getting the new category record\n executeView(\"SELECT RAW records from records use keys $1\",[data.NewCategories[newCatIndex]],function(catRecord){\n if (catRecord.error) {\n console.log(catRecord.error);\n createCatCities(newCatIndex+1);\n return;\n }\n catRecord = catRecord[0];\n //Creating MfrProCatCity\n var mfrProCatCityRecord = {\n \"$status\": \"published\",\n \"@identifier\": \"mfrprocatcity\",\n \"@uniqueUserName\": mfrRecord.name.trim().replace(/\\W+/g, \"-\").toLowerCase() + \"-\" + catRecord.categoryName.trim().replace(/\\W+/g, \"-\").toLowerCase() + \"-\" + cityRecord.cityName.trim().replace(/\\W+/g, \"-\").toLowerCase(),\n \"City\": data.City,\n \"Manufacturer\": data.Manufacturer,\n \"ProductCategory\": data.NewCategories[newCatIndex],\n \"author\": \"administrator\",\n \"cityName\": cityRecord.cityName,\n \"cloudPointHostId\": \"cloudseed\",\n \"dateCreated\": global.getDate(),\n \"dateModified\": global.getDate(),\n \"docType\": \"MfrProCatCity\",\n \"editor\": \"administrator\",\n \"flag\": \"created with script\",\n \"manufacturerName\": mfrRecord.name,\n \"metaDescription\": \"Find all \" + catRecord.categoryName + \" manufactured by \" + mfrRecord.name + \"in\" + cityRecord.cityName +\". Also locate and chat with stores and dealers near you.\",\n \"metaTitle\": mfrRecord.name + \" \" + catRecord.categoryName + \"in\" + cityRecord.cityName +\" | cloudseed.com\",\n \"mfrProCat\": mfrCatRecord.recordId,\n \"mfrprocatcity\": mfrRecord.name + \" \" + catRecord.categoryName + \" \" + cityRecord.cityName,\n \"org\": \"public\",\n \"productCategoryName\": catRecord.categoryName,\n \"recordId\": \"MfrProCatCity\" + global.guid(),\n \"relationDesc\": [\n \"mfrProCat-availableIn-City\",\n \"City-hasMfrProCat-mfrProCat\"\n ],\n \"revision\": 1\n }\n\n createRecordInDataBase(mfrProCatCityRecord,function(crr){\n mfrProCatCityRecord=crr;\n console.log(\"mfrProCatCityRecord----\",mfrProCatCityRecord.recordId);\n createCatCitySupplier(0);\n });\n function createCatCitySupplier(supplierIndex){\n if(supplierIndex>=data.Suppliers.length){\n //createCatCitySupplier();\n createCatCities(newCatIndex+1);\n return;\n }\n\n executeView(\"SELECT RAW records from records use keys $1\",[data.Suppliers[supplierIndex]],function(supRecordRes){\n if (supRecordRes.error) {\n console.log(supRecordRes.error);\n createCatCitySupplier(supplierIndex+1);\n return;\n }\n supRecord = supRecordRes[0];\n var mfrProCatCitySupRecord = {\n \"$status\": \"published\",\n \"@identifier\": \"recordId\",\n \"City\": data.City,\n \"Manufacturer\": data.Manufacturer,\n \"ProductCategory\": data.NewCategories[newCatIndex],\n \"MfrProCatCity\": mfrProCatCityRecord.recordId,\n \"Supplier\": data.Suppliers[supplierIndex],\n \"author\": \"administrator\",\n \"cloudPointHostId\": \"cloudseed\",\n \"dateCreated\": global.getDate(),\n \"dateModified\": global.getDate(),\n \"docType\": \"MfrProCatCitySupplier\",\n \"editor\": \"administrator\",\n \"flag\": \"created with script\",\n \"org\": \"public\",\n \"recordId\": \"MfrProCatCitySupplier\"+ global.guid(),\n \"relationDesc\": [\n \"MfrProCatCity-hasSupplier-Supplier\",\n \"Supplier-hasMfrProCatCity-MfrProCatCity\"\n ],\n \"revision\": 1\n }\n\n createRecordInDataBase(mfrProCatCitySupRecord,function(crr2){\n mfrProCatCitySupRecord=crr2;\n console.log(\"mfrProCatCitySupRecord----\",mfrProCatCitySupRecord.recordId);\n createCatCitySupplier(supplierIndex+1);\n });\n })\n\n }\n\n })\n });\n }" ]
[ "0.659236", "0.64316267", "0.63823956", "0.629352", "0.62469983", "0.61667466", "0.60887027", "0.60318846", "0.60295564", "0.6019952", "0.59892625", "0.59347", "0.59023935", "0.5854105", "0.5826978", "0.5824248", "0.5815708", "0.5805193", "0.5791007", "0.57905877", "0.578391", "0.5780162", "0.57745844", "0.5753913", "0.5748161", "0.5740445", "0.5713364", "0.5707352", "0.57069534", "0.57003325", "0.5697169", "0.56862885", "0.56862885", "0.56848353", "0.568318", "0.5679308", "0.56674284", "0.5663055", "0.5661335", "0.565965", "0.56530046", "0.5650876", "0.5635665", "0.5634939", "0.56262213", "0.5609632", "0.5606288", "0.5605815", "0.5605082", "0.5588357", "0.55861306", "0.558576", "0.558505", "0.5582982", "0.5580685", "0.55787796", "0.55707556", "0.555822", "0.55578125", "0.55552894", "0.5547955", "0.5541486", "0.5541139", "0.5538437", "0.5533539", "0.55324894", "0.5526084", "0.5524722", "0.55225515", "0.552136", "0.5521046", "0.5520604", "0.5520006", "0.5519497", "0.55154544", "0.551015", "0.550202", "0.54915273", "0.54834473", "0.54813933", "0.547004", "0.5467957", "0.54668593", "0.54520196", "0.5448563", "0.5443805", "0.54430306", "0.5436897", "0.54346675", "0.5423129", "0.5423042", "0.54184496", "0.5417099", "0.5413411", "0.54128057", "0.541193", "0.54091275", "0.5405816", "0.5403472", "0.5403424", "0.5402091" ]
0.0
-1
Provide setColor helper method to avoid determine if set the fill or stroke outside
function symbolPathSetColor(color, innerColor) { if (this.type !== 'image') { var symbolStyle = this.style; var symbolShape = this.shape; if (symbolShape && symbolShape.symbolType === 'line') { symbolStyle.stroke = color; } else if (this.__isEmptyBrush) { symbolStyle.stroke = color; symbolStyle.fill = innerColor || '#fff'; } else { // FIXME 判断图形默认是填充还是描边,使用 onlyStroke ? symbolStyle.fill && (symbolStyle.fill = color); symbolStyle.stroke && (symbolStyle.stroke = color); } this.dirty(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setFill(color) {\n if (color === false) color = `transparent`;\n this.ctx.fillStyle = color;\n }", "setStroke(color) {\n if (color === false) color = `transparent`;\n this.ctx.strokeStyle = color;\n }", "function setStrokeFillColor() {\r\n strokeColor = getStrokeColor.value\r\n fillColor = getFillColor.value\r\n}", "setFilled(color) {\n this.filled = true;\n this.color = color;\n }", "_setColor(color) {\n this._context.fillStyle = this._context.strokeStyle =\n color ? color : Chart.DEFAULT_FORE_COLOR;\n }", "function setColor(color){\ncontext.fillStyle = color\ncontext.strokeStyle = color\n}", "function fillColor(d){\n return '#0088cc';\n }", "function onChangeStrokeColor(color) {\n changeCurrMeme('stroke-color', color);\n renderCanvas();\n}", "function strokeColor(d){\n return '#444';\n }", "function setSwitchColor(name, color) {\n if (canvasObjects[name].attrs.fill != color) {\n canvasObjects[name].attr({\"fill\": color})\n }\n }", "function changeColor(color){\n context.strokeStyle = color;\n}", "set color(value) {}", "setColour(c){\n this.dragFill = c;\n }", "setColor(color) {\n this.context.fillStyle = color;\n this.context.strokeStyle = color;\n }", "function fill(color) {\r\n ctx.fillStyle = color;\r\n}", "function setColor(color) {\r\n lineColor = color;\r\n}", "function setStrokeColor(element) {\r\n \t\tcolor = \"#\"+element.value;\r\n \t\tvar object = canvas.getActiveObject();\r\n\r\n\r\n \t\tconsole.log(color) \r\n console.log(object)\r\n if (object.paths) {\r\n for (var i = 0; i < object.paths.length; i++) {\r\n object.paths[i].set({\r\n \r\n stroke: color\r\n });\r\n }\r\n }\r\n\t \r\n \tcanvas.renderAll();\r\n\t}", "fill(color) {\n this.addEffect(new Effects.Fill(color));\n }", "function typeColor(e) {\n if (isNaN(this.value) || this.value > 255 || this.value < 0) {\n this.style.backgroundColor = \"rgba(252, 171, 171, 1)\";\n } else {\n rgbaColorStroke = 'rgba(' + Rstroke.value + ',' + Gstroke.value + ',' + Bstroke.value + ',1)';\n strokeLabel.style.backgroundColor = rgbaColorStroke;\n fillGradientStroke();\n this.style.backgroundColor = \"\";\n }\n}", "function colorFigure(){//SET COLOR ON STROKE \n\n \n if (canvasState === CANVAS_STATE.COLOR) {\n getIntersectedFigure();\n //colorFigure();\n }\n\n selectedFigure.setColor(color);\n\n if ( canvasState === CANVAS_STATE.FILL) {\n console.log('fill state2');\n selectedFigure.fill();\n }\n\n redrawFigures();\n \n}", "function setColor() {\n var r_hex = parseInt(r.value, 10).toString(16);\n var g_hex = parseInt(g.value, 10).toString(16);\n var b_hex = parseInt(b.value, 10).toString(16);\n\n\n //updates the sliders output colors\n r_out.style.backgroundColor=\"#\"+r_hex+\"0000\";\n r_out.value=r.value;\n g_out.style.backgroundColor=\"#00\"+g_hex+\"00\";\n g_out.value=g.value;\n b_out.style.backgroundColor=\"#0000\"+b_hex;\n b_out.value=b.value;\n\n hex = \"#\" + pad(r_hex) + pad(g_hex) + pad(b_hex);\n strokeOut.style.backgroundColor=hex;\n}", "function changeDrawingColor(e) {\n fCanvas.freeDrawingBrush.color = e.target.value;\n}", "setColor(color) {\n this.ctx.strokeStyle = color\n }", "function setFill(fill) {\n properties.fillStyle = fill;\n }", "setColor(color){\n\t\tthis.shapeColor = color;\n\t}", "function repleaceSVGFillColor(elem,color)\n{\n\tvar style=elem.attr('style');\n\tstyle=style.replace(/fill\\:\\#\\w{6}/,\"fill:#\"+color);\n\telem.attr(\"style\",style);\n}", "changeColor(color){\n this.circleBasic.set('fill', ColorLuminance(color, -0.1));\n this.circleBasicEtx.set('fill', ColorLuminance(color, 0.1));\n this.text.set({\n fill : ColorLuminance(color, -0.15),\n stroke : ColorLuminance(color, -0.20)\n });\n }", "function setColor(color) {\n\tswitch(color) {\n\t\tcase \"red\":\n\t\t\tcontext.strokeStyle=\"red\";\n\t\t\tbreak;\n\t\tcase \"blue\":\n\t\t\tcontext.strokeStyle=\"blue\";\n\t\t\tbreak;\n\t\tcase \"skyblue\":\n\t\t\tcontext.strokeStyle=\"skyblue\";\n\t\t\tbreak;\n\t\tcase \"gradient\":\n\t\t\tvar gradient = context.createLinearGradient(0,0,500,500);\n\t\t\tgradient.addColorStop(0,\"red\");\n\t\t\tgradient.addColorStop(.5,\"blue\");\n\t\t\tgradient.addColorStop(1,\"skyblue\")\n\t\t\n\t\t\tcontext.strokeStyle = gradient;\n\t\t\tcontext.lineWidth = 1;\n\t\t\tcontext.stroke(0,0,200,500);\n\t\t\tbreak;\n\t}\n\tdrawColorLabel.innerHTML = \"Drawing Color is \" + color;\n}", "set dryColor(value) {}", "function setColoring(func) {\n getColor = func;\n}", "constructor (color) {\n this.color = color\n this.shouldDraw = true\n }", "function butColor(object,color){\n if(String(color)!=\"undefined\"&&String(color)!=\"NaN\")\n if(color[0]>0)\n {\n object.onDraw = fillRect; \n object.fillBrush= object.graphics.newBrush( object.graphics.BrushType.SOLID_COLOR, color );\n object.visible=0;\n object.visible=1;\n }\n\nfunction fillRect(){ \n with( this ) {\ntry{ \n graphics.drawOSControl();\n graphics.rectPath(0,0,size[0]-2,size[1]-2);\n graphics.fillPath(fillBrush);\n }\n catch(err){}\n }\n } \n }", "setColor(r, g, b, a) {\n\n let s = getColorString(r, g, b, a);\n this.ctx.fillStyle = s;\n this.ctx.strokeStyle = s;\n }", "function setColor(n) {\n var n_ = (n === undefined) ? -1 : n;\n //set global var g_fillColor once per query\n g_fillColor = convertNumToColor(n_);\n g_colorNum = n_;\n\n setMarkerClusterStyle();\n}", "set outlineColor(pCol) {\n\t\t//Clean the value\n\t\tpCol = Validate.instance(pCol, Color, null, true);\n\n\t\t//Set the value\n\t\tthis.__Internal__Dont__Modify__.outlineColor = new Color(pCol);\n\t}", "function ChangeColor(){\n selected_object.material.color.setHex(shape_params.color);\n }", "function setColor(){\n\tcolor1.value = \"#FF0000\";\n\tcolor2.value = \"#ffff00\";\n}", "function setConnectionColor(color) {\n\t\tthis.color = color;\n\t\tif (document.getElementById(this.id) != null) {\n\t\t\tdocument.getElementById(this.id).strokeColor = color;\n\t\t}\n\t}", "function changeShapeColor(shape, color)\n\t\t\t{\n\t\t\t\tshape.graphics.clear();\n\t\t\t\tshape.graphics.beginFill(color).drawRect(-50*0.5, -90*0.5, 50, 90);\n\t\t\t}", "setColor(color) { \n this.cells[this.position].style.backgroundColor = color; \n this.color = color; \n }", "function onChangeStrokeColor(txt, color) {\n changeStrokeColor(txt, color)\n draw()\n}", "highlight(color){\r\n let x = this.col * this.size / this.cols + 1\r\n let y = this.row * this.size / this.rows + 1\r\n ctx.fillStyle = color\r\n ctx.fillRect(x,y,this.size/this.cols -5,this.size/this.rows -5)\r\n }", "function setSelectionColor(color) {\n selection.forEach(layer => {\n layer.style.fills = [\n {\n fill: Sketch.Style.FillType.Color,\n color: color,\n },\n ];\n });\n}", "function set_fill_single_color(obj, fillColor) {\n console.log(\"Setting \" + obj + \" to one color of \" + fillColor);\n // can input hex or rgb as \"rgb(34,94,168)\"\n d3.selectAll(\".\" + obj).style(\"fill\", fillColor);\n}", "function changeColor(id, color) {\n document.getElementById(id).style.fill = color; \n}", "function changeColor(id, color) {\n\tdocument.getElementById(id).setAttribute('fill', color)\n}", "function setColor(element, colorString) {\n element.style.fill = colorString;\n }", "setColor(c){\n\t\tthis.color=c;\n\t}", "function color(fill_color){\n var style = [new ol.style.Style({\n stroke: new ol.style.Stroke({\n color: 'black',\n // lineDash: [7,10],\n lineCap: 'butt',\n lineJoin: 'miter',\n width: .6\n }),\n fill: new ol.style.Fill({\n color: fill_color,\n }),\n })];\n return style;\n }", "set colorValue(value) {}", "function setLEDColor(LED, color)\n{\n if((LED != undefined) && (LED != null))\n {\n setStyleSubAttribute(LED, \"fill\", color == \"off\" ? \"#808080\" : color);\n setStyleSubAttribute(LED, \"stroke\", color == \"off\" ? \"#808080\" : color);\n }\n}", "function Color(x, y, size, col){\n this.x=x;\n this.y=y;\n this.size=size;\n this.col=col;\n this.strokeCol = 'black';\n this.click=false;\n}", "function setStroke (d) {\n if (d.acct_type === 'owned') {\n return '#DCDCDC'\n } else {\n return '#4F4F4F'\n }\n }", "setEmpty() {\n this.filled = false;\n this.color = null;\n }", "function symbolPathSetColor(color, innerColor) {\n\t if (this.type !== 'image') {\n\t var symbolStyle = this.style;\n\t\n\t if (this.__isEmptyBrush) {\n\t symbolStyle.stroke = color;\n\t symbolStyle.fill = innerColor || '#fff'; // TODO Same width with lineStyle in LineView.\n\t\n\t symbolStyle.lineWidth = 2;\n\t } else {\n\t symbolStyle.fill = color;\n\t }\n\t\n\t this.markRedraw();\n\t }\n\t }", "constructor () {\n super();\n this.fillColor = '#EE362B';\n this.fillOpacity = 0.7;\n this.fillPattern = undefined;\n this.outlineColor = '#EE362B';\n this.outlineWidth = 1;\n this.outlineDashArray = [1, 0];\n this.type = 'fill';\n return this;\n }", "function setColor() {\n \t\t\t$(this).setPixels({\n\t \t\tx: 260, y: 30,\n\t \t\twidth: 60, height: 40,\n\t \t\t// loop through each pixel\n\t \t\teach: function(px) {\n\t \t\t\tpx.r = rgb_r;\n\t \t\t\tpx.g = rgb_g;\n\t \t\t\tpx.b = rgb_b;\n\t \t\t}\n \t\t\t});\n\t\t}", "setStroke({thickness = 1, cap = 'butt', join = 'miter', miterLimit = 10, color = [0, 0, 0, 0]} = {}) {\n this[_mesh] = null;\n this[_stroke] = stroke({thickness, cap, join, miterLimit});\n this[_strokeColor] = color;\n this[_enableBlend] = color[3] < 1.0;\n }", "selectColor(x, y, wd, ht){\n this.colorSec = this.colorPromedio(x, y, wd, ht);\n if (this.colorG){\n let tempG = this.colorSec.reduce((a, b) => a+b);\n this.colorSec = this.colorSec.map(t => tempG/3);\n }\n this.ctx.fillStyle = 'rgb('+this.colorSec[0]+\n ','+ this.colorSec[1]+\n ','+ this.colorSec[2]+')';\n }", "function changeColor(id, color) {\n\td3.select(id).style(\"fill\", color); \n}", "function setColor() {\n roll.style.backgroundColor = roll.style.backgroundColor == \"green\" ? \"blue\" : \"green\";\n }", "color(...args) {\n let color = args[0];\n if (typeof color == \"string\") {\n ctx.fillStyle = color;\n ctx.strokeStyle = color;\n } else if (typeof color == \"number\") {\n let r = color*255;\n if (args.length >= 4) {\n color = `rgba(${r}, ${args[1]*255}, ${args[2]*255}, ${args[3]})`;\n } else if (args.length == 3) {\n color = `rgb(${r}, ${args[1]*255}, ${args[2]*255})`;\n } else if (args.length == 2) {\n color = `rgba(${r}, ${r}, ${r}, ${args[1]})`;\n } else {\n color = `rgb(${r}, ${r}, ${r})`;\n }\n ctx.fillStyle = color;\n ctx.strokeStyle = color;\n } else if (typeof color == \"object\") {\n draw2D.color.apply(this, color);\n } else {\n ctx.fillStyle = \"white\";\n ctx.strokeStyle = \"white\";\n }\n }", "function fillNET(color){\n // console.log($('._NET_').length);\n $('._NET_').css('fill',color);\n}", "set color(value) {\n this._state.color.set(value || [0.7, 0.7, 0.8]);\n this._renderer.imageDirty();\n }", "function changeColor(id, color) {\r\n /*\r\n / Leslie Dao\r\n / 10561234\r\n /\r\n / Een functie die de kleur van een land verandert in javascript.\r\n / Bron: http://www.w3schools.com/js/js_htmldom_css.asp\r\n */\r\n document.getElementById(id).style.fill = color;\r\n}", "function fillColor() {\n\t$( \"#pixelCanvas\" ).on( \"click\", \"td\", function( evt ) {\n $( evt.target ).css( \"background\", color );\n\t});\n\n\t// Let's have the feature to remove color on right-click\n\t$( \"#pixelCanvas\" ).on( \"contextmenu\", \"td\", function( evt ) {\n\t\tevt.preventDefault();\n $( evt.target ).css( \"background\", \"#ffffff\" );\n\t});\n}", "changeColor() {\n //this.color = \n }", "function fillFn(d) {\n return fill_color[deptPartido(d)];\n }", "function colorsFigure(){\n console.log(color)\n selectedFigure.setColor(color);\n redrawFigures();\n}", "get fillStyle() { return this._.fillStyle; }", "function changeColor(id,color){\n\n if(color == \"special\"){\n $(\"#\"+id).children().each(function() {\n $(this).css( \"stroke\", getRandomColor());\n });\n}\nelse {\n $( \"#\"+id ).children().css( \"stroke\", color);\n}\n}", "fill(color, opacity = 1) {\n var l, x, y;\n if (!this.cleared) {\n this.clear();\n }\n if (opacity !== 1) {\n color = hexToRGBA(color, opacity);\n }\n this.layer.fillStyle = color;\n x = this.getXPixel();\n y = this.getYPixel();\n l = this.getCellLength();\n this.layer.fillRect(x - 0, y - 0, l + 0, l + 0);\n if (config.view.map.cellBorders) {\n this.stroke(config.view.colors.cellBorder);\n }\n return this.cleared = false;\n }", "function symbolPathSetColor(color, innerColor) {\n if (this.type !== 'image') {\n var symbolStyle = this.style;\n\n if (this.__isEmptyBrush) {\n symbolStyle.stroke = color;\n symbolStyle.fill = innerColor || '#fff'; // TODO Same width with lineStyle in LineView\n\n symbolStyle.lineWidth = 2;\n } else if (this.shape.symbolType === 'line') {\n symbolStyle.stroke = color;\n } else {\n symbolStyle.fill = color;\n }\n\n this.markRedraw();\n }\n}", "function selectColor(el){\n for(var i=0;i<document.getElementsByClassName(\"palette\").length;i++){\n document.getElementsByClassName(\"palette\")[i].style.borderColor = \"#777\";\n document.getElementsByClassName(\"palette\")[i].style.borderStyle = \"solid\";\n }\n el.style.borderColor = \"#fff\";\n el.style.borderStyle = \"dashed\";\n color = window.getComputedStyle(el).backgroundColor;\n //ctx.beginPath();\n ctx.strokeStyle = color;\n //ctx.lineWidth = 15;\n}", "changeAnchorColor(anchorDOM, newColor) {\n anchorDOM.attr(\"fill\", newColor)\n }", "function selectColor(myColour){\n\t\n\tcontext.strokeStyle=myColour;\n\tcontext.fillStyle=myColour;\n}", "function handleFill(event) {\n var target = cross_target(event);\n var new_class = target.className;\n getById('fill_sample').className = new_class;\n // Extract the color from the class name, that is like:\n // \"class_sample class_000000\"\n var new_color = '#' + new_class.split(' ')[1].split('_')[1];\n g['shape'].fill = new_color;\n g['shape_generator'].default_values.fill = new_color;\n}", "function colores(color){\r\n\tif(color===\"rojo\"){\r\n\t\treturn \tfill(255, 0, 0);\r\n\t}\r\n\telse if(color === \"azul\"){\r\n\t\treturn \tfill(0, 0, 255);\r\n\t}else if(color===\"verde\"){\r\n\t\treturn \tfill(0, 255, 0);\r\n\t}\r\n\telse if(color===\"morado\"){\r\n\t\treturn \tfill(90, 25, 100);\r\n\t}\r\n}", "function brushColor() {\n if(colorMode == 'custom'){\n var color = document.querySelector('#cor').value;\n return color;\n }\n if(colorMode == 'shape'){\n var color = colorShape;\n return color;\n }\n}", "function setColor(colNr){\r\n currentColor = colNr;\r\n\r\n pixels.children.forEach(pixel => {\r\n pixel.tweenTo({ fillColor: colors[currentColor][pixel.colStep]}, { duration: _.random(200, 1000)});\r\n });\r\n}", "function setColors (n, c) {\n if(n.strokeWidth=='1') { // adding time, cs, dv, nom to a node with no stroke\n n.strokeWidth = '4';\n n.strokeColor = c;\n n.nodeCol = taggedColor;\n if(dvColor==c) {\n // check if array, if not, make it an array\n // console.log(Object.prototype.toString.call(zparams.zdv));\n zparams.zdv = Object.prototype.toString.call(zparams.zdv) == \"[object Array]\" ? zparams.zdv : [];\n zparams.zdv.push(n.name);\n }\n else if(csColor==c) {\n zparams.zcross = Object.prototype.toString.call(zparams.zcross) == \"[object Array]\" ? zparams.zcross : [];\n zparams.zcross.push(n.name);\n }\n else if(timeColor==c) {\n zparams.ztime = Object.prototype.toString.call(zparams.ztime) == \"[object Array]\" ? zparams.ztime : [];\n zparams.ztime.push(n.name);\n }\n else if(nomColor==c) {\n zparams.znom = Object.prototype.toString.call(zparams.znom) == \"[object Array]\" ? zparams.znom : [];\n zparams.znom.push(n.name);\n }\n \n d3.select(\"#tab1\").select(\"p#\".concat(n.name))\n .style('background-color', hexToRgba(c));\n }\n else if (n.strokeWidth=='4') {\n if(c==n.strokeColor) { // deselecting time, cs, dv, nom\n n.strokeWidth = '1';\n n.strokeColor = selVarColor;\n n.nodeCol=colors(n.id);\n d3.select(\"#tab1\").select(\"p#\".concat(n.name))\n .style('background-color', hexToRgba(selVarColor));\n \n if(dvColor==c) {\n var dvIndex = zparams.zdv.indexOf(n.name);\n if (dvIndex > -1) { zparams.zdv.splice(dvIndex, 1); }\n }\n else if(csColor==c) {\n var csIndex = zparams.zcross.indexOf(n.name);\n if (csIndex > -1) { zparams.zcross.splice(csIndex, 1); }\n }\n else if(timeColor==c) {\n var timeIndex = zparams.ztime.indexOf(n.name);\n if (timeIndex > -1) { zparams.ztime.splice(timeIndex, 1); }\n }\n else if(nomColor==c) {\n var nomIndex = zparams.znom.indexOf(n.name);\n if (nomIndex > -1) { zparams.znom.splice(nomIndex, 1); }\n }\n }\n else { // deselecting time, cs, dv, nom AND changing it to time, cs, dv, nom\n if(dvColor==n.strokeColor) {\n var dvIndex = zparams.zdv.indexOf(n.name);\n if (dvIndex > -1) { zparams.zdv.splice(dvIndex, 1); }\n }\n else if(csColor==n.strokeColor) {\n var csIndex = zparams.zcross.indexOf(n.name);\n if (csIndex > -1) { zparams.zcross.splice(csIndex, 1); }\n }\n else if(timeColor==n.strokeColor) {\n var timeIndex = zparams.ztime.indexOf(n.name);\n if (timeIndex > -1) { zparams.ztime.splice(timeIndex, 1); }\n }\n else if(nomColor==n.strokeColor) {\n var nomIndex = zparams.znom.indexOf(n.name);\n if (nomIndex > -1) { zparams.znom.splice(nomIndex, 1); }\n }\n n.strokeColor = c;\n d3.select(\"#tab1\").select(\"p#\".concat(n.name))\n .style('background-color', hexToRgba(c));\n \n if(dvColor==c) {zparams.zdv.push(n.name);}\n else if(csColor==c) {zparams.zcross.push(n.name);}\n else if(timeColor==c) {zparams.ztime.push(n.name);}\n else if(nomColor==c) {zparams.znom.push(n.name);}\n }\n }\n}", "function changeColor(color) {\n\tctx.beginPath();\n\tctx.globalCompositeOperation = \"source-over\";\n\tctx.strokeStyle = color;\n\tctx.stroke();\n}", "function penColor(color) {\n $._setColor(color);\n}", "_updateRootColor() {\n if (!this._styleRootElement) {\n return;\n }\n const rootColor = this.getAttribute(\"color\") || \"green\";\n const style = this._styleRootElement.style;\n style.fill = rootColor;\n style.stroke = rootColor;\n style.color = rootColor;\n }", "function setCandidateColor(){\n\t\tcandidates\n\t\t.transition()\n\t\t.duration(500)\n\t\t.style(\"fill\", function(d){\n\t\t\tif(showPartyColors)\treturn getColor(d.party);\n\t\t\treturn getColor(d.segment)\n\t\t});\n\t}", "function color_node(node) {\n // console.log(\"color_node\");\n if (node.selected) { return \"red\"; }\n else { return fill(node.group);}\n }", "fill() {\n this.movePen(this.bpenx, this.bpeny);\n this.context.fill.apply(this.context, arguments);\n }", "function setColor(mask, pos, color) {\n return mask | (color << (2 * pos))\n }", "function thisFunction(elmnt, clr) {\n elmnt.style.color = clr;\n}", "function recolor() {\n\td3.selectAll(\"rect\").style(\"fill\", function() {\n\t\tvar values = stdSlider.noUiSlider.get();\n\t\tleft = values[0];\n\t\tright = values[1];\n\t\tvar lilval = (Math.floor(backwards(this.x.baseVal.value)));\n\t\treturn colorUp(lilval);\n\t})\n}", "function changeColor(e) {}", "set color(color) {\n this._color = color;\n return this._color;\n }", "fill(v){\tthis.ctx.fillStyle = v; return this; }" ]
[ "0.741192", "0.72955114", "0.7238079", "0.7159115", "0.71136236", "0.7096291", "0.69520766", "0.681445", "0.6811898", "0.6772395", "0.67583734", "0.67560637", "0.67524433", "0.671158", "0.6707232", "0.66953677", "0.668504", "0.6675644", "0.6671853", "0.666045", "0.6658146", "0.6649212", "0.6607844", "0.6578995", "0.6551504", "0.65427303", "0.6515231", "0.6505607", "0.6395314", "0.63616645", "0.63526744", "0.6350532", "0.63379234", "0.63173634", "0.6296115", "0.62960356", "0.6288552", "0.62850624", "0.6279063", "0.62750685", "0.62682647", "0.62637883", "0.6260628", "0.62434834", "0.62372035", "0.62309074", "0.62079436", "0.62073725", "0.62013894", "0.6199453", "0.6198514", "0.61980003", "0.61969745", "0.6193085", "0.6182098", "0.6176472", "0.6173491", "0.61662585", "0.61486864", "0.61439496", "0.6142031", "0.61192936", "0.61192137", "0.6115574", "0.6111007", "0.610518", "0.6079227", "0.6075927", "0.6075797", "0.60752827", "0.60701966", "0.6055912", "0.6051768", "0.60452706", "0.6041564", "0.603678", "0.6027464", "0.6021078", "0.60145056", "0.60062444", "0.6005061", "0.6002884", "0.6002799", "0.59874576", "0.59867245", "0.59801054", "0.5979847", "0.5979526", "0.59730667", "0.5970538", "0.59653246", "0.596054", "0.59587795" ]
0.61857325
61
Rule for validating the type of a value.
function type_type(rule, value, source, errors, options) { if (rule.required && value === undefined) { rule_required(rule, value, source, errors, options); return; } var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex']; var ruleType = rule.type; if (custom.indexOf(ruleType) > -1) { if (!types[ruleType](value)) { errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type)); } // straight typeof check } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : typeof_default()(value)) !== rule.type) { errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t required(rule, value, source, errors, options);\n\t return;\n\t }\n\t\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t } // straight typeof check\n\t\n\t } else if (ruleType && typeof value !== rule.type) {\n\t errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = [\n 'integer',\n 'float',\n 'array',\n 'regexp',\n 'object',\n 'method',\n 'email',\n 'number',\n 'date',\n 'url',\n 'hex',\n ];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(\n format(\n options.messages.types[ruleType],\n rule.fullField,\n rule.type,\n ),\n );\n } // straight typeof check\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(\n format(\n options.messages.types[ruleType],\n rule.fullField,\n rule.type,\n ),\n );\n }\n }", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2[\"default\"])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = [\n 'integer',\n 'float',\n 'array',\n 'regexp',\n 'object',\n 'method',\n 'email',\n 'number',\n 'date',\n 'url',\n 'hex',\n ];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(\n format(options.messages.types[ruleType], rule.fullField, rule.type),\n );\n } // straight typeof check\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(\n format(options.messages.types[ruleType], rule.fullField, rule.type),\n );\n }\n}", "function type(rule, value, source, errors, options) {\n\t\t if (rule.required && value === undefined) {\n\t\t (0, _required2[\"default\"])(rule, value, source, errors, options);\n\t\t return;\n\t\t }\n\t\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t\t var ruleType = rule.type;\n\t\t if (custom.indexOf(ruleType) > -1) {\n\t\t if (!types[ruleType](value)) {\n\t\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t\t }\n\t\t // straight typeof check\n\t\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n\t\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t\t }\n\t\t}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2.default)(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){(0,_required2[\"default\"])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\r\n\t}else if(ruleType&&(typeof value==='undefined'?'undefined':_typeof(value))!==rule.type){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){(0,_required2[\"default\"])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n\t}else if(ruleType&&(typeof value==='undefined'?'undefined':_typeof(value))!==rule.type){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){(0,_required2[\"default\"])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n}else if(ruleType&&(typeof value==='undefined'?'undefined':_typeof(value))!==rule.type){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required.default)(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof2.default)(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2['default'])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2['default'])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2['default'])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format$1(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && (0, _typeof2.default)(value) !== rule.type) {\n errors.push(format$1(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2['default'])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3['default'])(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2['default'])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3['default'])(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(_required__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value)) !== rule.type) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(_required__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value)) !== rule.type) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(_required__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value)) !== rule.type) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(_required__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value)) !== rule.type) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type_type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n rule_required(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : typeof_default()(value)) !== rule.type) {\n errors.push(util[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function typecheck(type, value) {\n var errors = type.validate(value, [{ path: \"\", type: type }])\n if (errors.length > 0) {\n fail(\n \"Error while converting \" +\n prettyPrintValue(value) +\n \" to `\" +\n type.name +\n \"`:\\n\" +\n errors.map(toErrorString).join(\"\\n\")\n )\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\"/* default */])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\"/* format */](options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n}else if(ruleType&&(typeof value==='undefined'?'undefined':__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value))!==rule.type){errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\"/* format */](options.messages.types[ruleType],rule.fullField,rule.type));}}", "function type_type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n rule_required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util_format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : typeof_default()(value)) !== rule.type) {\n errors.push(util_format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "validateValue (value) {\n return TypeNumber.isNumber(value) && !isNaN(value)\n }", "function ValidateTypeValue(type, value)\n{\n\tif (type == \"Bool\")\n\t{\n\t\tif (value != \"true\" && value != \"false\")\n\t\t{\n\t\t\treturn \"default value must be either 'True' or 'False' for Bool\";\n\t\t}\n\t}\n\telse if (type == \"Int\" || type == \"Float\")\n\t{\n\t\tif (isNaN(value))\n\t\t{\n\t\t\treturn \"default value must be digit(s) for Int or Float\";\n\t\t}\n\t}\n\telse\n\t{\n\t\t// everything is fine as a string or custom type\n\t\treturn null;\n\t}\n}", "async validateType(value: mixed) {\n if (value instanceof this.getModelClass()) {\n return;\n }\n this.expected(\"instance of Model class\", typeof value);\n }", "async checkType(value) {\n\t\t\t//C check against each datatype\n\t\t\tfor (let i = 0; i < this.dataTypes.length; i++) {\n\t\t\t\tif (\n\t\t\t\t\t// Quick hack for replacing isType which checks against custom types like 'array' and 'integer'\n\t\t\t\t\ttypeof value === this.dataTypes[i] ||\n\t\t\t\t\t(this.dataTypes[i] === 'array' && Array.isArray(value)) ||\n\t\t\t\t\t(this.dataTypes[i] === 'integer' && Number.isInteger(value))\n\t\t\t\t) {\n\t\t\t\t\treturn new Success({\n\t\t\t\t\t\torigin: `${this.origin}.checkType()`,\n\t\t\t\t\t\tmessage: 'validated data type',\n\t\t\t\t\t\tcontent: value,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t//C parse strings for numbers\n\t\t\t\tif (typeof value === 'string') {\n\t\t\t\t\tlet parsed = Number.parseFloat(value);\n\t\t\t\t\tif (this.dataTypes[i] === 'number' && !Number.isNaN(parsed) \n\t\t\t\t\t|| this.dataTypes[i] === 'integer' && Number.isInteger(parsed)) {\n\t\t\t\t\t\treturn new Success({\n\t\t\t\t\t\t\torigin: `${this.origin}.checkType()`,\n\t\t\t\t\t\t\tmessage: 'validated data type',\n\t\t\t\t\t\t\tcontent: parsed,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t//TODO parse strings for boolean & symbols & other?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//C throw if no matches\n\t\t\tthrow new Err({\n\t\t\t\tlog: true,\n\t\t\t\torigin: `${this.origin}.checkType()`,\n\t\t\t\tmessage: `${this.valueName} must be a ${this.dataTypes.join(' or ')}`,\n\t\t\t\tcontent: value,\n\t\t\t});\n\t\t}", "function check(name, value, type) {\n switch (type) {\n\n case 'object':\n case 'array':\n var stringOfValue = Object.prototype.toString.call(value).toLowerCase();\n if(value !== undefined && stringOfValue !== '[object ' + type + ']') {\n throw new Error('Expecting ' + name + ' to be an ' + type + ', \"' + (stringOfValue) + '\" given');\n }\n break;\n\n case 'string':\n case 'function':\n var typeofValue = typeof value;\n if(value !== undefined && typeOfValue !== type) {\n throw new Error('Expecting ' + name + ' to be a ' + type + ', \"' + (typeOfValue) + '\" given');\n }\n break;\n\n default: // type not specified\n if(value === undefined) {\n throw new Error('Missing \"' + type + '\"');\n }\n }\n}", "'validateValue'(value) {}", "function assertType(value, type) {\n\t\t var valid = void 0;\n\t\t var expectedType = void 0;\n\t\t if (type === String) {\n\t\t expectedType = 'string';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Number) {\n\t\t expectedType = 'number';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Boolean) {\n\t\t expectedType = 'boolean';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Function) {\n\t\t expectedType = 'function';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Object) {\n\t\t expectedType = 'Object';\n\t\t valid = isPlainObject(value);\n\t\t } else if (type === Array) {\n\t\t expectedType = 'Array';\n\t\t valid = Array.isArray(value);\n\t\t } else {\n\t\t expectedType = type.name || type.toString();\n\t\t valid = value instanceof type;\n\t\t }\n\t\t return {\n\t\t valid: valid,\n\t\t expectedType: expectedType\n\t\t };\n\t\t}", "function assertType(value,type){var valid;var expectedType=getType(type);if(expectedType==='String'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='string');}else if(expectedType==='Number'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='number');}else if(expectedType==='Boolean'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='boolean');}else if(expectedType==='Function'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='function');}else if(expectedType==='Object'){valid=isPlainObject(value);}else if(expectedType==='Array'){valid=Array.isArray(value);}else{valid=value instanceof type;}return{valid:valid,expectedType:expectedType};}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "function assertType (value, type) {\n\t var valid\n\t var expectedType = getType(type)\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string')\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number')\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean')\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function')\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value)\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value)\n\t } else {\n\t valid = value instanceof type\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function isValidValue(type: GraphQLType, value: any): boolean {\n if (type instanceof GraphQLNonNull) {\n if (isNullish(value)) {\n return false;\n }\n return isValidValue(type.ofType, value);\n }\n\n if (isNullish(value)) {\n return true;\n }\n\n if (type instanceof GraphQLList) {\n var itemType = type.ofType;\n if (Array.isArray(value)) {\n return value.every(item => isValidValue(itemType, item));\n } else {\n return isValidValue(itemType, value);\n }\n }\n\n if (type instanceof GraphQLInputObjectType) {\n var fields = type.getFields();\n return Object.keys(fields).every(\n fieldName => isValidValue(fields[fieldName].type, value[fieldName])\n );\n }\n\n if (type instanceof GraphQLScalarType ||\n type instanceof GraphQLEnumType) {\n return !isNullish(type.coerce(value));\n }\n\n return false;\n}", "function assertType(value, type) {\n var valid = void 0;\n var expectedType = void 0;\n if (type === String) {\n expectedType = 'string';\n valid = typeof value === expectedType;\n } else if (type === Number) {\n expectedType = 'number';\n valid = typeof value === expectedType;\n } else if (type === Boolean) {\n expectedType = 'boolean';\n valid = typeof value === expectedType;\n } else if (type === Function) {\n expectedType = 'function';\n valid = typeof value === expectedType;\n } else if (type === Object) {\n expectedType = 'Object';\n valid = isPlainObject(value);\n } else if (type === Array) {\n expectedType = 'Array';\n valid = Array.isArray(value);\n } else {\n expectedType = type.name || type.toString();\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n };\n}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function validateValue(validationType, value) {\n\t\t\t\tif (validationType == 'alpha_numeric') {\n\t\t\t\t\t/*\n\t\t\t\t\tvar Exp = /^[0-9a-zA-Z\\s]+$/;\n\t\t\t\t\treturn value.match(Exp);\n\t\t\t\t\t*/\n\t\t\t\t\treturn value;\n\t\t\t\t} else if (validationType == 'email') {\n\t\t\t\t\tvar re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\t\t\t\t\treturn re.test(value);\n\t\t\t\t} else if (validationType == 'numeric') {\n\t\t\t\t\treturn !isNaN(value)\n\t\t\t\t}\n\t\t\t}", "function checkType(type,value){\n\t\t\tif(type){\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\n\t\t\t\t}\n\t\t\t\tif(type instanceof Array){\n\t\t\t\t\tvar unionErrors=[];\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\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\tif(unionErrors.length){\n\t\t\t\t\t\treturn unionErrors;\n\t\t\t\t\t}\n\t\t\t\t}else if(typeof type == 'object'){\n\t\t\t\t\tvar priorErrors = errors;\n\t\t\t\t\terrors = [];\n\t\t\t\t\tcheckProp(value,type,path);\n\t\t\t\t\tvar theseErrors = errors;\n\t\t\t\t\terrors = priorErrors;\n\t\t\t\t\treturn theseErrors;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [];\n\t\t}", "function checkType(type,value){\n\t\t\tif(type){\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\n\t\t\t\t}\n\t\t\t\tif(type instanceof Array){\n\t\t\t\t\tvar unionErrors=[];\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\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\tif(unionErrors.length){\n\t\t\t\t\t\treturn unionErrors;\n\t\t\t\t\t}\n\t\t\t\t}else if(typeof type == 'object'){\n\t\t\t\t\tvar priorErrors = errors;\n\t\t\t\t\terrors = [];\n\t\t\t\t\tcheckProp(value,type,path);\n\t\t\t\t\tvar theseErrors = errors;\n\t\t\t\t\terrors = priorErrors;\n\t\t\t\t\treturn theseErrors;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [];\n\t\t}", "function checkType(type,value){\n\t\t\tif(type){\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\n\t\t\t\t}\n\t\t\t\tif(type instanceof Array){\n\t\t\t\t\tvar unionErrors=[];\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\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\tif(unionErrors.length){\n\t\t\t\t\t\treturn unionErrors;\n\t\t\t\t\t}\n\t\t\t\t}else if(typeof type == 'object'){\n\t\t\t\t\tvar priorErrors = errors;\n\t\t\t\t\terrors = [];\n\t\t\t\t\tcheckProp(value,type,path);\n\t\t\t\t\tvar theseErrors = errors;\n\t\t\t\t\terrors = priorErrors;\n\t\t\t\t\treturn theseErrors;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [];\n\t\t}", "function canUseAsIs(valueType) {\n return valueType === \"string\" ||\n valueType === \"boolean\" ||\n valueType === \"number\" ||\n valueType === \"json\" ||\n valueType === \"math\" ||\n valueType === \"regexp\" ||\n valueType === \"error\";\n }", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}" ]
[ "0.7744373", "0.77012837", "0.7555568", "0.7555568", "0.7555568", "0.7555568", "0.7555568", "0.7555568", "0.7555568", "0.7555568", "0.7555568", "0.7555568", "0.7555568", "0.7555568", "0.7555568", "0.7555349", "0.75483084", "0.75395113", "0.74793196", "0.7477892", "0.7468624", "0.74656826", "0.7427768", "0.7427768", "0.7427768", "0.7427768", "0.7427768", "0.7414868", "0.7413528", "0.7413528", "0.7413528", "0.74016255", "0.7380683", "0.7380683", "0.726935", "0.72521937", "0.72521937", "0.72521937", "0.72521937", "0.72490543", "0.72490543", "0.72490543", "0.72490543", "0.72490543", "0.72490543", "0.72490543", "0.72490543", "0.71888167", "0.71877253", "0.715868", "0.715868", "0.70568115", "0.705521", "0.6753064", "0.6728532", "0.6697933", "0.66947454", "0.65575516", "0.6544572", "0.6500019", "0.64475185", "0.64261764", "0.64261764", "0.64261764", "0.64261764", "0.64261764", "0.64261764", "0.64261764", "0.64261764", "0.64261764", "0.64261764", "0.64261764", "0.64175105", "0.6406919", "0.6373014", "0.63620067", "0.63620067", "0.63620067", "0.63620067", "0.63620067", "0.63620067", "0.63515425", "0.63240767", "0.63240767", "0.63240767", "0.62565726", "0.62537295", "0.62537295", "0.62537295", "0.62537295", "0.62537295", "0.62537295", "0.62537295", "0.62537295" ]
0.7137125
57
Rule for validating a value exists in an enumerable list.
function enumerable(rule, value, source, errors, options) { rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : []; if (rule[ENUM].indexOf(value) === -1) { errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', '))); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contains(list, value) {\n\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(\n format(\n options.messages[ENUM],\n rule.fullField,\n rule[ENUM].join(', '),\n ),\n );\n }\n }", "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util_format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(\n format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')),\n );\n }\n}", "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format$1(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n\t\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t\t if (rule[ENUM].indexOf(value) === -1) {\n\t\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t\t }\n\t\t}", "function enumerable(rule,value,source,errors,options){rule[ENUM]=Array.isArray(rule[ENUM])?rule[ENUM]:[];if(rule[ENUM].indexOf(value)===-1){errors.push(util.format(options.messages[ENUM],rule.fullField,rule[ENUM].join(', ')));}}", "function enumerable(rule,value,source,errors,options){rule[ENUM]=Array.isArray(rule[ENUM])?rule[ENUM]:[];if(rule[ENUM].indexOf(value)===-1){errors.push(util.format(options.messages[ENUM],rule.fullField,rule[ENUM].join(', ')));}}", "function enumerable(rule,value,source,errors,options){rule[ENUM]=Array.isArray(rule[ENUM])?rule[ENUM]:[];if(rule[ENUM].indexOf(value)===-1){errors.push(util.format(options.messages[ENUM],rule.fullField,rule[ENUM].join(', ')));}}", "function contains(list, value, fromIndex = 0) {\r\n if (!Array.isArray(list) && typeof list == \"object\" && list != null) {\r\n //list is an object\r\n //convert to array\r\n var ourValues = Object.values(list);\r\n for (let index = fromIndex; index < ourValues.length; index++) {\r\n let element = ourValues[index];\r\n if (element === value) return true;\r\n }\r\n return false;\r\n }\r\n if (Array.isArray(list)) {\r\n //list is an array\r\n for (let index = fromIndex; index < list.length; index++) {\r\n let element = list[index];\r\n if (element === value) return true;\r\n }\r\n return false;\r\n }\r\n }", "function onList(arr, value) {\n for(var i = 0; i < arr.length; i++) {\n if(arr[i] === value) {\n return true;\n }\n }\n return false;\n}", "function listHas(list, v) {\n\tfor (var i of list) {\n\t\tif (v[0] === i[0] && v[1] === i[1]) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function enumerable(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if(Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\"/* isEmptyValue */])(value)&&!rule.required){return callback();}__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */].required(rule,value,source,errors,options);if(value){__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */][ENUM](rule,value,source,errors,options);}}callback(errors);}", "function contains ( value, list ) {\n\t\tvar isFound = false;\n\t\tvar props = list.split( '|' );\n\t\tfor ( var x = 0; x < props.length; x++ ) {\n\t\t\tif ( value === props[ x ] ) {\n\t\t\t\tisFound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn isFound;\n\t}", "function contains( list, value ) {\n\t\tvar i = list.length;\n\t\twhile ( i-- ) {\n\t\t\tif ( list[ i ] == value ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function inList(val, list) {\n\treturn fold( function(v, acc) {\n\t\treturn acc || v == val;\n\t\t}, false, list);\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "contains(value) {\n //loop through the list again\n let currentNode = this.head;\n while(currentNode.value !== value) {\n currentNode = currentNode.next;\n }\n return currentNode.value === value; //return true if the value is in the list and return false if not\n }", "function checkArrayIncludes(list, valueToCheck) {\r\n for (const item of list) {\r\n if (item === valueToCheck) return true;\r\n }\r\n return false;\r\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function ListContains(list, value) //Function returns true if an item is in a list.\r\n{\r\n\tfor (i = 0; i < list.length; i++)\r\n\t{\r\n\t\tif (list[i] == value)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "contains(value) {\n let current = this.head;\n\n // iterate over the list\n // check value against each node's value\n while (current) {\n if (current.value === value) {\n return true;\n } else {\n current = current.next;\n }\n }\n return false;\n }", "function enumerable$1(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t\n\t if (validate) {\n\t if (isEmptyValue(value) && !rule.required) {\n\t return callback();\n\t }\n\t\n\t rules.required(rule, value, source, errors, options);\n\t\n\t if (value !== undefined) {\n\t rules[ENUM$1](rule, value, source, errors, options);\n\t }\n\t }\n\t\n\t callback(errors);\n\t}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2.default.required(rule, value, source, errors, options);\n if (value) {\n _rule2.default[ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "hasElement() {\n errors.throwNotImplemented(\"getting if value exists in a collection\");\n }", "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2['default'].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2['default'][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2['default'].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2['default'][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "oneOf(list) {\n return this.addValidator({\n message: (value, label) => {\n let printedList = JSON.stringify(list);\n if (list.length > 10) {\n const overflow = list.length - 10;\n printedList = JSON.stringify(list.slice(0, 10)).replace(/]$/, `,…+${overflow} more]`);\n }\n return `Expected ${label} to be one of \\`${printedList}\\`, got \\`${value}\\``;\n },\n validator: value => list.includes(value)\n });\n }", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n\n _rule.default.required(rule, value, source, errors, options);\n\n if (value) {\n _rule.default[ENUM](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enum_enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(util[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value) {\n es_rule[enum_ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate =\n rule.required ||\n (!rule.required && source.hasOwnProperty(rule.field));\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n }", "contains(value) {\n if (this.head.value === value) {\n return true;\n }\n let check = this.head; // stores the value of the current node\n // loop thru list checking the values\n // If value found return true\n // If value not found, go to next node\n while (check !== null) {\n if (check.value === value) {\n return true;\n }\n check = check.next;\n }\n // if value not found by end of list, return false\n return false;\n }", "function ExistsInList(candidate, list)\r{\r result = false; \r for ( i = 0; i < list.length; i++)\r {\r if (candidate == list[i]) {\r result = true;\r break;\r }\r }\r return result;\r}", "function enumerable(rule, value, callback, source, options) {\n\t\t var errors = [];\n\t\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t\t if (validate) {\n\t\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t\t return callback();\n\t\t }\n\t\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t\t if (value) {\n\t\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t\t }\n\t\t }\n\t\t callback(errors);\n\t\t}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}" ]
[ "0.6492287", "0.6353805", "0.6350291", "0.6344891", "0.63385135", "0.63385135", "0.63385135", "0.63385135", "0.63385135", "0.63385135", "0.63385135", "0.63385135", "0.63385135", "0.6337836", "0.632967", "0.632967", "0.632967", "0.632967", "0.632967", "0.632967", "0.632967", "0.632967", "0.632967", "0.632967", "0.632967", "0.632967", "0.632967", "0.6315333", "0.63089716", "0.63089716", "0.63089716", "0.63065326", "0.62867814", "0.6246095", "0.6246095", "0.6246095", "0.61045814", "0.61038584", "0.60824347", "0.6076633", "0.60509634", "0.6025421", "0.60238534", "0.60238534", "0.600888", "0.6001071", "0.6001071", "0.6001071", "0.6001071", "0.6001071", "0.6001071", "0.6001071", "0.6001071", "0.59819204", "0.59819204", "0.59705967", "0.59657717", "0.59657717", "0.59657717", "0.59657717", "0.59657717", "0.59657717", "0.59657717", "0.59657717", "0.5937683", "0.59194064", "0.59143704", "0.59143704", "0.59143704", "0.59143704", "0.5911091", "0.58689684", "0.5850117", "0.584687", "0.5819166", "0.581725", "0.58084506", "0.58084506", "0.5792786", "0.5791119", "0.5787944", "0.5784898", "0.5783088", "0.5776484", "0.5775347", "0.5769296", "0.5769296", "0.5769296", "0.57653177", "0.5765233", "0.5765233", "0.5765233", "0.5765233", "0.576024" ]
0.63200945
33
Validates an enumerable list.
function enum_enumerable(rule, value, callback, source, options) { var errors = []; var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); if (validate) { if (isEmptyValue(value) && !rule.required) { return callback(); } es_rule.required(rule, value, source, errors, options); if (value) { es_rule[enum_ENUM](rule, value, source, errors, options); } } callback(errors); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateList() {\n if (!this.isValid) {\n return;\n }\n\n for (let i = 0; i < this._data.length; i++) {\n const item = this._data[i];\n\n this._validateItem(item);\n }\n }", "function validate(list){\n if (!$.isArray(list)) throw new Error(\"The argument must be an array.\");\n }", "if (type instanceof GraphQLList) {\n const itemType = type.ofType;\n if (isCollection(value)) {\n const errors = [];\n forEach((value: any), (item, index) => {\n errors.push.apply(\n errors,\n isValidJSValue(item, itemType).map(\n error => `In element #${index}: ${error}`,\n ),\n );\n });\n return errors;\n }\n return isValidJSValue(value, itemType);\n }", "function enumerable(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if(Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\"/* isEmptyValue */])(value)&&!rule.required){return callback();}__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */].required(rule,value,source,errors,options);if(value){__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */][ENUM](rule,value,source,errors,options);}}callback(errors);}", "function enumerable(rule,value,source,errors,options){rule[ENUM]=Array.isArray(rule[ENUM])?rule[ENUM]:[];if(rule[ENUM].indexOf(value)===-1){errors.push(util.format(options.messages[ENUM],rule.fullField,rule[ENUM].join(', ')));}}", "function enumerable(rule,value,source,errors,options){rule[ENUM]=Array.isArray(rule[ENUM])?rule[ENUM]:[];if(rule[ENUM].indexOf(value)===-1){errors.push(util.format(options.messages[ENUM],rule.fullField,rule[ENUM].join(', ')));}}", "function enumerable(rule,value,source,errors,options){rule[ENUM]=Array.isArray(rule[ENUM])?rule[ENUM]:[];if(rule[ENUM].indexOf(value)===-1){errors.push(util.format(options.messages[ENUM],rule.fullField,rule[ENUM].join(', ')));}}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util__[\"f\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"isEmptyValue\"])(value) && !rule.required) {\n return callback();\n }\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(\n format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')),\n );\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(\n format(\n options.messages[ENUM],\n rule.fullField,\n rule[ENUM].join(', '),\n ),\n );\n }\n }", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format$1(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util_format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2.default.required(rule, value, source, errors, options);\n if (value) {\n _rule2.default[ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "function enumerable(rule, value, source, errors, options) {\n\t\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t\t if (rule[ENUM].indexOf(value) === -1) {\n\t\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t\t }\n\t\t}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n\n _rule.default.required(rule, value, source, errors, options);\n\n if (value) {\n _rule.default[ENUM](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function validateLists(part, path) {\n const { list } = part;\n if (!list) {\n return;\n }\n\n const listPath = _.concat(path, 'list').join('.');\n if (!_.isPlainObject(list)) {\n return errors.push(`Attribute ${listPath} after transformation must be an object.`);\n }\n\n const listName = list.name;\n const listVal = list.values;\n const listValByName = _.get(appLib.appModelHelpers, ['Lists', listName]);\n\n if (listValByName && listVal) {\n return errors.push(\n `Attribute ${listPath} must have only one source of values for list (either 'name' or 'values')`\n );\n }\n\n if (!list.isDynamicList && !_.isPlainObject(listValByName || listVal)) {\n errors.push(`Attribute ${listPath} must have list values(inlined or referenced) represented as object`);\n }\n }", "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2['default'].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2['default'][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2['default'].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2['default'][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "function enumerable$1(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t\n\t if (validate) {\n\t if (isEmptyValue(value) && !rule.required) {\n\t return callback();\n\t }\n\t\n\t rules.required(rule, value, source, errors, options);\n\t\n\t if (value !== undefined) {\n\t rules[ENUM$1](rule, value, source, errors, options);\n\t }\n\t }\n\t\n\t callback(errors);\n\t}", "function enumerable(rule,value,source,errors,options){rule[ENUM]=Array.isArray(rule[ENUM])?rule[ENUM]:[];if(rule[ENUM].indexOf(value)===-1){errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\"/* format */](options.messages[ENUM],rule.fullField,rule[ENUM].join(', ')));}}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function validateLists(part, path, errors) {\n const { list } = part;\n if (!list) {\n return;\n }\n\n const listPath = _.concat(path, 'list').join('.');\n if (!_.isPlainObject(list)) {\n return errors.push(`Attribute ${listPath} after transformation must be an object.`);\n }\n\n const listName = list.name;\n const listValues = list.values;\n const listReferenceByName = _.get(appLib.appModelHelpers, ['Lists', listName]);\n\n if (listReferenceByName && listValues) {\n return errors.push(\n `Attribute ${listPath} must have only one source of values for list (either 'name' or 'values')`\n );\n }\n\n const isValidListReference = _.isPlainObject(listReferenceByName) || _.isFunction(listReferenceByName);\n if (!list.isDynamicList && !_.isPlainObject(listValues) && !isValidListReference) {\n errors.push(\n `Attribute ${listPath} must have list 'values' represented as object or 'name' referenced to object or function`\n );\n }\n }", "function enumerable(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value)&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(value){_rule2[\"default\"][ENUM](rule,value,source,errors,options);}}callback(errors);}", "function enumerable(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value)&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(value){_rule2[\"default\"][ENUM](rule,value,source,errors,options);}}callback(errors);}", "function enumerable(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value)&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(value){_rule2[\"default\"][ENUM](rule,value,source,errors,options);}}callback(errors);}", "function enumerable(rule, value, callback, source, options) {\n\t\t var errors = [];\n\t\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t\t if (validate) {\n\t\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t\t return callback();\n\t\t }\n\t\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t\t if (value) {\n\t\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t\t }\n\t\t }\n\t\t callback(errors);\n\t\t}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable$1(rule, value, callback, source, options) {\n var errors = [];\n var validate =\n rule.required || (!rule.required && source.hasOwnProperty(rule.field));\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n\t var errors = [];\n\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t if (validate) {\n\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "function validateList(arr) {\n var res = true;\n \n arr.forEach(val => {\n if ( val != 0 && val != 1) {\n res = false;\n }\n });\n \n return res;\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}" ]
[ "0.7411859", "0.7048682", "0.65108424", "0.6466217", "0.6312775", "0.6312775", "0.6312775", "0.6153104", "0.6153104", "0.6153104", "0.6153104", "0.6153104", "0.6153104", "0.6153104", "0.6153104", "0.6084628", "0.6084628", "0.6067205", "0.6067205", "0.6067205", "0.6067205", "0.603881", "0.59961164", "0.59939724", "0.59929615", "0.59929615", "0.59929615", "0.59929615", "0.59929615", "0.59929615", "0.59929615", "0.59910697", "0.59910697", "0.59910697", "0.59910697", "0.59910697", "0.59910697", "0.59910697", "0.59910697", "0.59910697", "0.59910697", "0.59910697", "0.59910697", "0.59910697", "0.59888524", "0.5970005", "0.5968297", "0.5966665", "0.5966665", "0.5966665", "0.5966665", "0.5966665", "0.5966665", "0.5966665", "0.5966665", "0.5966665", "0.59659165", "0.5958615", "0.59113806", "0.59113806", "0.59113806", "0.59025025", "0.5901225", "0.58919126", "0.58857566", "0.5874344", "0.5874344", "0.58704364", "0.5866367", "0.5850467", "0.5850467", "0.5850467", "0.58174133", "0.580519", "0.580519", "0.580519", "0.57943714", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.57832766", "0.5772832", "0.5766736", "0.5758696", "0.5752592", "0.5752592", "0.5752592", "0.5752592", "0.5752592", "0.5717381", "0.5717381" ]
0.0
-1
zoomOnMouseWheel moveOnMouseMove moveOnMouseWheel } The value can be: true / false / 'shift' / 'ctrl' / 'alt'.
function isAvailableBehavior(behaviorToCheck, e, settings) { var setting = settings[behaviorToCheck]; return !behaviorToCheck || setting && (!zrUtil.isString(setting) || e.event[setting + 'Key']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scrollZoom(event){\n event.preventDefault();\n if(event.ctrlKey == true){\n if(event.wheelDelta < 0){\n this.zoomOut();\n }else{\n this.zoomIn();\n }\n }\n }", "function onMove() {\t\t\t\n\t\tWGL.mcontroller.zoommove(map.getZoom(), getTopLeftTC(), WGL.filterByExt);\n}", "function onMove() {\t\t\t\n\t\tWGL.mcontroller.zoommove(map.getZoom(), getTopLeftTC(), WGL.filterByExt);\n}", "onMouseMove($event) {\n this.isMouseMoveCalled = true;\n if ((this.isPanning || this.isMinimapPanning) && this.panningEnabled) {\n this.panWithConstraints(this.panningAxis, $event);\n }\n else if (this.isDragging && this.draggingEnabled) {\n this.onDrag($event);\n }\n }", "get mouseWheelZoom(){\n // getter\n return this.__mouseWheelZoomHandler ? true : false;\n }", "static set niceMouseDeltaZoom(value) {}", "function onDocumentMouseWheel (event) {\n}", "function wheelPanZoom( event ) {\n event = event.originalEvent;\n if ( event.deltaX === 0 && event.deltaY === 0 )\n return false;\n event.preventDefault();\n if ( event.shiftKey )\n return zoom( event.deltaX+event.deltaY > 0 ? 1 : -1, selectedCenter() );\n else {\n var x=0, y=0;\n if ( Math.abs(event.deltaX) > Math.abs(event.deltaY) )\n x = event.deltaX > 0 ? -0.02 : 0.02;\n else\n y = event.deltaY > 0 ? -0.02 : 0.02;\n return pan(x,y);\n }\n }", "function setMouseWheelScrolling(value){\r\n if(value){\r\n addMouseWheelHandler();\r\n addMiddleWheelHandler();\r\n }else{\r\n removeMouseWheelHandler();\r\n removeMiddleWheelHandler();\r\n }\r\n }", "function setMouseWheelScrolling(value){\r\n if(value){\r\n addMouseWheelHandler();\r\n addMiddleWheelHandler();\r\n }else{\r\n removeMouseWheelHandler();\r\n removeMiddleWheelHandler();\r\n }\r\n }", "function setMouseWheelScrolling(value){\r\n if(value){\r\n addMouseWheelHandler();\r\n addMiddleWheelHandler();\r\n }else{\r\n removeMouseWheelHandler();\r\n removeMiddleWheelHandler();\r\n }\r\n }", "function setMouseWheelScrolling(value){\r\n if(value){\r\n addMouseWheelHandler();\r\n addMiddleWheelHandler();\r\n }else{\r\n removeMouseWheelHandler();\r\n removeMiddleWheelHandler();\r\n }\r\n }", "function setMouseWheelScrolling(value){\r\n if(value){\r\n addMouseWheelHandler();\r\n addMiddleWheelHandler();\r\n }else{\r\n removeMouseWheelHandler();\r\n removeMiddleWheelHandler();\r\n }\r\n }", "function setMouseWheelScrolling(value){\n if(value){\n addMouseWheelHandler();\n addMiddleWheelHandler();\n }else{\n removeMouseWheelHandler();\n removeMiddleWheelHandler();\n }\n }", "function setMouseWheelScrolling(value){\n if(value){\n addMouseWheelHandler();\n addMiddleWheelHandler();\n }else{\n removeMouseWheelHandler();\n removeMiddleWheelHandler();\n }\n }", "function setMouseWheelScrolling(value){\n if(value){\n addMouseWheelHandler();\n addMiddleWheelHandler();\n }else{\n removeMouseWheelHandler();\n removeMiddleWheelHandler();\n }\n }", "function setMouseWheelScrolling(value){\n if(value){\n addMouseWheelHandler();\n addMiddleWheelHandler();\n }else{\n removeMouseWheelHandler();\n removeMiddleWheelHandler();\n }\n }", "function setMouseWheelScrolling(value){\n if(value){\n addMouseWheelHandler();\n addMiddleWheelHandler();\n }else{\n removeMouseWheelHandler();\n removeMiddleWheelHandler();\n }\n }", "function setMouseWheelScrolling(value) {\n if (value) {\n addMouseWheelHandler();\n addMiddleWheelHandler();\n } else {\n removeMouseWheelHandler();\n removeMiddleWheelHandler();\n }\n }", "function setMouseWheelScrolling(value) {\n if (value) {\n addMouseWheelHandler();\n addMiddleWheelHandler();\n } else {\n removeMouseWheelHandler();\n removeMiddleWheelHandler();\n }\n }", "mouseWheel(event) {\r\n\t\tthis.zooming(this.zoom *pow(this.zoomingRate, -event.delta), mouseX, mouseY);\r\n\t}", "function mousewheel() {\n start.apply(this, arguments);\n if (!d3_v3_behavior_zoomZooming) d3_v3_behavior_zoomZooming = d3_v3_behavior_zoomLocation(d3_v3.svg.mouse(d3_v3_behavior_zoomTarget));\n d3_v3_behavior_zoomTo(d3_v3_behavior_zoomDelta() + xyz[2], d3_v3.svg.mouse(d3_v3_behavior_zoomTarget), d3_v3_behavior_zoomZooming);\n }", "function mousewheel() {\n start.apply(this, arguments);\n if (!d3_behavior_zoomZooming) d3_behavior_zoomZooming = d3_behavior_zoomLocation(d3.svg.mouse(d3_behavior_zoomTarget));\n d3_behavior_zoomTo(d3_behavior_zoomDelta() + xyz[2], d3.svg.mouse(d3_behavior_zoomTarget), d3_behavior_zoomZooming);\n }", "function handleMouseWheel(shell, ev) {\n var scale = 1\n switch(ev.deltaMode) {\n case 0: //Pixel\n scale = 1\n break\n case 1: //Line\n scale = 12\n break\n case 2: //Page\n scale = shell.height\n break\n }\n //Add scroll\n shell.scroll[0] += ev.deltaX * scale\n shell.scroll[1] += ev.deltaY * scale\n shell.scroll[2] += (ev.deltaZ * scale)||0.0\n return false\n}", "zoomIn () {}", "function onDocumentMouseWheel(event) {\n \n\n if (event.deltaY < 0) { \n camera.zoom *= 1.25;\n };\n \n if (event.deltaY > 0) { \n if (camera.zoom > 0.1)\n camera.zoom /= 1.25;\n };\n camera.updateProjectionMatrix();\n\n}", "function handleWheel(delta, event) {\n\n QMouse.isMouseWheel = true;\n\n // Update Mouse Position\n QMouse.X = event.offsetX | event.layerX;\n QMouse.Y = event.offsetY | event.layerY;\n\n QMouse.wheelDelta = delta;\n if (0 < delta)\n $('#zoom-control-up img').click();\n\n if (0 > delta)\n $('#zoom-control-down img').click();\n\n QMouse.isMouseWheel = false;\n QMouse.wheelDelta = 0;\n }", "handleMouseMove({offsetX,offsetY}){\n // Update last mouse position only when scroll out\n if(this.state.zoom === MAP_LIMITS.ZOOM.MIN){\n this.setState({\n cursorX: offsetX,\n cursorY: offsetY\n });\n }\n }", "function canvasMouseWheelEv(event) {\n event.preventDefault(); // Scale_move tool need to be activated\n\n if (this.scope.tool !== this.scale_move_tool) return;\n\n if (!this.left_control_active) {\n // Zooming\n var speed = 1.75;\n var oldZoom = this.scope.view.zoom;\n var newZoom = this.scope.view.zoom * (event.deltaY < 0 ? speed : 1.0 / speed); // Move view center toward mouse position (zoom to mouse position)\n\n var canvasMousePosition = new paper.Point(event.offsetX, event.offsetY); //viewToProject: gives the coordinates in the Project space from the Screen Coordinates\n\n var viewMousePosition = this.scope.view.viewToProject(canvasMousePosition);\n\n if (!this.scope.view.zoom_animation.on && !this.scope.view.translate_animation.on) {\n this.scope.view.zoom_animation.reset();\n this.scope.view.zoom_animation.start_zoom = oldZoom;\n this.scope.view.zoom_animation.end_zoom = newZoom;\n this.scope.view.zoom_animation.center = viewMousePosition;\n this.scope.view.zoom_animation.p = 3;\n this.scope.view.zoom_animation.total_time = 0.3;\n this.scope.view.zoom_animation.on = true;\n }\n }\n}", "function zoom_defaultFilter() {\n return !on_event.ctrlKey && !on_event.button;\n}", "drag_rezoom(mouse_event) {\n const aY = mouse_event.clientY;\n this.state[\"zoom_val\"] = (\n this.drag_state[\"zoom\"][\"zoom_val_start\"]*Math.pow(\n 1.1, -(aY - this.drag_state[\"zoom\"][\"mouse_start\"][1])/10\n )\n );\n this.rezoom(this.drag_state[\"zoom\"][\"mouse_start\"][0], this.drag_state[\"zoom\"][\"mouse_start\"][1]);\n }", "function wheelZoom(e){\n var evt=window.event || e;//equalize event object\n var delta=evt.detail? evt.detail*(-120) : evt.wheelDelta; //delta returns +120 when wheel is scrolled up, -120 when scrolled down\n //console.log(\"Wheel Zoom\");\n //console.log(zoom);\n\n if(typeof(delta) === 'number'){\n zoom = zoom + parseInt(delta/12);\n }\n // console.log(zoom);\n\n if(zoom < 80){\n zoom = 80;\n }\n if(zoom > 400){\n zoom = 400;\n }\n if (evt.preventDefault) {//disable default wheel action of scrolling page\n evt.preventDefault();\n }else{\n return false;\n }\n setMatrix();\n drawWorld();\n}", "function setMouseHijack(value){\n if(value){\n setMouseWheelScrolling(true);\n addTouchHandler();\n }else{\n setMouseWheelScrolling(false);\n removeTouchHandler();\n }\n }", "function setMouseHijack(value){\n if(value){\n setMouseWheelScrolling(true);\n addTouchHandler();\n }else{\n setMouseWheelScrolling(false);\n removeTouchHandler();\n }\n }", "function setMouseHijack(value){\n if(value){\n setMouseWheelScrolling(true);\n addTouchHandler();\n }else{\n setMouseWheelScrolling(false);\n removeTouchHandler();\n }\n }", "function setMouseHijack(value){\r\n if(value){\r\n setMouseWheelScrolling(true);\r\n addTouchHandler();\r\n }else{\r\n setMouseWheelScrolling(false);\r\n removeTouchHandler();\r\n }\r\n }", "manualZoom(shouldZoomIn) {\n if (shouldZoomIn && this.zoom.value < this.zoom.max) {\n this.zoom.vel.value += this.zoom.vel.change.scroll;\n return;\n }\n\n if (this.zoom.value > this.zoom.min) {\n this.zoom.vel.value -= this.zoom.vel.change.scroll;\n }\n }", "toggleZoomPan () {\n this.isZoomPan = !this.isLayout1d ? !this.isZoomPan : false;\n }", "function setMouseHijack(value) {\n if (value) {\n setMouseWheelScrolling(true);\n addTouchHandler();\n } else {\n setMouseWheelScrolling(false);\n removeTouchHandler();\n }\n }", "mousewheel_handle(e) {\n // Test if mousewheel option is enabled and Ctrl key is pressed.\n if (!this.options.default_event_handle['enable_mousewheel_handle'] || !e.ctrlKey) {\n return;\n }\n var evt = e || event;\n // Avoid default page scrolling behavior.\n evt.preventDefault();\n\n if (evt.deltaY < 0) {\n this.view.zoom_in(evt); // wheel down\n } else {\n this.view.zoom_out(evt);\n }\n }", "function zoomdrag(chx_id, lb_id){\n map.removeInteraction(draw);\n document.getElementById(\"map\").className = \"map\";\n if (chx_id.checked == false){\n //Unchecked by the user, then disable the interaction\n document.getElementById(\"map\").style.cursor = \"default\";\n if(boxInteraction){\n boxInteraction.setActive(false);\n }\n }else {\n //Now the DragZoom doesn't need press shift to activate\n document.getElementById(\"map\").style.cursor = \"zoom-in\";\n boxInteraction = new ol.interaction.DragZoom({\n condition: ol.events.condition.noModifierKeys\n });\n map.addInteraction(boxInteraction);\n //Always check the buttons are ok\n toggle_buttons(chx_id, lb_id);\n }\n}", "function canvasMouseWheel(e){\r\n\tif(!e) e = window.event;\r\n\tif(useStates){\r\n\t\tStates.current().input.mouseWheel(e);\r\n\t}\r\n\tgInput.mouseWheel(e);\r\n}", "mouseMove(mousePos, mapSize, mapPos, scale, tileSize=32) {\n const newPos = this.getTilePos(mousePos, mapSize, mapPos, scale, tileSize);\n this.socket.emit('move', newPos);\n }", "function handleScroll(value) {\n\t// if(originX >= 0) {\n\t// \ttranslatePos.x = mouseX - originX;\n\t// }else{\n\t// \ttranslatePos.x = mouseX + Math.abs(originX);\n\t// }\n\n\t// if(originY >= 0) {\n\t// \ttranslatePos.y = mouseY - originY;\n\t// }else{\n\t// \ttranslatePos.y = mouseY + Math.abs(originY);\n\t// }\n\n\tif(value == -3 || value == -100) { //zoom in\n\t\tif(scaleFactor < 2.5) {\n\t\t\tscaleFactor += 0.1;\n\t\t\t// translatePos.x = (mouseX-originX)/scaleFactor;\n\t\t\t// translatePos.y = (mouseY-originY)/scaleFactor;\n\t\t\ttranslatePos.x = mouseX;\n\t\t\ttranslatePos.y = mouseY;\n\t\t\t// translatePos.x *= scaleFactor;\n\t\t\t// translatePos.y *= scaleFactor;\n\t\t\tzoom(scaleFactor, translatePos);\n\t\t\ttranslatePos.x = -((scaleFactor*translatePos.x)-translatePos.x);\n\t\t\ttranslatePos.y = -((scaleFactor*translatePos.y)-translatePos.y);\n\t\t\toriginX = translatePos.x;\n\t\t\toriginY = translatePos.y;\n\t\t\ttrackTransforms(translatePos.x, translatePos.y, translatePos.x+(scaleFactor*canvas.width), translatePos.y+(scaleFactor*canvas.height));\n\t\t}\n\t}else if(value == 3 || value == 100) { //zoom out\n\t\tif(scaleFactor > 1) {\n\t\t\tscaleFactor -= 0.1;\n\t\t\t// translatePos.x = (mouseX-originX)/scaleFactor;\n\t\t\t// translatePos.y = (mouseY-originY)/scaleFactor;\n\t\t\ttranslatePos.x = mouseX;\n\t\t\ttranslatePos.y = mouseY;\n\t\t\t// translatePos.x *= scaleFactor;\n\t\t\t// translatePos.y *= scaleFactor;\n\t\t\tzoom(scaleFactor, translatePos);\n\t\t\ttranslatePos.x = -((scaleFactor*translatePos.x)-translatePos.x);\n\t\t\ttranslatePos.y = -((scaleFactor*translatePos.y)-translatePos.y);\n\t\t\toriginX = translatePos.x; //autes oi 2 grammes kwdika prepei na einai askopes\n\t\t\toriginY = translatePos.y;\n\t\t\ttrackTransforms(translatePos.x, translatePos.y, translatePos.x+(scaleFactor*canvas.width), translatePos.y+(scaleFactor*canvas.height));\n\t\t}\n\t}\n}", "function scrollWheel(e)\n{\n if (e.deltaY < 0)\n zoomValue = Math.min(zoomValue + 100, 1600);\n else if (e.deltaY > 0)\n zoomValue = Math.max(zoomValue - 100, 300);\n\n if (e.deltaY != 0)\n updateZoom();\n}", "function zoom () {\r\n if (zoomAllowed) {\r\n d3.event.preventDefault()\r\n var dy = +d3.event.wheelDeltaY\r\n var sign = dy < 0 ? -1 : +1\r\n dy = Math.pow(Math.abs(dy), 1.4) * sign\r\n\r\n if (timeWindow + dy > 10 * 1000) {\r\n timeWindow += dy\r\n } else {\r\n timeWindow = 10 * 1000\r\n }\r\n }\r\n step()\r\n }", "bindMouseEvent () {\n document.addEventListener(\"mousewheel\", (event) => {\n this.direction = event.wheelDelta < 0\n this.changeSlide()\n })\n document.addEventListener(\"DOMMouseScroll\", (event) => {\n this.direction = event.detail == 3 \n this.changeSlide()\n })\n }", "setMouseWheel(_state) {\n this.events.mouseWheel = _state;\n this.setEvents();\n return this;\n }", "function _mouseWheelHandler(e) {\n // cross-browser wheel delta\n var e = window.event || e; // old IE support\n var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n\n // adjusts the camera zoom by the delta,\n // either + or - 1\n _cameraZoomAdjustment( delta*0.01 );\n\n return false;\n }", "function mouseMove() {\n /* jshint validthis: true */ // `this` is the D3 svg object\n var m = d3.mouse(this);\n zoomHandler.center([\n m[0] - layoutOffset[0] - margin.left,\n m[1] - layoutOffset[1] - margin.top]);\n }", "function onMouseWheel(event3D) {\n if (!that.userZoom) {\n return;\n }\n\n var event = event3D.domEvent;\n // wheelDelta --> Chrome, detail --> Firefox\n var delta;\n if (typeof (event.wheelDelta) !== 'undefined') {\n delta = event.wheelDelta;\n } else {\n delta = -event.detail;\n }\n if (delta > 0) {\n that.zoomIn();\n } else {\n that.zoomOut();\n }\n\n this.showAxes();\n }", "function setZoom(e) {\n // Scaling ratio\n if (window.gsc) {\n window.gsc *= Math.pow(0.9, e.wheelDelta / - 120 || e.detail / 2 || 0);\n window.desired_gsc = window.gsc;\n }\n }", "function onMouseMove(event) {\n\tpuzzle.mouseMove(event.point, event.delta);\n\n\tif (event.point.x < scrollMargin) {\n\t\tscrollVector = new Point(scrollMargin - event.point.x, 0);\n\t}\n\telse {\n\t\tscrollVector = new Point(0, 0);\n\t}\n}", "zoomOut () {}", "onMinimapDragMouseDown() {\n this.isMinimapPanning = true;\n }", "function zoomedxy(){\n if(x_scaling_on) zoomedx();\n if(y_scaling_on) zoomedy();\n translate_ticks();\n }", "function onDocumentMouseScroll(event) {\n\n if (Date.now() - lastMouseWheelStep > 600) {\n\n lastMouseWheelStep = Date.now();\n\n var delta = event.detail || -event.wheelDelta;\n if (delta > 0) {\n navigateNext();\n }\n else {\n navigatePrev();\n }\n\n }\n\n }", "function bindShortcuts() {\n // Arrow keys\n jQuery(document).bind('keydown', 'right', function(e) {\n e.preventDefault();\n _renderer.scrollRight();\n });\n\n jQuery(document).bind('keydown', 'left', function(e) {\n e.preventDefault();\n _renderer.scrollLeft();\n });\n\n jQuery(document).bind('keydown', 'up', function(e) {\n e.preventDefault();\n _renderer.scrollUp();\n });\n\n jQuery(document).bind('keydown', 'down', function(e) {\n e.preventDefault();\n _renderer.scrollDown();\n });\n\n // Vi like browsing.\n jQuery(document).bind('keydown', 'j', function() {\n _renderer.scrollRight();\n });\n\n jQuery(document).bind('keydown', 'h', function() {\n _renderer.scrollLeft();\n });\n\n jQuery(document).bind('keydown', 'k', function() {\n _renderer.scrollUp();\n });\n\n jQuery(document).bind('keydown', 'l', function() {\n _renderer.scrollDown();\n });\n\n // Page ups and downs using ctrl + arrow keys\n jQuery(document).bind('keydown', 'ctrl+up', function() {\n _renderer.pageUp();\n });\n\n jQuery(document).bind('keydown', 'ctrl+down', function() {\n _renderer.pageDown();\n });\n\n jQuery(document).bind('keydown', 'ctrl+left', function() {\n _renderer.pageLeft();\n });\n\n jQuery(document).bind('keydown', 'ctrl+right', function() {\n _renderer.pageRight();\n });\n \n jQuery(document).bind('keydown', 'i', function() {\n console.log('zoom in');\n _renderer.zoomIn();\n });\n\n jQuery(document).bind('keydown', 'o', function() {\n console.log('zoom out');\n _renderer.zoomOut();\n });\n\n _elem.mousewheel(function(event, delta) {\n var scrollLeft, scrollRight, scrollUp, scrollRight;\n\n if (event.ctrlKey) {\n // If ctrl key is down, we scroll by page.\n scrollLeft = _renderer.pageLeft;\n scrollRight = _renderer.pageRight;\n // If shift key is down, we do horizontal scroll instead of vertical.\n scrollDown = (event.shiftKey) ? _renderer.pageRight : _renderer.pageDown;\n scrollUp = (event.shiftKey) ? _renderer.pageLeft : _renderer.pageUp;\n } else {\n scrollLeft = _renderer.scrollLeft;\n scrollRight = _renderer.scrollRight;\n // If shift key is down, we do horizontal scroll instead of vertical.\n scrollDown = (event.shiftKey) ? _renderer.scrollRight : _renderer.scrollDown;\n scrollUp = (event.shiftKey) ? _renderer.scrollLeft : _renderer.scrollUp;\n }\n \n // Is mouse wheel scrolled horizontally?\n if (event.originalEvent.wheelDeltaX > 0) {\n scrollLeft();\n } else if (event.originalEvent.wheelDeltaX < 0) {\n scrollRight();\n }\n\n // Is mouse wheel scrolled vertically?\n if (event.originalEvent.wheelDeltaY > 0) {\n scrollUp();\n } else if (event.originalEvent.wheelDeltaY < 0) {\n scrollDown();\n }\n });\n }", "function handleMouseWheel(e) {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n var zoomDelta = parseInt(e.deltaY) / 10\r\n zoomlevel = parseInt(zoomlevel)\r\n zoomlevel = zoomlevel + zoomDelta / 10\r\n\r\n log(\"zoomDelta: \" + zoomDelta.toString())\r\n log(\"zoomlevel: \" + zoomlevel.toString())\r\n\r\n if (zoomlevel >= 400) {\r\n zoomlevel = 400\r\n log(\"Full Zoom\")\r\n } else if (zoomlevel <= 5) {\r\n zoomlevel = 5\r\n log(\"Full Zoom\")\r\n }\r\n $(\"#myRange\").eq(0).val(zoomlevel)\r\n recalc()\r\n}", "function zoom(event) {\n event.preventDefault();\n scale += event.deltaY * -0.001;\n scale = Math.min(Math.max(.5, scale), 2);\n wheel.style.transform = `scale(${scale})`;\n }", "handleOuterMousewheel (event) {\n // Prevent scrolling of the background\n event.preventDefault()\n event.stopPropagation()\n\n const xThreshold = WHEEL_MOVE_X_THRESHOLD\n let actionDelay = 0\n const imageMoveDelay = 500\n\n this.clearTimeout(this.resetScrollTimeout)\n this.resetScrollTimeout = this.setTimeout(() => {\n this.scrollX = 0\n this.scrollY = 0\n }, 300)\n\n // Prevent rapid-fire zoom behavior\n if (this.wheelActionTimeout !== null || this.isAnimating()) {\n return\n }\n\n if (Math.abs(event.deltaY) < Math.abs(event.deltaX)) {\n // handle horizontal scrolls with image moves\n this.scrollY = 0\n this.scrollX += event.deltaX\n\n const bigLeapX = xThreshold / 2\n // If the scroll amount has accumulated sufficiently, or a large leap was taken\n if (this.scrollX >= xThreshold || event.deltaX >= bigLeapX) {\n // Scroll right moves to next\n this.requestMoveNext(event)\n actionDelay = imageMoveDelay\n this.scrollX = 0\n } else if (this.scrollX <= -1 * xThreshold || event.deltaX <= -1 * bigLeapX) {\n // Scroll left moves to previous\n this.requestMovePrev(event)\n actionDelay = imageMoveDelay\n this.scrollX = 0\n }\n }\n\n // Allow successive actions after the set delay\n if (actionDelay !== 0) {\n this.wheelActionTimeout = this.setTimeout(() => {\n this.wheelActionTimeout = null\n }, actionDelay)\n }\n }", "DOMMouseScroll(evt) {\n this.fire(MouseWheelEvent, evt);\n }", "function zoomIn(key, modifiers) {\n\n if ((key === 107 || key === 187 || key === 171 || key === 61) && isCmd(modifiers)) {\n editorActions.trigger('stepZoom', { value: 1 });\n\n return true;\n }\n }", "function zoomDefault(key, modifiers) {\n\n if ((key === 96 || key === 48) && isCmd(modifiers)) {\n editorActions.trigger('zoom', { value: 1 });\n\n return true;\n }\n }", "function wheel(event) {\n\n var delta = 0;\n // Indicates that zoom has been 'activated'.\n TFplanner.grid.zoomed = true;\n\n /* For IE. */\n if (!event) {\n event = window.event;\n }\n /* IE/Opera. */\n if (event.wheelDelta) { \n delta = event.wheelDelta/120;\n\n /** Mozilla case. */\n } else if (event.detail) { \n /** In Mozilla, sign of delta is different than in IE.\n * Also, delta is multiple of 3.\n */\n delta = -event.detail/3;\n }\n /** If delta is nonzero, handle it.\n * Basically, delta is now positive if wheel was scrolled up,\n * and negative, if wheel was scrolled down.\n */\n if (delta) {\n TFplanner.grid.handle(delta);\n }\n \n /** Prevent default actions caused by mouse wheel.\n * That might be ugly, but we handle scrolls somehow\n * anyway, so don't bother here..\n */\n if (event.preventDefault) {\n event.preventDefault();\n }\n \n event.returnValue = false;\n }", "function changeZoomHandler(event) {\n if(event.target.value == '.25') {\n map.setZoom(18);\n }\n else if(event.target.value == '.5') {\n map.setZoom(17);\n }\n else if(event.target.value == '1') {\n map.setZoom(16);\n }\n}", "handleOuterMousewheel(event) {\n // Prevent scrolling of the background\n event.stopPropagation();\n\n const xThreshold = WHEEL_MOVE_X_THRESHOLD;\n let actionDelay = 0;\n const imageMoveDelay = 500;\n\n this.clearTimeout(this.resetScrollTimeout);\n this.resetScrollTimeout = this.setTimeout(() => {\n this.scrollX = 0;\n this.scrollY = 0;\n }, 300);\n\n // Prevent rapid-fire zoom behavior\n if (this.wheelActionTimeout !== null || this.isAnimating()) {\n return;\n }\n\n if (Math.abs(event.deltaY) < Math.abs(event.deltaX)) {\n // handle horizontal scrolls with image moves\n this.scrollY = 0;\n this.scrollX += event.deltaX;\n\n const bigLeapX = xThreshold / 2;\n // If the scroll amount has accumulated sufficiently, or a large leap was taken\n if (this.scrollX >= xThreshold || event.deltaX >= bigLeapX) {\n // Scroll right moves to next\n this.requestMoveNext(event);\n actionDelay = imageMoveDelay;\n this.scrollX = 0;\n } else if (\n this.scrollX <= -1 * xThreshold ||\n event.deltaX <= -1 * bigLeapX\n ) {\n // Scroll left moves to previous\n this.requestMovePrev(event);\n actionDelay = imageMoveDelay;\n this.scrollX = 0;\n }\n }\n\n // Allow successive actions after the set delay\n if (actionDelay !== 0) {\n this.wheelActionTimeout = this.setTimeout(() => {\n this.wheelActionTimeout = null;\n }, actionDelay);\n }\n }", "function zoom() {\n this\n .on(\"mousedown.zoom\", mousedown)\n .on(\"mousewheel.zoom\", mousewheel)\n .on(\"mousemove.zoom\", mousemove)\n .on(\"DOMMouseScroll.zoom\", mousewheel)\n .on(\"dblclick.zoom\", dblclick)\n .on(\"touchstart.zoom\", touchstart)\n .on(\"touchmove.zoom\", touchmove)\n .on(\"touchend.zoom\", touchstart);\n }", "zoomInOrOut() {\n //console.log('Muhahahaha');\n let vm = this;\n let {$document} = vm.DI();\n //Mouse wheel event\n let lens = $document[0].getElementById(\"lens\");\n angular.element(lens).on(\"wheel\", function (e) {\n e.preventDefault();\n //console.log(\"V M : \", vm);\n //console.log(\"Mouse Wheeled ..........................!!!!!!!!!!!!!!!!!!!!!!!1\", e.deltaX, e.deltaY);\n //console.log(\"z index before :\", vm.zoomIndex);\n if (e.deltaY > 0) {\n vm.zoomIndex++;\n //console.log(\"z index :\", vm.zoomIndex);\n } else {\n vm.zoomIndex--;\n //console.log(\"z index :\", vm.zoomIndex);\n }\n vm.enlarge();\n });\n /*if (lens.addEventListener) {\n // IE9, Chrome, Safari, Opera\n lens.addEventListener(\"mousewheel\", vm._mouseWheelHandler(vm), false);\n // Firefox\n lens.addEventListener(\"DOMMouseScroll\", vm._mouseWheelHandler, false);\n }\n // IE 6/7/8\n else lens.attachEvent(\"onmousewheel\", vm._mouseWheelHandler);*/\n }", "function themeMouseMove() {\n screen_has_mouse = true;\n }", "static get niceMouseDeltaZoom() {}", "onMinimapPanTo(event) {\n let x = event.offsetX - (this.dims.width - (this.graphDims.width + this.minimapOffsetX) / this.minimapScaleCoefficient);\n let y = event.offsetY + this.minimapOffsetY / this.minimapScaleCoefficient;\n this.panTo(x * this.minimapScaleCoefficient, y * this.minimapScaleCoefficient);\n this.isMinimapPanning = true;\n }", "mouseMove(prev, pt) {}", "function ZoomTheMap(action) {\n var zoom = geeMap.zoom;\n var newZoom;\n if ((action == 'out') && (zoom > 1)) {\n if (zoom == null || zoom == undefined) {\n zoom = 1;\n }\n newZoom = zoom - 1;\n geeMap.setZoom(newZoom);\n }\n if ((action == 'in') && (zoom < 24)) {\n if (zoom == null || zoom == undefined) {\n zoom = 24;\n }\n newZoom = zoom + 1;\n geeMap.setZoom(newZoom);\n }\n}", "on_mouse_move() {\n clearTimeout(this.focus_timeout);\n this.focus_timeout = this.create_focus_timeout();\n this.change_focus(true);\n }", "function mapMouseMove(event) {\n var x, y, mouseX, mouseY;\n x = parseInt($(\"#map\")[0].style.marginLeft);\n y = parseInt($(\"#map\")[0].style.marginTop);\n mouseX = event.clientX;\n mouseY = event.clientY;\n if (event.buttons == 0) {\n if (mouseX < 50) moveByX = 15 + (50 - mouseX);\n else if (mouseX > windowW - 50) moveByX = -15 + (windowW - 50 - mouseX);\n else moveByX = 0;\n\n if (mouseY < (50 + 35)) moveByY = 15 + (50 + 35 - mouseY);\n else if (mouseY > windowH + 35 - 50) moveByY = -15 + (windowH + 35 - 50 - mouseY);\n else moveByY = 0;\n }\n if (event.preventDefault) event.preventDefault();\n else event.returnValue = false;\n if (event.buttons != 1) {\n return false;\n }\n x += (mouseX - mapX);\n y += (mouseY - mapY);\n mapMove(x, y);\n mapX = mouseX;\n mapY = mouseY;\n event.stopPropagation();\n return false;\n}", "function setMapControl(mapName){\n\t\t\tmapName.scrollWheelZoom.disable();\n\t\t\tmapName.on('focus', () => { mapName.scrollWheelZoom.enable(); });\n\t\t\tmapName.on('blur', () => { mapName.scrollWheelZoom.disable(); });\n\t}", "function handleZoom() {\n hotkeys('command+=, command+-', function (event, handler) {\n switch (handler.key) {\n case \"command+=\":\n terminalMargin += .15;\n terminalFontSize += .2;\n break;\n case \"command+-\":\n terminalMargin -= .15;\n terminalFontSize -= .2;\n break;\n }\n $('#terminalFont').text('.terminal-output, .cmd {font-size:' + terminalFontSize + 'px;}');\n $('#terminalMargin').text('.terminal div {margin-bottom:' + terminalMargin + 'px;}');\n });\n}", "onZoom($event, direction) {\n if (this.enableTrackpadSupport && !$event.ctrlKey) {\n this.pan($event.deltaX * -1, $event.deltaY * -1);\n return;\n }\n const zoomFactor = 1 + (direction === 'in' ? this.zoomSpeed : -this.zoomSpeed);\n // Check that zooming wouldn't put us out of bounds\n const newZoomLevel = this.zoomLevel * zoomFactor;\n if (newZoomLevel <= this.minZoomLevel || newZoomLevel >= this.maxZoomLevel) {\n return;\n }\n // Check if zooming is enabled or not\n if (!this.enableZoom) {\n return;\n }\n if (this.panOnZoom === true && $event) {\n // Absolute mouse X/Y on the screen\n const mouseX = $event.clientX;\n const mouseY = $event.clientY;\n // Transform the mouse X/Y into a SVG X/Y\n const svg = this.chart.nativeElement.querySelector('svg');\n const svgGroup = svg.querySelector('g.chart');\n const point = svg.createSVGPoint();\n point.x = mouseX;\n point.y = mouseY;\n const svgPoint = point.matrixTransform(svgGroup.getScreenCTM().inverse());\n // Panzoom\n this.pan(svgPoint.x, svgPoint.y, true);\n this.zoom(zoomFactor);\n this.pan(-svgPoint.x, -svgPoint.y, true);\n }\n else {\n this.zoom(zoomFactor);\n }\n }", "function _mwt(){\n mousewheelTimeout=setTimeout(function(){\n if(!$.event.special.mousewheel){\n _mwt();\n }else{\n clearTimeout(mousewheelTimeout);\n _mousewheel.call($this[0]);\n }\n },100);\n }", "function pan() {\n\t\tvar range = 0.12,\n\t\t\trangeX = window.innerWidth * range,\n\t\t\trangeY = window.innerHeight * range,\n\t\t\tscrollOffset = getScrollOffset();\n\n\t\t// Up\n\t\tif( mouseY < rangeY ) {\n\t\t\twindow.scroll( scrollOffset.x, scrollOffset.y - ( 1 - ( mouseY / rangeY ) ) * ( 14 / level ) );\n\t\t}\n\t\t// Down\n\t\telse if( mouseY > window.innerHeight - rangeY ) {\n\t\t\twindow.scroll( scrollOffset.x, scrollOffset.y + ( 1 - ( window.innerHeight - mouseY ) / rangeY ) * ( 14 / level ) );\n\t\t}\n\n\t\t// Left\n\t\tif( mouseX < rangeX ) {\n\t\t\twindow.scroll( scrollOffset.x - ( 1 - ( mouseX / rangeX ) ) * ( 14 / level ), scrollOffset.y );\n\t\t}\n\t\t// Right\n\t\telse if( mouseX > window.innerWidth - rangeX ) {\n\t\t\twindow.scroll( scrollOffset.x + ( 1 - ( window.innerWidth - mouseX ) / rangeX ) * ( 14 / level ), scrollOffset.y );\n\t\t}\n\t}", "function onWheel(evt) {\n if (!evt) {\n evt = window.event;\n }\n\n var delta = 0;\n if (evt.wheelDelta) { // IE and Opera\n delta = evt.wheelDelta;\n }\n else if (evt.detail) { // Mozilla\n delta = -evt.detail;\n }\n \n if (delta !== 0) {\n if (evt.shiftKey) {\n rotate(delta);\n }\n else {\n zoom(delta, evt.clientX, evt.clientY);\n }\n }\n \n evt.stopPropagation();\n evt.preventDefault();\n }", "function mouseZoomAllTheWayIn() {\n expectLT(TimelineGraphView.MIN_SCALE, graphView().scale_);\n while (graphView().scale_ !== TimelineGraphView.MIN_SCALE) {\n mouseZoomIn(8);\n }\n // Verify that zooming in when already at max zoom works.\n mouseZoomIn(1);\n }", "function addMouseWheelHandler(){\n var prefix = '';\n var _addEventListener;\n\n if (window.addEventListener){\n _addEventListener = \"addEventListener\";\n }else{\n _addEventListener = \"attachEvent\";\n prefix = 'on';\n }\n\n // detect available wheel event\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\n var passiveEvent = g_supportsPassive ? {passive: false }: false;\n\n if(support == 'DOMMouseScroll'){\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, passiveEvent);\n }\n\n //handle MozMousePixelScroll in older Firefox\n else{\n document[ _addEventListener ](prefix + support, MouseWheelHandler, passiveEvent);\n }\n }", "function addMouseWheelHandler(){\n var prefix = '';\n var _addEventListener;\n\n if (window.addEventListener){\n _addEventListener = \"addEventListener\";\n }else{\n _addEventListener = \"attachEvent\";\n prefix = 'on';\n }\n\n // detect available wheel event\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\n var passiveEvent = g_supportsPassive ? {passive: false }: false;\n\n if(support == 'DOMMouseScroll'){\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, passiveEvent);\n }\n\n //handle MozMousePixelScroll in older Firefox\n else{\n document[ _addEventListener ](prefix + support, MouseWheelHandler, passiveEvent);\n }\n }", "function addMouseWheelHandler(){\n var prefix = '';\n var _addEventListener;\n\n if (window.addEventListener){\n _addEventListener = \"addEventListener\";\n }else{\n _addEventListener = \"attachEvent\";\n prefix = 'on';\n }\n\n // detect available wheel event\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\n var passiveEvent = g_supportsPassive ? {passive: false }: false;\n\n if(support == 'DOMMouseScroll'){\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, passiveEvent);\n }\n\n //handle MozMousePixelScroll in older Firefox\n else{\n document[ _addEventListener ](prefix + support, MouseWheelHandler, passiveEvent);\n }\n }", "mouseMove(e) {\n this._modifiers(e); // fetch event modifiers\n const [x, y] = this.status.crsr;\n if (this._handleMouseMove(x, y)) {\n Event.stop(e);\n return true;\n }\n else {\n return false;\n }\n }", "mouseMove(e) {\n this._modifiers(e); // fetch event modifiers\n const [x, y] = this.status.crsr;\n if (this._handleMouseMove(x, y)) {\n Event.stop(e);\n return true;\n }\n else {\n return false;\n }\n }", "function addMouseWheelHandler(){\r\n var prefix = '';\r\n var _addEventListener;\r\n\r\n if (window.addEventListener){\r\n _addEventListener = \"addEventListener\";\r\n }else{\r\n _addEventListener = \"attachEvent\";\r\n prefix = 'on';\r\n }\r\n\r\n // detect available wheel event\r\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\r\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\r\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\r\n var passiveEvent = g_supportsPassive ? {passive: false }: false;\r\n\r\n if(support == 'DOMMouseScroll'){\r\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, passiveEvent);\r\n }\r\n\r\n //handle MozMousePixelScroll in older Firefox\r\n else{\r\n document[ _addEventListener ](prefix + support, MouseWheelHandler, passiveEvent);\r\n }\r\n }", "mouseWheel(_delta) {}", "function _mwt(){\r\n mousewheelTimeout=setTimeout(function(){\r\n if(!$.event.special.mousewheel){\r\n _mwt();\r\n }else{\r\n clearTimeout(mousewheelTimeout);\r\n _mousewheel.call($this[0]);\r\n }\r\n },100);\r\n }", "function ZoomButton() {\n\tif(gridZoom == 10) {\n\t\tgridZoom = 3;\n\t}\n\telse {\n\t\tgridZoom = 10;\n\t\tUpdateGraphicsZoomMap();\n\t}\n\tUpdateTileMap();\n\tUpdateNoteGrid();\n}", "function mouseWheel() {\n g = g + 10;\n}", "function ChartMouseWheelHandler(e) {\r\n // cross-browser wheel delta\r\n var e = window.event || e;\r\n var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\r\n \r\n if(global_chart){\r\n if(allow_scroll_zoom){\r\n \r\n //We should adjust the view extents based on the read-in mouse wheel scroll action\r\n \r\n //Grab the current view level (min/max data range)\r\n old_max = global_chart.xAxis[0].getExtremes().max;\r\n old_min = global_chart.xAxis[0].getExtremes().min;\r\n \r\n //Calculate the zoom action center (presumed to be center of chart if not yet set)\r\n if(mouse_cursor_center != null){\r\n center = mouse_cursor_center;\r\n } else {\r\n center = (old_max + old_min)/2;\r\n }\r\n \r\n \r\n //Calculate the above/below center widths\r\n old_right_size = old_max - center;\r\n old_left_size = center - old_min;\r\n \r\n //Calculate a multiplicative factor (1.0 for no change, > 1.0 for more zoom, < 1.0 for less zoom)\r\n scaler = (1-delta*0.1);\r\n \r\n //Apply the factor to the above/below center widths\r\n new_right_size = old_right_size * scaler;\r\n new_left_size = old_left_size * scaler;\r\n \r\n //calculate the new extents\r\n new_max = center + new_right_size;\r\n new_min = center - new_left_size;\r\n \r\n //Limit the extents to the available data. Make sure to display the\r\n // \"reset zoom\" button if we're not yet looking at the whole chart.\r\n if(global_chart.xAxis[0].getExtremes().dataMin > new_min){\r\n new_min = global_chart.xAxis[0].getExtremes().dataMin;\r\n } \r\n \r\n if(global_chart.xAxis[0].getExtremes().dataMax < new_max){\r\n new_max = global_chart.xAxis[0].getExtremes().dataMax;\r\n }\r\n \r\n //Set the new extents\r\n global_chart.xAxis[0].setExtremes(new_min, new_max);\r\n \r\n }\r\n }\r\n \r\n //Return false to prevent this mouse event we're handling here from scrolling the page\r\n if (e.preventDefault)e.preventDefault();\r\n return false;\r\n}", "function zoomed() {\n var zoomEventByMWheel=false;\n if (d3.event.sourceEvent) {\n if (d3.event.sourceEvent.deltaY)\n zoomEventByMWheel=true;\n }\n\n if (zoomEventByMWheel===false){\n if (transformAnimation===true){\n // console.log(\"still animating\");\n return;\n }\n zoomFactor = d3.event.scale;\n graphTranslation = d3.event.translate;\n graphContainer.attr(\"transform\", \"translate(\" + graphTranslation + \")scale(\" + zoomFactor + \")\");\n updateHaloRadius();\n return;\n\t\t}\n\t\t/** animate the transition **/\n var x,y;\n zoomFactor = d3.event.scale;\n graphTranslation = d3.event.translate;\n graphContainer.transition()\n .tween(\"attr.translate\", function () {\n return function (t) {\n \ttransformAnimation=true;\n var tr = d3.transform(graphContainer.attr(\"transform\"));\n x = tr.translate[0];\n y = tr.translate[1];\n graphTranslation[0] = x;\n graphTranslation[1] = y;\n zoomFactor=tr.scale[0];\n updateHaloRadius();\n };\n })\n\t\t\t.each(\"end\", function(){transformAnimation=false;})\n .attr(\"transform\", \"translate(\" + graphTranslation + \")scale(\" + zoomFactor + \")\")\n .ease('linear')\n\t\t\t.duration(250);\n\t}", "function move() {\n\n var t = d3.event.translate;\n var s = d3.event.scale; \n interact_map(t, s);\n}", "function documentMouseMoveHandler(event){\n mouseX = event.clientX * scale;\n mouseY = event.clientY * scale;\n }", "function onMouseMove(event) {\n moveAt(event.pageX, event.pageY);\n }", "autoToggleZoomButton() {\n if (dvt.Agent.isTouchDevice() || !this.zoomButton) return;\n\n if (this._chart.xAxis.isFullViewport() && this._chart.yAxis.isFullViewport()) {\n if (this._dragMode == DvtChartEventManager.DRAG_MODE_PAN) {\n this.zoomButton.setToggled(true);\n this.onZoomButtonClick(null);\n }\n } else {\n if (this._dragMode == DvtChartEventManager.DRAG_MODE_ZOOM) {\n this.zoomButton.setToggled(false);\n this.onZoomButtonClick(null);\n }\n }\n }", "function enableMouseMove() {\n // Add event listener for mouse move events to the canvas\n canvas.addEventListener(\"mousemove\", function (evt) {\n triggerMouseEvent(evt, canvas, connectedGame.mouseMoveEvent);\n }, false);\n }", "function addMouseWheelHandler(){\n var prefix = '';\n var _addEventListener;\n\n if (window.addEventListener){\n _addEventListener = \"addEventListener\";\n }else{\n _addEventListener = \"attachEvent\";\n prefix = 'on';\n }\n\n // detect available wheel event\n var support = 'onwheel' in document.createElement('div') ? 'wheel' : // Modern browsers support \"wheel\"\n document.onmousewheel !== undefined ? 'mousewheel' : // Webkit and IE support at least \"mousewheel\"\n 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\n\n\n if(support == 'DOMMouseScroll'){\n document[ _addEventListener ](prefix + 'MozMousePixelScroll', MouseWheelHandler, false);\n }\n\n //handle MozMousePixelScroll in older Firefox\n else{\n document[ _addEventListener ](prefix + support, MouseWheelHandler, false);\n }\n }" ]
[ "0.63050866", "0.62884635", "0.62884635", "0.6262329", "0.62495875", "0.6220784", "0.6166487", "0.6136359", "0.6102232", "0.6102232", "0.6102232", "0.6102232", "0.6102232", "0.6100884", "0.6100884", "0.6100884", "0.6100884", "0.6100884", "0.60994065", "0.59863317", "0.5970488", "0.5918339", "0.59115213", "0.58747643", "0.5790566", "0.5765086", "0.5712034", "0.5702412", "0.57024026", "0.5672435", "0.56657434", "0.5637411", "0.563677", "0.563677", "0.563677", "0.56346047", "0.56311643", "0.5622574", "0.5613165", "0.5602001", "0.559327", "0.5587306", "0.5564975", "0.55488336", "0.5546923", "0.55317026", "0.5514253", "0.5512127", "0.55116045", "0.55107945", "0.54774356", "0.5419445", "0.54132825", "0.5404039", "0.5390375", "0.53889585", "0.5379519", "0.5372538", "0.5366388", "0.53619194", "0.53495973", "0.5333433", "0.53301233", "0.53229433", "0.53153086", "0.53131205", "0.53053695", "0.52960956", "0.52886456", "0.5279216", "0.5279087", "0.52756274", "0.52704334", "0.5265488", "0.5262781", "0.5246614", "0.5242244", "0.52399695", "0.5211511", "0.5209225", "0.51958644", "0.51948833", "0.51915467", "0.51814616", "0.51814616", "0.51814616", "0.5178573", "0.5178573", "0.51700425", "0.51673466", "0.51626515", "0.5159757", "0.51594865", "0.5152", "0.51486593", "0.5147826", "0.51456463", "0.5143791", "0.5139344", "0.5137883", "0.513767" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(ecModel) { ecModel.eachSeriesByType('graph', function (graphSeries) { var coordSys = graphSeries.coordinateSystem; if (coordSys && coordSys.type !== 'view') { return; } if (graphSeries.get('layout') === 'force') { var preservedPoints = graphSeries.preservedPoints || {}; var graph = graphSeries.getGraph(); var nodeData = graph.data; var edgeData = graph.edgeData; var forceModel = graphSeries.getModel('force'); var initLayout = forceModel.get('initLayout'); if (graphSeries.preservedPoints) { nodeData.each(function (idx) { var id = nodeData.getId(idx); nodeData.setItemLayout(idx, preservedPoints[id] || [NaN, NaN]); }); } else if (!initLayout || initLayout === 'none') { simpleLayout(graphSeries); } else if (initLayout === 'circular') { circularLayout(graphSeries, 'value'); } var nodeDataExtent = nodeData.getDataExtent('value'); var edgeDataExtent = edgeData.getDataExtent('value'); // var edgeDataExtent = edgeData.getDataExtent('value'); var repulsion = forceModel.get('repulsion'); var edgeLength = forceModel.get('edgeLength'); if (!zrUtil.isArray(repulsion)) { repulsion = [repulsion, repulsion]; } if (!zrUtil.isArray(edgeLength)) { edgeLength = [edgeLength, edgeLength]; } // Larger value has smaller length edgeLength = [edgeLength[1], edgeLength[0]]; var nodes = nodeData.mapArray('value', function (value, idx) { var point = nodeData.getItemLayout(idx); var rep = linearMap(value, nodeDataExtent, repulsion); if (isNaN(rep)) { rep = (repulsion[0] + repulsion[1]) / 2; } return { w: rep, rep: rep, fixed: nodeData.getItemModel(idx).get('fixed'), p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point }; }); var edges = edgeData.mapArray('value', function (value, idx) { var edge = graph.getEdgeByIndex(idx); var d = linearMap(value, edgeDataExtent, edgeLength); if (isNaN(d)) { d = (edgeLength[0] + edgeLength[1]) / 2; } var edgeModel = edge.getModel(); var curveness = zrUtil.retrieve3(edgeModel.get('lineStyle.curveness'), -getCurvenessForEdge(edge, graphSeries, idx, true), 0); return { n1: nodes[edge.node1.dataIndex], n2: nodes[edge.node2.dataIndex], d: d, curveness: curveness, ignoreForceLayout: edgeModel.get('ignoreForceLayout') }; }); var coordSys = graphSeries.coordinateSystem; var rect = coordSys.getBoundingRect(); var forceInstance = forceLayout(nodes, edges, { rect: rect, gravity: forceModel.get('gravity'), friction: forceModel.get('friction') }); var oldStep = forceInstance.step; forceInstance.step = function (cb) { for (var i = 0, l = nodes.length; i < l; i++) { if (nodes[i].fixed) { // Write back to layout instance vec2.copy(nodes[i].p, graph.getNodeByIndex(i).getLayout()); } } oldStep(function (nodes, edges, stopped) { for (var i = 0, l = nodes.length; i < l; i++) { if (!nodes[i].fixed) { graph.getNodeByIndex(i).setLayout(nodes[i].p); } preservedPoints[nodeData.getId(i)] = nodes[i].p; } for (var i = 0, l = edges.length; i < l; i++) { var e = edges[i]; var edge = graph.getEdgeByIndex(i); var p1 = e.n1.p; var p2 = e.n2.p; var points = edge.getLayout(); points = points ? points.slice() : []; points[0] = points[0] || []; points[1] = points[1] || []; vec2.copy(points[0], p1); vec2.copy(points[1], p2); if (+e.curveness) { points[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness]; } edge.setLayout(points); } // Update layout cb && cb(stopped); }); }; graphSeries.forceLayout = forceInstance; graphSeries.preservedPoints = preservedPoints; // Step to get the layout forceInstance.step(); } else { // Remove prev injected forceLayout instance graphSeries.forceLayout = null; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "started () {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "function SigV4Utils() { }", "started() {\r\n\r\n\t}", "static get NOT_READY () {return 0}", "initialize() {\n\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "heartbeat () {\n }", "static final private internal function m106() {}", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53504926", "0.4896905", "0.48514667", "0.48116106", "0.4775166", "0.4743932", "0.47342455", "0.47035336", "0.4694186", "0.4694186", "0.46744877", "0.46453032", "0.46394095", "0.4629355", "0.46211302", "0.45832416", "0.45812932", "0.45752546", "0.45698234", "0.45625272", "0.4557475", "0.4549714", "0.45494938", "0.4545794", "0.45383474", "0.4523037", "0.45180768", "0.45005357", "0.4496748", "0.4486438", "0.447462", "0.44716924", "0.4468301", "0.44601226", "0.4456266", "0.4455926", "0.44557476", "0.4445067", "0.44378054", "0.44258687", "0.44258553", "0.4424118", "0.44097725", "0.4406038", "0.4404498", "0.4404498", "0.4404498", "0.43926418", "0.43781474", "0.43708664", "0.43657827", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43526813", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4349645", "0.43450522", "0.43440443", "0.43390423", "0.43347356", "0.43347356", "0.43332103", "0.43318707" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function dataToCoordSize(dataSize, dataItem) { // dataItem is necessary in log axis. var axis = this.getAxis(); var val = dataItem instanceof Array ? dataItem[0] : dataItem; var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2; return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1
Safely extract function name from itself
function getFunctionName(fn) { try { if (!fn || typeof fn !== 'function') { return defaultFunctionName; } return fn.name || defaultFunctionName; } catch (e) { // Just accessing custom props in some Selenium environments // can cause a "Permission denied" exception (see raven-js#495). return defaultFunctionName; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_function_name(f) {\r\n\tvar str = f.toString();\r\n var name = str.split ('(')[0];\r\n name = name.split (/[' '{1,}]/)[1];\r\n return(name);\r\n}", "function funcname(f) {\n const s = f.toString().match(/function (\\w*)/)[1];\n if ((s === null) || (s.length === 0)){ return \"~anonymous~\";}\n return s;\n}", "function functionName(func) {\n var result = /^function\\s+([\\w\\$]+)\\s*\\(/.exec(func.toString());\n return result ? result[1] : '<anonymous>'; // for an anonymous function there won't be a match\n}", "function getFunctionName( func ){\n\n\ttry {\n\t\tfunc = func.substr('function '.length);\n\t \tfunc = func.substr(0, func.indexOf('('));\n\n\t\tif( func == \"\" ) func = \"ANONYMOUS_FUNC\";\n\t\tif( func.indexOf( \"=>\" ) >= 0 ) func = \"ANONYMOUS_FUNC\";\n\n\t\treturn func;\n\t} catch( err ){\n\t\tconsole.log( \"\\x1b[31m%s\\x1b[0m\", \"[summer-mvc core]\", \"[logger.js]\", err );\n\t\tthrow err;\n\t}\n}", "function name() {}", "function funcName(func) {\n return func.name || \"{anonymous}\"\n }", "function getFunctionName(aFunction) {\n var regexpResult = aFunction.toString().match(/function (\\w*)/);\n if (regexpResult && regexpResult[1]) {\n return regexpResult[1];\n }\n return 'anonymous';\n}", "function getFunctionName(fn) {\n return fn.name || fn.__name__ || fn.displayName || 'anonymous';\n}", "processNamedFunction() {\n if (this.tokens.matches1(TokenType._function)) {\n this.tokens.copyToken();\n } else if (this.tokens.matches2(TokenType.name, TokenType._function)) {\n if (!this.tokens.matchesContextual(ContextualKeyword._async)) {\n throw new Error(\"Expected async keyword in function export.\");\n }\n this.tokens.copyToken();\n this.tokens.copyToken();\n }\n if (this.tokens.matches1(TokenType.star)) {\n this.tokens.copyToken();\n }\n if (!this.tokens.matches1(TokenType.name)) {\n throw new Error(\"Expected identifier for exported function name.\");\n }\n const name = this.tokens.identifierName();\n this.tokens.copyToken();\n if (this.tokens.currentToken().isType) {\n this.tokens.removeInitialToken();\n while (this.tokens.currentToken().isType) {\n this.tokens.removeToken();\n }\n }\n this.tokens.copyExpectedToken(TokenType.parenL);\n this.rootTransformer.processBalancedCode();\n this.tokens.copyExpectedToken(TokenType.parenR);\n this.rootTransformer.processPossibleTypeRange();\n this.tokens.copyExpectedToken(TokenType.braceL);\n this.rootTransformer.processBalancedCode();\n this.tokens.copyExpectedToken(TokenType.braceR);\n return name;\n }", "function trimFunctionName(ownName) {\r\n\townName = ownName.substr('function '.length);\r\n\townName = ownName.substr(0, ownName.indexOf('('));\r\n\treturn ownName;\r\n}", "function nom(fun) {\n var src = fun.toString();\n src = src.substr('function '.length);\n var n = src.substr(0, src.indexOf('('));\n\n if (!_.isFunction(fun)) fail(\"Cannot derive the name of a non-function.\");\n if (fun.name && (fun.name === n)) return fun.name;\n if (n) return n;\n fail(\"Anonymous function has no name.\");\n }", "function nameFunction(handler) {\n var scope = handler.scope ? handler.scope.constructor.name + '.' : '';\n var name = handler.func.name;\n if (name) {\n return scope + name;\n }\n for (var prop in handler.scope) {\n if (handler.scope[prop] === handler.func) {\n return scope + prop;\n }\n }\n return scope + handler.func;\n}", "function call_name(n) {\n if (n.children[0].type === IDENTIFIER) {\n return n.children[0].value\n }\n if (n.children[0].type === DOT) {\n return n.children[0].children[1].value\n }\n throw new Error('Can not find name of function called')\n}", "function functionName(fn)\r\n\t\t\t{\r\n\t\t\t\tvar name = /\\W*function\\s+([\\w\\$]+)\\(/.exec(fn);\r\n\t\t\t\tif(!name)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn 'No name';\r\n\t\t\t\t}\r\n\t\t\t\treturn name[1];\r\n\t\t\t}", "function getFunctionName(fn) {\r\n try {\r\n return fn && fn.name || '<anonymous>';\r\n } catch (e) {\r\n // Just accessing custom props in some Selenium environments\r\n // can cause a \"Permission denied\" exception (see raven-js#495).\r\n return '<anonymous>';\r\n }\r\n}", "function cleanFunctionName(functionName) {\n var ignoredPrefix = 'non-virtual thunk to ';\n if (functionName.startsWith(ignoredPrefix)) {\n return functionName.substr(ignoredPrefix.length);\n }\n return functionName;\n}", "function funcName(f) {\n var n = f.displayName || f.name;\n if(!n) {\n n = (f+'').match(/function\\s+([^\\(]*)/);\n if(n) {\n n = n[1];\n }\n else n = undefined;\n }\n return n;\n }", "function functionName(fn) {\n\t if (Function.prototype.name === undefined) {\n\t var funcNameRegex = /function\\s([^(]{1,})\\(/;\n\t var results = funcNameRegex.exec(fn.toString());\n\t return results && results.length > 1 ? results[1].trim() : \"\";\n\t } else if (fn.prototype === undefined) {\n\t return fn.constructor.name;\n\t } else {\n\t return fn.prototype.constructor.name;\n\t }\n\t }", "function getFunctionName(fn) {\n try {\n return (fn && fn.name) || '<anonymous>';\n }\n catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return '<anonymous>';\n }\n}", "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n }", "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n }", "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n }", "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n }", "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n }", "function nameof(fn) {\n if (typeof fn.name === \"string\") {\n return fn.name;\n }\n return \"undefined\";\n}", "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n}", "function functionName(fn) {\n if (typeof Function.prototype.name === 'undefined') {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (typeof fn.prototype === 'undefined') {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n}", "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = (funcNameRegex).exec((fn).toString());\n return (results && results.length > 1) ? results[1].trim() : \"\";\n }\n else if (fn.prototype === undefined) {\n return fn.constructor.name;\n }\n else {\n return fn.prototype.constructor.name;\n }\n}", "function getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n }", "function getFunctionName(fn) {\n\t try {\n\t if (!fn || typeof fn !== 'function') {\n\t return defaultFunctionName;\n\t }\n\t return fn.name || defaultFunctionName;\n\t } catch (e) {\n\t // Just accessing custom props in some Selenium environments\n\t // can cause a \"Permission denied\" exception (see raven-js#495).\n\t return defaultFunctionName;\n\t }\n\t}", "function jum_normalize_func_name(funcname) {\n if (funcname.substring(0,5) == 'test_') return funcname.substring('test_'.length);\n if (funcname.substring(0,4) == 'test') return funcname.substring('test'.length);\n return funcname;\n}", "function functionName(f) {\n return f._name || f.name;\n }", "function getFN(str) {\r\n\t\treturn str.split('\\\\').pop().split('/').pop()\r\n\t}", "function AnyName() {}", "function myName(name) {\n return name;\n}", "function getName(){\n console.log('THIS IS MY FUNCTION');\n}", "function getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}", "function getTidyName(name) {\n return name.split(\"(\")[0];\n }", "function getOriginalFunction(func) {\n return func.__sentry_original__;\n}", "function nameOnly(catch_name){\n return catch_name.name\n}", "function functionName(func) {\n // Engines that support Function.prototype.name OR the nth (n>1) time after\n // the name has been computed in the following else block.\n var existingNameProp = func.name;\n if (existingNameProp) {\n return existingNameProp;\n }\n // hack for IE and engines that do not support Object.defineProperty on function.name (Node.js 0.10 && 0.12)\n var existingSpecialCacheNameProp = func[exports.SPECIAL_NAME_CACHE_KEY];\n if (existingSpecialCacheNameProp) {\n return existingSpecialCacheNameProp;\n }\n var computedName = func.toString().match(FUNC_NAME_REGEXP)[1];\n if (!defineNameProp(func, computedName)) {\n func[exports.SPECIAL_NAME_CACHE_KEY] = computedName;\n }\n return computedName;\n}", "function getOriginalFunction(func) {\n return func.__sentry_original__;\n }", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n\n var match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n }", "function getOriginalFunction(func) {\n\t return func.__sentry_original__;\n\t}", "function NamedFunction() {\n\treturn \"I was called\";\n}", "function myName(name) {\n console.log(this);\n return name;\n}", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n\n var match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n }", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n\n var match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n }", "getFunction(nameOrSignatureOrSighash) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__ethersproject_bytes__[\"f\" /* isHexString */])(nameOrSignatureOrSighash)) {\n for (const name in this.functions) {\n if (nameOrSignatureOrSighash === this.getSighash(name)) {\n return this.functions[name];\n }\n }\n logger.throwArgumentError(\"no matching function\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.functions).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching function\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching functions\", \"name\", name);\n }\n return this.functions[matching[0]];\n }\n // Normlize the signature and lookup the function\n const result = this.functions[__WEBPACK_IMPORTED_MODULE_8__fragments__[\"d\" /* FunctionFragment */].fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching function\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }", "function myName6(name){\n\treturn name;\n}", "getFunction(nameOrSignatureOrSighash) {\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__ethersproject_bytes__[\"f\" /* isHexString */])(nameOrSignatureOrSighash)) {\n for (const name in this.functions) {\n if (nameOrSignatureOrSighash === this.getSighash(name)) {\n return this.functions[name];\n }\n }\n logger.throwArgumentError(\"no matching function\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.functions).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching function\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching functions\", \"name\", name);\n }\n return this.functions[matching[0]];\n }\n // Normlize the signature and lookup the function\n const result = this.functions[__WEBPACK_IMPORTED_MODULE_8__fragments__[\"c\" /* FunctionFragment */].fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching function\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }", "getEventName(eventType, funcName) {\n return `sls-${eventType}-${funcName}`.replace(/-/g, '_');\n }", "function get_my_name(name){\n return name;\n}", "getName() {}", "function $pDrw$var$getName(func) {\n if (!$pDrw$var$util.isFunction(func)) {\n return;\n }\n\n if ($pDrw$var$functionsHaveNames) {\n return func.name;\n }\n\n var str = func.toString();\n var match = str.match($pDrw$var$regex);\n return match && match[1];\n}", "function getParentFunctionName(scope) {\n // if it is a function declaration\n if(scope.block.id){\n return scope.block.id.name;\n } else if(scope.block.parent.key){ // if it is a method defination\n return scope.block.parent.key.name;\n } else { // it is a function expression\n return scope.block.parent.id && scope.block.parent.id.name;\n }\n }", "getFunction(nameOrSignatureOrSighash) {\n if (Object(_ethersproject_bytes__WEBPACK_IMPORTED_MODULE_2__[/* isHexString */ \"l\"])(nameOrSignatureOrSighash)) {\n for (const name in this.functions) {\n if (nameOrSignatureOrSighash === this.getSighash(name)) {\n return this.functions[name];\n }\n }\n logger.throwArgumentError(\"no matching function\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.functions).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching function\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching functions\", \"name\", name);\n }\n return this.functions[matching[0]];\n }\n // Normlize the signature and lookup the function\n const result = this.functions[_fragments__WEBPACK_IMPORTED_MODULE_7__[/* FunctionFragment */ \"f\"].fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching function\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }", "function getCalleeName(call) {\n if (ts.isIdentifier(call.expression)) {\n return call.expression.text;\n }\n if (ts.isPropertyAccessExpression(call.expression)) {\n return call.expression.name.text;\n }\n return null;\n }", "function defaultMessage(site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage(site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage(site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function tryGetName(node) {\n if (node.kind === 225 /* ModuleDeclaration */) {\n return getModuleName(node);\n }\n var decl = node;\n if (decl.name) {\n return ts.getPropertyNameForPropertyNameNode(decl.name);\n }\n switch (node.kind) {\n case 179 /* FunctionExpression */:\n case 180 /* ArrowFunction */:\n case 192 /* ClassExpression */:\n return getFunctionOrClassName(node);\n case 279 /* JSDocTypedefTag */:\n return getJSDocTypedefTagName(node);\n default:\n return undefined;\n }\n }", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function defaultMessage (site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}", "function getCalleeName(call) {\n if (ts.isIdentifier(call.expression)) {\n return stripDollarSuffix(call.expression.text);\n }\n if (ts.isPropertyAccessExpression(call.expression)) {\n return stripDollarSuffix(call.expression.name.text);\n }\n return null;\n}", "function parseSpoonName(s)\n{\n let parsed;\n if (s === \"executive-function\")\n {\n parsed = \"executive function\";\n } else {\n parsed = s;\n }\n return parsed;\n}", "function defaultMessage(site) {\n var callSite = site.callSite;\n var funcName = site.name; // make useful anonymous name\n\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>';\n }\n\n var context = callSite.getThis();\n var typeName = context && callSite.getTypeName(); // ignore useless type name\n\n if (typeName === 'Object') {\n typeName = undefined;\n } // make useful type name\n\n\n if (typeName === 'Function') {\n typeName = context.name || typeName;\n }\n\n return typeName && callSite.getMethodName() ? typeName + '.' + funcName : funcName;\n}", "function typeNameToFuncName(typeName) {\n var parts = typeName.split('_');\n return parts.map(function (part, i) {\n if (i !== 0 && part.length) return part.charAt(0).toUpperCase() + part.slice(1).toLowerCase();else return part.toLowerCase();\n }).join('');\n}", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n const match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n}", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n const match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n}", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n const match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n}", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n const match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n}", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n const match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n}", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n const match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n}", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n const match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n}", "function extractInstanceTestName(symbolName) {\n const match = symbolName.match(testMethodRegex);\n if (!match || match.length !== 3) {\n return null;\n }\n return match[2];\n}", "function nameSomeoneGaveMe () { return \"Chris\"; }", "function getTypeName(type) {\n // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers\n // it'll always return the name of the function itself, no matter how many other functions it\n // inherits from. On IE the function doesn't have its own `name` property, but it takes it from\n // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most\n // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around\n // the issue by converting the function to a string and parsing its name out that way via a regex.\n if (type.hasOwnProperty('name')) {\n return type.name;\n }\n\n var match = ('' + type).match(/^function\\s*([^\\s(]+)/);\n return match === null ? '' : match[1];\n}", "function getFirstName(name) {\n fName = name.split(\" \")[0];\n function helloFirstName() {\n console.log(\"Hello \" + fName );\n }\n return(helloFirstName);\n}" ]
[ "0.7382182", "0.7025916", "0.6980525", "0.6827642", "0.68144387", "0.6778119", "0.6767917", "0.6732436", "0.66889864", "0.66453636", "0.65887886", "0.6558353", "0.65296525", "0.6477961", "0.64645743", "0.64645636", "0.64425325", "0.6431579", "0.6425804", "0.6415161", "0.6415161", "0.6415161", "0.6415161", "0.6415161", "0.6380851", "0.6349299", "0.6306946", "0.62655896", "0.6243832", "0.62272084", "0.618675", "0.61681557", "0.615397", "0.6142852", "0.6140754", "0.61284924", "0.6108307", "0.6064081", "0.5996556", "0.5970566", "0.59620774", "0.595501", "0.5947497", "0.5935192", "0.59158176", "0.59123313", "0.5896002", "0.5896002", "0.58799416", "0.58758", "0.5875371", "0.58741605", "0.5842566", "0.5832831", "0.58227766", "0.5819587", "0.58180815", "0.58109945", "0.57939655", "0.57939655", "0.57939655", "0.578739", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.578121", "0.57809514", "0.57680494", "0.5762206", "0.57616615", "0.57523733", "0.57523733", "0.57523733", "0.57523733", "0.57523733", "0.57523733", "0.57523733", "0.57096124", "0.5704865", "0.57047623", "0.5694809" ]
0.6177072
33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(ecModel, api) { ecModel.eachSeriesByType('tree', function (seriesModel) { commonLayout(seriesModel, api); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "function getImplementation( cb ){\n\n }", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53492224", "0.48935446", "0.48514137", "0.48082927", "0.47720826", "0.4744996", "0.47347993", "0.47019523", "0.46926585", "0.46926585", "0.46730793", "0.46452278", "0.46379203", "0.46256977", "0.4618543", "0.45818752", "0.45806864", "0.45742333", "0.4568166", "0.45616665", "0.45558366", "0.4549164", "0.45481402", "0.45447382", "0.4537214", "0.4522665", "0.451785", "0.4497493", "0.44942656", "0.4484697", "0.4472648", "0.44683102", "0.4465637", "0.44581723", "0.44557354", "0.4454013", "0.44524705", "0.44436827", "0.44380364", "0.4427005", "0.44242096", "0.44237852", "0.44070554", "0.44050547", "0.44050547", "0.44050547", "0.4404598", "0.4393088", "0.43767613", "0.43684104", "0.43635124", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.4353219", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43515262", "0.43511948", "0.43502447", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43487865", "0.43443355", "0.43417493", "0.43380377", "0.43350744", "0.43350744", "0.4332956", "0.43327877" ]
0.0
-1
Build axisPointerModel, mergin tooltip.axisPointer model for each axis. allAxesInfo should be updated when setOption performed.
function collect(ecModel, api) { var result = { /** * key: makeKey(axis.model) * value: { * axis, * coordSys, * axisPointerModel, * triggerTooltip, * involveSeries, * snap, * seriesModels, * seriesDataCount * } */ axesInfo: {}, seriesInvolved: false, /** * key: makeKey(coordSys.model) * value: Object: key makeKey(axis.model), value: axisInfo */ coordSysAxesInfo: {}, coordSysMap: {} }; collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart. result.seriesInvolved && collectSeriesInfo(result, ecModel); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var axisKey = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[axisKey] = {\n key: axisKey,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: [],\n linkGroup: null\n };\n axesInfoInCoordSys[axisKey] = axisInfo;\n result.seriesInvolved = result.seriesInvolved || involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[axisKey] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\n var axisPointerShow = axisPointerModel.get('show');\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\n\n // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { axesInfo: {} });\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\n var axisPointerShow = axisPointerModel.get('show');\n if (!axisPointerShow || (\n axisPointerShow === 'auto'\n && !fromTooltip\n && !isHandleTrigger(axisPointerModel)\n )) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip\n ? makeAxisPointerModel(\n axis, baseTooltipModel, globalAxisPointerModel, ecModel,\n fromTooltip, triggerTooltip\n )\n : axisPointerModel;\n\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\n\n // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {axesInfo: {}});\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\n var axisPointerShow = axisPointerModel.get('show');\n if (!axisPointerShow || (\n axisPointerShow === 'auto'\n && !fromTooltip\n && !isHandleTrigger(axisPointerModel)\n )) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip\n ? makeAxisPointerModel(\n axis, baseTooltipModel, globalAxisPointerModel, ecModel,\n fromTooltip, triggerTooltip\n )\n : axisPointerModel;\n\n var snap = axisPointerModel.get('snap');\n var key = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category';\n\n // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n var axisInfo = result.axesInfo[key] = {\n key: key,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: []\n };\n axesInfoInCoordSys[key] = axisInfo;\n result.seriesInvolved |= involveSeries;\n\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {axesInfo: {}});\n linkGroup.axesInfo[key] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n\t var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\t var axisPointerShow = axisPointerModel.get('show');\n\t\n\t if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n\t return;\n\t }\n\t\n\t if (triggerTooltip == null) {\n\t triggerTooltip = axisPointerModel.get('triggerTooltip');\n\t }\n\t\n\t axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n\t var snap = axisPointerModel.get('snap');\n\t var axisKey = makeKey(axis.model);\n\t var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\t\n\t var axisInfo = result.axesInfo[axisKey] = {\n\t key: axisKey,\n\t axis: axis,\n\t coordSys: coordSys,\n\t axisPointerModel: axisPointerModel,\n\t triggerTooltip: triggerTooltip,\n\t involveSeries: involveSeries,\n\t snap: snap,\n\t useHandle: isHandleTrigger(axisPointerModel),\n\t seriesModels: [],\n\t linkGroup: null\n\t };\n\t axesInfoInCoordSys[axisKey] = axisInfo;\n\t result.seriesInvolved = result.seriesInvolved || involveSeries;\n\t var groupIndex = getLinkGroupIndex(linksOption, axis);\n\t\n\t if (groupIndex != null) {\n\t var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n\t axesInfo: {}\n\t });\n\t linkGroup.axesInfo[axisKey] = axisInfo;\n\t linkGroup.mapper = linksOption[groupIndex].mapper;\n\t axisInfo.linkGroup = linkGroup;\n\t }\n\t }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n\t var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\n\t var axisPointerShow = axisPointerModel.get('show');\n\t if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n\t return;\n\t }\n\n\t if (triggerTooltip == null) {\n\t triggerTooltip = axisPointerModel.get('triggerTooltip');\n\t }\n\n\t axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n\n\t var snap = axisPointerModel.get('snap');\n\t var key = makeKey(axis.model);\n\t var involveSeries = triggerTooltip || snap || axis.type === 'category';\n\n\t // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\t var axisInfo = result.axesInfo[key] = {\n\t key: key,\n\t axis: axis,\n\t coordSys: coordSys,\n\t axisPointerModel: axisPointerModel,\n\t triggerTooltip: triggerTooltip,\n\t involveSeries: involveSeries,\n\t snap: snap,\n\t useHandle: isHandleTrigger(axisPointerModel),\n\t seriesModels: []\n\t };\n\t axesInfoInCoordSys[key] = axisInfo;\n\t result.seriesInvolved |= involveSeries;\n\n\t var groupIndex = getLinkGroupIndex(linksOption, axis);\n\t if (groupIndex != null) {\n\t var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { axesInfo: {} });\n\t linkGroup.axesInfo[key] = axisInfo;\n\t linkGroup.mapper = linksOption[groupIndex].mapper;\n\t axisInfo.linkGroup = linkGroup;\n\t }\n\t }", "function axisPointer_install_install(registers) {\n // CartesianAxisPointer is not supposed to be required here. But consider\n // echarts.simple.js and online build tooltip, which only require gridSimple,\n // CartesianAxisPointer should be able to required somewhere.\n axis_AxisView.registerAxisPointerClass('CartesianAxisPointer', axisPointer_CartesianAxisPointer);\n registers.registerComponentModel(axisPointer_AxisPointerModel);\n registers.registerComponentView(axisPointer_AxisPointerView);\n registers.registerPreprocessor(function (option) {\n // Always has a global axisPointerModel for default setting.\n if (option) {\n (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});\n var link = option.axisPointer.link; // Normalize to array to avoid object mergin. But if link\n // is not set, remain null/undefined, otherwise it will\n // override existent link setting.\n\n if (link && !Object(util[\"t\" /* isArray */])(link)) {\n option.axisPointer.link = [link];\n }\n }\n }); // This process should proformed after coordinate systems created\n // and series data processed. So put it on statistic processing stage.\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\n // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n // allAxesInfo should be updated when setOption performed.\n ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api);\n }); // Broadcast to all views.\n\n registers.registerAction({\n type: 'updateAxisPointer',\n event: 'updateAxisPointer',\n update: ':updateAxisPointer'\n }, axisTrigger);\n}", "buildAnchors() {\r\n this.buildPointAnchors();\r\n }", "function cartesianAxisHelper_layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (util[\"O\" /* retrieve */](opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}", "getOptions() {\n let grids = []\n let xAxies = []\n let yAxies = []\n let series = []\n \n let sampleRate = store.getState().sampleRate\n let keysArray = Object.keys(this.state.eegData)\n // Remove deleted keys\n keysArray = keysArray.filter((key) => {\n return !this.removedAxies.includes(key);\n });\n\n // Layout configuration\n function generateGridTops(grid_height, num_grids) {\n // Returns an array of the top value for each\n // grid to be represented by keysArray\n let padding = 4\n let render_limits = [0+padding, 100-padding]\n let jump_width = (100 - 2*padding) / num_grids\n var list = [];\n for (var i = render_limits[0]; i <= render_limits[1]; i += jump_width) {\n let adjusted_top = i - (grid_height / 2) \n list.push(Math.ceil(adjusted_top));\n }\n return list\n }\n let height = 40\n let topsList = generateGridTops(height, keysArray.length)\n\n keysArray.forEach((key) => {\n let i = keysArray.indexOf(key)\n let grid_top = topsList[i] + \"%\"\n\n grids.push({\n id: key,\n left: '10%',\n right: '2%',\n top: grid_top,\n height: height + \"%\",\n show: true,\n name: key,\n tooltip: {\n show: false,\n trigger: 'axis',\n showDelay: 25\n },\n containLabel: false, // Help grids aligned by axis\n borderWidth: 0\n })\n\n xAxies.push({\n id: key,\n name: key,\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[key].length).keys()],\n type: 'category',\n gridIndex: i,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: (i == keysArray.length - 1), // Only show on last grid\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return (this.bufferStartIndex + parseInt(value)) / sampleRate\n }\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: true,\n interval: sampleRate - 1,\n },\n // Trigger event means you can click on name to register event\n triggerEvent: true,\n nameLocation: 'start',\n })\n\n // let scaleMax = new MyMaths().roundToNextDigit(Math.max(...this.state.eegData[key]))\n let scaleMax = 1\n let scaleMin = -scaleMax\n\n yAxies.push({\n id: key,\n type: 'value',\n gridIndex: i,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n // Programatically scale min/max\n min: scaleMin,\n max: scaleMax\n })\n\n // Add a line config to series object\n series.push({\n name: key,\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0.5,\n color: 'black',\n },\n gridIndex: i,\n yAxisIndex: i,\n xAxisIndex: i,\n smooth: false,\n sampling: 'lttb',\n\n data: this.state.eegData[key],\n })\n })\n\n /**\n * Configure backsplash grid for highlights and such\n * Adds a grid at backsplashGridIndex that takes full height\n * Adds an xAxis identical to the others\n * Adds a series of 0s meant to be undisplayed,\n * just for markAreas to be applied to\n */\n let timestampFormatter = (value) => {\n let secs = ((value + this.bufferStartIndex) / sampleRate) + this.time_adjustment_secs\n var date = new Date(0);\n date.setSeconds(secs);\n return date.toISOString().substr(11, 8);\n }\n\n this.backsplashGridIndex = keysArray.length\n let backsplashGridIndex = this.backsplashGridIndex\n let configureBacksplashGrid = () => {\n if (backsplashGridIndex == 0) {\n // Catch before data loads in\n return\n }\n let arbitraryKey = keysArray[0]\n\n grids.push({\n left: '10%',\n right: '4%',\n top: '0%',\n bottom: '4%',\n show: false,\n containLabel: false, // Help grids aligned by axis\n })\n yAxies.push({\n type: 'value',\n gridIndex: backsplashGridIndex,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n min: -1e-3,\n max: 1e-3,\n })\n xAxies.push({\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[arbitraryKey].length).keys()],\n type: 'category',\n gridIndex: backsplashGridIndex,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: true,\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return timestampFormatter(value)\n }\n },\n axisLine: {\n show: false,\n },\n })\n series.push({\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0,\n color: '#00000000',\n },\n gridIndex: backsplashGridIndex,\n yAxisIndex: backsplashGridIndex,\n xAxisIndex: backsplashGridIndex,\n sampling: 'lttb',\n \n name: 'backSplashSeries',\n \n data: new Array(this.state.eegData[arbitraryKey].length).fill(0),\n })\n }\n configureBacksplashGrid()\n\n /**\n * \n * The actual configuration for the chart\n * Loads in all of the previously filled grids, xAxies, yAxies, and series\n * \n */\n let options = {\n // Use the values configured above\n grid: grids,\n xAxis: xAxies,\n yAxis: yAxies,\n series: series,\n\n // Other Configuration options\n animation: false,\n\n tooltip: {\n show: false,\n },\n\n // toolbox hidden\n toolbox: {\n orient: 'vertical',\n show: false,\n },\n\n // Brush allows for selection that gets turned into markAreas\n brush: {\n toolbox: ['lineX', 'keep'],\n xAxisIndex: backsplashGridIndex\n },\n\n dataZoom: [\n {\n show: false,\n xAxisIndex: Object.keys(series),\n type: 'slider',\n bottom: '2%',\n startValue: this.dz_start,\n endValue: this.dz_end,\n preventDefaultMouseMove: true,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n },\n {\n yAxisIndex: Object.keys(series),\n type: 'slider',\n top: '45%',\n filterMode: 'none',\n show: false,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n\n id: 'eegGain',\n start: 50 - this.yZoom,\n end: 50 + this.yZoom,\n },{\n type: 'inside',\n yAxisIndex: Object.keys(series),\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n }\n ],\n }\n\n return options\n }", "function axisTrigger(payload, ecModel, api) {\n\t var currTrigger = payload.currTrigger;\n\t var point = [payload.x, payload.y];\n\t var finder = payload;\n\t var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\n\t var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending\n\t // See #6121. But we are not able to reproduce it yet.\n\t\n\t if (!coordSysAxesInfo) {\n\t return;\n\t }\n\t\n\t if (illegalPoint(point)) {\n\t // Used in the default behavior of `connection`: use the sample seriesIndex\n\t // and dataIndex. And also used in the tooltipView trigger.\n\t point = findPointFromSeries({\n\t seriesIndex: finder.seriesIndex,\n\t // Do not use dataIndexInside from other ec instance.\n\t // FIXME: auto detect it?\n\t dataIndex: finder.dataIndex\n\t }, ecModel).point;\n\t }\n\t\n\t var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n\t // Notice: In this case, it is difficult to get the `point` (which is necessary to show\n\t // tooltip, so if point is not given, we just use the point found by sample seriesIndex\n\t // and dataIndex.\n\t\n\t var inputAxesInfo = finder.axesInfo;\n\t var axesInfo = coordSysAxesInfo.axesInfo;\n\t var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n\t var outputPayload = {};\n\t var showValueMap = {};\n\t var dataByCoordSys = {\n\t list: [],\n\t map: {}\n\t };\n\t var updaters = {\n\t showPointer: curry(showPointer, showValueMap),\n\t showTooltip: curry(showTooltip, dataByCoordSys)\n\t }; // Process for triggered axes.\n\t\n\t each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n\t // If a point given, it must be contained by the coordinate system.\n\t var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n\t each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n\t var axis = axisInfo.axis;\n\t var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted.\n\t\n\t if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n\t var val = inputAxisInfo && inputAxisInfo.value;\n\t\n\t if (val == null && !isIllegalPoint) {\n\t val = axis.pointToData(point);\n\t }\n\t\n\t val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\n\t }\n\t });\n\t }); // Process for linked axes.\n\t\n\t var linkTriggers = {};\n\t each(axesInfo, function (tarAxisInfo, tarKey) {\n\t var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link.\n\t\n\t if (linkGroup && !showValueMap[tarKey]) {\n\t each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n\t var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis.\n\t\n\t if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n\t var val = srcValItem.value;\n\t linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n\t linkTriggers[tarAxisInfo.key] = val;\n\t }\n\t });\n\t }\n\t });\n\t each(linkTriggers, function (val, tarKey) {\n\t processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\n\t });\n\t updateModelActually(showValueMap, axesInfo, outputPayload);\n\t dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n\t dispatchHighDownActually(axesInfo, dispatchAction, api);\n\t return outputPayload;\n\t }", "function buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) {\n // Last is always tooltip model.\n var ecModel = globalTooltipModel.ecModel;\n var resultModel;\n\n if (defaultTooltipOption) {\n resultModel = new Model[\"a\" /* default */](defaultTooltipOption, ecModel, ecModel);\n resultModel = new Model[\"a\" /* default */](globalTooltipModel.option, resultModel, ecModel);\n } else {\n resultModel = globalTooltipModel;\n }\n\n for (var i = modelCascade.length - 1; i >= 0; i--) {\n var tooltipOpt = modelCascade[i];\n\n if (tooltipOpt) {\n if (tooltipOpt instanceof Model[\"a\" /* default */]) {\n tooltipOpt = tooltipOpt.get('tooltip', true);\n } // In each data item tooltip can be simply write:\n // {\n // value: 10,\n // tooltip: 'Something you need to know'\n // }\n\n\n if (util[\"C\" /* isString */](tooltipOpt)) {\n tooltipOpt = {\n formatter: tooltipOpt\n };\n }\n\n if (tooltipOpt) {\n resultModel = new Model[\"a\" /* default */](tooltipOpt, resultModel, ecModel);\n }\n }\n }\n\n return resultModel;\n}", "buildPointAnchors() {\r\n this.regionData.points.forEach((point, index) => {\r\n const anchor = this.createAnchor(this.paper, point.x, point.y);\r\n this.anchors.push(anchor);\r\n this.anchorsNode.add(anchor);\r\n this.subscribeAnchorToEvents(anchor, index);\r\n });\r\n }", "function updatePlot(axisType) {\n\n // update axisType\n if (axisType) {\n $(`#${currentAxisType}-button`).removeClass('active');\n $(`#${axisType}-button`).addClass('active');\n currentAxisType = axisType;\n }\n\n get_geolocation();\n\n if (geolocation === null || geolocation === undefined) {\n return;\n }\n if ((rawData === null) || (old_geolocation[0] != geolocation[0]) | (old_geolocation[1] != geolocation[1])) {\n rawData = {\n SMAP: {},\n NDMI: {}\n };\n rawData = get_data(geolocation, rawData);\n old_geolocation = geolocation;\n }\n\n let plot_data = null;\n let domain = null;\n let axis = {\n \"labelFontSize\": 24,\n \"titleFontSize\": 24,\n }\n if (currentAxisType === \"ndmi\") {\n plot_data = soilmoistureToNDMI(rawData);\n domain = [0, 6];\n axis.title = \"Drought Category\";\n axis.tickCount = 0;\n\n } else if (currentAxisType === \"sm\") {\n plot_data = NDMIToSoilmoisture(rawData);\n // domain = [Math.min.apply(Math, rawData.SMAP.map(function(o) {\n // if (o.moisture === undefined) {\n // return 1;\n // } else {\n // return o.moisture;\n // }\n // })), Math.max.apply(Math, rawData.SMAP.map(function(o) {\n // if (o.moisture == undefined) {\n // return 0;\n // } else {\n // return o.moisture;\n // }\n // }))];\n let smapMax = Math.max.apply(Math, Object.values(rawData.SMAP).map(function(o) {\n if (o.moisture == undefined) {\n return 0;\n } else {\n return o.moisture;\n }\n }));\n let ndmiMax = Math.max.apply(Math, plot_data.values.map(function(o) {\n if (o.NDMI == undefined) {\n return 0;\n } else {\n return o.NDMI;\n }\n }));\n domain = [0, Math.max(ndmiMax, smapMax)];\n axis.title = \"Soil Moisture (m³/m³)\";\n axis.tickCount = 5;\n }\n\n let vlSpec = makeVLSpec(plot_data, domain, axis);\n\n // Embed the visualization in the container with id `vis`\n vegaEmbed('#vis', vlSpec);\n}", "createAxesForInternalLyphs(modelClasses, entitiesByID){\n const createAxis = lyph => {\n let [sNode, tNode] = [\"s\", \"t\"].map(prefix => (\n Node.fromJSON({\n \"id\" : `${prefix}${lyph.id}`,\n \"name\" : `${prefix}${lyph.id}`,\n \"color\" : \"#ccc\",\n \"val\" : 0.1,\n \"skipLabel\": true,\n \"generated\": true\n }, modelClasses, entitiesByID)));\n\n let link = Link.fromJSON({\n \"id\" : `${lyph.id}-lnk`,\n \"source\" : sNode,\n \"target\" : tNode,\n \"geometry\" : Link.LINK_GEOMETRY.INVISIBLE,\n \"color\" : \"#ccc\",\n \"conveyingLyph\": lyph,\n \"skipLabel\" : true,\n \"generated\" : true\n }, modelClasses, entitiesByID);\n lyph.conveyedBy = link;\n sNode.sourceOf = [link];\n tNode.targetOf = [link];\n\n this.links.push(link);\n [sNode, tNode].forEach(node => this.nodes.push(node));\n };\n\n [...(this.lyphs||[]), ...(this.regions||[])]\n .filter(lyph => lyph.internalIn && !lyph.axis).forEach(lyph => createAxis(lyph, lyph.internalIn));\n\n const assignAxisLength = (lyph, container) => {\n if (container.axis) {\n if (!container.axis.length && container.container) {\n assignAxisLength(container, container.container);\n }\n lyph.axis.length = container.axis.length ? container.axis.length * 0.8 : DEFAULT_LENGTH;\n }\n };\n\n [...(this.lyphs||[]), ...(this.regions||[])]\n .filter(lyph => lyph.internalIn).forEach(lyph => assignAxisLength(lyph, lyph.internalIn));\n }", "function buildElStyle(axisPointerModel) {\n var axisPointerType = axisPointerModel.get('type');\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\n var style;\n\n if (axisPointerType === 'line') {\n style = styleModel.getLineStyle();\n style.fill = null;\n } else if (axisPointerType === 'shadow') {\n style = styleModel.getAreaStyle();\n style.stroke = null;\n }\n\n return style;\n}", "function drawAxes(){\n\td3.select(LRG1vLRG2)\n\t .append(\"rect\")\n\t .attr({\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\twidth: w,\n\t\t\theight: h,\n\t\t\tfill: \"white\",\n\t\t})\n\t .on(\"click\", function(d) {\n\t\t\tremovePlotPointsWithClass(\".selected\");\n\t \t\td3.select(\"#tooltip\")\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine1\")\n\t\t\t\t.text(\"\")\n\n\t\t\td3.select(\"#tooltip\")\t\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine2\")\n\t\t\t\t.text(\"\");\n\t\t});\n\td3.select(LRG2vQSO)\n\t .append(\"rect\")\n\t .attr({\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\twidth: w,\n\t\t\theight: h,\n\t\t\tfill: \"white\",\n\t\t})\n\t .on(\"click\", function(d) {\n\t\t\tremovePlotPointsWithClass(\".selected\");\n\t \t\td3.select(\"#tooltip\")\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine1\")\n\t\t\t\t.text(\"\")\n\n\t\t\td3.select(\"#tooltip\")\t\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine2\")\n\t\t\t\t.text(\"\");\n\t\t});\n\td3.select(SN2_G12vSN2_I12)\n\t .append(\"rect\")\n\t .attr({\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\twidth: w,\n\t\t\theight: h,\n\t\t\tfill: \"white\",\n\t\t})\n\t .on(\"click\", function(d) {\n\t\t\tremovePlotPointsWithClass(\".selected\");\n\t \t\td3.select(\"#tooltip\")\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine1\")\n\t\t\t\t.text(\"\")\n\n\t\t\td3.select(\"#tooltip\")\t\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine2\")\n\t\t\t\t.text(\"\");\n\t\t});\n\td3.select(RAvDEC)\n\t .append(\"rect\")\n\t .attr({\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\twidth: RAvDECwidth,\n\t\t\theight: h,\n\t\t\tfill: \"white\",\n\t\t})\n\t .on(\"click\", function(d) {\n\t\t\tremovePlotPointsWithClass(\".selected\");\n\t \t\td3.select(\"#tooltip\")\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine1\")\n\t\t\t\t.text(\"\")\n\n\t\t\td3.select(\"#tooltip\")\t\t\t\t\t\n\t\t\t\t.select(\"#selectedTooltipLine2\")\n\t\t\t\t.text(\"\");\n\t\t});\n\t//%LRG1v%LRG2\n\tvar xAxis= d3.svg.axis()\n\t\t\t\t\t .scale(xScaleLRG1vLRG2)\n\t\t\t\t\t .orient(\"bottom\");\n\tvar yAxis= d3.svg.axis()\n\t\t\t\t .scale(yScaleLRG1vLRG2)\n\t\t\t\t .orient(\"left\");\n\t/*axes*/\n\td3.select(LRG1vLRG2).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(0,\" + (h-(3.5 * padding)) + \")\",\n\t\t})\n\t .call(xAxis);\n\n\td3.select(LRG1vLRG2).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(\" + (4.5 * padding) + \",0)\",\n\t\t})\n\t .call(yAxis);\n\n\t/*label x-axis*/\n\td3.select(LRG1vLRG2).append(\"text\")\n\t .attr(\"class\", \"x label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", w /2 )\n\t .attr(\"y\", h - 6)\n\t .text(\"%LRG1\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n\t/*label y-axis*/\n\td3.select(LRG1vLRG2).append(\"text\")\n\t .attr(\"class\", \"y label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 0- h/2 )\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".75em\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .text(\"%LRG2\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n\t//%LRG2vQSO\n\n\tvar xAxis= d3.svg.axis()\n\t\t\t\t\t .scale(xScaleLRG2vQSO)\n\t\t\t\t\t .orient(\"bottom\");\n\tvar yAxis= d3.svg.axis()\n\t\t\t\t .scale(yScaleLRG2vQSO)\n\t\t\t\t .orient(\"left\");\n\t/*axes*/\n\td3.select(LRG2vQSO).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(0,\" + (h-(3.5 * padding)) + \")\",\n\t\t})\n\t .call(xAxis);\n\n\td3.select(LRG2vQSO).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(\" + (4.5 * padding) + \",0)\",\n\t\t})\n\t .call(yAxis);\n\n\t/*label x-axis*/\n\td3.select(LRG2vQSO).append(\"text\")\n\t .attr(\"class\", \"x label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", w /2 )\n\t .attr(\"y\", h - 6)\n\t .text(\"%QSO\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n\t/*label y-axis*/\n\td3.select(LRG2vQSO).append(\"text\")\n\t .attr(\"class\", \"y label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 0- h/2 )\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".75em\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .text(\"%LRG2\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n\t//SN2_G12vSN2_I12\n\tvar xAxis= d3.svg.axis()\n\t\t\t\t\t .scale(xScaleSN2_G12vSN2_I12)\n\t\t\t\t\t .orient(\"bottom\");\n\tvar yAxis= d3.svg.axis()\n\t\t\t\t .scale(yScaleSN2_G12vSN2_I12)\n\t\t\t\t .orient(\"left\");\n\t/*axis*/\n\td3.select(SN2_G12vSN2_I12).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(0,\" + (h-(3.5 * padding)) + \")\",\n\t\t})\n\t .call(xAxis);\n\n\td3.select(SN2_G12vSN2_I12).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(\" + (4.5 * padding) + \",0)\",\n\t\t})\n\t .call(yAxis);\n\n\t/*label x-axis*/\n\td3.select(SN2_G12vSN2_I12).append(\"text\")\n\t .attr(\"class\", \"x label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", w /2 -25)\n\t .attr(\"y\", h - 6)\n\t .text(\"SN2_G1\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"blue\");\n\n\td3.select(SN2_G12vSN2_I12).append(\"text\")\n\t .attr(\"class\", \"x label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", w /2 + 25)\n\t .attr(\"y\", h - 6)\n\t .text(\"SN2_G2\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"#ff6600\");\n\n\t/*label y-axis*/\n\td3.select(SN2_G12vSN2_I12).append(\"text\")\n\t .attr(\"class\", \"y label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 0- h/2 - 25)\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".75em\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .text(\"SN2_I1\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"blue\");\n\n\td3.select(SN2_G12vSN2_I12).append(\"text\")\n\t .attr(\"class\", \"y label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 0- h/2 + 25)\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".75em\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .text(\"SN2_I2\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"#ff6600\");\n\n\t//RAvDEC\n\tvar xAxis= d3.svg.axis()\n\t\t\t\t\t .scale(xAxisScaleRAvDEC)\n\t\t\t\t\t .orient(\"bottom\");\n\tvar yAxis= d3.svg.axis()\n\t\t\t\t .scale(yScaleRAvDEC)\n\t\t\t\t .orient(\"left\");\n\t/*axes*/\n\td3.select(RAvDEC).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(0,\" + (h-(3.5 * padding)) + \")\",\n\t\t})\n\t .call(xAxis);\n\n\td3.select(RAvDEC).append(\"g\")\n\t .attr({\n\t \t\tclass: \"axis\",\n\t \t\ttransform: \"translate(\" + (4.5 * padding) + \",0)\",\n\t\t})\n\t .call(yAxis);\n\n\t/*label x-axis*/\n\td3.select(RAvDEC).append(\"text\")\n\t .attr(\"class\", \"x label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", RAvDECwidth /2 )\n\t .attr(\"y\", h - 6)\n\t .text(\"RA\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n\t/*label y-axis*/\n\td3.select(RAvDEC).append(\"text\")\n\t .attr(\"class\", \"y label\")\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 0- h/2 )\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".75em\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .text(\"DEC\")\n\t .attr(\"font-family\", \"sans-serif\")\n\t .attr(\"font-size\", \"11px\")\n\t .attr(\"fill\", \"black\");\n\n}", "function buildTooltipModel(modelCascade) {\n\t // Last is always tooltip model.\n\t var resultModel = modelCascade.pop();\n\t\n\t while (modelCascade.length) {\n\t var tooltipOpt = modelCascade.pop();\n\t\n\t if (tooltipOpt) {\n\t if (tooltipOpt instanceof Model) {\n\t tooltipOpt = tooltipOpt.get('tooltip', true);\n\t } // In each data item tooltip can be simply write:\n\t // {\n\t // value: 10,\n\t // tooltip: 'Something you need to know'\n\t // }\n\t\n\t\n\t if (isString(tooltipOpt)) {\n\t tooltipOpt = {\n\t formatter: tooltipOpt\n\t };\n\t }\n\t\n\t resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel);\n\t }\n\t }\n\t\n\t return resultModel;\n\t }", "function axisTrigger(payload, ecModel, api) {\n var currTrigger = payload.currTrigger;\n var point = [payload.x, payload.y];\n var finder = payload;\n var dispatchAction = payload.dispatchAction || Object(util[\"c\" /* bind */])(api.dispatchAction, api);\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending\n // See #6121. But we are not able to reproduce it yet.\n\n if (!coordSysAxesInfo) {\n return;\n }\n\n if (illegalPoint(point)) {\n // Used in the default behavior of `connection`: use the sample seriesIndex\n // and dataIndex. And also used in the tooltipView trigger.\n point = findPointFromSeries({\n seriesIndex: finder.seriesIndex,\n // Do not use dataIndexInside from other ec instance.\n // FIXME: auto detect it?\n dataIndex: finder.dataIndex\n }, ecModel).point;\n }\n\n var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n // Notice: In this case, it is difficult to get the `point` (which is necessary to show\n // tooltip, so if point is not given, we just use the point found by sample seriesIndex\n // and dataIndex.\n\n var inputAxesInfo = finder.axesInfo;\n var axesInfo = coordSysAxesInfo.axesInfo;\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n var outputPayload = {};\n var showValueMap = {};\n var dataByCoordSys = {\n list: [],\n map: {}\n };\n var updaters = {\n showPointer: Object(util[\"i\" /* curry */])(axisTrigger_showPointer, showValueMap),\n showTooltip: Object(util[\"i\" /* curry */])(showTooltip, dataByCoordSys)\n }; // Process for triggered axes.\n\n Object(util[\"k\" /* each */])(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n // If a point given, it must be contained by the coordinate system.\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n Object(util[\"k\" /* each */])(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n var axis = axisInfo.axis;\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted.\n\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n var val = inputAxisInfo && inputAxisInfo.value;\n\n if (val == null && !isIllegalPoint) {\n val = axis.pointToData(point);\n }\n\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\n }\n });\n }); // Process for linked axes.\n\n var linkTriggers = {};\n Object(util[\"k\" /* each */])(axesInfo, function (tarAxisInfo, tarKey) {\n var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link.\n\n if (linkGroup && !showValueMap[tarKey]) {\n Object(util[\"k\" /* each */])(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis.\n\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n var val = srcValItem.value;\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n linkTriggers[tarAxisInfo.key] = val;\n }\n });\n }\n });\n Object(util[\"k\" /* each */])(linkTriggers, function (val, tarKey) {\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\n });\n updateModelActually(showValueMap, axesInfo, outputPayload);\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n dispatchHighDownActually(axesInfo, dispatchAction, api);\n return outputPayload;\n}", "function singleAxisHelper_layout(axisModel, opt) {\n opt = opt || {};\n var single = axisModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var axisPosition = axis.position;\n var orient = axis.orient;\n var rect = single.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var positionMap = {\n horizontal: {\n top: rectBound[2],\n bottom: rectBound[3]\n },\n vertical: {\n left: rectBound[0],\n right: rectBound[1]\n }\n };\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n var r = {\n horizontal: 0,\n vertical: 1\n };\n layout.rotation = Math.PI / 2 * r[orient];\n var directionMap = {\n top: -1,\n bottom: 1,\n right: 1,\n left: -1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (util[\"O\" /* retrieve */](opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n }\n\n var labelRotation = opt.rotate;\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\n layout.z2 = 1;\n return layout;\n}", "function buildMultipleAxes() {\n if (multipleAxes && !horizontal && !stack && seriesData.length > 1) {\n stackLayout.yaxis = [];\n\n seriesData.forEach((row, index) => {\n if (index != 0) {\n if (!settings[`seriesAxis_${index}`]) {\n changed = true;\n settings[`seriesAxis_${index}`] = {\n label: `Set ${row.name} on the second axis`,\n order: 10 + index,\n section: `Multiple Axes`,\n type: `boolean`,\n default: false,\n hidden: false\n };\n }\n }\n });\n\n // Apply the config settings to the chart\n let nameA = seriesData[0].name;\n let nameB = seriesData[1].name;\n let passShow = false;\n seriesData.forEach((row, index) => {\n let sTitle = row.name;\n let seriesName = nameA;\n let axisOrientation = false;\n let show = false;\n\n if (config[`seriesAxis_${index}`] == true) {\n seriesName = nameB;\n axisOrientation = true;\n if (config.yTitle2 != ``) sTitle = yTitle2;\n } else {\n seriesName = nameA;\n axisOrientation = false;\n if (config.yTitle != ``) sTitle = yTitle;\n }\n\n // Configuration to show the axes\n if (index == 0) show = true;\n if (config[`seriesAxis_${index}`] && passShow == false) {\n passShow = true;\n show = true;\n }\n\n let obj = {\n seriesName: seriesName,\n opposite: axisOrientation,\n show: show,\n name: row.name,\n labels: {\n formatter: function(val) {\n if (typeof val == `number` && !horizontal)\n return formatAxes(val, row.value_format);\n else return val;\n }\n }\n };\n\n // Axis based label\n if (seriesName == nameA) {\n if (showTitleY) obj[`title`] = { text: sTitle };\n }\n if (seriesName == nameB) {\n if (showSecondTitleY) obj[`title`] = { text: sTitle };\n }\n\n console.log(`iteration: ${index} object`, obj);\n stackLayout.yaxis.push(obj);\n });\n }\n }", "axisPlot() {\n this.ctx = this.canvas.getContext(\"2d\");\n\n /**\n * Grid grid\n */\n if (this.grid.grid) {\n this.ctx.beginPath();\n this.ctx.font = 'italic 18pt Calibri';\n this.ctx.strokeStyle = '#979797';\n this.ctx.lineWidth = 1;\n this.ctx.setLineDash([10, 15]);\n for (let i = 30; i < this.field.width; i+= 100) {\n this.ctx.fillText(Math.ceil(this.ScreenToWorldY(i)*1000)/1000, 0, i);\n this.ctx.moveTo(0, i);\n this.ctx.lineTo(this.field.width, i);\n }\n for (let i = 100; i < this.field.width; i+= 100) {\n this.ctx.fillText(Math.ceil(this.ScreenToWorldX(i)*1000)/1000, i, this.field.height);\n this.ctx.moveTo(i, 0);\n this.ctx.lineTo(i, this.field.height);\n }\n this.ctx.stroke();\n this.ctx.closePath();\n }\n\n\n /**\n * Grid axiss\n */\n if (this.grid.axiss) {\n this.ctx.beginPath();\n this.ctx.strokeStyle = '#b10009';\n this.ctx.lineWidth = 2;\n this.ctx.setLineDash([]);\n\n this.ctx.moveTo(this.center.x, 0);\n this.ctx.lineTo(this.center.x, this.field.height);\n\n this.ctx.moveTo(0, this.center.y);\n this.ctx.lineTo(this.field.width, this.center.y);\n\n this.ctx.stroke();\n this.ctx.closePath();\n }\n\n\n if (this.grid.serifs) {\n this.ctx.beginPath();\n this.ctx.strokeStyle = '#058600';\n this.ctx.fillStyle = '#888888'\n this.ctx.lineWidth = 2;\n this.ctx.setLineDash([]);\n\n let start = 0;\n if (!this.grid.serifsStep){\n return;\n }\n\n let s = Math.abs(\n this.ScreenToWorldY(0) -\n this.ScreenToWorldY(this.grid.serifsSize)\n );\n\n /**\n * To right & to left\n */\n if ((this.center.y > 0) && (this.center.y < this.field.height)) {\n\n let finish = this.ScreenToWorldX(this.field.width);\n\n for (let i = start; i < finish; i+=this.grid.serifsStep) {\n this.moveTo(i+this.grid.serifsStep/2,(s/2));\n this.lineTo(i+this.grid.serifsStep/2,-(s/2));\n this.ctx.fillText(i+this.grid.serifsStep/2, this.WorldToScreenX(i+this.grid.serifsStep/2), this.WorldToScreenY(s/2));\n\n this.moveTo(i+this.grid.serifsStep,s);\n this.lineTo(i+this.grid.serifsStep,-s);\n this.ctx.fillText(i+this.grid.serifsStep, this.WorldToScreenX(i+this.grid.serifsStep), this.WorldToScreenY(s));\n }\n\n finish = this.ScreenToWorldX(0);\n\n for (let i = start; i > finish; i-=this.grid.serifsStep) {\n this.moveTo(i-this.grid.serifsStep/2,(s/2));\n this.lineTo(i-this.grid.serifsStep/2,-(s/2));\n this.ctx.fillText(i-this.grid.serifsStep/2, this.WorldToScreenX(i-this.grid.serifsStep/2), this.WorldToScreenY(s/2));\n\n this.moveTo(i-this.grid.serifsStep,s);\n this.lineTo(i-this.grid.serifsStep,-s);\n this.ctx.fillText(i-this.grid.serifsStep, this.WorldToScreenX(i-this.grid.serifsStep), this.WorldToScreenY(s));\n }\n }\n\n /**\n * To top & to bot\n */\n if ((this.center.x > 0) && (this.center.x < this.field.width)) {\n\n start = 0;\n let finish = this.ScreenToWorldY(0);\n\n for (let i = start; i < finish; i+=this.grid.serifsStep) {\n this.moveTo((s/2),i+this.grid.serifsStep/2);\n this.lineTo(-(s/2),i+this.grid.serifsStep/2);\n this.ctx.fillText(i+this.grid.serifsStep/2, this.WorldToScreenX(s/2), this.WorldToScreenY(i+this.grid.serifsStep/2));\n\n this.moveTo(s, i+this.grid.serifsStep);\n this.lineTo(-s, i+this.grid.serifsStep);\n this.ctx.fillText(i+this.grid.serifsStep, this.WorldToScreenX(s), this.WorldToScreenY(i+this.grid.serifsStep));\n }\n\n finish = this.ScreenToWorldY(this.field.width);\n\n for (let i = start; i > finish-this.grid.serifsStep; i-=this.grid.serifsStep) {\n this.moveTo((s/2),i+this.grid.serifsStep/2);\n this.lineTo(-(s/2),i+this.grid.serifsStep/2);\n this.ctx.fillText(i+this.grid.serifsStep/2, this.WorldToScreenX(s/2), this.WorldToScreenY(i+this.grid.serifsStep/2));\n\n this.moveTo(s, i+this.grid.serifsStep);\n this.lineTo( -s, i+this.grid.serifsStep);\n this.ctx.fillText(i+this.grid.serifsStep, this.WorldToScreenX(s), this.WorldToScreenY(i+this.grid.serifsStep));\n }\n }\n this.ctx.stroke();\n this.ctx.closePath();\n }\n }", "function tooltips ( ) {\r\n\r\n\t\t\tif ( options.dir ) {\r\n\t\t\t\toptions.tooltips.reverse();\r\n\t\t\t}\r\n\r\n\t\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\t\tif ( options.dir ) {\r\n\t\t\t\ttips.reverse();\r\n\t\t\t\toptions.tooltips.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tbindEvent('update', function(f, o, r) {\r\n\t\t\t\tif ( tips[o] ) {\r\n\t\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "function tooltips ( ) {\n\t\n\t\t\tif ( options.dir ) {\n\t\t\t\toptions.tooltips.reverse();\n\t\t\t}\n\t\n\t\t\t// Tooltips are added with options.tooltips in original order.\n\t\t\tvar tips = scope_Handles.map(addTooltip);\n\t\n\t\t\tif ( options.dir ) {\n\t\t\t\ttips.reverse();\n\t\t\t\toptions.tooltips.reverse();\n\t\t\t}\n\t\n\t\t\tbindEvent('update', function(f, o, r) {\n\t\t\t\tif ( tips[o] ) {\n\t\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function tooltips ( ) {\n\n\t\tif ( options.dir ) {\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tif ( options.dir ) {\n\t\t\ttips.reverse();\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\tbindEvent('update', function(f, o, r) {\n\t\t\tif ( tips[o] ) {\n\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\n\t\t\t}\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\tif ( options.dir ) {\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tif ( options.dir ) {\n\t\t\ttips.reverse();\n\t\t\toptions.tooltips.reverse();\n\t\t}\n\n\t\tbindEvent('update', function(f, o, r) {\n\t\t\tif ( tips[o] ) {\n\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\n\t\t\t}\n\t\t});\n\t}", "function updateToolTip(chosenXAxis, chosenYAxis, circlesGroup) {\n\n var xlabel = \"\";\n var ylabel = \"\";\n // Looping through X axes to grab the object that corresponds\n for (var i = 0; i < xAxes.length; i++)\n if (chosenXAxis === xAxes[i].option)\n\n xLabel = xAxes[i].label;\n // Looping through Y axes to grab the object that corresponds\n for (var i = 0; i < yAxes.length; i++)\n if (chosenYAxis === yAxes[i].option)\n yLabel = yAxes[i].label;\n\n // Adding Tooltip\n\n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([110, 0])\n .html(d => [\n d.state,\n formatToolTipText(xLabel, d[chosenXAxis]),\n formatToolTipText(yLabel, d[chosenYAxis])\n ].join(\"<br>\"));\n\n // Adding a callback\n circlesGroup.call(toolTip);\n\n // Adding the mouse over event\n circlesGroup\n .on(\"mouseover\", (data, index, element) => toolTip.show(data, element[index]))\n .on(\"mouseout\", (data, index, element) => toolTip.hide(data, element[index]));\n\n return circlesGroup;\n}", "function tooltips ( ) {\r\n\r\n\t\tif ( options.dir ) {\r\n\t\t\toptions.tooltips.reverse();\r\n\t\t}\r\n\r\n\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\tif ( options.dir ) {\r\n\t\t\ttips.reverse();\r\n\t\t\toptions.tooltips.reverse();\r\n\t\t}\r\n\r\n\t\tbindEvent('update', function(f, o, r) {\r\n\t\t\tif ( tips[o] ) {\r\n\t\t\t\ttips[o].innerHTML = options.tooltips[o] === true ? f[o] : options.tooltips[o].to(r[o]);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "init() {\n\t\t\t\tstructureData()\n\n\t\t\t\t$tooltip = d3.selectAll('.chart figure').append('div').attr('class', 'tooltip')\n\t\t\t\t$vertical = d3.selectAll('.chart figure').append('div').attr('class', 'vertical')\n\n\t\t\t\t$svg = $sel.append('svg').attr('class', 'pudding-chart');\n\t\t\t\t$axis = $svg.append('g').attr('class', 'g-axis');\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// offset chart for margins\n\t\t\t\t$g.attr('transform', `translate(${marginLeft}, ${marginTop})`);\n\n\t\t\t\t// create axis\n\t\t\t\txAxisGroup = $axis.append('g')\n\t\t\t\t\t.attr('class', 'x axis')\n\n\t\t\t\tyAxisGroup = $axis.append('g')\n\t\t\t\t\t.attr('class', 'y axis')\n\n\t\t\t\t$fLabel = $g.append('text').attr('class', 'f-label').text('Women')\n\t\t\t\t$mLabel = $g.append('text').attr('class', 'm-label').text('Men')\n\n\t\t\t\t$biggerLabelGroup = $svg.append('g')\n\t\t\t\t$smallerLabelGroup = $svg.append('g')\n\n\t\t\t\t$biggerLabel = $biggerLabelGroup.append('text')\n\t\t\t\t\t\t.text('Bigger median hair')\n\t\t\t\t\t\t.attr('class', 'axis-label bigger-axis-label')\n\n\t\t\t\t$smallerLabel = $smallerLabelGroup.append('text')\n\t\t\t\t\t\t.text('Smaller median hair')\n\t\t\t\t\t\t.attr('class', 'axis-label smaller-axis-label')\n\n\t\t\t\t$upArrow = $biggerLabelGroup.append('svg:image')\n\t\t\t\t\t\t.attr('xlink:href', `assets/images/arrow-up.svg`)\n\t\t\t\t\t\t.attr('width', '20px')\n\t\t\t\t\t\t.attr('height', '20px')\n\n\t\t\t\t$downArrow = $smallerLabelGroup.append('svg:image')\n\t\t\t\t\t\t.attr('xlink:href', `assets/images/arrow-down.svg`)\n\t\t\t\t\t\t.attr('width', '20px')\n\t\t\t\t\t\t.attr('height', '20px')\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g').attr('class', 'g-vis');\n\n\t\t\t\tlineGroup = $svg.select('.g-vis')\n\n\t\t\t\tfemaleLine = lineGroup.append('path')\n\t\t\t\t\t.datum(femaleData)\n\t\t\t\t\t.attr('class', 'Female')\n\n\t\t\t\tmaleLine = lineGroup.append('path')\n\t\t\t\t\t.datum(maleData)\n\t\t\t\t\t.attr('class', 'Male')\n\n\t\t\t\tdrawArea = $vis.append('path')\n\t\t\t\t\t.datum(dataByYear)\n\t\t\t\t\t.attr('class', 'area')\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function tooltips() {\n if (options.dir) {\n options.tooltips.reverse();\n }\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n if (options.dir) {\n tips.reverse();\n options.tooltips.reverse();\n }\n bindEvent('update', function(f, o, r) {\n if (tips[o]) {\n tips[o].innerHTML = options.tooltips[o] === true ? f[o] :\n options.tooltips[o].to(r[o]);\n }\n });\n }", "__cleanUpAxisAndPlotArea() {\n // Tooltip cleanup\n this.EventManager.hideHoverFeedback();\n\n // Clear the list of registered peers\n this.Peers = [];\n\n // Clean up the axis and plot area\n if (this.xAxis) {\n this._container.removeChild(this.xAxis);\n this.xAxis.destroy();\n }\n if (this.yAxis) {\n this._container.removeChild(this.yAxis);\n this.yAxis.destroy();\n }\n if (this.y2Axis) {\n this._container.removeChild(this.y2Axis);\n this.y2Axis.destroy();\n }\n\n // Plot area which is a touch target needs to be kept so that subsequent touch events are fired.\n if (this._plotArea && this._plotArea == this._panZoomTarget) this._plotArea.setVisible(false);\n else if (this._plotArea) {\n this._container.removeChild(this._plotArea);\n this._plotArea.destroy();\n }\n\n this._plotArea = null;\n\n // Reset cache\n this.getCache().clearCache();\n }", "function appendAxes() {\n graphImg\n .append(\"g\")\n .call(xAxis)\n .attr(\"class\", \"xAxis\")\n .attr(\n \"transform\",\n \"translate(0,\" + (displayHeight - margin - labelArea) + \")\"\n );\n graphImg\n .append(\"g\")\n .call(yAxis)\n .attr(\"class\", \"yAxis\")\n .attr(\"transform\", \"translate(\" + (margin + labelArea) + \", 0)\");\n }", "plot(){\n /* plot the X and Y axis of the graph */\n super.plotXAxis();\n super.plotYAxis();\n\n /* (re)draw the points, grouped in a single graphics element */\n let canvas = d3.select('svg#canvas_bioActivity > g#graph');\n canvas.selectAll('#points').remove();\n canvas.append('g')\n .attr('id', 'points')\n .attr('transform', 'translate('+this._margin.left+', 0)')\n ;\n /* Each data point will be d3 symbol (represented using svg paths) */\n let pts = d3.select('#points').selectAll('g')\n .data(this._data)\n /* each point belongs to the 'data-point' class its positioned in the graph\n * according to the associated (x,y) coordinates and its drawn using its\n * color and shape */\n let point = pts.enter().append('path')\n .attr('class', 'data-point')\n .attr('transform', d => 'translate('+d.x+' '+d.y+')')\n .attr('fill', d => d.color )\n .attr('d', function(d){\n let s = ['Circle','Cross','Diamond','Square','Star','Triangle','Wye']\n let symbol = d3.symbol()\n .size(50)\n .type(d3.symbols[s.indexOf(d.shape)])\n ;\n return symbol();\n })\n ;\n /* each point will also have an associated svg title (tooltip) */\n point.append('svg:title')\n .text((d) => {\n return 'Organism: '+d['Organism Name']+\n '\\nGene: '+d['Gene Symbol']+\n '\\nConcentation: '+d['Activity Concentration']+'nM';\n })\n ;\n }", "function buildAxis() {\n xAxis = d3Axis.axisBottom(xScale)\n .ticks(xTicks, numberFormat)\n .tickSizeInner([-chartHeight]);\n\n yAxis = d3Axis.axisLeft(yScale);\n }", "function createAxes() {\n //create x axis svg\n xAxisSVG = diagramG.append('g')\n .style('fill', 'none')\n .style('shape-rendering', 'crispEdges')\n .attr('transform', 'translate(0,' + (height - margin.bottom - margin.top) + ')')\n .attr('class', 'eve-x-axis')\n .call(xAxis);\n\n //create y axis left svg\n yAxisSVG = diagramG.append('g')\n .style('fill', 'none')\n .style('shape-rendering', 'crispEdges')\n .attr('transform', 'translate(0)')\n .attr('class', 'eve-y-axis')\n .call(yAxis);\n\n //set axes styling\n updateAxisStyle();\n }", "function cursorCoords(x, y) {\r\n // update global chart width and height dimensions\r\n aleph.chartWidth = svgWidth;\r\n aleph.chartHeight = svgHeight;\r\n var currentSelectedYear = aleph.formatDate(aleph.xYear);\r\n\r\n // modify class definiton of tooltip 'g' element and current offset position based on mouse cursor position\r\n d3.selectAll(\".aleph-toolTip-Div\")\r\n .moveToFront()\r\n .classed(\"aleph-hide\", false)\r\n .style(\"left\", function () {\r\n if (x < aleph.chartWidth / 2) {\r\n d3.selectAll(\".aleph-mouseover-textlabel\")\r\n .style(\"text-anchor\", \"end\")\r\n .attr(\"transform\", \"translate(-20,3)\");\r\n\r\n return x + 15 + \"px\"; // left half\r\n } else {\r\n d3.selectAll(\".aleph-mouseover-textlabel\")\r\n .style(\"text-anchor\", \"start\")\r\n .attr(\"transform\", \"translate(10,3)\");\r\n\r\n return x - aleph.toolTipDimensions.width - 15 + \"px\"; // right half\r\n }\r\n })\r\n .style(\"top\", function () {\r\n if (y < aleph.chartHeight / 2) {\r\n return y + 15 + \"px\"; // top half\r\n } else {\r\n return (\r\n y -\r\n d3.selectAll(\".aleph-toolTip-Div\").style(\"height\").replace(\"px\", \"\") +\r\n \"px\"\r\n ); // bottom half\r\n }\r\n });\r\n\r\n // upate main tootlitp title.\r\n d3.selectAll(\".aleph-toolTipTitle-label\").html(currentSelectedYear);\r\n\r\n // initialise local array to help sort information content to display on tooltip\r\n var unsortedScenarioArray = [];\r\n var sortedScenarioArray = [];\r\n\r\n // cycle through all currently displayed scenarios, and push into a local array ...\r\n for (var scenario in aleph.scenarios) {\r\n unsortedScenarioArray.push(aleph.scenarios[scenario]);\r\n } // end for loop\r\n\r\n // sort local storage array based on summed values for each tiem series year.\r\n sortedScenarioArray = unsortedScenarioArray.sort(function (a, b) {\r\n return (\r\n +b.yearSummedValues[currentSelectedYear] -\r\n +a.yearSummedValues[currentSelectedYear]\r\n );\r\n });\r\n\r\n // remove the main tooltip div\r\n d3.selectAll(\".aleph-tooltip-scenario-div\").remove();\r\n\r\n d3.selectAll(\".toolTip-content-to-Remove\").remove();\r\n d3.selectAll(\".aleph-toolTip-Div\")\r\n .append(\"table\")\r\n .attr(\"class\", \"tooltip-table toolTip-content-to-Remove\")\r\n .style(\"width\", \"100%\")\r\n .style(\"height\", \"100%\");\r\n\r\n d3.selectAll(\".tooltip-table\").append(\"tr\").attr(\"class\", \"table-header-row\");\r\n\r\n var headers = [\r\n \"Marker\",\r\n \"Population Size\",\r\n \"% Total Year UK Pop.\",\r\n \"Scenario Criteria*\",\r\n ];\r\n\r\n headers.forEach(function (d, i) {\r\n d3.selectAll(\".table-header-row\")\r\n .append(\"td\")\r\n .attr(\"class\", \"table-header-row-header-cell header-cell-\" + i)\r\n .style(\"width\", \"auto\");\r\n\r\n d3.selectAll(\".table-header-row-header-cell.header-cell-\" + i)\r\n .append(\"label\")\r\n .attr(\r\n \"class\",\r\n \"table-header-row-header-cell-label header-cell-label-\" + i\r\n )\r\n .html(headers[i]);\r\n });\r\n\r\n sortedScenarioArray.forEach(function (d, i) {\r\n var rowNumber = i;\r\n d3.selectAll(\".tooltip-table\")\r\n .append(\"tr\")\r\n .attr(\r\n \"class\",\r\n \"tooltip-table-row toolTip-content-to-Remove tooltip-table-row-\" +\r\n rowNumber\r\n )\r\n .style(\"width\", \"100%\");\r\n\r\n for (var columnNumber = 0; columnNumber < headers.length; columnNumber++) {\r\n d3.selectAll(\".tooltip-table-row-\" + rowNumber)\r\n .append(\"td\")\r\n .attr(\"class\", function () {\r\n return \"table-dataCell table-dataCell-\" + columnNumber;\r\n });\r\n\r\n if (columnNumber == 0) {\r\n d3.selectAll(\".tooltip-table-row-\" + rowNumber)\r\n .selectAll(\".table-dataCell-\" + columnNumber)\r\n .append(\"div\")\r\n .attr(\"class\", \"aleph-tooltip-marker-circle-div\")\r\n .style(\"background-color\", d.lineColour);\r\n } else {\r\n d3.selectAll(\".tooltip-table-row-\" + rowNumber)\r\n .selectAll(\".table-dataCell-\" + columnNumber)\r\n .append(\"label\")\r\n .attr(\r\n \"class\",\r\n \"table-cell-text-content table-cell-text-content-\" + columnNumber\r\n )\r\n .html(function () {\r\n if (columnNumber == 1) {\r\n return numberWithCommas(d.yearSummedValues[currentSelectedYear]);\r\n } else if (columnNumber == 2) {\r\n return (\r\n (\r\n (d.yearSummedValues[currentSelectedYear] /\r\n aleph.dataYearPopulations[\r\n aleph.years.indexOf(currentSelectedYear)\r\n ]) *\r\n 100\r\n ).toFixed(2) + \"%\"\r\n );\r\n } else if (columnNumber == 3) {\r\n var string = \"\";\r\n\r\n if (\r\n d.genderString.split(\",\").length == 2 &&\r\n d.ethnicityString.split(\",\").length == 6 &&\r\n d.agebandString.split(\",\").length == 9 &&\r\n d.nationalitiesString.split(\",\").length == 2 &&\r\n d.religionsString.split(\",\").length == 4 &&\r\n d.healthString.split(\",\").length == 7 &&\r\n d.qualificationString.split(\",\").length == 4\r\n ) {\r\n string = \"Full Population\";\r\n } else {\r\n if (d.genderString.split(\",\").length != 2) {\r\n d.genderString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.genders[d - 1] + \", \";\r\n });\r\n string =\r\n \"<span class='spanBold'>Genders:</span> \" +\r\n string.substr(0, string.length - 2) +\r\n \"</br>\";\r\n }\r\n\r\n if (d.ethnicityString.split(\",\").length != 6) {\r\n string =\r\n string + \"<span class='spanBold'> Ethnicities:</span> \";\r\n d.ethnicityString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.ethnicities[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n\r\n if (d.agebandString.split(\",\").length != 9) {\r\n string =\r\n string + \"<span class='spanBold'> Age Bands:</span> \";\r\n d.agebandString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.ageBands[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n\r\n if (d.nationalitiesString.split(\",\").length != 2) {\r\n string =\r\n string + \"<span class='spanBold'> Nationalities:</span> \";\r\n d.nationalitiesString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.nationalities[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n\r\n if (d.religionsString.split(\",\").length != 4) {\r\n string =\r\n string + \"<span class='spanBold'> Religions:</span> \";\r\n d.religionsString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.religions[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n\r\n if (d.healthString.split(\",\").length != 7) {\r\n string = string + \"<span class='spanBold'> Health:</span> \";\r\n d.healthString.split(\",\").forEach(function (d, i) {\r\n string = string + aleph.codes.health[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n\r\n if (d.qualificationString.split(\",\").length != 4) {\r\n string =\r\n string + \"<span class='spanBold'> Qualifications:</span> \";\r\n d.qualificationString.split(\",\").forEach(function (d) {\r\n string = string + aleph.codes.qualifications[d - 1] + \", \";\r\n });\r\n string = string.substr(0, string.length - 2) + \"</br>\";\r\n }\r\n }\r\n\r\n return string;\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n d3.selectAll(\".aleph-toolTip-Div\")\r\n .append(\"label\")\r\n .attr(\"class\", \"aleph-tooltip-footer toolTip-content-to-Remove\")\r\n .text(\r\n \"* Only criteria are listed for those selections modified from 'Full Population'.\"\r\n );\r\n\r\n d3.selectAll(\".aleph-toolTip-Div\").moveToFront();\r\n\r\n return;\r\n}", "function plotChart() {\n\n // Determine color\n xArr.forEach((param) => { \n if (param.xAxisVal === xSelVal) xColor = param.xColor;\n });\n yArr.forEach((param) => {\n if (param.yAxisVal === ySelVal) yColor = param.yColor;\n }); \n \n // Determine scales of x- and y-axis in the chart\n let xLinearScale = xScale(acsData, xSelVal),\n yLinearScale = yScale(acsData, ySelVal);\n\n // Create axis functions\n let bottomAxis = d3.axisBottom(xLinearScale),\n leftAxis = d3.axisLeft(yLinearScale);\n\n // Update x- and y-axis\n xAxis.transition()\n .call(bottomAxis);\n yAxis.transition()\n .call(leftAxis);\n \n // Update color of axes ticks and texts\n xAxis.select('path').style(\"stroke\", xColor);\n xAxis.selectAll(\"line\").style(\"stroke\", xColor);\n xAxis.selectAll('text').style(\"fill\", xColor); \n yAxis.select('path').style(\"stroke\", yColor);\n yAxis.selectAll(\"line\").style(\"stroke\", yColor);\n yAxis.selectAll('text').style(\"fill\", yColor);\n\n // Update x-axis titles\n xTitleWrapper.selectAll('text')\n .transition()\n .style(\"fill\", \"#c9c9c9\")\n .attr(\"class\", \"inactive axis-text\"); \n xTitleWrapper.select(`#${xSelVal}`)\n .transition()\n .style(\"fill\", xColor)\n .attr(\"class\", \"active axis-text\");\n\n // Update y-axis titles \n yTitleWrapper.selectAll('text')\n .transition()\n .style(\"fill\", \"#c9c9c9\")\n .attr(\"class\", \"inactive axis-text\"); \n yTitleWrapper.select(`#${ySelVal}`)\n .transition()\n .style(\"fill\", yColor)\n .attr(\"class\", \"active axis-text\"); \n\n // Update circles\n circlesGroup.transition()\n .duration(500)\n .attr(\"cx\", (d) => xLinearScale(d[xSelVal]))\n .attr(\"cy\", (d) => yLinearScale(d[ySelVal]))\n .attr(\"r\", 10)\n .style(\"fill\", yColor);\n\n // Update circle texts\n circleTextsGroup.transition()\n .duration(500)\n .attr(\"x\", (d) => xLinearScale(d[xSelVal]))\n .attr(\"y\", (d) => yLinearScale(d[ySelVal])) \n .attr(\"dy\", 3.5)\n .text((d) => d.abbr)\n .style(\"fill\", xColor);\n\n // .......... Event listener for tool tips .......... //\n // Determine x- and y-label to be displayed in tool tips\n xArr.forEach((param) => { \n if (param.xAxisVal === xSelVal) xToolTipLabel = param.xAxisToolTip;\n });\n yArr.forEach((param) => {\n if (param.yAxisVal === ySelVal) yToolTipLabel = param.yAxisToolTip;\n }); \n\n // Setup tool tip\n let toolTip = d3.tip()\n .attr(\"class\", \"d3-tip\")\n .offset([-20, -60])\n .html((d) => {\n return `${d.state}<br>${xToolTipLabel} ${d[xSelVal]}%<br>${yToolTipLabel} ${d[ySelVal]}%`;\n });\n \n // APPEND TOOL TIP\n circlesGroup.call(toolTip);\n\n // Event listeners for circle and tool tip\n circlesGroup\n\n .on(\"mouseover\", function(d) {\n // Show tool tip\n toolTip.show(d, this);\n // Setup selected circle\n d3.select(this)\n .style(\"fill\", \"black\") \n .attr(\"stroke-width\", 2.5)\n .attr(\"r\", 14);\n })\n\n .on(\"mouseout\", function(d) {\n // Hide tool tip\n toolTip.hide(d, this);\n // Setup selected circle\n d3.select(this)\n .style(\"fill\", yColor)\n .attr(\"stroke-width\", 1)\n .attr(\"r\", 10); \n }); \n\n // End of \"plotChart()\"\" function\n }", "_drawAnchorPoints() {\n let ctx = this.chart.canvas.ctx;\n let hoveredAnchorPoint = this.chart.selectionModule.hoveredAnchorPoint || {};\n\n // Draw the not active anchor points\n ctx.beginPath();\n ctx.fillStyle = 'rgba(255, 255, 255, 0.7)';\n ctx.lineWidth = 1;\n ctx.strokeStyle = 'rgba(100, 100, 100, 0.4)';\n this.anchorPoints.filter(a => !a.isActive && a.id != hoveredAnchorPoint.id).forEach(a => a.draw(ctx));\n ctx.stroke();\n ctx.fill();\n\n // Draw the active anchor points\n ctx.beginPath();\n ctx.fillStyle = 'rgba(255, 255, 255, 1)';\n ctx.lineWidth = 1;\n ctx.strokeStyle = 'rgba(100, 100, 100, 1)';\n this.anchorPoints.filter(a => a.isActive || a.id === hoveredAnchorPoint.id).forEach(a => a.draw(ctx));\n ctx.stroke();\n ctx.fill();\n }", "constructor(dimensions, xvar, yvar, possible_xs, possible_ys) {\n graph_counter += 1\n this.graph_name = 'WowG' + String(graph_counter);\n this.hover_circle = main_svg.append('circle')\n .attr('r', 5)\n .attr('cx', 100)\n .attr('cy', 100)\n .attr('fill', 'none')\n .attr('stroke', '#000000')\n .attr('opacity', 0);\n [this.left, this.top, this.w, this.h] = dimensions;\n this.xvar = xvar;\n this.yvar = yvar;\n let self = this;\n this.svg = main_svg;\n this.graph_stuff = this.svg.append('g');\n \n this.x_axis = this.graph_stuff.append('g').attr(\"transform\", \"translate(0,\" + String(self.top+self.h) + \")\");\n this.y_axis = this.graph_stuff.append('g').attr(\"transform\", \"translate(\" + String(self.left) + \",0)\");\n\n this.xlabel = this.svg.append('foreignObject')\n .attr('x', self.left+self.w/2-50)\n .attr('y', self.top+self.h+20)\n .attr('width', 100)\n .attr('height', 20)\n .attr('class', 'axis_label_foreign_obj');\n this.xlabel_dropdown = this.xlabel.append('xhtml:select')\n .attr('class', 'axis_label_select')\n .on('change', function() {\n self.set_x(d3.select(this).property('value'));\n console.log('Changing x to', self.xvar);\n draw_right();\n })\n .selectAll('option')\n .data(possible_xs)\n .enter()\n .append('option')\n .attr('value', d => d)\n .property('selected', d => d==self.xvar)\n .html(d => d);\n\n this.ylabel = this.svg.append('foreignObject')\n .attr('x', self.left-50)\n .attr('y', self.top-25)\n .attr('width', 100)\n .attr('height', 20)\n .attr('class', 'axis_label_foreign_obj');\n this.ylabel_dropdown = this.ylabel.append('xhtml:select')\n .attr('class', 'axis_label_select')\n .on('change', function() {\n self.set_y(d3.select(this).property('value'));\n console.log('Changing y to', self.yvar);\n draw_right();\n })\n .selectAll('option')\n .data(possible_ys)\n .enter()\n .append('option')\n .attr('value', d => d)\n .property('selected', d => d==self.yvar)\n .html(d => d);\n \n self.set_x(self.xvar);\n self.set_y(self.yvar);\n }", "function updateAxis(){\n\t\tchangeAxisX();\n\t\tchangeAxisY();\n\t\tupdateMaxMinForAxis();\n\n\t\t/*Init helpers*/\n\t\tvar width = getWidth();\n\t\tvar height = getHeight();\n\t\t//horisontal xAxis\n\t\txAxisLine\n\t\t\t.attr(\"x1\", 0)\n\t\t\t.attr(\"y1\", height/2)\n\t\t\t.attr(\"x2\", width)\n\t\t\t.attr(\"y2\", height/2)\n\t\t\t.attr(\"class\", \"axisLine\")\n\t\t\t.attr(\"stroke-width\", 2)\n\t\t\t.attr(\"stroke\", \"black\");\n\t\txAxisLabelRight\n\t\t\t.attr(\"x\", width)\n\t\t\t.attr(\"y\", height/2)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"rotate(90 \"+width+\" \"+height/2+\") translate(0, 35)\")\n\t\t\t.text(xAxisValue);\n\t\txAxisLabelLeft\n\t\t\t.attr(\"x\", 0)\n\t\t\t.attr(\"y\", height/2)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"rotate(270 \"+0+\" \"+height/2+\") translate(0, 35)\")\n\t\t\t.text(axisValueOpposites[axisValues.indexOf(xAxisValue)]);\n\t\t//vertical yAxis\n\t\tyAxisLine\n\t\t\t.attr(\"x1\", width/2)\n\t\t\t.attr(\"y1\", 0)\n\t\t\t.attr(\"x2\", width/2)\n\t\t\t.attr(\"y2\", height)\n\t\t\t.attr(\"class\", \"axisLine\")\n\t\t\t.attr(\"stroke-width\", 2)\n\t\t\t.attr(\"stroke\", \"black\");\n\t\tyAxisLabelTop\n\t\t\t.attr(\"x\", width/2)\n\t\t\t.attr(\"y\", 30)\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.attr(\"transform\", \"translate(0, 5)\")\n\t\t\t.text(yAxisValue);\n\t\tyAxisLabelBottom\n\t\t\t.attr(\"x\", width/2)\n\t\t\t.attr(\"y\", height)\n\t\t\t.attr(\"transform\", \"translate(0, -5)\")\n\t\t\t.attr(\"class\", \"axisExplanation\")\n\t\t\t.text(axisValueOpposites[axisValues.indexOf(yAxisValue)]);\n\t}", "function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n Object(util[\"k\" /* each */])(AXIS_TYPES, function (v, axisType) {\n var defaultOption = Object(util[\"I\" /* merge */])(Object(util[\"I\" /* merge */])({}, axisDefault[axisType], true), extraDefaultOption, true);\n\n var AxisModel =\n /** @class */\n function (_super) {\n Object(tslib_tslib_es6[\"b\" /* __extends */])(AxisModel, _super);\n\n function AxisModel() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var _this = _super.apply(this, args) || this;\n\n _this.type = axisName + 'Axis.' + axisType;\n return _this;\n }\n\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = Object(util_layout[\"d\" /* fetchLayoutMode */])(this);\n var inputPositionParams = layoutMode ? Object(util_layout[\"f\" /* getLayoutParams */])(option) : {};\n var themeModel = ecModel.getTheme();\n Object(util[\"I\" /* merge */])(option, themeModel.get(axisType + 'Axis'));\n Object(util[\"I\" /* merge */])(option, this.getDefaultOption());\n option.type = getAxisType(option);\n\n if (layoutMode) {\n Object(util_layout[\"h\" /* mergeLayoutParam */])(option, inputPositionParams, layoutMode);\n }\n };\n\n AxisModel.prototype.optionUpdated = function () {\n var thisOption = this.option;\n\n if (thisOption.type === 'category') {\n this.__ordinalMeta = data_OrdinalMeta.createByAxisModel(this);\n }\n };\n /**\n * Should not be called before all of 'getInitailData' finished.\n * Because categories are collected during initializing data.\n */\n\n\n AxisModel.prototype.getCategories = function (rawData) {\n var option = this.option; // FIXME\n // warning if called before all of 'getInitailData' finished.\n\n if (option.type === 'category') {\n if (rawData) {\n return option.data;\n }\n\n return this.__ordinalMeta.categories;\n }\n };\n\n AxisModel.prototype.getOrdinalMeta = function () {\n return this.__ordinalMeta;\n };\n\n AxisModel.type = axisName + 'Axis.' + axisType;\n AxisModel.defaultOption = defaultOption;\n return AxisModel;\n }(BaseAxisModelClass);\n\n registers.registerComponentModel(AxisModel);\n });\n registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n}", "function tooltips() {\n removeTooltips();\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n bindEvent(\"update\" + INTERNAL_EVENT_NS.tooltips, function (values, handleNumber, unencoded) {\n if (!scope_Tooltips || !options.tooltips) {\n return;\n }\n if (scope_Tooltips[handleNumber] === false) {\n return;\n }\n var formattedValue = values[handleNumber];\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "getLinkAnchors(mode) {\n const attrs = this.state.attributes;\n return [\n {\n element: this.object._id,\n points: [\n {\n x: attrs.x,\n y: attrs.y,\n xAttribute: \"x\",\n yAttribute: \"y\",\n direction: { x: mode == \"begin\" ? 1 : -1, y: 0 }\n }\n ]\n }\n ];\n }", "buildDefs() {\n const svg = d3.select(this.svgEl);\n const edges = flatten(this.layout).edges;\n\n // Clean up\n svg.select('defs').selectAll('.edge-marker-end').remove();\n\n svg.select('defs')\n .selectAll('.edge-marker-end')\n .data(edges)\n .enter()\n .append('marker')\n .classed('edge-marker-end', true)\n .attr('id', d => {\n const source = d.data.source.replace(/\\s/g, '');\n const target = d.data.target.replace(/\\s/g, '');\n return `arrowhead-${source}-${target}`;\n })\n .attr('viewBox', svgUtil.MARKER_VIEWBOX)\n .attr('refX', 2)\n .attr('refY', 0)\n .attr('orient', 'auto')\n .attr('markerWidth', 15)\n .attr('markerHeight', 15)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('xoverflow', 'visible')\n .append('svg:path')\n .attr('d', svgUtil.ARROW)\n .style('fill', '#000')\n .style('stroke', 'none');\n }", "function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n\t each(AXIS_TYPES, function (v, axisType) {\n\t var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\n\t\n\t var AxisModel =\n\t /** @class */\n\t function (_super) {\n\t __extends(AxisModel, _super);\n\t\n\t function AxisModel() {\n\t var args = [];\n\t\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t args[_i] = arguments[_i];\n\t }\n\t\n\t var _this = _super.apply(this, args) || this;\n\t\n\t _this.type = axisName + 'Axis.' + axisType;\n\t return _this;\n\t }\n\t\n\t AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n\t var layoutMode = fetchLayoutMode(this);\n\t var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n\t var themeModel = ecModel.getTheme();\n\t merge(option, themeModel.get(axisType + 'Axis'));\n\t merge(option, this.getDefaultOption());\n\t option.type = getAxisType(option);\n\t\n\t if (layoutMode) {\n\t mergeLayoutParam(option, inputPositionParams, layoutMode);\n\t }\n\t };\n\t\n\t AxisModel.prototype.optionUpdated = function () {\n\t var thisOption = this.option;\n\t\n\t if (thisOption.type === 'category') {\n\t this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\n\t }\n\t };\n\t /**\n\t * Should not be called before all of 'getInitailData' finished.\n\t * Because categories are collected during initializing data.\n\t */\n\t\n\t\n\t AxisModel.prototype.getCategories = function (rawData) {\n\t var option = this.option; // FIXME\n\t // warning if called before all of 'getInitailData' finished.\n\t\n\t if (option.type === 'category') {\n\t if (rawData) {\n\t return option.data;\n\t }\n\t\n\t return this.__ordinalMeta.categories;\n\t }\n\t };\n\t\n\t AxisModel.prototype.getOrdinalMeta = function () {\n\t return this.__ordinalMeta;\n\t };\n\t\n\t AxisModel.type = axisName + 'Axis.' + axisType;\n\t AxisModel.defaultOption = defaultOption;\n\t return AxisModel;\n\t }(BaseAxisModelClass);\n\t\n\t registers.registerComponentModel(AxisModel);\n\t });\n\t registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n\t }", "function makePlotFramework(gd) {\n var gd3 = d3.select(gd);\n var fullLayout = gd._fullLayout;\n fullLayout._calcInverseTransform = calcInverseTransform;\n fullLayout._calcInverseTransform(gd);\n\n // Plot container\n fullLayout._container = gd3.selectAll('.plot-container').data([0]);\n fullLayout._container.enter().insert('div', ':first-child').classed('plot-container', true).classed('plotly', true);\n\n // Make the svg container\n fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);\n fullLayout._paperdiv.enter().append('div').classed('user-select-none', true).classed('svg-container', true).style('position', 'relative');\n\n // Make the graph containers\n // start fresh each time we get here, so we know the order comes out\n // right, rather than enter/exit which can muck up the order\n // TODO: sort out all the ordering so we don't have to\n // explicitly delete anything\n // FIXME: parcoords reuses this object, not the best pattern\n fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container').data([{}]);\n fullLayout._glcontainer.enter().append('div').classed('gl-container', true);\n fullLayout._paperdiv.selectAll('.main-svg').remove();\n fullLayout._paperdiv.select('.modebar-container').remove();\n fullLayout._paper = fullLayout._paperdiv.insert('svg', ':first-child').classed('main-svg', true);\n fullLayout._toppaper = fullLayout._paperdiv.append('svg').classed('main-svg', true);\n fullLayout._modebardiv = fullLayout._paperdiv.append('div');\n delete fullLayout._modeBar;\n fullLayout._hoverpaper = fullLayout._paperdiv.append('svg').classed('main-svg', true);\n if (!fullLayout._uid) {\n var otherUids = {};\n d3.selectAll('defs').each(function () {\n if (this.id) otherUids[this.id.split('-')[1]] = 1;\n });\n fullLayout._uid = Lib.randstr(otherUids);\n }\n fullLayout._paperdiv.selectAll('.main-svg').attr(xmlnsNamespaces.svgAttrs);\n fullLayout._defs = fullLayout._paper.append('defs').attr('id', 'defs-' + fullLayout._uid);\n fullLayout._clips = fullLayout._defs.append('g').classed('clips', true);\n fullLayout._topdefs = fullLayout._toppaper.append('defs').attr('id', 'topdefs-' + fullLayout._uid);\n fullLayout._topclips = fullLayout._topdefs.append('g').classed('clips', true);\n fullLayout._bgLayer = fullLayout._paper.append('g').classed('bglayer', true);\n fullLayout._draggers = fullLayout._paper.append('g').classed('draglayer', true);\n\n // lower shape/image layer - note that this is behind\n // all subplots data/grids but above the backgrounds\n // except inset subplots, whose backgrounds are drawn\n // inside their own group so that they appear above\n // the data for the main subplot\n // lower shapes and images which are fully referenced to\n // a subplot still get drawn within the subplot's group\n // so they will work correctly on insets\n var layerBelow = fullLayout._paper.append('g').classed('layer-below', true);\n fullLayout._imageLowerLayer = layerBelow.append('g').classed('imagelayer', true);\n fullLayout._shapeLowerLayer = layerBelow.append('g').classed('shapelayer', true);\n\n // single cartesian layer for the whole plot\n fullLayout._cartesianlayer = fullLayout._paper.append('g').classed('cartesianlayer', true);\n\n // single polar layer for the whole plot\n fullLayout._polarlayer = fullLayout._paper.append('g').classed('polarlayer', true);\n\n // single smith layer for the whole plot\n fullLayout._smithlayer = fullLayout._paper.append('g').classed('smithlayer', true);\n\n // single ternary layer for the whole plot\n fullLayout._ternarylayer = fullLayout._paper.append('g').classed('ternarylayer', true);\n\n // single geo layer for the whole plot\n fullLayout._geolayer = fullLayout._paper.append('g').classed('geolayer', true);\n\n // single funnelarea layer for the whole plot\n fullLayout._funnelarealayer = fullLayout._paper.append('g').classed('funnelarealayer', true);\n\n // single pie layer for the whole plot\n fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);\n\n // single treemap layer for the whole plot\n fullLayout._iciclelayer = fullLayout._paper.append('g').classed('iciclelayer', true);\n\n // single treemap layer for the whole plot\n fullLayout._treemaplayer = fullLayout._paper.append('g').classed('treemaplayer', true);\n\n // single sunburst layer for the whole plot\n fullLayout._sunburstlayer = fullLayout._paper.append('g').classed('sunburstlayer', true);\n\n // single indicator layer for the whole plot\n fullLayout._indicatorlayer = fullLayout._toppaper.append('g').classed('indicatorlayer', true);\n\n // fill in image server scrape-svg\n fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true);\n\n // lastly upper shapes, info (legend, annotations) and hover layers go on top\n // these are in a different svg element normally, but get collapsed into a single\n // svg when exporting (after inserting 3D)\n // upper shapes/images are only those drawn above the whole plot, including subplots\n var layerAbove = fullLayout._toppaper.append('g').classed('layer-above', true);\n fullLayout._imageUpperLayer = layerAbove.append('g').classed('imagelayer', true);\n fullLayout._shapeUpperLayer = layerAbove.append('g').classed('shapelayer', true);\n fullLayout._selectionLayer = fullLayout._toppaper.append('g').classed('selectionlayer', true);\n fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);\n fullLayout._menulayer = fullLayout._toppaper.append('g').classed('menulayer', true);\n fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);\n fullLayout._hoverlayer = fullLayout._hoverpaper.append('g').classed('hoverlayer', true);\n\n // Make the modebar container\n fullLayout._modebardiv.classed('modebar-container', true).style('position', 'absolute').style('top', '0px').style('right', '0px');\n gd.emit('plotly_framework');\n}", "function updatePlot(selection, mydata, currentaxis) {\n \n // reset existing plot\n svg.selectAll(\"circle\").remove();\n svg.selectAll(\".node\").remove();\n var xaxis = \"\";\n var yaxis = \"\";\n \n \n // set data set based on selected dimensions\n if (selected[0][2]) {\n xaxis = function(d) { return x(d.pctInPoverty); }\n x.domain([d3.min(mydata, function(d) { return d.pctInPoverty; }) - 1, d3.max(mydata, function(d) { return d.pctInPoverty; }) + 1]);\n }\n if (selected[1][2]) {\n xaxis = function(d) { return x(d.medAge); }\n x.domain([d3.min(mydata, function(d) { return d.medAge; }) -1, d3.max(mydata, function(d) { return d.medAge; }) + 1]);\n }\n if (selected[2][2]) {\n xaxis = function(d) { return x(d.medFamilyInc); }\n x.domain([d3.min(mydata, function(d) { return d.medFamilyInc; }) - 5000, d3.max(mydata, function(d) { return d.medFamilyInc; }) + 5000]);\n }\n if (selected[3][2]) {\n yaxis = function(d) { return y(d.pctNeverHadCheckup); }\n y.domain([d3.min(mydata, function(d) { return d.pctNeverHadCheckup; }) - .1, d3.max(mydata, function(d) { return d.pctNeverHadCheckup; }) + .1]);\n }\n if (selected[4][2]) {\n yaxis = function(d) { return y(d.pctStroke); }\n y.domain([d3.min(mydata, function(d) { return d.pctStroke; }) -1, d3.max(mydata, function(d) { return d.pctStroke; }) +1]);\n myYTip = \"<div>Stroke %: \" + (function(d) { return d.pctStroke; }) + \"</div>\";\n }\n if (selected[5][2]) {\n yaxis = function(d) { return y(d.pctObese); }\n y.domain([d3.min(mydata, function(d) { return d.pctObese; }) -1, d3.max(mydata, function(d) { return d.pctObese; }) +1]);\n }\n \n svg.call(tool_tip);\n \n //Refomat the x axis if clicked\n if (currentaxis == \"x\") {\n svg.select(selection)\n .style(\"fill\", \"purple\")\n .style(\"font-weight\", \"bold\")\n .attr('fill-opacity', 1)\n .transition();\n \n svg.select(prevXSelected)\n .style(\"fill\", \"black\")\n .attr('fill-opacity', 0.5)\n .style(\"font-weight\", \"normal\")\n .transition();\n \n prevXSelected = selection;\n }\n \n //Reformat the y axis if clicked\n if (currentaxis == \"y\") {\n svg.select(selection)\n .style(\"fill\", \"purple\")\n .style(\"font-weight\", \"bold\")\n .attr('fill-opacity', 1)\n .transition();\n \n svg.select(prevYSelected)\n .style(\"fill\", \"black\")\n .style(\"font-weight\", \"normal\")\n .attr('fill-opacity', 0.5)\n .transition();\n \n prevYSelected = selection;\n }\n\n // Add the scatterplot\n svg.selectAll(\"dot\")\n .data(mydata)\n .enter()\n .append(\"circle\")\n .attr(\"r\", 10)\n .attr(\"fill\", \"purple\")\n .attr('fill-opacity', 0.5)\n .attr(\"text\", mydata.state)\n .on('mouseover', tool_tip.show)\n .on('mouseout', tool_tip.hide)\n .attr(\"cx\", xaxis)\n .attr(\"cy\", yaxis); \n \n // Add the state labels\n var myg = svg.selectAll(\"g.node\")\n .data(mydata)\n .enter().append(\"svg:g\")\n .attr(\"class\", \"node\");\n \n myg.append(\"svg:text\")\n .attr(\"x\", xaxis)\n .attr(\"y\", yaxis)\n .attr(\"dy\", \".31em\")\n .style(\"font\", \"8px sans-serif\")\n .style(\"text-anchor\", \"middle\")\n .style(\"fill\", \"white\")\n .attr(\"class\", \"labels\")\n .text(function(d) { return d.state; });\n \n // Update the X Axis\n svg.select(\".xaxis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .transition()\n .call(d3.axisBottom(x));\n \n // Update the Y Axis\n svg.select(\".yaxis\")\n .transition()\n .call(d3.axisLeft(y));\n\n}", "function setupCtrlPointEvent(){\n circles.call(tip);\n circles.on('mouseover', tip.show).on('mousemove', tip.show).on('mouseout', tip.hide);\n circles.call(drag);\n //// right click to remove a opacity control point\n circles.on('contextmenu', function(d,i){\n d3.event.preventDefault(); //disable default menu popout\n if( i > 0 && i < vis.opaCtrlPoint.length - 1) {\n vis.opaCtrlPoint.splice(i, 1);\n updateTFInterface();\n tip.hide();\n }\n });\n\n circlesColor.call(tipColor);\n circlesColor.on('mouseover', tipColor.show).on('mousemove', tipColor.show).on('mouseout', tipColor.hide);\n circlesColor.call(dragColor);\n //// right click to remove a color control point\n circlesColor.on('contextmenu', function(d,i){\n d3.event.preventDefault(); //disable default menu popout\n if( i > 0 && i < vis.colorCtrlPoint.length - 1) {\n vis.colorCtrlPoint.splice(i, 1);\n updateColorGradientDef();\n updateTFInterface();\n tip.hide();\n }\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "function tooltips() {\n removeTooltips();\n\n // Tooltips are added with options.tooltips in original order.\n scope_Tooltips = scope_Handles.map(addTooltip);\n\n bindEvent(\"update.tooltips\", function(values, handleNumber, unencoded) {\n if (!scope_Tooltips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n scope_Tooltips[handleNumber].innerHTML = formattedValue;\n });\n }", "getLinkAnchors() {\n const attrs = this.state.attributes;\n const element = this.object._id;\n return [\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y1,\n xAttribute: \"x1\",\n yAttribute: \"y1\",\n direction: { x: -1, y: 0 }\n },\n {\n x: attrs.x1,\n y: attrs.y2,\n xAttribute: \"x1\",\n yAttribute: \"y2\",\n direction: { x: -1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x2,\n y: attrs.y1,\n xAttribute: \"x2\",\n yAttribute: \"y1\",\n direction: { x: 1, y: 0 }\n },\n {\n x: attrs.x2,\n y: attrs.y2,\n xAttribute: \"x2\",\n yAttribute: \"y2\",\n direction: { x: 1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y1,\n xAttribute: \"x1\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n },\n {\n x: attrs.x2,\n y: attrs.y1,\n xAttribute: \"x2\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.y2,\n xAttribute: \"x1\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n },\n {\n x: attrs.x2,\n y: attrs.y2,\n xAttribute: \"x2\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.cx,\n y: attrs.y1,\n xAttribute: \"cx\",\n yAttribute: \"y1\",\n direction: { x: 0, y: -1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.cx,\n y: attrs.y2,\n xAttribute: \"cx\",\n yAttribute: \"y2\",\n direction: { x: 0, y: 1 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x1,\n y: attrs.cy,\n xAttribute: \"x1\",\n yAttribute: \"cy\",\n direction: { x: -1, y: 0 }\n }\n ]\n },\n {\n element,\n points: [\n {\n x: attrs.x2,\n y: attrs.cy,\n xAttribute: \"x2\",\n yAttribute: \"cy\",\n direction: { x: 1, y: 0 }\n }\n ]\n }\n ];\n }", "function getYaxisOptions(){\n scale = new Array();\n\n if(generate_param_1){\n y1_scale = {\n type: \"linear\",\n\n display: show_scale_1,\n position: \"left\",\n id: \"y-axis-1\",\n scaleLabel: {\n display: true,\n labelString: label_1,\n },\n };\n\n if(same_scale) {\n y1_scale[\"ticks\"] = {\n min: min_scale_value,\n max: max_scale_value\n }\n }\n\n scale.push(y1_scale);\n }\n\n\n if(generate_param_2){\n y2_scale = {\n type: \"linear\",\n display: show_scale_2,\n position: \"right\",\n id: \"y-axis-2\",\n scaleLabel: {\n display: true,\n labelString: label_2,\n },\n gridLines: {\n drawOnChartArea: false,\n }\n };\n\n if(same_scale) {\n y2_scale[\"ticks\"] = {\n min: min_scale_value,\n max: max_scale_value\n }\n }\n\n scale.push(y2_scale);\n }\n\n if(generate_param_3){\n y3_scale = {\n type: \"linear\",\n display: show_scale_3,\n position: \"right\",\n id: \"y-axis-3\",\n scaleLabel: {\n display: true,\n labelString: label_3\n },\n gridLines: {\n drawOnChartArea: false,\n }\n };\n scale.push(y3_scale);\n }\n\n\n\n return scale;\n}", "function updateToolTip(selectedAxis, circlesGroup) {\n console.log(\"Selected Axis inside updateToolTips: \" + selectedAxis)\n\n if (selectedAxis == \"poverty\") {\n var label = \"Poverty (%):\"\n } else {\n var label = \"Obesity (%)\"\n }\n \n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([80, -60])\n .html(function (d) {\n console.log(\"d[selectedAxis]: \" + d[selectedAxis]);\n return (`${d.states}<br>${label} ${d[selectedAxis]}`);\n \n });\n console.log(\"tooltip: \" +toolTip );\n circlesGroup.call(toolTip);\n \n circlesGroup.on(\"mouseover\", function (data) {\n toolTip.show(data);\n })\n // onmouseout event\n .on(\"mouseout\", function (data, index) {\n toolTip.hide(data);\n });\n \n return circlesGroup\n }", "function tooltips() {\n\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n\n bindEvent('update', function (values, handleNumber, unencoded) {\n\n if (!tips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n tips[handleNumber].innerHTML = formattedValue;\n });\n }", "function chartOps() {\n const mainChartOpts = {\n tooltips: {\n enabled: false,\n custom: CustomTooltips,\n intersect: true,\n mode: 'index',\n position: 'nearest',\n callbacks: {\n labelColor: function(tooltipItem, chart) {\n return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].borderColor }\n }\n }\n },\n maintainAspectRatio: false,\n legend: {\n display: false,\n },\n scales: {\n xAxes: [\n {\n gridLines: {\n drawOnChartArea: false,\n },\n }],\n yAxes: [\n {\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 5,\n stepSize: Math.ceil(250 / 5),\n max: 250,\n },\n }],\n },\n elements: {\n point: {\n radius: 0,\n hitRadius: 10,\n hoverRadius: 4,\n hoverBorderWidth: 3,\n },\n },\n };\n return mainChartOpts;\n}", "function prepareScatterPlot(parentKeys, childKeys) {\n\t//empty the container\n\t// $(\"#lct-main-container\").empty();\n\t//dynamically load the parent keys from the data user selected\n\t//x-axis\n\t$.each(parentKeys, function (index, value) {\n\t\t$(\"#sct-parentkey-select-x\").append($(\"<option ></option>\").attr(\"value\", index).text(value));\n\t});\n\t$(\"#sct-parentkey-select-x option[value=0]\").attr(\"selected\", \"selected\");//set the first element in the parentKeys as the default value\n\n\t//set childKeys of the first parent key as the default value\n\t$.each(childKeys[parentKeys[0]], function (index, value) {\n\t\t$(\"#sct-childkey-select-x\").append($(\"<option></option>\").attr(\"value\", index).text(value));\n\t});\n\n\t//dynamically load the child keys from the parent key user selected\n\t$(\"#sct-parentkey-select-x\").change(function () {\n\t\t$(\"#sct-childkey-select-x\").empty();\n\t\tvar parentkey = $(\"#sct-parentkey-select-x option:selected\").text();\n\t\tvar validChildKeys = childKeys[parentkey];\n\t\t$.each(validChildKeys, function (index, value) {\n\t\t\t$(\"#sct-childkey-select-x\").append($(\"<option></option>\").attr(\"value\", index).text(value));\n\t\t})\n\t});\n\n\t// set the first element of the child keys as the default option\n\t$(\"#sct-childkey-select-x option[value=0]\").attr(\"selected\", \"selected\");\n\n\n\n\t//y-axis\n\t$.each(parentKeys, function (index, value) {\n\t\t$(\"#sct-parentkey-select-y\").append($(\"<option ></option>\").attr(\"value\", index).text(value));\n\t});\n\t$(\"#sct-parentkey-select-y option[value=0]\").attr(\"selected\", \"selected\");//set the first element in the parentKeys as the default value\n\n\t//set childKeys of the first parent key as the default value\n\t$.each(childKeys[parentKeys[0]], function (index, value) {\n\t\t$(\"#sct-childkey-select-y\").append($(\"<option></option>\").attr(\"value\", index).text(value));\n\t});\n\n\t//dynamically load the child keys from the parent key user selected\n\t$(\"#sct-parentkey-select-y\").change(function () {\n\t\t$(\"#sct-childkey-select-y\").empty();\n\t\tvar parentkey = $(\"#sct-parentkey-select-y option:selected\").text();\n\t\tvar validChildKeys = childKeys[parentkey];\n\t\t$.each(validChildKeys, function (index, value) {\n\t\t\t$(\"#sct-childkey-select-y\").append($(\"<option></option>\").attr(\"value\", index).text(value));\n\t\t})\n\t});\n\n\t// set the first element of the child keys as the default option\n\t$(\"#sct-childkey-select-y option[value=0]\").attr(\"selected\", \"selected\");\n}", "function setupAxes(target){\n target\n .append('g')\n .attr('class', 'axis axis-x')\n .call(d3.axisBottom(x))\n .attr('transform', 'translate(0,' + height + ')')\n .selectAll(\"text\")\n //Note: There's prob a better way to do this...\n .attr(\"transform\", \"rotate(45)\")\n .attr(\"dx\", 80)\n .attr(\"dy\", \"1em\");\n \n target\n .append('g')\n .attr('class', 'axis axis-y')\n .call(d3.axisLeft(y)\n .ticks(10));\n }", "function layout$1(gridModel, axisModel, opt) {\n\t opt = opt || {};\n\t var grid = gridModel.coordinateSystem;\n\t var axis = axisModel.axis;\n\t var layout = {};\n\t var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n\t var rawAxisPosition = axis.position;\n\t var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n\t var axisDim = axis.dim;\n\t var rect = grid.getRect();\n\t var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n\t var idx = {\n\t left: 0,\n\t right: 1,\n\t top: 0,\n\t bottom: 1,\n\t onZero: 2\n\t };\n\t var axisOffset = axisModel.get('offset') || 0;\n\t var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\t\n\t if (otherAxisOnZeroOf) {\n\t var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n\t posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n\t } // Axis position\n\t\n\t\n\t layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\t\n\t layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\t\n\t var dirMap = {\n\t top: -1,\n\t bottom: 1,\n\t left: -1,\n\t right: 1\n\t };\n\t layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n\t layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\t\n\t if (axisModel.get(['axisTick', 'inside'])) {\n\t layout.tickDirection = -layout.tickDirection;\n\t }\n\t\n\t if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n\t layout.labelDirection = -layout.labelDirection;\n\t } // Special label rotation\n\t\n\t\n\t var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n\t layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\t\n\t layout.z2 = 1;\n\t return layout;\n\t }", "function sharingAxis() {\n\n\n angular.forEach(dqFactory.completeness.variables, function (variable) {\n if(variable.state.selected) {\n\n //console.log(\"sharingAxis: \", xWidth);\n\n //historical bar chart, sharing x\n var optionSharingX = {\n chart: {\n type: 'historicalBarChart',\n height: 150,\n width: xWidth,\n margin: {\n //top: 20,\n right: 20,\n bottom: 65,\n left: 75\n },\n x: function (d) {\n return d[0];\n },\n y: function (d) {\n //return d[1] / 100000;\n return d[1]\n },\n showValues: true,\n valueFormat: function (d) {\n return d3.format(',.0f')(d);\n },\n duration: 100,\n\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameX + \"</td>\" +\n \"<td class='x-value'>\" + series.key + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>Missing: </td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.0f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + variable.name + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n },\n\n\n\n\n //xAxis: {\n // axisLabel: $rootScope.gv.stpX,\n // tickFormat: function (d) {\n // return d3.format('.0f')(d);\n // //return d3.time.format('%x')(new Date(d))\n // },\n // ticks: 8,\n // rotateLabels: 30,\n // showMaxMin: true\n //},\n xDomain: $scope.optionPlot.chart.xDomain,\n xAxis: $scope.optionPlot.chart.xAxis,\n yAxis: {\n axisLabel: variable.name,\n axisLabelDistance: -10,\n tickFormat: function (d) {\n return d3.format(',.0f')(d);\n }\n },\n multibar: {\n height: 1\n },\n // useInteractiveGuideline: true,\n // tooltip: {\n // keyFormatter: function (d) {\n // //$log.debug(d);\n // return \"(\".concat(variable.name).concat(\", # missing): \").concat(d);\n // //return d3.time.format('%x')(new Date(d));\n // }\n // },\n zoom: {\n enabled: false,\n scaleExtent: [1, 10],\n useFixedDomain: false,\n useNiceScale: false,\n horizontalOff: false,\n verticalOff: false,\n unzoomEventType: 'dblclick.zoom'\n }\n }\n };\n //console.log(\"xDomain: \", $scope.optionPlot.chart.xDomain);\n //optionSharingX.chart.xDomain = $scope.optionPlot.chart.xDomain;\n //optionSharingX.chart.width = xWidth;\n //console.log(variable.name, \" width: \", optionSharingX.chart.width);\n\n //optionSharingX.chart.width = document.getElementById(\"onlyMainPlotAndBottom\").offsetWidth;//$scope.optionPlot.chart.width;\n\n //optionSharingX.chart.yDomain = $scope.optionPlot.chart.yDomain;\n //console.log(\"plot width: \", $scope.optionPlot.chart.width);\n //optionSharingX.chart.width = $scope.optionPlot.chart.width;\n\n //horizontal bar chart, sharing y\n var optionSharingY = {\n chart: {\n type: 'multiBarHorizontalChart',\n height: $scope.optionPlot.chart.height,\n width: 80,\n margin: {\n left: 0\n },\n x: function (d) {\n return d.label;\n },\n y: function (d) {\n return d.value;\n },\n showControls: false,\n showValues: false,\n showLegend: false,\n showXAxis: false,\n duration: 500,\n xAxis: {showMaxMin: false},\n yAxis: {\n //axisLabel: 'Values',\n tickFormat: function (d) {\n return d3.format(',.0f')(d);\n }\n },\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameY + \"</td>\" +\n \"<td class='x-value'>\" + e.value + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>Missing: </td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.0f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + variable.name + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n },\n multibar: {\n stacked: false\n }\n },\n title: {\n enable: true,\n text: variable.name,\n className: \"h5\"\n },\n subtitle: {\n enable: true,\n text: \"#missing\",\n class: {\n textAlign: \"center\"\n }\n }\n };\n\n var optionCategorical = {\n chart: {\n type: 'scatterChart',\n height: $scope.optionPlot.chart.height,\n color: dqFactory.completeness.colorRange.present, //d3.scale.category10().range(), //TODO\n scatter: {\n onlyCircles: false\n },\n showDistX: false,\n showDistY: false,\n showLegend: true,\n\n useInteractiveGuideline: false,\n tooltip: {\n contentGenerator: function (e) {\n var series = e.series[0];\n\n var rows =\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameX + \"</td>\" +\n \"<td class='x-value'>\" + e.value + \"</td>\" +\n \"</tr>\" +\n \"<tr>\" +\n \"<td class='key'>\" + $scope.nameY + \"</td>\" +\n \"<td class='x-value'><strong>\" + d3.format(',.2f')(series.value) + \"</strong></td>\" +\n \"</tr>\";\n\n var header =\n \"<thead>\" +\n \"<tr>\" +\n \"<td class='legend-color-guide'><div style='background-color: \" + series.color + \";'></div></td>\" +\n \"<td class='key'><strong>\" + series.key + \"</strong></td>\" +\n \"</tr>\" +\n \"</thead>\";\n\n return \"<table>\" +\n header +\n \"<tbody>\" +\n rows +\n \"</tbody>\" +\n \"</table>\";\n }\n\n },\n\n xAxis: {\n axisLabel: $scope.nameX,\n tickFormat: function (d) {\n return d3.format('.0f')(d);\n },\n ticks: 8\n },\n yAxis: {\n axisLabel: $scope.nameY,\n tickFormat: function (d) {\n return d3.format(',.2f')(d);\n },\n axisLabelDistance: -5\n },\n zoom: {\n //NOTE: All attributes below are optional\n enabled: false,\n scaleExtent: [1, 10],\n useFixedDomain: false,\n useNiceScale: false,\n horizontalOff: false,\n verticalOff: false\n //unzoomEventType: 'dblclick.zoom'\n }\n },\n title: {\n enable: true,\n text: variable.name,\n className: \"h5\"\n },\n subtitle: {\n enable: true,\n text: \"Categories for the \"\n .concat(variable.name)\n .concat(\" variable, related to the \")\n .concat(dqFactory.completeness.numericalPlot.nameX)\n .concat(\" vs \")\n .concat(dqFactory.completeness.numericalPlot.nameY)\n .concat(\" plot\"),\n class: {\n textAlign: \"left\"\n },\n className: \"h5\"\n }\n };\n optionCategorical.chart.xDomain = $scope.optionPlot.chart.xDomain;\n //console.log(\"categorical range: \", optionCategorical.chart.xDomain);\n optionCategorical.chart.yDomain = $scope.optionPlot.chart.yDomain;\n\n\n var dataSharingX = completenessOfVariableRespectX(variable.name, $scope.nameX);\n var dataSharingY = completenessOfVariableRespectY(variable.name, $scope.nameY);\n\n //var dataCategorical = [];\n //if(variable.state.isCategorical)\n var dataCategorical = completenessCategorical(variable.name);\n\n variable.optionSharingX = optionSharingX;\n variable.dataSharingX = dataSharingX;\n\n variable.optionSharingY = optionSharingY;\n variable.dataSharingY = dataSharingY;\n\n variable.optionCategorical = optionCategorical;\n variable.dataCategorical = dataCategorical;\n\n }\n });\n\n\n }", "function createAxis() {\n for (var i = 0; i < picArray.length; i++) {\n titleArray.push(picArray[i].title);\n clickArray.push(picArray[i].clicked);\n viewArray.push(picArray[i].viewed);\n }\n}", "function initTooltip() {\n if (!tooltip || !tooltip.node()) {\n // Create new tooltip div if it doesn't exist on DOM.\n\n var data = [1];\n tooltip = d3.select(document.body).select('#'+id).data(data);\n\n tooltip.enter().append('div')\n .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\"))\n .attr(\"id\", id)\n .style(\"top\", 0).style(\"left\", 0)\n .style('opacity', 0)\n .style('position', 'fixed')\n .selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true)\n .classed(nvPointerEventsClass, true);\n\n tooltip.exit().remove()\n }\n }", "function initTooltip() {\n if (!tooltip || !tooltip.node()) {\n // Create new tooltip div if it doesn't exist on DOM.\n\n var data = [1];\n tooltip = d3.select(document.body).select('#'+id).data(data);\n\n tooltip.enter().append('div')\n .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\"))\n .attr(\"id\", id)\n .style(\"top\", 0).style(\"left\", 0)\n .style('opacity', 0)\n .style('position', 'fixed')\n .selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true)\n .classed(nvPointerEventsClass, true);\n\n tooltip.exit().remove()\n }\n }", "function updateToolTip(chosenXAxis, chosenYAxis, circlesGroup) {\r\n\r\n // X Axis\r\n if (chosenXAxis === \"intelligence\") {\r\n var xlabel = \"intelligence: \";\r\n }\r\n else if (chosenXAxis === \"speed\") {\r\n var xlabel = \"speed: \"\r\n }\r\n else {\r\n var xlabel = \"strength: \"\r\n }\r\n\r\n // Y Axis\r\n if (chosenYAxis === \"durability\") {\r\n var ylabel = \"durability: \";\r\n }\r\n else if (chosenYAxis === \"combat\") {\r\n var ylabel = \"combat: \"\r\n }\r\n else {\r\n var ylabel = \"power: \"\r\n }\r\n\r\n var toolTip = d3.tip()\r\n .attr(\"class\", \"tooltip\")\r\n .style(\"background\", \"purple\")\r\n .style(\"color\", \"white\")\r\n .offset([100, -60])\r\n .html(function (d) {\r\n if (chosenXAxis === \"strength\") {\r\n\r\n return (`${d.name}<hr>${xlabel} ${d[chosenXAxis]}<br>${ylabel}${d[chosenYAxis]}`);\r\n } else if (chosenXAxis !== \"intelligence\" && chosenXAxis !== \"strength\") {\r\n\r\n return (`${d.name}<hr>${xlabel}${d[chosenXAxis]}<br>${ylabel}${d[chosenYAxis]}`);\r\n } else {\r\n\r\n return (`${d.name}<hr>${xlabel}${d[chosenXAxis]}<br>${ylabel}${d[chosenYAxis]}`);\r\n }\r\n });\r\n\r\n circlesGroup.call(toolTip);\r\n\r\n circlesGroup.on(\"mouseover\", function (data) {\r\n toolTip.show(data, this);\r\n })\r\n\r\n .on(\"mouseout\", function (data, index) {\r\n toolTip.hide(data)\r\n });\r\n\r\n return circlesGroup;\r\n}", "function updateToolTip(chosenXAxis, xLabel, yLabel, chosenYAxis, circlesGroup) {\n \n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n //.offset([80, -60])\n .html(function(d) {\n return (`${d.state}<br>${xLabel} ${d[chosenXAxis]}<br>${yLabel}${d[chosenYAxis]}`);\n });\n \n circlesGroup.call(toolTip);\n \n circlesGroup.on(\"mouseover\", function(data) {\n toolTip.show(data,this);\n })\n //onmouseout event\n .on(\"mouseout\", function(data, index) {\n toolTip.hide(data);\n });\n \n return circlesGroup;\n }", "function configureOneAxe(axisName, inputChartDef, c3Axes) {\r\n var axisMap = inputChartDef.axisMap;\r\n if (!axisMap) {\r\n return;\r\n }\r\n var series = axisMap[axisName];\r\n if (!series) {\r\n return;\r\n }\r\n for (var _i = 0, series_1 = series; _i < series_1.length; _i++) {\r\n var seriesConfig = series_1[_i];\r\n c3Axes[seriesConfig.series] = axisName;\r\n }\r\n}", "function updateToolTip(chosenXAxis, chosenYAxis, circlesGroup) {\n\n var label;\n var labelY;\n\n if (chosenXAxis === \"gender\") {\n label = \"gender\";\n } else if (chosenXAxis === \"birthyear\") {\n label = \"birthyear\"; \n } else if (chosenXAxis === \"subscribertype\") {\n label = \"subscribertype\"; \n }\n\n if (chosenYAxis === \"tripduration\") {\n labelY = \"tripduration\";\n } else if (chosenYAxis === \"bikeid\") {\n labelY = \"bikeid\"; \n }\n\n\n var toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([80, -60])\n .html(function(d) {\n //return (`${d.birthyear}<br>${label} ${d[chosenXAxis]}<br>${labelY} ${d[chosenYAxis]}`);\n //return (`${label} ${d[chosenXAxis]}<br>${labelY} ${d[chosenYAxis]}`);\n\n if (chosenXAxis === \"gender\") {\n return (`${label}: ${get_gender_string(d[chosenXAxis])}<br>${labelY}: ${d[chosenYAxis]}`); \n } else if (chosenXAxis === \"subscribertype\") {\n return (`usertype: ${get_usertype_string(d[chosenXAxis])}<br>${labelY}: ${d[chosenYAxis]}`);\n } else if (chosenXAxis === \"birthyear\") {\n return (`age: ${d[chosenXAxis]}<br>${labelY}: ${d[chosenYAxis]}`);\n }\n\n });\n\n circlesGroup.call(toolTip);\n\n circlesGroup.on(\"mouseover\", function(data) {\n toolTip.show(data);\n \n })\n // onmouseout event\n .on(\"mouseout\", function(data, index) {\n toolTip.hide(data);\n });\n\n return circlesGroup;\n}", "_updateIndicators() {\n const _this = this;\n this.duration = this.model.time.delayAnimations;\n this.yScale = this.model.marker.axis_y.getScale();\n this.xScale = this.model.marker.axis_x.getScale();\n this.yAxis.tickFormat(_this.model.marker.axis_y.getTickFormatter());\n this.xAxis.tickFormat(_this.model.marker.axis_x.getTickFormatter());\n this.xAxisLeft.tickFormat(_this.model.marker.axis_x.getTickFormatter());\n\n const sideDim = this.SIDEDIM;\n const stackDim = this.STACKDIM;\n\n const stacks = this.model.marker.getKeys(stackDim);\n let stackKeys = [];\n stackKeys = stacks.map(m => m[stackDim]);\n this.stackKeys = stackKeys;\n\n const sideItems = this.model.marker.label_side.getItems();\n //var sideKeys = Object.keys(sideItems);\n let sideKeys = [];\n if (!utils.isEmpty(sideItems)) {\n const sideFiltered = !!this.model.marker.side.getEntity().show[sideDim];\n const sides = this.model.marker.getKeys(sideDim)\n .filter(f => !sideFiltered || this.model.marker.side.getEntity().isShown(f));\n sideKeys = sides.map(m => m[sideDim]);\n\n if (sideKeys.length > 2) sideKeys.length = 2;\n if (sideKeys.length > 1) {\n const sortFunc = this.ui.chart.flipSides ? d3.ascending : d3.descending;\n sideKeys.sort(sortFunc);\n }\n }\n if (!sideKeys.length) sideKeys.push(\"undefined\");\n this.sideKeys = sideKeys;\n\n this.twoSided = this.sideKeys.length > 1;\n this.titleRight.classed(\"vzb-hidden\", !this.twoSided);\n if (this.twoSided) {\n this.xScaleLeft = this.xScale.copy();\n this.title.text(sideItems[this.sideKeys[1]]);\n this.titleRight.text(sideItems[this.sideKeys[0]]);\n } else {\n const title = this.sideKeys.length && sideItems[this.sideKeys[0]] ? sideItems[this.sideKeys[0]] : \"\";\n this.title.text(title);\n }\n\n this.cScale = this.model.marker.color.getScale();\n }", "function bubbleChart() {\n // Constants for sizing\n var width = 940;\n var height = 400;\n var widthGraph = 800;\n var widthOffset = 0.5*(width-widthGraph);\n widthOffset = 0;\n widthGraph = 800;\n var heightGraph = 450;\n var heightOffset = 0.5*(height-heightGraph);\n console.log(\"in bubblechart\");\n // tooltip for mouseover functionality\n var tooltip = floatingTooltip('gates_tooltip', 240);\n\n // Locations to move bubbles towards, depending\n // on which view mode is selected.\n var center = { x: width / 2, y: height / 2 };\n\n var topicCenters = {\n \t\t0: { x: 2*width/12, y: 3*height/8 },\n \t\t1: { x: 4*width/12, y: 3*height/8 },\n \t\t2: { x: 6*width/12, y: 3*height/8 },\n \t\t3: { x: 8*width/12, y: 3*height/8 },\n \t\t4: { x: 10*width/12, y: 3*height/8 }\n };\n\n\tvar dtypeCenters = {\n \t\t0: { x: 2*width/10, y: 3*height/8 },\n \t\t1: { x: 4*width/10, y: 3*height/8 },\n \t\t2: { x: 6*width/10, y: 3*height/8 },\n \t\t3: { x: 8*width/10, y: 3*height/8 },\n\t };\n\n // X locations of the topic titles.\n var topicsTitleX = {}\n topicsTitleX[\"ALL\"] = 1*width/12;\n topicsTitleX[topic1.substring(0,20)+'...'] = 3*width/12;\n topicsTitleX[topic2.substring(0,20)+'...'] = 6*width/12;\n //topicsTitleX[topic3.substring(0,20)+'...'] = 8*width/12;\n //topicsTitleX[topic4.substring(0,20)+'...'] = 11*width/12;\n // X locations of the year titles.\n var dtypesTitleX = {\n \"Pubmed\": \t\t\t2*width/10,\n \"Patents\": \t\t\t4*width/10,\n \"Clinical Trials\": 6*width/10,\n \"Grants\": \t\t\t8*width/10\n };\n\n // Used when setting up force and\n // moving around nodes\n var damper = 0.102;\n\n // These will be set in create_nodes and create_vis\n var svg = null;\n var bubbles = null;\n var nodes = [];\n\n // Charge function that is called for each node.\n // Charge is proportional to the diameter of the\n // circle (which is stored in the radius attribute\n // of the circle's associated data.\n // This is done to allow for accurate collision\n // detection with nodes of different sizes.\n // Charge is negative because we want nodes to repel.\n // Dividing by 8 scales down the charge to be\n // appropriate for the visualization dimensions.\n function charge(d) {\n return -Math.pow(d.radius, 2.0) / 8;\n }\n\n // Here we create a force layout and\n // configure it to use the charge function\n // from above. This also sets some contants\n // to specify how the force layout should behave.\n // More configuration is done below.\n var force = d3.layout.force()\n .size([width, height])\n .charge(charge)\n .gravity(-0.01)\n .friction(0.9);\n\n\n // Nice looking colors - no reason to buck the trend\n var fillColor = d3.scale.ordinal()\n .domain(['low', 'medium', 'high'])\n .range(['#d84b2a', '#beccae', '#7aa25c']);\n\n // Nice looking colors - no reason to buck the trend\n var fillColor2 = d3.scale.linear()\n .domain([0,3,6,9,12,15,18,21,24])\n .range([\n\"#b2182b\",\n\"#d6604d\",\n\"#f4a582\",\n\"#fddbc7\",\n\"#f7f7f7\",\n\"#d1e5f0\",\n\"#92c5de\",\n\"#4393c3\",\n\"#2166ac\"\n]);\n\n // Sizes bubbles based on their area instead of raw radius\n var radiusScale = d3.scale.pow()\n .exponent(0.5)\n .range([2,15]);\n\n /*\n * This data manipulation function takes the raw data from\n * the CSV file and converts it into an array of node objects.\n * Each node will store data and visualization values to visualize\n * a bubble.\n *\n * rawData is expected to be an array of data objects, read in from\n * one of d3's loading functions like d3.csv.\n *\n * This function returns the new node array, with a node in that\n * array for each element in the rawData input.\n */\n function createNodes(rawData) {\n // Use map() to convert raw data into node data.\n // Checkout http://learnjsdata.com/ for more on\n // working with data.\n console.log(\"in create nodes\");\n\t console.log(rawData);\n\t var id = 0;\n var myNodes = rawData.map(function (d) {\n console.log(\"data \"+d.name+\";\"+d.number+\";\"+d.iq+\";\"+d.dtype);\n return {\n id: d.id,\n radius: radiusScale(+d.number),\n value: d.number,\n name: d.name,\n nameID: d.nameID,\n org: d.name,\n// group: d.group,\n group: d.dtype,\n topic: d.iq,\n dtype: d.dtype,\n\n x: Math.random() * 900,\n y: Math.random() * 800\n };\n });\n\n // sort them to prevent occlusion of smaller nodes.\n myNodes.sort(function (a, b) { return b.value - a.value; });\n\n return myNodes;\n }\n\n /*\n * Main entry point to the bubble chart. This function is returned\n * by the parent closure. It prepares the rawData for visualization\n * and adds an svg element to the provided selector and starts the\n * visualization creation process.\n *\n * selector is expected to be a DOM element or CSS selector that\n * points to the parent element of the bubble chart. Inside this\n * element, the code will add the SVG continer for the visualization.\n *\n * rawData is expected to be an array of data objects as provided by\n * a d3 loading function like d3.csv.\n */\n var chart = function chart(selector, rawData) {\n console.log(\"in chart\");\n // Use the max total_amount in the data as the max in the scale's domain\n // note we have to ensure the total_amount is a number by converting it\n // with `+`.\n var maxAmount = d3.max(rawData, function (d) { return +d.number; });\n radiusScale.domain([0, maxAmount]);\n\n nodes = createNodes(rawData);\n // Set the force's nodes to our newly created nodes array.\n force.nodes(nodes);\n\n // Create a SVG element inside the provided selector\n // with desired size.\n svg = d3.select(selector)\n .append('svg')\n .attr('width', width)\n .attr('height', height);\n\n // Bind nodes data to what will become DOM elements to represent them.\n bubbles = svg.selectAll('.bubble')\n .data(nodes, function (d) { return d.id; });\n\n // Create new circle elements each with class `bubble`.\n // There will be one circle.bubble for each object in the nodes array.\n // Initially, their radius (r attribute) will be 0.\n bubbles.enter().append('circle')\n .classed('bubble', true)\n .attr('r', 0)\n .attr('fill', function (d) { return fillColor2(d.nameID); })\n .attr('stroke', function (d) { return d3.rgb(fillColor2(d.nameID)).darker(); })\n .attr('stroke-width', 2)\n .on('mouseover', showDetail)\n .on('mouseout', hideDetail);\n\n // Fancy transition to make bubbles appear, ending with the\n // correct radius\n bubbles.transition()\n .duration(2000)\n .attr('r', function (d) { return d.radius; });\n\n // Set initial layout to single group.\n groupBubbles();\n };\n\n /*\n * Sets visualization in \"single group mode\".\n * The topic labels are hidden and the force layout\n * tick function is set to move all nodes to the\n * center of the visualization.\n */\n function groupBubbles() {\n hideTopics();\n hideDtypes();\n\n force.on('tick', function (e) {\n bubbles.each(moveToCenter(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n });\n\n force.start();\n }\n\n /*\n * Helper function for \"single group mode\".\n * Returns a function that takes the data for a\n * single node and adjusts the position values\n * of that node to move it toward the center of\n * the visualization.\n *\n * Positioning is adjusted by the force layout's\n * alpha parameter which gets smaller and smaller as\n * the force layout runs. This makes the impact of\n * this moving get reduced as each node gets closer to\n * its destination, and so allows other forces like the\n * node's charge force to also impact final location.\n */\n function moveToCenter(alpha) {\n return function (d) {\n d.x = d.x + (center.x - d.x) * damper * alpha;\n d.y = d.y + (center.y - d.y) * damper * alpha;\n };\n }\n\n /*\n * Sets visualization in \"split by topic mode\".\n * The topic labels are shown and the force layout\n * tick function is set to move nodes to the\n * topicCenter of their data's topic.\n */\n function splitBubbles() {\n hideDtypes();\n showTopics();\n\n force.on('tick', function (e) {\n bubbles.each(moveToTopics(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n });\n\n force.start();\n }\n\n /*\n * Sets visualization in \"split by topic mode\".\n * The topic labels are shown and the force layout\n * tick function is set to move nodes to the\n * topicCenter of their data's topic.\n */\n function splitBubblesDtype() {\n hideTopics();\n showDtypes();\n\n force.on('tick', function (e) {\n bubbles.each(moveToDtypes(e.alpha))\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n });\n\n force.start();\n }\n\n /*\n * Helper function for \"split by topic mode\".\n * Returns a function that takes the data for a\n * single node and adjusts the position values\n * of that node to move it the topic center for that\n * node.\n *\n * Positioning is adjusted by the force layout's\n * alpha parameter which gets smaller and smaller as\n * the force layout runs. This makes the impact of\n * this moving get reduced as each node gets closer to\n * its destination, and so allows other forces like the\n * node's charge force to also impact final location.\n */\n function moveToTopics(alpha) {\n return function (d) {\n var target = topicCenters[d.topic];\n d.x = d.x + (target.x - d.x) * damper * alpha * 1.1;\n d.y = d.y + (target.y - d.y) * damper * alpha * 1.1;\n };\n }\n\n /*\n * Helper function for \"split by year mode\".\n * Returns a function that takes the data for a\n * single node and adjusts the position values\n * of that node to move it the year center for that\n * node.\n *\n * Positioning is adjusted by the force layout's\n * alpha parameter which gets smaller and smaller as\n * the force layout runs. This makes the impact of\n * this moving get reduced as each node gets closer to\n * its destination, and so allows other forces like the\n * node's charge force to also impact final location.\n */\n function moveToDtypes(alpha) {\n return function (d) {\n\t //console.log(d);\n var target = dtypeCenters[d.dtype];\n\t\t//console.log(target);\n d.x = d.x + (target.x - d.x) * damper * alpha * 1.1;\n d.y = d.y + (target.y - d.y) * damper * alpha * 1.1;\n };\n }\n\n /*\n * Hides Year title displays.\n */\n function hideTopics() {\n svg.selectAll('.topic').remove();\n }\n\n /*\n * Shows topic title displays.\n */\n function showTopics() {\n // Another way to do this would be to create\n // the topic texts once and then just hide them.\n var topicsData = d3.keys(topicsTitleX);\n var topics = svg.selectAll('.topic')\n .data(topicsData);\n\n topics.enter().append('text')\n .attr('class', 'topic')\n .attr('x', function (d) { return topicsTitleX[d]; })\n .attr('y', 40)\n .attr('text-anchor', 'middle')\n .text(function (d) { return d; });\n }\n /*\n * Hides Year title displays.\n */\n function hideDtypes() {\n svg.selectAll('.dtype').remove();\n }\n /*\n * Shows Year title displays.\n */\n function showDtypes() {\n // Another way to do this would be to create\n // the year texts once and then just hide them.\n var dtypesData = d3.keys(dtypesTitleX);\n var dtypes = svg.selectAll('.dtype')\n .data(dtypesData);\n\n dtypes.enter().append('text')\n .attr('class', 'dtype')\n .attr('x', function (d) { return dtypesTitleX[d]; })\n .attr('y', 40)\n .attr('text-anchor', 'middle')\n .text(function (d) { return d; });\n }\n\n\n /*\n * Function called on mouseover to display the\n * details of a bubble in the tooltip.\n */\n function showDetail(d) {\n // change outline to indicate hover state.\n d3.select(this).attr('stroke', 'black');\n\n var content = '<span class=\"value\">' +\n d.name +\n '</span><br/>' +\n '<span class=\"name\">Dtype: </span><span class=\"value\">' +\n addCommas(d.dtype) +\n '</span><br/>' +\n '<span class=\"name\">topic: </span><span class=\"value\">' +\n d.topic +\n '</span><br/>' +\n '<span class=\"name\">Number: </span><span class=\"value\">' +\n d.value +\n '</span>';\n tooltip.showTooltip(content, d3.event);\n }\n\n /*\n * Hides tooltip\n */\n function hideDetail(d) {\n // reset outline\n d3.select(this)\n .attr('stroke', d3.rgb(fillColor2(d.group)).darker());\n\n tooltip.hideTooltip();\n }\n\n /*\n * Externally accessible function (this is attached to the\n * returned chart function). Allows the visualization to toggle\n * between \"single group\" and \"split by topic\" modes.\n *\n * displayName is expected to be a string and either 'topic' or 'all'.\n */\n chart.toggleDisplay = function (displayName) {\n if (displayName === 'topic') {\n splitBubbles();\n } else if (displayName === 'dtype') {\n splitBubblesDtype();\n } else {\n groupBubbles();\n }\n };\n\n\n // return the chart function from closure.\n return chart;\n}", "function initTooltip() {\n if (!tooltip) {\n var body;\n if (chartContainer) {\n body = chartContainer;\n } else {\n body = document.body;\n }\n //Create new tooltip div if it doesn't exist on DOM.\n tooltip = d3.select(body).append(\"div\")\n .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\"))\n .attr(\"id\", id);\n tooltip.style(\"top\", 0).style(\"left\", 0);\n tooltip.style('opacity', 0);\n tooltip.selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true);\n tooltip.classed(nvPointerEventsClass, true);\n tooltipElem = tooltip.node();\n }\n }", "getHandles() {\n const attrs = this.state.attributes;\n const { x1, y1, x2, y2 } = attrs;\n return [\n {\n type: \"line\",\n axis: \"x\",\n actions: [{ type: \"attribute\", attribute: \"x1\" }],\n value: x1,\n span: [y1, y2]\n },\n {\n type: \"line\",\n axis: \"x\",\n actions: [{ type: \"attribute\", attribute: \"x2\" }],\n value: x2,\n span: [y1, y2]\n },\n {\n type: \"line\",\n axis: \"y\",\n actions: [{ type: \"attribute\", attribute: \"y1\" }],\n value: y1,\n span: [x1, x2]\n },\n {\n type: \"line\",\n axis: \"y\",\n actions: [{ type: \"attribute\", attribute: \"y2\" }],\n value: y2,\n span: [x1, x2]\n },\n {\n type: \"point\",\n x: x1,\n y: y1,\n actions: [\n { type: \"attribute\", source: \"x\", attribute: \"x1\" },\n { type: \"attribute\", source: \"y\", attribute: \"y1\" }\n ]\n },\n {\n type: \"point\",\n x: x1,\n y: y2,\n actions: [\n { type: \"attribute\", source: \"x\", attribute: \"x1\" },\n { type: \"attribute\", source: \"y\", attribute: \"y2\" }\n ]\n },\n {\n type: \"point\",\n x: x2,\n y: y1,\n actions: [\n { type: \"attribute\", source: \"x\", attribute: \"x2\" },\n { type: \"attribute\", source: \"y\", attribute: \"y1\" }\n ]\n },\n {\n type: \"point\",\n x: x2,\n y: y2,\n actions: [\n { type: \"attribute\", source: \"x\", attribute: \"x2\" },\n { type: \"attribute\", source: \"y\", attribute: \"y2\" }\n ]\n }\n ];\n }", "function recalculatePositions() {\n\t\t// Set node positions\n\t\tnodeElements.attr(\"transform\", function (node) {\n\t\t\treturn \"translate(\" + node.x + \",\" + node.y + \")\";\n\t\t});\n\n\t\t// Set link paths and calculate additional informations\n\t\tlinkPathElements.attr(\"d\", function (l) {\n\t\t\tif (l.domain() === l.range()) {\n\t\t\t\treturn webvowl.util.math().calculateLoopPath(l);\n\t\t\t}\n\n\t\t\t// Calculate these every time to get nicer curved paths\n\t\t\tvar pathStart = webvowl.util.math().calculateIntersection(l.range(), l.domain(), 1),\n\t\t\t\tpathEnd = webvowl.util.math().calculateIntersection(l.domain(), l.range(), 1),\n\t\t\t\tlinkDistance = getVisibleLinkDistance(l),\n\t\t\t\tcurvePoint = webvowl.util.math().calculateCurvePoint(pathStart, pathEnd, l,\n\t\t\t\t\tlinkDistance / options.defaultLinkDistance());\n\n\t\t\tl.curvePoint(curvePoint);\n\n\t\t\treturn curveFunction([webvowl.util.math().calculateIntersection(l.curvePoint(), l.domain(), 1),\n\t\t\t\tcurvePoint, webvowl.util.math().calculateIntersection(l.curvePoint(), l.range(), 1)]);\n\t\t});\n\n\t\t// Set label group positions\n\t\tlabelGroupElements.attr(\"transform\", function (link) {\n\t\t\tvar posX = link.curvePoint().x,\n\t\t\t\tposY = link.curvePoint().y;\n\n\t\t\treturn \"translate(\" + posX + \",\" + posY + \")\";\n\t\t});\n\n\n\t\t// Set cardinality positions\n\t\tcardinalityElements.attr(\"transform\", function (p) {\n\t\t\tvar curve = p.link().curvePoint(),\n\t\t\t\tpos = webvowl.util.math().calculateIntersection(curve, p.range(), CARDINALITY_HDISTANCE),\n\t\t\t\tnormalV = webvowl.util.math().calculateNormalVector(curve, p.domain(), CARDINALITY_VDISTANCE);\n\n\t\t\treturn \"translate(\" + (pos.x + normalV.x) + \",\" + (pos.y + normalV.y) + \")\";\n\t\t});\n\t}", "function collect(ecModel, api) {\n\t var result = {\n\t /**\n\t * key: makeKey(axis.model)\n\t * value: {\n\t * axis,\n\t * coordSys,\n\t * axisPointerModel,\n\t * triggerTooltip,\n\t * involveSeries,\n\t * snap,\n\t * seriesModels,\n\t * seriesDataCount\n\t * }\n\t */\n\t axesInfo: {},\n\t seriesInvolved: false,\n\t\n\t /**\n\t * key: makeKey(coordSys.model)\n\t * value: Object: key makeKey(axis.model), value: axisInfo\n\t */\n\t coordSysAxesInfo: {},\n\t coordSysMap: {}\n\t };\n\t collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\t\n\t result.seriesInvolved && collectSeriesInfo(result, ecModel);\n\t return result;\n\t }", "function updateToolTip(chosenXAxis, chosenYAxis, circlesGroup) {\n let xLabel, yLabel;\n // poverty\n if (chosenXAxis === \"poverty\") {\n xLabel = \"Poverty:\";\n }\n // age\n else {\n xLabel = \"Age:\";\n }\n // Y label\n // healthcare\n if (chosenYAxis === \"healthcare\") {\n yLabel = \"No Healthcare:\";\n }\n // smoking\n else {\n yLabel = \"Smokers:\";\n }\n\n // Step 1: Append tooltip div\n var toolTip = d3.select(\"body\").append(\"div\").classed(\"tooltip\", true);\n\n // Step 2: Create \"mouseover\" event listener to display tooltip\n circlesGroup\n .on(\"mouseover\", function(d) {\n toolTip\n .style(\"display\", \"d3Style\")\n .html(function () {\n console.log(\"mouseover\",d)\n return `${\n d\n }<strong>${xLabel} ${styleX([chosenXAxis])}<strong>${yLabel} ${[chosenYAxis]}`\n })\n .style(\"left\", d3.event.pageX + \"px\")\n .style(\"top\", d3.event.pageY + \"px\");\n })\n \n // Step 3: Create \"mouseout\" event listener to hide tooltip\n .on(\"mouseout\", function () {\n toolTip.style(\"display\", \"d3Style\");\n });\n\n return circlesGroup;\n}", "function initTooltip() {\n\t if (!tooltip || !tooltip.node()) {\n\t // Create new tooltip div if it doesn't exist on DOM.\n\n\t var data = [1];\n\t tooltip = d3.select(document.body).select('#'+id).data(data);\n\n\t tooltip.enter().append('div')\n\t .attr(\"class\", \"nvtooltip \" + (classes ? classes : \"xy-tooltip\"))\n\t .attr(\"id\", id)\n\t .style(\"top\", 0).style(\"left\", 0)\n\t .style('opacity', 0)\n\t .style('position', 'fixed')\n\t .selectAll(\"div, table, td, tr\").classed(nvPointerEventsClass, true)\n\t .classed(nvPointerEventsClass, true);\n\n\t tooltip.exit().remove()\n\t }\n\t }", "function TooltipUpdate(chosenXAxis, chosenYAxis, circlesGroup) {\n\n // ----- X Axis\n //----- Poverty\n if (chosenXAxis === \"poverty\") {\n var xLabel = \"Poverty:\";\n }\n //----- Income USD\n else if (chosenXAxis === \"income\") {\n var xLabel = \"Median Income: $\";\n }\n //----- Obesity\n else if (chosenXAxis === \"obesity\") {\n var xLabel = \"Obesity (%): \";\n }\n //----- Smokes\n else if (chosenXAxis === \"smokes\") {\n var xLabel = \"Smokes (%): \";\n }\n //----- Healthcare\n else if (chosenXAxis === \"healthcare\") {\n var xLabel = \"No Healthcare (%)\";\n }\n //------ Age (Average)\n else {\n var xLabel = \"Age:\";\n }\n\n // ----- Y Axis\n //----- Poverty\n if (chosenYAxis === \"poverty\") {\n var yLabel = \"Poverty:\";\n }\n //----- Icome USD\n else if (chosenYAxis === \"income\") {\n var yLabel = \"Median Income: $\";\n }\n //----- Obesity\n else if (chosenYAxis === \"obesity\") {\n var yLabel = \"Obesity (%): \";\n }\n //----- Smokes\n else if (chosenYAxis === \"smokes\") {\n var yLabel = \"Smokes (%): \";\n }\n //----- Healthcare\n else if (chosenYAxis === \"healthcare\") {\n var yLabel = \"No Healthcare (%)\";\n }\n //------ Age (Average)\n else {\n var yLabel = \"Age:\";\n }\n\n //Tooltip\n var toolTip = d3.tip()\n .attr(\"class\", \"d3-tip\")\n .offset([-8, 0])\n .html(function(d) {\n return (`${d.state}<br>${xLabel} ${styleX(d[chosenXAxis], chosenXAxis)}<br>${yLabel} ${d[chosenYAxis]}`);\n });\n\n circlesGroup.call(toolTip);\n\n //Mouse Over event\n circlesGroup.on(\"mouseover\", toolTip.show)\n .on(\"mouseout\", toolTip.hide);\n\n return circlesGroup;\n}", "function _setTooltipPosition() {\n const targetProps = {\n height: $element.outerHeight(),\n left: $element.offset().left,\n top: $element.offset().top,\n width: $element.outerWidth(),\n };\n const tooltipPosition = angular.isDefined(lx.position) ? lx.position : 'top';\n const tooltipProps = {};\n\n _tooltip.addClass(`${CSS_PREFIX}-tooltip--position-${tooltipPosition}`).appendTo('body');\n\n /* eslint-disable no-magic-numbers */\n if (tooltipPosition === 'top') {\n tooltipProps.x = targetProps.left - _tooltip.outerWidth() / 2 + targetProps.width / 2;\n tooltipProps.y = targetProps.top - _tooltip.outerHeight() - _OFFSET;\n } else if (tooltipPosition === 'bottom') {\n tooltipProps.x = targetProps.left - _tooltip.outerWidth() / 2 + targetProps.width / 2;\n tooltipProps.y = targetProps.top + targetProps.height + _OFFSET;\n } else if (tooltipPosition === 'left') {\n tooltipProps.x = targetProps.left - _tooltip.outerWidth() - _OFFSET;\n tooltipProps.y = targetProps.top + targetProps.height / 2 - _tooltip.outerHeight() / 2;\n } else if (tooltipPosition === 'right') {\n tooltipProps.x = targetProps.left + targetProps.width + _OFFSET;\n tooltipProps.y = targetProps.top + targetProps.height / 2 - _tooltip.outerHeight() / 2;\n }\n\n _tooltip.css({\n transform: `translate3d(${tooltipProps.x}px, ${tooltipProps.y}px, 0px)`,\n });\n /* eslint-enable no-magic-numbers */\n }", "numericalMapping(axis) {\n const solver = this.solver;\n const state = this.plotSegment.state;\n const props = this.plotSegment.object.properties;\n const attrs = state.attributes;\n const dataIndices = state.dataRowIndices;\n const table = this.getTableContext();\n switch (axis) {\n case \"x\":\n {\n const data = props.xData;\n if (data.type == \"numerical\") {\n const [x1, x2] = solver.attrs(attrs, [this.x1Name, this.x2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (1 - t) * props.marginX1 - t * props.marginX2, [[1 - t, x1], [t, x2]], [[1, solver.attr(markState.attributes, \"x\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [x1, x2, gapX] = solver.attrs(attrs, [\n this.x1Name,\n this.x2Name,\n \"gapX\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapX(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginX1 -\n (i + 0.5) * props.marginX2, [\n [i + 0.5, x2],\n [data.categories.length - i - 0.5, x1],\n [-data.categories.length / 2 + i + 0.5, gapX]\n ], [\n [\n data.categories.length,\n solver.attr(markState.attributes, \"x\")\n ]\n ]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, x, x1);\n }\n break;\n case \"y\": {\n const data = props.yData;\n if (data.type == \"numerical\") {\n const [y1, y2] = solver.attrs(attrs, [this.y1Name, this.y2Name]);\n const expr = this.getExpression(data.expression);\n const interp = axis_1.getNumericalInterpolate(data);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getNumberValue(rowContext);\n const t = interp(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (t - 1) * props.marginY2 + t * props.marginY1, [[1 - t, y1], [t, y2]], [[1, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n if (data.type == \"categorical\") {\n const [y1, y2, gapY] = solver.attrs(attrs, [\n this.y1Name,\n this.y2Name,\n \"gapY\"\n ]);\n const expr = this.getExpression(data.expression);\n for (const [index, markState] of state.glyphs.entries()) {\n const rowContext = table.getGroupedContext(dataIndices[index]);\n const value = expr.getStringValue(rowContext);\n this.gapY(data.categories.length, data.gapRatio);\n const i = data.categories.indexOf(value);\n solver.addLinear(solver_1.ConstraintStrength.HARD, (data.categories.length - i - 0.5) * props.marginY1 -\n (i + 0.5) * props.marginY2, [\n [i + 0.5, y2],\n [data.categories.length - i - 0.5, y1],\n [-data.categories.length / 2 + i + 0.5, gapY]\n ], [[data.categories.length, solver.attr(markState.attributes, \"y\")]]);\n }\n }\n // solver.addEquals(ConstraintWeight.HARD, y, y2);\n }\n }\n }", "_initToolbarPositioning() {\n __querySelectorLive(`[s-node][s-specs]`, ($node) => {\n // get the parent element that is actually the\n // element to move\n const $elm = $node.parentNode;\n $elm.addEventListener('pointerover', (e) => {\n var _a;\n // add hover class\n $elm.classList.add('hover');\n e.stopPropagation();\n const element = this.getElementFromDomNode(e.currentTarget);\n // do nothing more if already activated\n if (element.uid === ((_a = this._preselectedNode) === null || _a === void 0 ? void 0 : _a.uid)) {\n return;\n }\n // position toolbar\n this._setToolbarTitleAndPosition($elm, __upperFirst(element.specs.split('.').pop()));\n // set the \"pre\" activate element\n this._preselectedNode = element;\n });\n $elm.addEventListener('pointerout', (e) => {\n // remove hover class\n $elm.classList.remove('hover');\n });\n }, {\n rootNode: this._$websiteDocument.body,\n });\n }", "function updateToolTip(chosenXAxis, chosenYAxis, circlesGroup) {\n let xLabel = ''\n let yLabel = ''\n // console.log(chosenXAxis);\n switch (chosenXAxis) {\n\n case \"poverty\":\n xLabel = \"Percentage in Poverty\";\n break;\n case \"income\":\n xLabel = \"Median Income\";\n break;\n case \"age\":\n xLabel = \"Median Age\";\n break;\n\n }\n switch (chosenYAxis) {\n case \"obesity\":\n yLabel = \"Percentage Obese\";\n break;\n case \"healthcare\":\n yLabel = \"Percentage that Lacks Healthcare\";\n break;\n case \"smokes\":\n yLabel = \"Percentage of Smokers\";\n break;\n }\n // console.log(xLabel);\n\n let toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .offset([85, -90])\n .html(function(d) {\n return (`${d.state}<br>${yLabel}: ${d[chosenYAxis]}<br>${xLabel}: ${d[chosenXAxis]}`);\n });\n\n circlesGroup.call(toolTip);\n\n circlesGroup.on(\"mouseover\", (d, i, n) => toolTip.show(d, n[i]));\n circlesGroup.on(\"mouseout\", (d, i, n) => toolTip.hide(d, n[i]));\n\n return circlesGroup;\n}", "makeTooltip ( ) {\n this.tip = d3.tip( )\n .attr( 'id', 'tooltip' )\n .html( d => d );\n this.canvas.call( this.tip );\n \n return this;\n }", "function updateToolTip(chosenXAxis,chosenYAxis, circlesGroup) {\n var toolTip = d3.tip()\n .attr(\"class\", \"d3-tip\")\n .offset([80, -60])\n .html(function(d) {\n console.log(d);\n console.log(d[chosenXAxis],d[chosenYAxis]);\n return (`${d[state]}<br>${chosenXAxis}:${d[chosenXAxis]}<br>${chosenYAxis}:${d[chosenYAxis]}`);\n });\n \n console.log(chosenXAxis,chosenYAxis);\n circlesGroup.call(toolTip);\n\n circlesGroup.on(\"mouseover\", function(data) {\n toolTip.show(data);\n })\n // onmouseout event\n .on(\"mouseout\", function(data, index) {\n toolTip.hide(data);\n });\n \n return circlesGroup;\n}", "function wrapPointerGetCoordinates(proceed, e) {\n var chart = this.chart;\n var ret = {\n xAxis: [],\n yAxis: []\n };\n if (chart.polar) {\n chart.axes.forEach(function (axis) {\n // Skip colorAxis\n if (axis.coll === 'colorAxis') {\n return;\n }\n var isXAxis = axis.isXAxis, center = axis.center, x = e.chartX - center[0] - chart.plotLeft, y = e.chartY - center[1] - chart.plotTop;\n ret[isXAxis ? 'xAxis' : 'yAxis'].push({\n axis: axis,\n value: axis.translate(isXAxis ?\n Math.PI - Math.atan2(x, y) : // angle\n // distance from center\n Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)), true)\n });\n });\n }\n else {\n ret = proceed.call(this, e);\n }\n return ret;\n}", "function axisProvider(){\n\t/*\n\t * setAxisContainer(svg);\n\t * setXScale(makeLinearScale([0,width],[0,d3.max(data, function(d) { return d.x; })]));\n\t * setYScale(makeLinearScale([height,0],[0,d3.max(data, function(d) { return d.y; })]));\n\t * draw()\n\t * */\n\tvar axisProviderImpl = {\n\t\t\theight \t: 0,\n\t\t\twidth\t: 0,\n\t\t\tsvg\t\t: null,\n\t\t\txScale\t: null,\n\t\t\tyScale\t: null,\n\t\t\txAxis\t: null,\n\t\t\txGrid\t: null,\n\t\t\tyAxis\t: null,\n\t\t\tyGrid\t: null,\n\t\t\tdrawXGrid: true,\n\t\t\tdrawYGrid: true,\n\t\t\tdrawGrid: true,\n\t\t\txScaleOrient : \"bottom\",\n\t\t\tyScaleOrient : \"left\",\n\t\t\txTitle:\"\",\n\t\t\tyTitle:\"\",\n\t\t\ttitle:\"\",\n\t\t\tticks\t: 10,\n\t\t\tgridTicks : 10,\n\t\t\ttickFormat:\",r\",\n\t\t\tsetAxisContainer: function(svg){\n\t\t\t\tif(!isDefined(svg) || isNull(svg)){\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\tthis.height = svg.attr(\"height\");\n\t\t\t\tthis.width = svg.attr(\"width\");\n\t\t\t\tthis.svg\t= svg;\n\t\t\t},\n\t\t\tmakeLinearScale : function(range,domain){\n\t\t\t\treturn d3.scale.linear().range(range).domain(domain).nice();\n\t\t\t},\n\t\t\tsetXScale\t: function(xScale){\n\t\t\t\tthis.xScale = xScale;\n\t\t\t\tthis.xAxis = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.xGrid = d3.svg.axis().scale(xScale).orient(this.xScaleOrient).tickSize(-this.height, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tsetYScale\t:function(yScale){\n\t\t\t\tthis.yScale = yScale;\n\t\t\t\tthis.yAxis = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).ticks(this.ticks, this.tickFormat);\n\t\t\t this.yGrid = d3.svg.axis().scale(yScale).orient(this.yScaleOrient).tickSize(-this.width, 0, 0).ticks(this.gridTicks).tickFormat(\"\");\n\t\t\t},\n\t\t\tdraw\t: function(){\n\t\t\t\tconsole.log(\"Drawing Axis.\");\n\t\t\t\tthis.clear();\n\t\t\t\tif(this.drawGrid && this.drawYGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").call(this.yGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").call(this.yAxis);\n\t\t\t\t//Y axis title\n\t\t\t\tthis.svg.append(\"g\")\n\t\t\t\t.attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t\t .text(this.yTitle)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",-((this.height/2)))\n\t\t\t .attr(\"y\",-30);\n\t\t\t\t\n\t\t\t\tif(this.drawGrid && this.drawXGrid){\n\t\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\", \"grid\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xGrid);\n\t\t\t\t}\n\t\t\t\tthis.svg.insert(\"g\",\":first-child\").attr(\"class\",\"axis\").attr(\"transform\", \"translate(0,\" + this.height + \")\").call(this.xAxis);\n\t\t\t\t//X axis title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"transform\", \"translate(0,\" + this.height + \")\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .text(this.xTitle)\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",30);\n\t\t\t //chart Title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"chartTitle\")\n\t\t\t .text(this.title)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",(this.width/2))\n\t\t\t .attr(\"y\",0);\n\t\t\t},\n\t\t\tclear : function(){\n\t\t\t\tthis.svg.selectAll(\".grid\").remove();\n\t\t\t\tthis.svg.selectAll(\".axis\").remove();\n\t\t\t\tthis.svg.selectAll(\".axisLabel\").remove();\n\t\t\t}\n\t};\n\t\n\tthis.$get = function(){\n\t\treturn axisProviderImpl;\n\t};\n}", "function updateToolTip(chosenXAxis, chosenYAxis, chosenCircles) {\n\n// Set up x axis\n if (chosenXAxis === \"poverty\") {\n let xlabel = \"Poverty: \";\n }\n else if (chosenXAxis === \"income\") {\n let xlabel = \"Median Income: \"\n }\n else {\n let xlabel = \"Age: \"\n }\n \n// Set up y axis\n if (chosenYAxis === \"healthcare\") {\n let ylabel = \"Healthcare: \";\n }\n else if (chosenYAxis === \"smokes\") {\n let ylabel = \"Smokers: \"\n }\n else {\n let ylabel = \"Obesity: \"\n }\n// Check .tip() error? This worked in class activity?\n let toolTip = d3.tip()\n .attr(\"class\", \"tooltip\")\n .style(\"background\", \"black\")\n .style(\"color\", \"white\")\n .offset([120, -60])\n .html(function(d) {\n if (chosenXAxis === \"age\") {\n// Format yAxis tooltip labels as percentages\n// Display age as integer\n return (`${d.state}<hr>${xlabel} ${d[chosenXAxis]}<br>${ylabel}${d[chosenYAxis]}%`);\n } else if (chosenXAxis !== \"poverty\" && chosenXAxis !== \"age\") {\n return (`${d.state}<hr>${xlabel}$${d[chosenXAxis]}<br>${ylabel}${d[chosenYAxis]}%`);\n } else {\n return (`${d.state}<hr>${xlabel}${d[chosenXAxis]}%<br>${ylabel}${d[chosenYAxis]}%`);\n } \n });\n\n// Call on tooltip to perform follwing functions\n chosenCircles.call(toolTip);\n// Mouseon event\n chosenCircles.on(\"mouseover\", function(data) {\n toolTip.show(data, this);\n })\n\n// Mouseout event\n .on(\"mouseout\", function(data,index) {\n toolTip\n .hide(data)\n });\n return chosenCircles;\n }", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}" ]
[ "0.5693873", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.5636385", "0.56148744", "0.55848104", "0.55848104", "0.5581302", "0.5558696", "0.5493384", "0.5264039", "0.507943", "0.49443126", "0.49220106", "0.49116898", "0.48798317", "0.48484772", "0.4827196", "0.48213246", "0.48095825", "0.48003286", "0.4796459", "0.47802812", "0.47563294", "0.47531843", "0.47336313", "0.4710723", "0.47016373", "0.47016373", "0.47000188", "0.46899724", "0.46896964", "0.46862018", "0.46859935", "0.46853885", "0.468122", "0.46751446", "0.46694976", "0.46690065", "0.46430567", "0.46207744", "0.46177292", "0.45977753", "0.45489272", "0.45486256", "0.45407984", "0.45372686", "0.45356816", "0.45297462", "0.4526617", "0.45132092", "0.4499357", "0.4499357", "0.4499357", "0.4499357", "0.4493729", "0.44889888", "0.44747373", "0.44609272", "0.44438985", "0.44436267", "0.44406122", "0.443194", "0.4425691", "0.4425523", "0.44230402", "0.44230402", "0.44212425", "0.4406561", "0.4400707", "0.43911982", "0.43742052", "0.4373457", "0.43659353", "0.434704", "0.4328492", "0.43265364", "0.43221426", "0.4316971", "0.43157765", "0.4311815", "0.43095618", "0.4306028", "0.43038583", "0.43019158", "0.42954445", "0.42933792", "0.42896298", "0.42894155", "0.4286199", "0.4286199", "0.4286199", "0.4286199", "0.4286199", "0.4286199", "0.4286199" ]
0.0
-1
fromTooltip: true | false | 'cross' triggerTooltip: true | false | null
function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) { var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel); var axisPointerShow = axisPointerModel.get('show'); if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) { return; } if (triggerTooltip == null) { triggerTooltip = axisPointerModel.get('triggerTooltip'); } axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel; var snap = axisPointerModel.get('snap'); var key = makeKey(axis.model); var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority). var axisInfo = result.axesInfo[key] = { key: key, axis: axis, coordSys: coordSys, axisPointerModel: axisPointerModel, triggerTooltip: triggerTooltip, involveSeries: involveSeries, snap: snap, useHandle: isHandleTrigger(axisPointerModel), seriesModels: [] }; axesInfoInCoordSys[key] = axisInfo; result.seriesInvolved |= involveSeries; var groupIndex = getLinkGroupIndex(linksOption, axis); if (groupIndex != null) { var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { axesInfo: {} }); linkGroup.axesInfo[key] = axisInfo; linkGroup.mapper = linksOption[groupIndex].mapper; axisInfo.linkGroup = linkGroup; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tooltipClicked() {}", "setTooltip(valueNew){let t=e.ValueConverter.toString(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"Tooltip\")),t!==this.__tooltip&&(this.__tooltip=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"Tooltip\"}),this.__processTooltip())}", "toggleTooltips() {\n self.enableTooltips = !self.enableTooltips;\n }", "set tooltip(value) {}", "get tooltip() {}", "getTooltip(){return this.__tooltip}", "showTip(context) {\n const me = this;\n\n if (me.showTooltip) {\n me.clockTemplate = new ClockTemplate({\n scheduler: me.client\n });\n me.tip = new Tooltip({\n id: `${me.client.id}-time-range-tip`,\n cls: 'b-interaction-tooltip',\n align: 'b-t',\n autoShow: true,\n updateContentOnMouseMove: true,\n forElement: context.element,\n getHtml: () => me.getTipHtml(context.record, context.element)\n });\n }\n }", "addHighlighTooltip () {\n }", "_tooltipChanged(newValue,oldValue){if(\"\"==newValue||null==newValue){this.shadowRoot.querySelector(\"#tooltip\").setAttribute(\"aria-hidden\",\"true\")}else{this.shadowRoot.querySelector(\"#tooltip\").setAttribute(\"aria-hidden\",\"false\")}}", "showToolTip_(event) {\n this.updateToolTip_(event);\n }", "_callToolTip () {\n const toolTip = this.getToolTip();\n const svg = this.getSVG();\n\n if (toolTip) {\n svg.call(toolTip);\n\n const toolTipNode = document.getElementById('ets-tip');\n\n if (toolTipNode) {\n toolTipNode.onmouseover = () => { this._shortCircuitHide(); };\n toolTipNode.onmouseout = () => { this._hideToolTip(); };\n }\n }\n }", "set Tooltip(value) {\n this._tooltip = value;\n }", "showTip(context) {\n const me = this;\n\n if (me.showTooltip) {\n me.clockTemplate = new ClockTemplate({\n timeAxisViewModel: me.client.timeAxisViewModel\n });\n\n me.tip = new Tooltip({\n cls: 'b-interaction-tooltip',\n align: 'b-t',\n autoShow: true,\n forElement: context.element,\n getHtml: () => me.getTipHtml(context.record, context.element)\n });\n }\n }", "setupTooltipHandlers() {\n this.button.onmouseenter = () => {\n this.tooltip.showTooltip();\n };\n\n this.button.onmouseleave = () => {\n this.tooltip.hideTooltip();\n };\n }", "function enableTooltip() {\n $('[v-tooltip]').tooltip({trigger: \"hover\", 'delay': {show: 1000, hide: 100}});\n}", "function makeTip(selector, title, placement, trigger) {\n placement = placement || \"right\";\n trigger = trigger || \"focus\";\n $(selector).tooltip({\n \"placement\": placement,\n \"title\": title,\n \"trigger\": trigger,\n });\n}", "handleFocus() {\n this.setState({ tooltipOpen: true });\n }", "function showTooltipRelatedTo(el) {\n $('.tooltip-simple').hide();\n var offset = el.offset();\n var tooltip = $('.' + el.attr('tooltip-class'));\n var direction = el.attr('tooltip-direction');\n var align = el.attr('tooltip-align');\n \n if (direction === 'left') {\n tooltip.css('top', offset.top - $(window).scrollTop() + parseInt(el.css('margin-top')) +'px');\n tooltip.css('left', offset.left + parseInt(el.css('margin-left')) + (el.width()+5)+'px');\n // tooltip.fadeIn( 250 );\n }\n\n if (direction === 'right') {\n tooltip.show();\n tooltip.css('top', offset.top - $(window).scrollTop() + parseInt(el.css('margin-top')) +'px');\n tooltip.css('left', offset.left - tooltip.outerWidth() - 5 +'px');\n tooltip.hide();\n // tooltip.fadeIn( 250 );\n \n }\n\n if (direction === 'up') {\n tooltip.show();\n tooltip.css('top', offset.top - $(window).scrollTop() - tooltip.outerHeight() - 5 +'px');\n if (align === 'right') {\n tooltip.css('left', offset.left + (el.width() - tooltip.outerWidth()) + 'px');\n } else {\n tooltip.css('left', offset.left + parseInt(el.css('margin-left')) +'px');\n }\n tooltip.hide();\n // tooltip.fadeIn( 250 );\n }\n\n if (direction === 'down') {\n tooltip.show();\n tooltip.css('top', offset.top + el.height() - $(window).scrollTop() + parseInt(el.css('margin-bottom')) + 5 +'px');\n if (align === 'right') {\n tooltip.css('left', offset.left + (el.width() - tooltip.outerWidth()) + 'px');\n } else {\n tooltip.css('left', offset.left + parseInt(el.css('margin-left')) +'px');\n }\n tooltip.hide();\n }\n tooltip.fadeIn( 250 );\n return;\n }", "function doTooltip(e, msg) {\nif ( typeof Tooltip == \"undefined\" || !Tooltip.ready ) return;\nTooltip.show(e, msg);\n}", "function mouseOver() {\n tooltip\n .style(\"opacity\", 1)\n .style(\"display\",\"inherit\");\n}", "function ActivateTooltip() {\n // creates the tooltip to display the y point\n $(\"<div id='tooltip'></div>\").css({\n position: \"absolute\",\n display: \"none\",\n border: \"1px solid #fdd\",\n padding: \"2px\",\n \"background-color\": \"#fee\",\n opacity: 0.80\n }).appendTo(\"body\");\n // displays the tooltip on hover\n $(\"#placeholder\").bind(\"plothover\", function (event, pos, item) {\n if (item) {\n var x = item.datapoint[0].toFixed(2), y = item.datapoint[1].toFixed(2);\n $(\"#tooltip\").html(y)\n .css({ top: item.pageY + 5, left: item.pageX + 5 })\n .fadeIn(200);\n }\n else {\n $(\"#tooltip\").hide();\n }\n });\n }", "function MatTooltipDefaultOptions() {}", "handleTooltip(event) {\n if (this.state.showTooltip == event.currentTarget.id) {\n this.setState({\n showTooltip: '',\n eventListener: false,\n });\n trackEvent('Full Modal', `Opened Tooltip by clicking`)\n } else {\n this.setState({\n showTooltip: event.currentTarget.id,\n eventListener: true,\n });\n trackEvent('Full Modal', `Closed Tooltip by clicking on it`)\n }\n }", "function toggleAllTooltips() {\n \ttooltip_active = true; //only set to true during programmatic triggering of events\n\n \t$.each(pegList, function( index1, arr ) {\n \t\t$.each(arr, function( index2, peg ) {\n\n \t\t\t//if the tooltips are not being shown, turn them on\n \t\t\tif (!tooltip_status) {\n \t\t\t\tpeg.shape.fire('mouseenter');\n \t\t\t}\n \t\t\t//if the tooltips are being shown, turn them off\n \t\t\telse if (tooltip_status) {\n \t\t\t\tpeg.shape.fire('mouseleave');\n \t\t\t}\n \t\t\t//else - Error\n \t\t\telse {\n \t\t\t\tconsole.log('Error with toggleAllTooltips');\n \t\t\t\talert('Error with toggling tooltips - tooltip_status reached unknown state');\n \t\t\t}\n\n \t\t});\n \t});\n \ttooltip_active = false; //set back to false to prevent non-programmatic event triggers\n \ttooltip_status = (!tooltip_status) ? true : false;\n }", "_moveToolTip (element, event) {\n var div = document.getElementById(\"bcdChartToolTip\");\n if (! div)\n return;\n if (jQuery(div).is(\":visible\"))\n bcdui.widget._flyOverPositioning({event: event, htmlElement: div, positionUnderMouse: false});\n }", "initTooltip() {\n const me = this,\n {\n client\n } = me;\n\n if (me.showTooltip) {\n if (me.tip) {\n me.tip.showBy(me.getTooltipTarget());\n } else {\n me.clockTemplate = new ClockTemplate({\n scheduler: client\n });\n me.tip = new Tooltip({\n id: `${client.id}-drag-create-tip`,\n autoShow: true,\n trackMouse: false,\n updateContentOnMouseMove: true,\n getHtml: me.getTipHtml.bind(me),\n align: client.isVertical ? 't-b' : 'b100-t100',\n hideDelay: 0,\n axisLock: true // Don't want it flipping to the side where we are dragging\n\n });\n me.tip.on('innerhtmlupdate', me.updateDateIndicator, me);\n }\n }\n }", "async toggleTooltip() {\n this.actionEventHandler();\n }", "initTooltip() {\n const me = this,\n client = me.client;\n\n if (me.showTooltip) {\n if (me.tip) {\n me.tip.showBy(me.getTooltipTarget());\n } else {\n me.clockTemplate = new ClockTemplate({\n timeAxisViewModel: client.timeAxisViewModel\n });\n\n me.tip = new Tooltip({\n id: `${client.id}-drag-create-tip`,\n autoShow: true,\n trackMouse: false,\n getHtml: me.getTipHtml.bind(me),\n align: client.isVertical ? 't-b' : 'b100-t100',\n hideDelay: 0,\n axisLock: true // Don't want it flipping to the side where we are dragging\n });\n\n me.tip.on('innerhtmlupdate', me.updateDateIndicator, me);\n }\n }\n }", "toggleBonusTooltip() {\n this.setState({ shouldTooltipDisplay: !this.state.shouldTooltipDisplay })\n }", "function HideToolTip (){\ntooltip\n .style(\"opacity\",0);\n}", "function toggle_tooltip() {\n $('[data-toggle=\"tooltip\"]').tooltip(); \n}", "_addTooltips() {\n $(this.el.querySelectorAll('[title]')).tooltip({\n delay: { show: 500, hide: 0 }\n });\n }", "function enableToolTipForContactTime(){\r\n\t$('[id^=\"contactFrom\"]').tooltip({title: \"Please follow military time format from 0800 to 1800.\", animation: true,placement: \"auto\"});\r\n\t$('[id^=\"contactTo\"]').tooltip({title: \"Please follow military time format from 0800 to 1800.\", animation: true,placement: \"auto\"});\r\n}", "function tooltips ( ) {\r\n\r\n\t\t// Tooltips are added with options.tooltips in original order.\r\n\t\tvar tips = scope_Handles.map(addTooltip);\r\n\r\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\r\n\r\n\t\t\tif ( !tips[handleNumber] ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar formattedValue = values[handleNumber];\r\n\r\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\r\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\r\n\t\t\t}\r\n\r\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\r\n\t\t});\r\n\t}", "function mouseOver() {\n\t\ttooltip.style(\"display\", \"block\")\n\t\t\t .style(\"visibility\", \"visible\");\n\t}", "function tooltipx(event){\n\t\t$(\"[data-toggle=tooltip]\").tooltip({ \n\t\t\t//placement: 'right'\n\t\t});\n\t}", "_createToolTip () {\n const tip = d3.tip().attr('id', 'ets-tip')\n .html((d) => { return this._getTipContent(d); })\n .direction((d) => { return this._setTipDirection(d); });\n\n\n return tip;\n }", "getToolTip () {\n if (this._toolTip) {\n return this._toolTip;\n }\n }", "function displayNavMenuControlTooltip() {\n var tooltipAnchor = $(\"#leftnav-maincontent-wrapper .right-pane .menu-control\");\n\n tooltipAnchor.tooltipster({\n position: \"right\",\n trigger: \"custom\",\n minWidth: 150, \n theme: 'tooltipster-shadow', \n content: i18n.getMessage(\"nav_menu_collapse_helper\"), \n timer: 5000\n }).tooltipster('show');\n }", "function toolTip() {\n $('[data-toggle=\"tooltip\"]').tooltip();\n}", "showTooltip() {\n this.setState({ visible: true });\n }", "_events() {\n var _this = this;\n var $template = this.template;\n var isFocus = false;\n\n if (!this.options.disableHover) {\n\n this.$element\n .on('mouseenter.zf.tooltip', function(e) {\n if (!_this.isActive) {\n _this.timeout = setTimeout(function() {\n _this.show();\n }, _this.options.hoverDelay);\n }\n })\n .on('mouseleave.zf.tooltip', function(e) {\n clearTimeout(_this.timeout);\n if (!isFocus || (_this.isClick && !_this.options.clickOpen)) {\n _this.hide();\n }\n });\n }\n\n if (this.options.clickOpen) {\n this.$element.on('mousedown.zf.tooltip', function(e) {\n e.stopImmediatePropagation();\n if (_this.isClick) {\n //_this.hide();\n // _this.isClick = false;\n } else {\n _this.isClick = true;\n if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) {\n _this.show();\n }\n }\n });\n } else {\n this.$element.on('mousedown.zf.tooltip', function(e) {\n e.stopImmediatePropagation();\n _this.isClick = true;\n });\n }\n\n if (!this.options.disableForTouch) {\n this.$element\n .on('tap.zf.tooltip touchend.zf.tooltip', function(e) {\n _this.isActive ? _this.hide() : _this.show();\n });\n }\n\n this.$element.on({\n // 'toggle.zf.trigger': this.toggle.bind(this),\n // 'close.zf.trigger': this.hide.bind(this)\n 'close.zf.trigger': this.hide.bind(this)\n });\n\n this.$element\n .on('focus.zf.tooltip', function(e) {\n isFocus = true;\n if (_this.isClick) {\n // If we're not showing open on clicks, we need to pretend a click-launched focus isn't\n // a real focus, otherwise on hover and come back we get bad behavior\n if(!_this.options.clickOpen) { isFocus = false; }\n return false;\n } else {\n _this.show();\n }\n })\n\n .on('focusout.zf.tooltip', function(e) {\n isFocus = false;\n _this.isClick = false;\n _this.hide();\n })\n\n .on('resizeme.zf.trigger', function() {\n if (_this.isActive) {\n _this._setPosition();\n }\n });\n }", "tooltipHide(vis) {\n moveTimeSliderLayerUp();\n d3.select('#mapchart-tooltip').style('display', 'none');\n }", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function tooltips ( ) {\n\n\t\t// Tooltips are added with options.tooltips in original order.\n\t\tvar tips = scope_Handles.map(addTooltip);\n\n\t\tbindEvent('update', function(values, handleNumber, unencoded) {\n\n\t\t\tif ( !tips[handleNumber] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar formattedValue = values[handleNumber];\n\n\t\t\tif ( options.tooltips[handleNumber] !== true ) {\n\t\t\t\tformattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n\t\t\t}\n\n\t\t\ttips[handleNumber].innerHTML = formattedValue;\n\t\t});\n\t}", "function bindTooltip(){\n bindTooltipSkin(\".b-tooltip, .b-panel-icons-item a,.b-tool, .b-image-nav, .b-help, .b-title\",\"qtip-light\");\n }", "get currentTooltip() {\n return this._defaultOrToggled(\n this.tooltip,\n this.toggledTooltip,\n this.isToggled\n );\n }", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n\t var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\n\t var axisPointerShow = axisPointerModel.get('show');\n\t if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n\t return;\n\t }\n\n\t if (triggerTooltip == null) {\n\t triggerTooltip = axisPointerModel.get('triggerTooltip');\n\t }\n\n\t axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n\n\t var snap = axisPointerModel.get('snap');\n\t var key = makeKey(axis.model);\n\t var involveSeries = triggerTooltip || snap || axis.type === 'category';\n\n\t // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\t var axisInfo = result.axesInfo[key] = {\n\t key: key,\n\t axis: axis,\n\t coordSys: coordSys,\n\t axisPointerModel: axisPointerModel,\n\t triggerTooltip: triggerTooltip,\n\t involveSeries: involveSeries,\n\t snap: snap,\n\t useHandle: isHandleTrigger(axisPointerModel),\n\t seriesModels: []\n\t };\n\t axesInfoInCoordSys[key] = axisInfo;\n\t result.seriesInvolved |= involveSeries;\n\n\t var groupIndex = getLinkGroupIndex(linksOption, axis);\n\t if (groupIndex != null) {\n\t var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { axesInfo: {} });\n\t linkGroup.axesInfo[key] = axisInfo;\n\t linkGroup.mapper = linksOption[groupIndex].mapper;\n\t axisInfo.linkGroup = linkGroup;\n\t }\n\t }", "_tooltipChanged(newValue, oldValue) {\n if (newValue == \"\" || newValue == null) {\n this.shadowRoot\n .querySelector(\"#tooltip\")\n .setAttribute(\"aria-hidden\", \"true\");\n } else {\n this.shadowRoot\n .querySelector(\"#tooltip\")\n .setAttribute(\"aria-hidden\", \"false\");\n }\n }", "function showTooltips(evt) {\n\t\tif (tooltips_element) {\n\t\t\ttooltips_element.style.display = '';\n\t\t}\n\t}", "function customToolTip(tooltip, elementId, templateEpaSourceMap) {\n\n // Tooltip Element\n let tooltipEl = $('#' + elementId);\n // Hide if no tooltip\n if (!tooltip) {\n tooltipEl.css({\n opacity: 0\n });\n return;\n }\n\n let epaId = EPATextToNumber(tooltip.text.split(\":\")[0]),\n epaRootId = epaId.split(\".\")[0];\n\n // Set caret Position\n tooltipEl.removeClass('above below');\n tooltipEl.addClass(tooltip.yAlign);\n // Set Text\n tooltipEl.html(tooltip.text + \", \" + templateEpaSourceMap[epaRootId].subRoot[epaId]);\n // Find Y Location on page\n var top;\n if (tooltip.yAlign == 'above') {\n top = tooltip.y - tooltip.caretHeight - tooltip.caretPadding;\n } else {\n top = tooltip.y + tooltip.caretHeight + tooltip.caretPadding;\n }\n // Display, position, and set styles for font\n tooltipEl.css({\n opacity: 1,\n left: tooltip.chart.canvas.offsetLeft + tooltip.x + 'px',\n top: tooltip.chart.canvas.offsetTop + top + 'px',\n fontFamily: tooltip.fontFamily,\n fontSize: tooltip.fontSize,\n fontStyle: tooltip.fontStyle,\n });\n\n}", "setHyperlinkContentToToolTip(fieldBegin, widget, xPos) {\n if (fieldBegin) {\n if (this.owner.contextMenuModule &&\n this.owner.contextMenuModule.contextMenuInstance.element.style.display === 'block') {\n return;\n }\n if (!this.toolTipElement) {\n this.toolTipElement = createElement('div', { className: 'e-de-tooltip' });\n this.viewer.viewerContainer.appendChild(this.toolTipElement);\n }\n this.toolTipElement.style.display = 'block';\n let l10n = new L10n('documenteditor', this.owner.defaultLocale);\n l10n.setLocale(this.owner.locale);\n let toolTipText = l10n.getConstant('Click to follow link');\n if (this.owner.useCtrlClickToFollowHyperlink) {\n toolTipText = 'Ctrl+' + toolTipText;\n }\n let linkText = this.getLinkText(fieldBegin);\n this.toolTipElement.innerHTML = linkText + '</br><b>' + toolTipText + '</b>';\n let widgetTop = this.getTop(widget) * this.viewer.zoomFactor;\n let page = this.getPage(widget.paragraph);\n let containerWidth = this.viewer.viewerContainer.getBoundingClientRect().width + this.viewer.viewerContainer.scrollLeft;\n let left = page.boundingRectangle.x + xPos * this.viewer.zoomFactor;\n if ((left + this.toolTipElement.clientWidth + 10) > containerWidth) {\n left = left - ((this.toolTipElement.clientWidth - (containerWidth - left)) + 15);\n }\n let top = this.getPageTop(page) + (widgetTop - this.toolTipElement.offsetHeight);\n top = top > this.viewer.viewerContainer.scrollTop ? top : top + widget.height + this.toolTipElement.offsetHeight;\n this.showToolTip(left, top);\n if (!isNullOrUndefined(this.toolTipField) && fieldBegin !== this.toolTipField) {\n this.toolTipObject.position = { X: left, Y: top };\n }\n this.toolTipObject.show();\n this.toolTipField = fieldBegin;\n }\n else {\n this.hideToolTip();\n }\n }", "get eventTooltipTemplate() {\n\t\treturn this.nativeElement ? this.nativeElement.eventTooltipTemplate : undefined;\n\t}", "function showTooltip(d) {\n $(this).popover({\n placement: 'auto top', //place the tooltip above the item\n container: '#chart', //the name (class or id) of the container\n trigger: 'manual',\n html : true,\n content: function() { //the html content to show inside the tooltip\n return \"<span style='font-size: 11px; text-align: center;'>\" + \"sds\" + \"</span>\"; }\n });\n $(this).popover('show'); \n}//function showTooltip", "async showTooltip() {\n this.actionEventHandler();\n }", "function moveTooltip() {\n\t tooltip.style(\"top\",(d3.event.pageY+tooltipOffset.y)+\"px\")\n\t .style(\"left\",(d3.event.pageX+tooltipOffset.x)+\"px\");\n\t}", "get tooltipTemplate() {\n return html`<simple-tooltip\n id=\"tooltip\"\n for=\"button\"\n ?hidden=\"${!this.currentTooltip && !this.currentLabel}\"\n position=\"${this.tooltipDirection || \"bottom\"}\"\n >${this.currentTooltip || this.currentLabel}</simple-tooltip\n >`;\n }", "function hideTooltip() {\n tooltip.style(\"display\",\"none\");\n}", "bindEvents ($element) {\n let showEvents = 'srf.tooltip.show',\n hideEvents = 'srf.tooltip.hide';\n\n if ($element.data('tooltipNoHover') === undefined) {\n showEvents += ' mouseenter focus';\n hideEvents += ' mouseleave focusout';\n }\n\n $element.on(showEvents, () => {\n $element.children('.tooltip').remove();\n\n $element.append(this.template);\n $element.css('position', 'relative');\n\n $element.find('.tooltip-content').html(this.title);\n\n const $tooltip = $element.children('.tooltip');\n\n // use custom offset, if defined. Otherwise take the default offset\n let offset = $element.data('tooltipOffset') ? $element.data('tooltipOffset') : DEFAULT_OFFSET;\n\n // Move tooltip in right position relative to its parent\n const leftPosition = (this.originalWidth - $tooltip.width()) / 2;\n const topPosition = ($tooltip.height() + ADDITIONAL_OFFSET + offset) * -1;\n\n $tooltip.css({\n 'top': topPosition,\n 'left': leftPosition - 8,\n 'position': 'absolute'\n });\n }).on(hideEvents, () => {\n $element.children('.tooltip').remove();\n });\n }", "function v(){var n=Q.popperChildren.tooltip,e=Q.props.popperOptions,t=Me[\"round\"===Q.props.arrowType?\"ROUND_ARROW\":\"ARROW\"],i=n.querySelector(t),r=fe({placement:Q.props.placement},e||{},{modifiers:fe({},e?e.modifiers:{},{arrow:fe({element:t},e&&e.modifiers?e.modifiers.arrow:{}),flip:fe({enabled:Q.props.flip,padding:Q.props.distance+5/* 5px from viewport boundary */,behavior:Q.props.flipBehavior},e&&e.modifiers?e.modifiers.flip:{}),offset:fe({offset:Q.props.offset},e&&e.modifiers?e.modifiers.offset:{})}),onCreate:function e(){n.style[St(Q.popper)]=Ct(Q.props.distance,de.distance),i&&Q.props.arrowTransform&&wt(i,Q.props.arrowTransform)},onUpdate:function e(){var t=n.style;t.top=\"\",t.bottom=\"\",t.left=\"\",t.right=\"\",t[St(Q.popper)]=Ct(Q.props.distance,de.distance),i&&Q.props.arrowTransform&&wt(i,Q.props.arrowTransform)}}),o=new MutationObserver(function(){Q.popperInstance.update()});return o.observe(Q.popper,{childList:!0,subtree:!0}),R&&R.disconnect(),R=o,\n// fixes https://github.com/atomiks/tippyjs/issues/193\n$||($=!0,Q.popper.addEventListener(\"mouseenter\",function(e){Q.props.interactive&&Q.state.isVisible&&\"mouseenter\"===M.type&&a(e)}),Q.popper.addEventListener(\"mouseleave\",function(e){Q.props.interactive&&\"mouseenter\"===M.type&&0===Q.props.interactiveDebounce&&Et(St(Q.popper),Q.popper.getBoundingClientRect(),e,Q.props)&&s()})),new Re(Q.reference,Q.popper,r)}", "function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n\t var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n\t var axisPointerShow = axisPointerModel.get('show');\n\t\n\t if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n\t return;\n\t }\n\t\n\t if (triggerTooltip == null) {\n\t triggerTooltip = axisPointerModel.get('triggerTooltip');\n\t }\n\t\n\t axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n\t var snap = axisPointerModel.get('snap');\n\t var axisKey = makeKey(axis.model);\n\t var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\t\n\t var axisInfo = result.axesInfo[axisKey] = {\n\t key: axisKey,\n\t axis: axis,\n\t coordSys: coordSys,\n\t axisPointerModel: axisPointerModel,\n\t triggerTooltip: triggerTooltip,\n\t involveSeries: involveSeries,\n\t snap: snap,\n\t useHandle: isHandleTrigger(axisPointerModel),\n\t seriesModels: [],\n\t linkGroup: null\n\t };\n\t axesInfoInCoordSys[axisKey] = axisInfo;\n\t result.seriesInvolved = result.seriesInvolved || involveSeries;\n\t var groupIndex = getLinkGroupIndex(linksOption, axis);\n\t\n\t if (groupIndex != null) {\n\t var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n\t axesInfo: {}\n\t });\n\t linkGroup.axesInfo[axisKey] = axisInfo;\n\t linkGroup.mapper = linksOption[groupIndex].mapper;\n\t axisInfo.linkGroup = linkGroup;\n\t }\n\t }", "get tooltipClass() { return this._tooltipClass; }", "function tooltips() {\r\n\t$('.tooltip-link').tooltip();\r\n}", "setTooltip_() {\n this.tooltip = $('arc-event-band-tooltip');\n this.svg.onmouseover = this.showToolTip_.bind(this);\n this.svg.onmouseout = this.hideToolTip_.bind(this);\n this.svg.onmousemove = this.updateToolTip_.bind(this);\n this.svg.onclick = (event) => {\n showDetailedInfoForBand(this, event);\n };\n }", "tooltipMove(event, d, vis) {\n d3.select('#mapchart-tooltip')\n .style('left', () => {\n if (event.pageX > 750)\n return event.pageX - vis.tooltipWidth - vis.config.tooltipPadding + 'px';\n return event.pageX + vis.config.tooltipPadding + 'px';\n })\n .style('top', () => {\n if (event.pageY > 500)\n return event.pageY - vis.tooltipHeight - vis.config.tooltipPadding + 'px';\n return event.pageY + vis.config.tooltipPadding + 'px';\n });\n }", "function checkLeft(targetOffset,tooltipLayerStyleRight,tooltipOffset,tooltipLayer){if(targetOffset.left+targetOffset.width-tooltipLayerStyleRight-tooltipOffset.width<0){// off the left side of the window\ntooltipLayer.style.left=\"\".concat(-targetOffset.left,\"px\");return false;}tooltipLayer.style.right=\"\".concat(tooltipLayerStyleRight,\"px\");return true;}", "function initTooltip() {\n angular.element(elem).tooltip({\n title: scope.bsTip,\n placement: scope.bsTipPlacement\n });\n }", "function tooltipInit() {\n $('[data-toggle=\"tooltip\"]').tooltip();\n}", "function toolTips(el,help) {\n\t\t$(el).on('mouseenter', function() {\n\t\t\t$(help).show();\n\t\t\t$(el).on('click', function() {\n\t\t\t\t$(help).hide();\n\t\t\t});\n\t\t\t$(el).on('mouseleave', function() {\n\t\t\t\t$(help).hide();\n\t\t\t});\n\t\t});\n\t}", "displayToolTip(item) {\n console.log(\"Hovering Over Item: \", item.name);\n }", "function showTooltip_onMouseOver(){\n//----------------------------------------------------------------------------------------------------------------------------\t\n\n\n this.dispalyTooltips = function(toolz){ //args(tooplips array)\n // request mousemove events\n $(\"#graph\").mousemove(function (e) {\n\t\t var onMouseOver_file = new onMouseOver();//uses other module in this very file\n onMouseOver_file.handleMouseMoveAction(e, toolz); //args(mouse event, tooplips array)\n });\n\n } \n}", "function openTooltip(row, col, action) {\n\t\t\tconsole.log(\"tooltip opened\", row, col, action);\n\t\t}", "function show() {\n tID = null;\n let isBrowsable = false;\n if ($.tooltip.current !== null) {\n isBrowsable = settings($.tooltip.current).isBrowsable;\n }\n\n if ((!IE || !$.fn.bgiframe) && settings($.tooltip.current).fade) {\n if (helper.parent.is(':animated'))\n helper.parent\n .stop()\n .show()\n .fadeTo(settings($.tooltip.current).fade, 100);\n else\n helper.parent.is(':visible')\n ? helper.parent.fadeTo(\n settings($.tooltip.current).fade,\n 100\n )\n : helper.parent.fadeIn(settings($.tooltip.current).fade);\n } else {\n helper.parent.show();\n }\n\n $(helper.parent[0])\n .unbind('mouseenter')\n .unbind('mouseleave')\n .mouseenter(function () {\n if (isBrowsable) {\n $.tooltip.currentHover = true;\n }\n })\n .mouseleave(function () {\n if (isBrowsable) {\n // if tooltip has scrollable content or selectionnable text - should be closed on mouseleave:\n $.tooltip.currentHover = false;\n helper.parent.hide();\n }\n });\n\n update();\n }", "function tooltips() {\n\n // Tooltips are added with options.tooltips in original order.\n var tips = scope_Handles.map(addTooltip);\n\n bindEvent('update', function (values, handleNumber, unencoded) {\n\n if (!tips[handleNumber]) {\n return;\n }\n\n var formattedValue = values[handleNumber];\n\n if (options.tooltips[handleNumber] !== true) {\n formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);\n }\n\n tips[handleNumber].innerHTML = formattedValue;\n });\n }", "function mouseLeave() {\n tooltip\n .style(\"opacity\", 0)\n .style(\"display\",\"none\")\n}", "function openTaxesAndFeesToolTip(){\n\t$(\"span[id^='taxesAndFees-']\").hover(function(event) {\n\t\tvar packageId = $(this).attr(\"id\").split(\"-\")[1];\n\t\tmouseEnterAnchor($(this), packageId,event);\n\t}, function() {\n\t\tvar packageId = $(this).attr(\"id\").split(\"-\")[1];\n\t\tmouseLeaveAnchor($(this), packageId);\n\t});\n}", "function initBootstrapTooltips() {\n const options = {\n delay: { \"show\": 750, \"hide\": 100 },\n trigger: 'hover'\n };\n\n if(isTouchDevice() === false) {\n $('[data-toggle = \"tooltip\"]').tooltip(options);\n }\n}", "function ActivateTooltips(container) {\n if (container && container.tooltip) {\n container.find('span[rel=\"tooltip\"]').tooltip();\n }\n }", "applyTooltips() {\n tippy(\".tipped\", {\n arrow: true,\n animateFill: false,\n size: \"small\",\n maxWidth: 200,\n interactiveBorder: 8\n });\n }", "function enableToolTipForHeader(){\r\n\t$('#merchantUpload').tooltip({title: \"Upload new set of images for an application.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/search\"]').tooltip({title: \"Search existing or previously uploaded application from the system.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/followup\"]').tooltip({title: \"Search applications for document followup from Head office.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"/signup\"]').tooltip({title: \"Register new merchant promoter or staff in Online Submission Application.\", animation: true,placement: \"auto\"});\r\n\t$('[href=\"#logout\"]').tooltip({title: \"Logout to OSA-PH.\", animation: true,placement: \"auto\"});\r\n}", "function showTooltip() {\n if (angular.isDefined(_tooltip) || angular.isUndefined(lx.text) || !lx.text) {\n return;\n }\n\n _tooltip = angular.element('<div/>', {\n class: `${CSS_PREFIX}-tooltip`,\n });\n\n _tooltipArrow = angular.element('<div/>', {\n class: `${CSS_PREFIX}-tooltip__arrow`,\n });\n\n _tooltipInner = angular.element('<span/>', {\n class: `${CSS_PREFIX}-tooltip__inner`,\n text: lx.text,\n });\n\n _tooltip.append(_tooltipArrow).append(_tooltipInner);\n\n _hoverTimeout = $timeout(_setTooltipPosition, _HOVER_DELAY);\n }", "function switchToolTip() {\n //show information box when the mouse is placed on top of the question mark image\n document.getElementById('questionmark').onmouseover = function() {\n var toolTip = document.getElementById('tooltip');\n toolTip.style.display = 'block';\n };\n //hide information box when mouse is moved away from question mark image\n document.getElementById('questionmark').onmouseout = function() {\n var toolTip = document.getElementById('tooltip');\n toolTip.style.display = 'none';\n };\n}", "function hideTooltip() {\n\t tooltip.style(\"display\",\"none\");\n\t}", "function showToolTipHelp() {\n\t\tvar link = tip.triggerElement;\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\t\tvar table = link.getAttribute('data-table');\n\t\tvar field = link.getAttribute('data-field');\n\t\tvar key = table + '.' + field;\n\t\tvar response = cshHelp.key(key);\n\t\ttip.target = tip.triggerElement;\n\t\tif (response) {\n\t\t\tupdateTip(response);\n\t\t} else {\n\t\t\t\t// If a table is defined, use ExtDirect call to get the tooltip's content\n\t\t\tif (table) {\n\t\t\t\tvar description = '';\n\t\t\t\tif (typeof(top.TYPO3.LLL) !== 'undefined') {\n\t\t\t\t\tdescription = top.TYPO3.LLL.core.csh_tooltip_loading;\n\t\t\t\t} else if (opener && typeof(opener.top.TYPO3.LLL) !== 'undefined') {\n\t\t\t\t\tdescription = opener.top.TYPO3.LLL.core.csh_tooltip_loading;\n\t\t\t\t}\n\n\t\t\t\t\t// Clear old tooltip contents\n\t\t\t\tupdateTip({\n\t\t\t\t\tdescription: description,\n\t\t\t\t\tcshLink: '',\n\t\t\t\t\tmoreInfo: '',\n\t\t\t\t\ttitle: ''\n\t\t\t\t});\n\t\t\t\t\t// Load content\n\t\t\t\tTYPO3.CSH.ExtDirect.getTableContextHelp(table, function(response, options) {\n\t\t\t\t\tExt.iterate(response, function(key, value){\n\t\t\t\t\t\tcshHelp.add(value);\n\t\t\t\t\t\tif (key === field) {\n\t\t\t\t\t\t\tupdateTip(value);\n\t\t\t\t\t\t\t\t// Need to re-position because the height may have increased\n\t\t\t\t\t\t\ttip.show();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, this);\n\n\t\t\t\t// No table was given, use directly title and description\n\t\t\t} else {\n\t\t\t\tupdateTip({\n\t\t\t\t\tdescription: link.getAttribute('data-description'),\n\t\t\t\t\tcshLink: '',\n\t\t\t\t\tmoreInfo: '',\n\t\t\t\t\ttitle: link.getAttribute('data-title')\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "function showHelpTooltip() {\n $('#tooltip_help').show();\n}", "function canvasClickEvent(event){\r\n if((typeof clickeventFlag !== 'undefined') && clickeventFlag){\r\n //desactive le focus\r\n if(document.getElementById(\"tooltip\")!=null)\r\n document.getElementById(\"tooltip\").remove();\r\n clickeventFlag= false;\r\n canvasMouseEvent(event);\r\n return;\r\n }\r\n\r\n canvasMouseEvent(event);\r\n //Active le drapeau pour bloquer le tooltip\r\n clickeventFlag=true;\r\n var tooltip= document.getElementById(\"tooltip\");\r\n var doc = document.documentElement;\r\n //Position du scroll de la page\r\n var scrolltop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);\r\n var scrollleft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);\r\n\r\n var mytop = tooltip.offsetTop+scrolltop;\r\n var myleft = tooltip.offsetLeft+scrollleft;\r\n\r\n tooltip.style.position=\"absolute\";\r\n tooltip.style.left = myleft+\"px\";\r\n tooltip.style.top = mytop+\"px\";\r\n var div = document.createElement(\"div\");\r\n div.innerHTML=\"Actions : <br>\";\r\n var a = document.createElement(\"a\");\r\n a.innerHTML=\"Afficher plus d'information (lot de 500)\";\r\n a.onclick=function (ev) {\r\n showLot();\r\n return false;\r\n };\r\n a.className=\"btn btn-default btn-xs\";\r\n div.appendChild(a);\r\n /*var a2 = document.createElement(\"a\");\r\n a2.innerHTML=\"Afficher plus d'information (tous)\";\r\n a2.onclick=function (ev) {\r\n showLot();\r\n return false;\r\n };\r\n a2.className=\"btn btn-default btn-xs\";\r\n div.appendChild(a2);*/\r\n tooltip.appendChild(div);\r\n}", "function mousemoveDeputy() { return tooltip.style(\"top\", (event.pageY - 10)+\"px\").style(\"left\",(event.pageX + 10)+\"px\");}", "function createTooltip(obj, w, h) {\n var radius, label, type, note;\n\n if (obj.type === 'edge') {\n radius = 0;\n label = obj.node.label;\n note = Object(_modal_node__WEBPACK_IMPORTED_MODULE_1__[\"typeConversion\"])(obj.node.type) + ' connected to this line';\n d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"]('#chart-tooltip').style('border', '2px solid ' + obj.node.fill).style('box-shadow', 'none');\n } else {\n //node\n radius = obj.r;\n label = obj.label;\n note = Object(_modal_node__WEBPACK_IMPORTED_MODULE_1__[\"typeConversion\"])(obj.type);\n d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"]('#chart-tooltip').style('border', null).style('box-shadow', null);\n } //else\n //Change titles\n\n\n d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"]('#chart-tooltip .tooltip-type').html(note);\n d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"]('#chart-tooltip .tooltip-title').html(label);\n var box_size = document.getElementById('chart-tooltip').getBoundingClientRect(); //Place & show the tooltip\n\n d3__WEBPACK_IMPORTED_MODULE_0__[\"select\"]('#chart-tooltip').style('top', obj.y + h / 2 - box_size.height - radius - Math.max(radius * 0.2, 30) + 'px').style('left', obj.x + w / 2 - box_size.width / 2 + 'px').style('opacity', 1);\n} //function createTooltip", "hideTooltip () {\n this.tooltip\n .transition ()\n .duration (this.settings.transition_duration / 2)\n .ease (d3.easeLinear)\n .style ('opacity', 0);\n }", "function enableTooltip() {\n\tvar hoverMsg = ( _sessLang == SESS_LANG_CHN ) ? \"如果選擇列表中沒有,選擇任何稱謂然後用“更改”的方式去更正!\" : \"If not found in the dropdown selection list, select any and then use Edit to correct it!\";\n\t$(document).tooltip({content: hoverMsg});\n\t$(document).tooltip(\"enable\");\n} // enableTooltip()", "function tooltipOff(d) {\n tooltip.style('left', '-10000px');\n }", "function showTooltip(content, refIndic,event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatelineChart(refIndic)\n updatePosition(event);\n }", "function tooltip(options) {\n var arrow = options.arrow;\n var shadowSize = (options.shadow) ? options.shadow.size : 0;\n var shadowSideMultiplier = 2.5;\n var pathOptions = {\n x: shadowSideMultiplier * shadowSize,\n y: shadowSideMultiplier * shadowSize,\n width: options.width,\n height: options.height,\n cornerRadius: options.cornerRadius,\n arrow: options.arrow\n };\n var path = svg_1.tooltipPath(pathOptions);\n var width = options.width + 2 * shadowSideMultiplier * shadowSize;\n if (arrow && (arrow.position === 'left' || arrow.position === 'right'))\n width += arrow.height;\n var height = options.height + 2 * shadowSideMultiplier * shadowSize;\n if (arrow && (arrow.position === 'top' || arrow.position === 'bottom'))\n height += arrow.height;\n var filterXOffset = (shadowSize * shadowSideMultiplier / options.width) * -200;\n var filterYOffset = (shadowSize * shadowSideMultiplier / options.height) * -200;\n var filterWidth = 100 + (shadowSize * shadowSideMultiplier / options.width) * 400;\n var filterHeight = 100 + (shadowSize * shadowSideMultiplier / options.height) * 400;\n var shadowColor = 'rgb(0, 0, 0)';\n var shadowOpacity = 0.5;\n var shadowOffset = { x: 0, y: 0 };\n if (options.shadow) {\n if (options.shadow.color)\n shadowColor = options.shadow.color;\n if (options.shadow.opacity)\n shadowOpacity = options.shadow.opacity;\n if (options.shadow.offset)\n shadowOffset = options.shadow.offset;\n }\n var svg = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n <svg width=\\\"\" + width + \"px\\\" height=\\\"\" + height + \"px\\\" viewBox=\\\"0 0 \" + width + \" \" + height + \"\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\">\\n <defs>\\n <path d=\\\"\" + path.toString() + \"\\\" id=\\\"tooltip\\\"></path>\\n <filter id=\\\"shadow\\\" x=\\\"\" + filterXOffset + \"%\\\" y=\\\"\" + filterYOffset + \"%\\\" width=\\\"\" + filterWidth + \"%\\\" height=\\\"\" + filterHeight + \"%\\\">\\n <feGaussianBlur stdDeviation=\\\"\" + shadowSize + \"\\\" />\\n <feOffset dx=\\\"\" + shadowOffset.x + \"\\\" dy=\\\"\" + shadowOffset.y + \"\\\" result=\\\"blur\\\"/>\\n <feFlood flood-color=\\\"\" + shadowColor + \"\\\" flood-opacity=\\\"\" + shadowOpacity + \"\\\"/>\\n <feComposite in2=\\\"blur\\\" operator=\\\"in\\\" result=\\\"colorShadow\\\"/>\\n <feComposite in=\\\"SourceGraphic\\\" in2=\\\"colorShadow\\\" operator=\\\"over\\\"/>\\n </filter>\\n </defs>\\n <g>\\n <use fill=\\\"\" + options.fillColor + \"\\\" fill-rule=\\\"evenodd\\\" xlink:href=\\\"#tooltip\\\"\" + (shadowSize ? ' filter=\"url(#shadow)\"' : '') + \"></use>\\n </g>\\n </svg>\\n \";\n return {\n svg: svg,\n insets: {\n top: pathOptions.y + ((arrow && arrow.position === 'top') ? arrow.height : 0),\n left: pathOptions.x + ((arrow && arrow.position === 'left') ? arrow.height : 0),\n right: pathOptions.x + ((arrow && arrow.position === 'right') ? arrow.height : 0),\n bottom: pathOptions.y + ((arrow && arrow.position === 'bottom') ? arrow.height : 0)\n },\n size: {\n width: width,\n height: height\n }\n };\n}" ]
[ "0.7494436", "0.73168004", "0.7181213", "0.715156", "0.70786935", "0.70663327", "0.69018006", "0.68914866", "0.6801135", "0.677454", "0.6710075", "0.6703516", "0.6672522", "0.6609714", "0.66061527", "0.65261465", "0.65257114", "0.65245795", "0.65063286", "0.65041316", "0.64813066", "0.64683515", "0.6456692", "0.64557916", "0.6448445", "0.64309245", "0.6402186", "0.6361047", "0.6345824", "0.63429", "0.633853", "0.6334176", "0.6326008", "0.63164246", "0.6310243", "0.63052243", "0.62881655", "0.62875867", "0.62800604", "0.6279509", "0.62739676", "0.62730366", "0.6268545", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.626171", "0.6258432", "0.62564933", "0.62541914", "0.62415284", "0.62409943", "0.6238519", "0.62343955", "0.6233417", "0.6232791", "0.6221738", "0.6221485", "0.6212476", "0.62086934", "0.61926806", "0.61868626", "0.618376", "0.61833954", "0.6182102", "0.6154979", "0.61540914", "0.6147967", "0.61380386", "0.61257243", "0.61237806", "0.61204344", "0.6114426", "0.61022097", "0.6098415", "0.6096829", "0.60962653", "0.60891396", "0.6078649", "0.60711", "0.6070862", "0.6068885", "0.60651606", "0.60629576", "0.6058629", "0.6044136", "0.60403943", "0.6027624", "0.60261285", "0.6021907", "0.6019591", "0.601432", "0.6010743", "0.60104954", "0.60044545" ]
0.0
-1
Create symbol or update symbol opt: basic position and event handlers
function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) { var color = itemStyleModel.get('color'); if (!symbol) { var symbolType = hostModel.get('symbol'); symbol = createSymbol(symbolType, -1, -1, 2, 2, color); symbol.setStyle('strokeNoScale', true); group.add(symbol); callback && callback.onCreate(symbol); } else { symbol.setColor(color); group.add(symbol); // Group may be new, also need to add. callback && callback.onUpdate(symbol); } // Style var itemStyle = itemStyleModel.getItemStyle(['color', 'symbol', 'symbolSize']); symbol.setStyle(itemStyle); // Transform and events. opt = zrUtil.merge({ rectHover: true, z2: 100 }, opt, true); var symbolSize = hostModel.get('symbolSize'); symbolSize = symbolSize instanceof Array ? symbolSize.slice() : [+symbolSize, +symbolSize]; symbolSize[0] /= 2; symbolSize[1] /= 2; opt.scale = symbolSize; var symbolOffset = hostModel.get('symbolOffset'); if (symbolOffset) { var pos = opt.position = opt.position || [0, 0]; pos[0] += numberUtil.parsePercent(symbolOffset[0], symbolSize[0]); pos[1] += numberUtil.parsePercent(symbolOffset[1], symbolSize[1]); } var symbolRotate = hostModel.get('symbolRotate'); opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; symbol.attr(opt); // FIXME // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed, // getBoundingRect will return wrong result. // (This is supposed to be resolved in zrender, but it is a little difficult to // leverage performance and auto updateTransform) // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol. symbol.updateTransform(); return symbol; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placeSymbol() {\n if (type == \"moon\") {\n moon = new magicalCanvas.Moon();\n moon.name = \"moon\";\n symbols.push(moon);\n }\n if (type == \"cloud\") {\n cloud = new magicalCanvas.Cloud();\n cloud.name = \"cloud\";\n symbols.push(cloud);\n }\n if (type == \"house\") {\n house = new magicalCanvas.House();\n house.name = \"house\";\n symbols.push(house);\n }\n if (type == \"star\") {\n star = new magicalCanvas.Star();\n star.name = \"star\";\n symbols.push(star);\n }\n if (type == \"sun\") {\n sun = new magicalCanvas.Sun();\n sun.name = \"sun\";\n symbols.push(sun);\n }\n if (type == \"tree\") {\n tree = new magicalCanvas.Tree();\n tree.name = \"tree\";\n symbols.push(tree);\n }\n move = true;\n }", "function findSymbol(_event) {\n if (move == true) {\n move = false; //drop symbol on new position after edit\n }\n else {\n for (let i = 0; symbols.length > i; i++) { //goes through every symbol to check if clicked on\n if (symbols[i].name == \"cloud\") {\n if (_event.offsetX > (symbols[i].x) && _event.offsetX < (symbols[i].x + symbols[i].size)) { //check if click was inbetween left and right end of symbol \n if (_event.offsetY > (symbols[i].y - symbols[i].size / 2) && _event.offsetY < (symbols[i].y + symbols[i].size / 2)) { //check if click was inbetween upper and lower end of symbol \n if (selectedSymbol != undefined) {\n selectedSymbol.selected = false; //previously selected symbol is deselected\n }\n selectedSymbol = symbols[i]; //set selected symbol to clicked on symbol\n selectedSymbol.selected = true; //new symbol is highlighted\n editBox.style.display = \"block\"; //show edit box\n editBox.style.left = (symbols[i].x + symbols[i].size) + \"px\"; //position of edit box relative to symbol\n editBox.style.top = (symbols[i].y + symbols[i].size) + \"px\";\n }\n }\n }\n else if (symbols[i].name == \"tree\" || symbols[i].name == \"house\") {\n if (_event.offsetX > (symbols[i].x - symbols[i].size / 2) && _event.offsetX < (symbols[i].x + symbols[i].size)) {\n if (_event.offsetY > (symbols[i].y - symbols[i].size * 1.25) && _event.offsetY < (symbols[i].y)) {\n if (selectedSymbol != undefined) {\n selectedSymbol.selected = false;\n }\n selectedSymbol = symbols[i];\n selectedSymbol.selected = true;\n document.getElementById(\"rotate\").value = \"0\";\n document.getElementById(\"scale-symbol\").value = \"1\";\n editBox.style.display = \"block\";\n editBox.style.left = (symbols[i].x + symbols[i].size) + \"px\";\n editBox.style.top = (symbols[i].y + symbols[i].size) + \"px\";\n }\n }\n }\n else {\n if (_event.offsetX > (symbols[i].x - symbols[i].size) && _event.offsetX < (symbols[i].x + symbols[i].size)) {\n if (_event.offsetY > (symbols[i].y - symbols[i].size) && _event.offsetY < (symbols[i].y + symbols[i].size)) {\n if (selectedSymbol != undefined) {\n selectedSymbol.selected = false;\n }\n selectedSymbol = symbols[i];\n selectedSymbol.selected = true;\n document.getElementById(\"rotate\").value = \"0\";\n document.getElementById(\"scale-symbol\").value = \"1\";\n editBox.style.display = \"block\";\n editBox.style.left = (symbols[i].x + symbols[i].size) + \"px\";\n editBox.style.top = (symbols[i].y + symbols[i].size) + \"px\";\n }\n }\n }\n }\n }\n }", "function moveSymbol(_event) {\n if (move == true) { //false if left mouse button released on Canvas\n if (type == \"rePosition\") {\n selectedSymbol.x = _event.offsetX; //_event.offsetX is current position of mouse on canvas\n selectedSymbol.y = _event.offsetY;\n }\n if (type == \"moon\") {\n moon.x = _event.offsetX;\n moon.y = _event.offsetY;\n }\n if (type == \"cloud\") {\n cloud.x = _event.offsetX;\n cloud.y = _event.offsetY;\n }\n if (type == \"house\") {\n house.x = _event.offsetX;\n house.y = _event.offsetY;\n }\n if (type == \"star\") {\n star.x = _event.offsetX;\n star.y = _event.offsetY;\n }\n if (type == \"sun\") {\n sun.x = _event.offsetX;\n sun.y = _event.offsetY;\n }\n if (type == \"tree\") {\n tree.x = _event.offsetX;\n tree.y = _event.offsetY;\n }\n }\n }", "function appendSymbol(parent, x, y, symbol, color) {\r\n if (symbol === 'none') {\r\n return;\r\n }\r\n\r\n parent.append(\"path\")\r\n .attr(\"transform\", function (d) {\r\n return \"translate(\" + x + \", \" + y + \")\";\r\n })\r\n .attr(\"class\", \"symbol\")\r\n .attr(\"d\", d3.svg.symbol()\r\n .type(symbol)\r\n .size(50))\r\n .style(\"fill\", color)\r\n .style(\"stroke\", color);\r\n}", "createSymbol(ballX, ballY) {\n let symbolX = ballX + (CONFIG.ball.ballSize / 2);\n let symbolY = ballY + (CONFIG.ball.ballSize / 2);\n\n let style = {font: \"35px Arial\", fill: \"#fff\", align: \"center\"}\n symbol = this.scene.add.text(symbolX, symbolY, generatedSymbols[readSymbol], style)\n symbol.setOrigin(0.5, 0.5);\n readSymbol++;\n toGenerateSymbol = false;\n }", "function giveSymbol(hostModel,itemStyleModel,group,opt,symbol,callback){var symbolType=hostModel.get('symbol');var color=itemStyleModel.get('color');var symbolSize=hostModel.get('symbolSize');var halfSymbolSize=symbolSize / 2;var itemStyle=itemStyleModel.getItemStyle(['color','symbol','symbolSize']);if(!symbol){symbol = symbolUtil.createSymbol(symbolType,-halfSymbolSize,-halfSymbolSize,symbolSize,symbolSize,color);group.add(symbol);callback && callback.onCreate(symbol);}else {symbol.setStyle(itemStyle);symbol.setColor(color);group.add(symbol); // Group may be new, also need to add.\n callback && callback.onUpdate(symbol);}opt = zrUtil.merge({rectHover:true,style:itemStyle,z2:100},opt,true);symbol.attr(opt);return symbol;}", "function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\n\t var color = itemStyleModel.get('color');\n\t\n\t if (!symbol) {\n\t var symbolType = hostModel.get('symbol');\n\t symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\n\t symbol.setStyle('strokeNoScale', true);\n\t group.add(symbol);\n\t callback && callback.onCreate(symbol);\n\t } else {\n\t symbol.setColor(color);\n\t group.add(symbol); // Group may be new, also need to add.\n\t\n\t callback && callback.onUpdate(symbol);\n\t } // Style\n\t\n\t\n\t var itemStyle = itemStyleModel.getItemStyle(['color']);\n\t symbol.setStyle(itemStyle); // Transform and events.\n\t\n\t opt = merge({\n\t rectHover: true,\n\t z2: 100\n\t }, opt, true);\n\t var symbolSize = hostModel.get('symbolSize');\n\t symbolSize = symbolSize instanceof Array ? symbolSize.slice() : [+symbolSize, +symbolSize];\n\t opt.scaleX = symbolSize[0] / 2;\n\t opt.scaleY = symbolSize[1] / 2;\n\t var symbolOffset = hostModel.get('symbolOffset');\n\t\n\t if (symbolOffset) {\n\t opt.x = opt.x || 0;\n\t opt.y = opt.y || 0;\n\t opt.x += parsePercent$1(symbolOffset[0], symbolSize[0]);\n\t opt.y += parsePercent$1(symbolOffset[1], symbolSize[1]);\n\t }\n\t\n\t var symbolRotate = hostModel.get('symbolRotate');\n\t opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n\t symbol.attr(opt); // FIXME\n\t // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,\n\t // getBoundingRect will return wrong result.\n\t // (This is supposed to be resolved in zrender, but it is a little difficult to\n\t // leverage performance and auto updateTransform)\n\t // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.\n\t\n\t symbol.updateTransform();\n\t return symbol;\n\t }", "function Symbol(identifier, name, step) {\n this.identifier = identifier;\n this.orientation = 0; //DEG, clockwise\n this.name = name;\n this.step = step;\n this.classes = \"\";\n \n //get a starting position\n var position = {};\n position.posX = \"0px\"; //px from left\n position.posY = \"0px\"; //px from top\n this.positions = new Array();\n this.positions[0] = position; \n}", "function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\n\t var color = itemStyleModel.get('color');\n\n\t if (!symbol) {\n\t var symbolType = hostModel.get('symbol');\n\t symbol = symbolUtil.createSymbol(symbolType, -1, -1, 2, 2, color);\n\t symbol.setStyle('strokeNoScale', true);\n\t group.add(symbol);\n\t callback && callback.onCreate(symbol);\n\t } else {\n\t symbol.setColor(color);\n\t group.add(symbol); // Group may be new, also need to add.\n\t callback && callback.onUpdate(symbol);\n\t }\n\n\t // Style\n\t var itemStyle = itemStyleModel.getItemStyle(['color', 'symbol', 'symbolSize']);\n\t symbol.setStyle(itemStyle);\n\n\t // Transform and events.\n\t opt = zrUtil.merge({\n\t rectHover: true,\n\t z2: 100\n\t }, opt, true);\n\n\t var symbolSize = hostModel.get('symbolSize');\n\t symbolSize = symbolSize instanceof Array ? symbolSize.slice() : [+symbolSize, +symbolSize];\n\t symbolSize[0] /= 2;\n\t symbolSize[1] /= 2;\n\t opt.scale = symbolSize;\n\n\t var symbolOffset = hostModel.get('symbolOffset');\n\t if (symbolOffset) {\n\t var pos = opt.position = opt.position || [0, 0];\n\t pos[0] += numberUtil.parsePercent(symbolOffset[0], symbolSize[0]);\n\t pos[1] += numberUtil.parsePercent(symbolOffset[1], symbolSize[1]);\n\t }\n\n\t var symbolRotate = hostModel.get('symbolRotate');\n\t opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n\n\t symbol.attr(opt);\n\n\t // FIXME\n\t // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,\n\t // getBoundingRect will return wrong result.\n\t // (This is supposed to be resolved in zrender, but it is a little difficult to\n\t // leverage performance and auto updateTransform)\n\t // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.\n\t symbol.updateTransform();\n\n\t return symbol;\n\t}", "function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\n var color = itemStyleModel.get('color');\n\n if (!symbol) {\n var symbolType = hostModel.get('symbol');\n symbol = Object(util_symbol[\"a\" /* createSymbol */])(symbolType, -1, -1, 2, 2, color);\n symbol.setStyle('strokeNoScale', true);\n group.add(symbol);\n callback && callback.onCreate(symbol);\n } else {\n symbol.setColor(color);\n group.add(symbol); // Group may be new, also need to add.\n\n callback && callback.onUpdate(symbol);\n } // Style\n\n\n var itemStyle = itemStyleModel.getItemStyle(['color']);\n symbol.setStyle(itemStyle); // Transform and events.\n\n opt = Object(util[\"I\" /* merge */])({\n rectHover: true,\n z2: 100\n }, opt, true);\n var symbolSize = hostModel.get('symbolSize');\n symbolSize = symbolSize instanceof Array ? symbolSize.slice() : [+symbolSize, +symbolSize];\n opt.scaleX = symbolSize[0] / 2;\n opt.scaleY = symbolSize[1] / 2;\n var symbolOffset = hostModel.get('symbolOffset');\n\n if (symbolOffset) {\n opt.x = opt.x || 0;\n opt.y = opt.y || 0;\n opt.x += number[\"o\" /* parsePercent */](symbolOffset[0], symbolSize[0]);\n opt.y += number[\"o\" /* parsePercent */](symbolOffset[1], symbolSize[1]);\n }\n\n var symbolRotate = hostModel.get('symbolRotate');\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n symbol.attr(opt); // FIXME\n // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,\n // getBoundingRect will return wrong result.\n // (This is supposed to be resolved in zrender, but it is a little difficult to\n // leverage performance and auto updateTransform)\n // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.\n\n symbol.updateTransform();\n return symbol;\n}", "function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\n var color = itemStyleModel.get('color');\n\n if (!symbol) {\n var symbolType = hostModel.get('symbol');\n symbol = symbolUtil.createSymbol(symbolType, -1, -1, 2, 2, color);\n symbol.setStyle('strokeNoScale', true);\n group.add(symbol);\n callback && callback.onCreate(symbol);\n }\n else {\n symbol.setColor(color);\n group.add(symbol); // Group may be new, also need to add.\n callback && callback.onUpdate(symbol);\n }\n\n // Style\n var itemStyle = itemStyleModel.getItemStyle(['color', 'symbol', 'symbolSize']);\n symbol.setStyle(itemStyle);\n\n // Transform and events.\n opt = zrUtil.merge({\n rectHover: true,\n z2: 100\n }, opt, true);\n\n var symbolSize = hostModel.get('symbolSize');\n symbolSize = symbolSize instanceof Array\n ? symbolSize.slice()\n : [+symbolSize, +symbolSize];\n symbolSize[0] /= 2;\n symbolSize[1] /= 2;\n opt.scale = symbolSize;\n\n var symbolOffset = hostModel.get('symbolOffset');\n if (symbolOffset) {\n var pos = opt.position = opt.position || [0, 0];\n pos[0] += numberUtil.parsePercent(symbolOffset[0], symbolSize[0]);\n pos[1] += numberUtil.parsePercent(symbolOffset[1], symbolSize[1]);\n }\n\n var symbolRotate = hostModel.get('symbolRotate');\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n\n symbol.attr(opt);\n\n // FIXME\n // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,\n // getBoundingRect will return wrong result.\n // (This is supposed to be resolved in zrender, but it is a little difficult to\n // leverage performance and auto updateTransform)\n // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.\n symbol.updateTransform();\n\n return symbol;\n }", "function AddSymbolToDoc (symbol,doc,exist) {\n if (!exist)\n {\n var symbolChildren = symbol.children()\n for (var i = 0; i < symbolChildren.count(); i++)\n {\n\t\t\tvar matchedSymbol = getMatchSymbolInDoc(symbol.children()[i],doc)\n\t\t\tlog (\"🛑 \" + matchedSymbol)\n if (symbol.children()[i].class() == MSSymbolInstance && matchedSymbol == -1)\n {\n AddSymbolToDoc(symbol.children()[i].symbolMaster(),doc,false)\n }\n\t\t\telse if (symbol.children()[i].class() == MSSymbolInstance){\n\t\t\t\tsymbol.children()[i].changeInstanceToSymbol(matchedSymbol)\n\t\t\t}\n }\n var frameX = JSON.parse(JSON.stringify(symbol.frame().x()))\n var frameY = JSON.parse(JSON.stringify(symbol.frame().y()))\n doc.addSymbolMaster(symbol)\n symbol.frame().setX(frameX)\n symbol.frame().setY(frameY)\n //copiedSymbols[symbol]=1\n }\n}", "function symbolClick() {\n var symbol = $(this).text();\n updateFormula(function(text) {\n return text + symbol;\n });\n }", "function displaySymbol(evt){\n evt.target.classList.add('open', 'show');\n}", "function setYourSymbol() {\n document.getElementById('yourSymbol').innerHTML = yourSymbol;\n}", "function redrawSymbols() {\n if(mode == 1) {\n justDrawLinearTogether(getPositions(), symbol1, symbol2);\n } else if(mode == 2) {\n justDrawLinearSeparately(getPositions(1), symbol1, getPositions(2), symbol2);\n }\n}", "function setSymbol( symbol ) {symbolField().value = symbol}", "setSymbolArt(state, sa) {\n state.parts = sa.parts\n state.lastId = sa.lastId\n state.selected = {}\n state.requestUpdateColorLayers = {}\n state.requestUpdateVertLayers = {}\n state.equestUpdateTypeLayers = {}\n //start history from a fresh state\n state.undoStack = []\n state.redoStack = []\n }", "function symbol() {\n return document.createElementNS(Svg.svgNS, \"symbol\");\n }", "function updateSymbol() {\n // get value from input field\n let symbolValue = symbolInput.value;\n // test input value - log to console\n console.log(`input field = ${symbolValue}`);\n // update symbol value in sampleTrading object\n sampleTrading.symbol = symbolValue;\n // call symbolLoader for updated symbol property value from sampleTrading object\n symbolLoader();\n}", "createGraphic(geometry, symbol) {\n\n var graphic = new this.Graphic({geometry: geometry, symbol: symbol});\n return graphic;\n }", "function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) {\n symbols[mode][name] = { font: font, group: group, replace: replace };\n\n if (acceptUnicodeChar && replace) {\n symbols[mode][replace] = symbols[mode][name];\n }\n}", "function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) {\n symbols[mode][name] = { font: font, group: group, replace: replace };\n\n if (acceptUnicodeChar && replace) {\n symbols[mode][replace] = symbols[mode][name];\n }\n}", "function createSymbolPreviewWindowForFont(font) {\n var fontDiv = doc.createElement('div'),\n closeDiv = doc.createElement('p'),\n setDiv = doc.createElement('p');\n closeDiv.innerHTML = \"Close\";\n setDiv.innerHTML = \"Set Font\";\n closeDiv.id = 'symbolCloseDiv';\n setDiv.id = 'symbolSetDiv';\n closeDiv.onclick = function() {\n doc.body.removeChild(fontDiv);\n };\n setDiv.onclick = function() {\n doc.body.removeChild(fontDiv);\n action.setFont(font);\n };\n fontDiv.id = 'symbolFontList';\n fontDiv.innerHTML = createSymbolPreviewInnerHTML(font);\n fontDiv.appendChild(closeDiv);\n fontDiv.appendChild(setDiv);\n doc.body.appendChild(fontDiv);\n }", "function createSymbol(xOffset, lithSymbol, xPos, perc){\n\t\t// console.log(perc)\n\t\t// console.log(xScale(perc))\n\t\tx1 = xScale(xOffset);\n\t\txPos = xScale(xPos);\n\t\tvar lithWidth = xScale(perc);\n\n\t\t// Add the background color to lith symbol\n\t\tvar symbol = svg.append(\"rect\")\n\t\t\t.attr('x', xPos + x1)\n\t\t\t.attr('y', depth + yOffset)\n\t\t\t.attr('width', function(){ return xScale(10)})\n\t\t\t.attr('height', yScale(100))\n\t\t\t.attr('fill', lithSymbol.fill)\n\t\t\t.attr('stroke-width', function(){\n\t\t\t\tif(borders.on){\n\t\t\t\t\treturn borders.width\n\t\t\t\t} else {\n\t\t\t\t\treturn yScale(lithSymbol.borderWidth);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr('stroke', function(){\n\t\t\t\tif(borders.on){\n\t\t\t\t\treturn borders.color;\n\t\t\t\t} else {\n\t\t\t\t\treturn lithSymbol.borderColor;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.attr('opacity', .9)\n\t\t\t// .append('path')\n\t\t\t// .attr('transform', `translate(${(xPos + x1)}, ${depth}) scale(${xScale(.1)}, ${yScale(1)}) translate(0, 10)`)\n\t\t\t// .attr('stroke-width', lithSymbol.lineThickness)\n\t\t\t// .attr(\"stroke\", lithSymbol.lineColor)\n\t\t\t// .attr('d', lithSymbol.pattern );\n\n\t\t// Add the pattern to the symbol\n\t\t// Change this to use 'polyline' or 'polygon' instead of 'path'\n\t\tvar pattern = svg.append('path')\n\t\t\t.attr('width', xScale(svgWidth))\n\t\t\t// .attr('height', yScale(200))\n\t\t\t.attr('transform', `translate(${(xPos + x1)}, ${depth}) scale(${xScale(.1)}, ${yScale(1)}) translate(0, 10)`)\n\t\t\t.attr('stroke-width', lithSymbol.lineThickness)\n\t\t\t.attr(\"stroke\", lithSymbol.lineColor)\n\t\t\t.attr('d', lithSymbol.pattern )\n\t}", "function createAddTrackTool() {\n if(zenbu_embedded_view) { return; }\n var glyphset = document.getElementById(\"gLyphTrackSet\");\n\n var div = document.createElement('div');\n div.setAttribute(\"align\",\"left\");\n div.setAttribute(\"style\", \"margin: 0px 0px -2px 0px; border-width: 0px; padding: 0px 0px 0px 0px;\");\n div.id = \"glyphTrack\" + (newTrackID++);\n\n var svg = createSVG(300, 25);\n div.appendChild(svg);\n\n var defs = document.createElementNS(svgNS,'defs');\n var rg1 = document.createElementNS(svgNS,'linearGradient');\n rg1.setAttributeNS(null, 'id', 'purpLinearGradient');\n rg1.setAttributeNS(null, 'x1', '0%');\n rg1.setAttributeNS(null, 'y1', '0%');\n rg1.setAttributeNS(null, 'x2', '0%');\n rg1.setAttributeNS(null, 'y2', '100%');\n defs.appendChild(rg1);\n var stop1 = document.createElementNS(svgNS,'stop');\n stop1.setAttributeNS(null, 'offset', '0%');\n stop1.setAttributeNS(null, 'style', 'stop-opacity:1; stop-color:rgb(200,200,255);');\n rg1.appendChild(stop1);\n var stop2 = document.createElementNS(svgNS,'stop');\n stop2.setAttributeNS(null, 'offset', '100%');\n stop2.setAttributeNS(null, 'style', 'stop-opacity:1; stop-color:slateblue;');\n rg1.appendChild(stop2);\n svg.appendChild(defs);\n\n //\n // new track config\n //\n var g3 = document.createElementNS(svgNS,'g');\n svg.appendChild(g3);\n var polyback2 = document.createElementNS(svgNS,'polygon');\n polyback2.setAttributeNS(null, 'points', '0,0 130,0 130,14 65,21 0,14');\n polyback2.setAttributeNS(null, 'style', 'fill:url(#purpLinearGradient)');\n polyback2.setAttributeNS(null, \"onclick\", \"addNewTrack(\\\"\" + div.id + \"\\\");\");\n g3.appendChild(polyback2);\n\n var circle2 = document.createElementNS(svgNS,'circle');\n circle2.setAttributeNS(null, 'cx', '8px');\n circle2.setAttributeNS(null, 'cy', '8px');\n circle2.setAttributeNS(null, 'r', '5px');\n circle2.setAttributeNS(null, 'fill', 'lightgray');\n circle2.setAttributeNS(null, \"onclick\", \"addNewTrack(\\\"\" + div.id + \"\\\");\");\n g3.appendChild(circle2);\n\n var line2 = document.createElementNS(svgNS,'path');\n line2.setAttributeNS(null, 'd', 'M4.5 8 L11.5 8 M8 4.5 L8 11.5 ');\n line2.setAttributeNS(null, 'style', 'stroke-width: 1.5px; stroke: darkslateblue;');\n line2.setAttributeNS(null, \"onclick\", \"addNewTrack(\\\"\" + div.id + \"\\\");\");\n g3.appendChild(line2);\n\n var label2 = document.createElementNS(svgNS,'text');\n label2.setAttributeNS(null, 'x', '20px');\n label2.setAttributeNS(null, 'y', '11px');\n label2.setAttributeNS(null, \"font-size\",\"10\");\n label2.setAttributeNS(null, \"fill\", \"black\");\n label2.setAttributeNS(null, \"font-family\", 'arial,helvetica,sans-serif');\n label2.setAttributeNS(null, \"font-weight\", 'bold');\n label2.setAttributeNS(null, \"onclick\", \"addNewTrack(\\\"\" + div.id + \"\\\");\");\n label2.appendChild(document.createTextNode(\"create custom track\"));\n g3.appendChild(label2);\n\n \n //\n // add predefined track\n //\n var g3 = document.createElementNS(svgNS,'g');\n svg.appendChild(g3);\n var polyback2 = document.createElementNS(svgNS,'polygon');\n polyback2.setAttributeNS(null, 'points', '0,0 130,0 130,14 65,21 0,14');\n polyback2.setAttributeNS(null, 'style', 'fill:url(#purpLinearGradient)');\n polyback2.setAttributeNS(null, \"onclick\", \"gLyphsPredefinedTracksPanel();\");\n g3.appendChild(polyback2);\n \n var circle2 = document.createElementNS(svgNS,'circle');\n circle2.setAttributeNS(null, 'cx', '8px');\n circle2.setAttributeNS(null, 'cy', '8px');\n circle2.setAttributeNS(null, 'r', '5px');\n circle2.setAttributeNS(null, 'fill', 'lightgray');\n circle2.setAttributeNS(null, \"onclick\", \"gLyphsPredefinedTracksPanel();\");\n g3.appendChild(circle2);\n \n var line2 = document.createElementNS(svgNS,'path');\n line2.setAttributeNS(null, 'd', 'M4.5 8 L11.5 8 M8 4.5 L8 11.5 ');\n line2.setAttributeNS(null, 'style', 'stroke-width: 1.5px; stroke: darkslateblue;');\n line2.setAttributeNS(null, \"onclick\", \"gLyphsPredefinedTracksPanel();\");\n g3.appendChild(line2);\n \n var label2 = document.createElementNS(svgNS,'text');\n label2.setAttributeNS(null, 'x', '20px');\n label2.setAttributeNS(null, 'y', '11px');\n label2.setAttributeNS(null, \"font-size\",\"10\");\n label2.setAttributeNS(null, \"fill\", \"black\");\n label2.setAttributeNS(null, \"font-family\", 'arial,helvetica,sans-serif');\n label2.setAttributeNS(null, \"font-weight\", 'bold');\n label2.setAttributeNS(null, \"onclick\", \"gLyphsPredefinedTracksPanel();\");\n label2.appendChild(document.createTextNode(\"add predefined tracks\"));\n g3.appendChild(label2);\n g3.setAttributeNS(null, 'transform', \"translate(170, 0)\");\n \n glyphset.appendChild(div);\n\n return div;\n}", "function initSymbols() {\n // special callback: this is invoked before ASCIImath symbol data is set up\n // but AFTER the ASCIImath configuration has been initialized completely.\n // This is the time where userland code gets to edit the symbol tables...\n if (typeof asciimath.config.preInitSymbols === \"function\") {\n var data = {\n AMsymbols: AMsymbols,\n asciimath: asciimath,\n };\n asciimath.config.preInitSymbols(data);\n AMsymbols = data.AMsymbols; // this table may have been patched by the preInitSymbols() callback.\n }\n\n var symlen = AMsymbols.length;\n for (var i = 0; i < symlen; i++) {\n if (AMsymbols[i].tex && !AMsymbols[i].notexcopy) {\n AMsymbols.push({\n input: AMsymbols[i].tex,\n tag: AMsymbols[i].tag,\n output: AMsymbols[i].output,\n ttype: AMsymbols[i].ttype,\n atname: AMsymbols[i].atname,\n atval: AMsymbols[i].atval,\n tex: AMsymbols[i].tex,\n rewriteleftright: AMsymbols[i].rewriteleftright,\n acc: AMsymbols[i].acc || false,\n val: AMsymbols[i].val || false,\n func: AMsymbols[i].func || false,\n tietoprev: AMsymbols[i].tietoprev || false,\n notexcopy: true,\n });\n }\n }\n refreshSymbols();\n }", "renderSymbol(symbolNode) {\n var func = this.renderGrammar[symbolNode.symbol];\n if (func) { \n func();\n } \n }", "function addGraphic(symbol, point){\n map.graphics.add(new Graphic(point, symbol));\n }", "function createSymbol(document, id, element, viewBox) {\n\t\tvar symbol = document.createElementNS(\"http://www.w3.org/2000/svg\", \"symbol\");\n\t\twhile (element.firstChild) {\n\t\t\tsymbol.appendChild(element.firstChild);\n\t\t}\n\t\ttypeof id === \"string\" && symbol.setAttribute(\"id\", id);\n\t\ttypeof viewBox === \"string\" && symbol.setAttribute(\"viewBox\", viewBox);\n\t\treturn symbol;\n\t}", "function ms_createButton(x, y, height, width, clickAction, icon=null, text=null)\r\n{\r\n let container = new PIXI.Container();\r\n let graphics = new PIXI.Graphics();\r\n graphics.beginFill(0xFFFFFF, 1);\r\n graphics.lineStyle(2, 0x414141, 1);\r\n graphics.drawRect(0, 0, width, height);\r\n graphics.endFill();\r\n graphics.interactive = true;\r\n graphics.on('mouseover', function(){ this.alpha = 1; if(icon){icon.alpha = 1;}})\r\n .on('mouseout', function(){ this.alpha = 0.5; if(icon){icon.alpha = 0.5;}});\r\n if(clickAction){\r\n graphics.on('pointerdown', clickAction)\r\n }\r\n graphics.alpha = 0.5;\r\n container.addChild(graphics);\r\n if(icon){\r\n container.addChild(icon);\r\n icon.height = height;\r\n icon.width = width;\r\n icon.alpha = 0.5;\r\n }\r\n if(text){\r\n let style = {align: \"center\", fontWeight:\"bold\", fontSize: \"60\"};\r\n let textSprite = new PIXI.Text(text, style);\r\n textSprite.anchor.set(0.5);\r\n textSprite.x = width/2;\r\n textSprite.y = height/2;\r\n container.addChild(textSprite);\r\n }\r\n container.x = x;\r\n container.y = y;\r\n return container;\r\n}", "function updateSymbol() {\n const symbol = this.paused ? `►` : `▮▮`;\n toggle.textContent = symbol;\n}", "function createSymbol(symbolType, x, y, w, h, color, // whether to keep the ratio of w/h,\nkeepAspect) {\n // TODO Support image object, DynamicImage.\n var isEmpty = symbolType.indexOf('empty') === 0;\n\n if (isEmpty) {\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\n }\n\n var symbolPath;\n\n if (symbolType.indexOf('image://') === 0) {\n symbolPath = _graphic__WEBPACK_IMPORTED_MODULE_5__[\"makeImage\"](symbolType.slice(8), new zrender_lib_core_BoundingRect__WEBPACK_IMPORTED_MODULE_6__[/* default */ \"a\"](x, y, w, h), keepAspect ? 'center' : 'cover');\n } else if (symbolType.indexOf('path://') === 0) {\n symbolPath = _graphic__WEBPACK_IMPORTED_MODULE_5__[\"makePath\"](symbolType.slice(7), {}, new zrender_lib_core_BoundingRect__WEBPACK_IMPORTED_MODULE_6__[/* default */ \"a\"](x, y, w, h), keepAspect ? 'center' : 'cover');\n } else {\n symbolPath = new SymbolClz({\n shape: {\n symbolType: symbolType,\n x: x,\n y: y,\n width: w,\n height: h\n }\n });\n }\n\n symbolPath.__isEmptyBrush = isEmpty; // TODO Should deprecate setColor\n\n symbolPath.setColor = symbolPathSetColor;\n\n if (color) {\n symbolPath.setColor(color);\n }\n\n return symbolPath;\n}", "function drawSymbol( ctx, symbol, fc, cx, cy, cw, ch ) {\n\tctx.beginPath();\n\tswitch ( symbol ) {\n\t\tcase \"0\":\n\t\t\tctx.moveTo(cx+fc,cy+(ch*0.333333));\n\t\t\tctx.arc(cx+(cw/2),cy+(cw/2),(cw/2)-fc,deg2rad(180),0, false);\n\t\t\tctx.arc(cx+(cw/2),(cy+ch)-(cw/2),(cw/2)-fc,0,deg2rad(180), false);\n\t\t\tctx.closePath();\n\t\tbreak;\n\t\tcase \"1\":\n\t\t\tctx.moveTo(cx+(cw*0.1)+fc,cy+ch-fc);\n\t\t\tctx.lineTo(cx+cw-fc,cy+ch-fc);\n\t\t\tctx.moveTo(cx+(cw*0.666666),cy+ch-fc);\n\t\t\tctx.lineTo(cx+(cw*0.666666),cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.25),cy+(ch*0.25));\n\t\tbreak;\n\t\tcase \"2\":\n\t\t\tctx.moveTo(cx+cw-fc,cy+(ch*0.8));\n\t\t\tctx.lineTo(cx+cw-fc,cy+ch-fc);\n\t\t\tctx.lineTo(cx+fc,cy+ch-fc);\n\t\t\tctx.arc(cx+(cw/2),cy+(cw*0.425),(cw*0.425)-fc,deg2rad(45),deg2rad(-180), true);\n\t\tbreak;\n\t\tcase \"3\":\n\t\t\tctx.moveTo(cx+(cw*0.1)+fc,cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.9)-fc,cy+fc);\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-90),deg2rad(180), false);\n\t\tbreak;\n\t\tcase \"4\":\n\t\t\tctx.moveTo(cx+(cw*0.75),cy+ch-fc);\n\t\t\tctx.lineTo(cx+(cw*0.75),cy+fc);\n\t\t\tctx.moveTo(cx+cw-fc,cy+(ch*0.666666));\n\t\t\tctx.lineTo(cx+fc,cy+(ch*0.666666));\n\t\t\tctx.lineTo(cx+(cw*0.75),cy+fc);\n\t\t\tctx.moveTo(cx+cw-fc,cy+ch-fc);\n\t\t\tctx.lineTo(cx+(cw*0.5),cy+ch-fc);\n\t\tbreak;\n\t\tcase \"5\":\n\t\t\tctx.moveTo(cx+(cw*0.9)-fc,cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.1)+fc,cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.1)+fc,cy+(ch*0.333333));\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-80),deg2rad(180), false);\n\t\tbreak;\n\t\tcase \"6\":\n\t\t\tctx.moveTo(cx+fc,cy+ch-(cw*0.5)-fc);\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-180),deg2rad(180), false);\n\t\t\tctx.bezierCurveTo(cx+fc,cy+fc,cx+fc,cy+fc,cx+(cw*0.9)-fc,cy+fc);\n\t\t\tctx.moveTo(cx+(cw*0.9)-fc,cy+fc);\n\t\tbreak;\n\t\tcase \"7\":\n\t\t\tctx.moveTo(cx+(cw*0.5),cy+ch-fc);\n\t\t\tctx.lineTo(cx+cw-fc,cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.1)+fc,cy+fc);\n\t\t\tctx.lineTo(cx+(cw*0.1)+fc,cy+(ch*0.25)-fc);\n\t\tbreak;\n\t\tcase \"8\":\n\t\t\tctx.moveTo(cx+(cw*0.92)-fc,cy+(cw*0.59));\n\t\t\tctx.arc(cx+(cw/2),cy+(cw*0.45),(cw*0.45)-fc,deg2rad(25),deg2rad(-205), true);\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-135),deg2rad(-45), true);\n\t\t\tctx.closePath();\n\t\t\tctx.moveTo(cx+(cw*0.79),cy+(ch*0.47));\n\t\t\tctx.lineTo(cx+(cw*0.21),cy+(ch*0.47));\n\t\tbreak;\n\t\tcase \"9\":\n\t\t\tctx.moveTo(cx+cw-fc,cy+(cw*0.5));\n\t\t\tctx.arc(cx+(cw/2),cy+(cw*0.5),(cw*0.5)-fc,deg2rad(0),deg2rad(360), false);\n\t\t\tctx.bezierCurveTo(cx+cw-fc,cy+ch-fc,cx+cw-fc,cy+ch-fc,cx+(cw*0.1)+fc,cy+ch-fc);\n\t\tbreak;\n\t\tcase \"%\":\n\t\t\tctx.moveTo(cx+fc,cy+(ch*0.75));\n\t\t\tctx.lineTo(cx+cw-fc,cy+(ch*0.25));\n\t\t\tctx.moveTo(cx+(cw*0.505),cy+(cw*0.3));\n\t\t\tctx.arc(cx+(cw*0.3),cy+(cw*0.3),(cw*0.3)-fc,deg2rad(0),deg2rad(360), false);\n\t\t\tctx.moveTo(cx+(cw*0.905),cy+ch-(cw*0.3));\n\t\t\tctx.arc(cx+(cw*0.7),cy+ch-(cw*0.3),(cw*0.3)-fc,deg2rad(0),deg2rad(360), false);\n\t\tbreak;\n\t\tcase \".\":\n\t\t\tctx.moveTo(cx+(cw*0.25),cy+ch-fc-fc);\n\t\t\tctx.arc(cx+(cw*0.25),cy+ch-fc-fc,fc,deg2rad(0),deg2rad(360), false);\n\t\t\tctx.closePath();\n\t\tbreak;\n\t\tcase \"M\":\n\t\t\tctx.moveTo(cx+(cw*0.083),cy+ch-fc);\n\t\t\tctx.lineTo(cx+(cw*0.083),cy+fc);\t\n ctx.moveTo(cx+(cw*0.083),cy+fc);\t\n ctx.lineTo(cx+(cw*0.4167),cy+ch-fc);\n ctx.moveTo(cx+(cw*0.4167),cy+ch-fc);\n ctx.lineTo(cx+(cw*0.75),cy+fc);\t\n\t\t\tctx.moveTo(cx+(cw*0.75),cy+ch-fc);\n\t\t\tctx.lineTo(cx+(cw*0.75),cy+fc);\t\t\n\t\tbreak;\n\t\tcase \"G\":\n ctx.moveTo(cx+fc,cy+(ch*0.333333));\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(180),deg2rad(-15), true);\n\t\t\tctx.moveTo(cx+fc,cy+(ch*0.333333));\n\t\t\tctx.bezierCurveTo(cx+fc,cy+fc,cx+fc,cy+fc,cx+(cw*0.9)-fc,cy+fc);\n\t\t\tctx.moveTo(cx+(cw*1.00),cy+(ch*0.5));\n\t\t\tctx.lineTo(cx+(cw*0.60),cy+(ch*0.5));\n\t\tbreak;\n\t\tcase \"b\":\n\t\t\tctx.moveTo(cx+fc,cy+ch-(cw*0.5)-fc);\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-180),deg2rad(180), false);\n\t\t\tctx.bezierCurveTo(cx+fc,cy+fc,cx+fc,cy+fc,cx+(cw*0.2)-fc,cy+fc);\n\t\t\tctx.moveTo(cx+(cw*0.9)-fc,cy+fc);\n\t\tbreak;\n\t\tcase \"B\":\n\t\t\tctx.moveTo(cx+(cw*0.92)-fc,cy+(cw*0.59));\n\t\t\tctx.arc(cx+(cw/2),cy+(cw*0.45),(cw*0.45)-fc,deg2rad(25),deg2rad(-165), true);\t\t\t\n\t\t\tctx.arc(cx+(cw/2),cy+ch-(cw*0.5),(cw*0.5)-fc,deg2rad(-215),deg2rad(-45), true);\n\t\t\tctx.closePath();\n\t\t\tctx.moveTo(cx+(cw*0.79),cy+(ch*0.47));\n\t\t\tctx.lineTo(cx+(cw*0.21),cy+(ch*0.47));\n\t\tbreak;\n\t\tdefault:\n\t\tbreak;\n\t}\t\n\tctx.stroke();\n}", "function doMarkup(type, create, symbol) {\n\t\tif (canStartMarkup(type)) {\n\t\t\tstartBlock(type, {});\n\t\t} else if (canEndMarkup(type)) {\n\t\t\tendBlock();\n\t\t} else {\n\t\t\taddText(symbol);\n\t\t}\n\t}", "function newcircle(name, transcost, info, type){\n var figure = new draw2d.shape.basic.Circle({height: 40, width:40});\n var title\n\n figure.userData = {\"name\": String(name), \"transcost\": transcost, \"addinfo\": info}\n figure.add(new draw2d.shape.basic.Label({text:figure.userData.name, stroke:0}), new draw2d.layout.locator.BottomLocator())\n figure.setSelectable(false)\n figure.setDraggable(false)\n\n if (type == 'raw' ){\n var rawcolor = new draw2d.util.Color(\"#f7ee36\")\n figure.resetPorts();\n figure.createPort(\"output\", new draw2d.layout.locator.RightLocator()).setSelectable(false).setResizeable(false)\n figure.setBackgroundColor(rawcolor)\n figure.setColor(rawcolor.darker())\n title = \"Raw Material Information\"\n }\n\n if (type == 'final'){\n var rawcolor = new draw2d.util.Color(\"#2ad148\")\n figure.resetPorts();\n figure.createPort(\"input\", new draw2d.layout.locator.LeftLocator()).setSelectable(false).setResizeable(false)\n figure.setBackgroundColor(rawcolor)\n figure.setColor(rawcolor.darker())\n title = \"Final Product Information\"\n }\n\n if (type == 'int') {\n var rawcolor = new draw2d.util.Color(\"#3ea9f0\")\n figure.resetPorts();\n figure.createPort(\"input\", new draw2d.layout.locator.LeftLocator()).setSelectable(false).setResizeable(false)\n figure.createPort(\"output\", new draw2d.layout.locator.RightLocator()).setSelectable(false).setResizeable(false)\n figure.setBackgroundColor(rawcolor)\n figure.setColor(rawcolor.darker())\n title = \"Intermediate Product Information\"\n }\n\n figure.on(\"dblclick\", function(emitter, event) {\n $('.productinfo').html(\"\");\n var productinfoHTML = '<p> *Product name: </p> <input class=\"ajs-input\" id=\"inpOne\" type=\"text\" value = \"'+ String(figure.userData.name)+ '\" /> <p> *Transportation cost [USD/tonne/km]: </p> <input class=\"ajs-input\" id=\"inpTwo\" type=\"number\" step = 0.1 min = 0 value = \"'+String(figure.userData.transcost)+'\" /> <p> Additional information: </p> <input class=\"ajs-input\" id=\"inpThree\" type=\"text\" value = \"'+String(figure.userData.addinfo)+'\" />';\n\n\n alertify.confirm(productinfoHTML).set('onok', function(closeEvent) {\n\n var prodname = $('#inpOne').val();\n var transcost = $('#inpTwo').val();\n var addinfo = $('#inpThree').val();\n\n\n if (prodname != \"\" && transcost != \"\"){\n if (transcost < 0) {\n alertify.error('Input not valid!');}\n else{\n figure.resetChildren()\n figure.add(new draw2d.shape.basic.Label({text:prodname, stroke: 0}), new draw2d.layout.locator.BottomLocator());\n figure.userData = {\"name\": prodname, \"transcost\": transcost, \"addinfo\": addinfo}\n }\n } else {\n alertify.error('Please enter required information!');\n }\n $('.productinfo').html(empty_prod_form)\n }).set('oncancel', function(closeEvent){\n $('#inpOne')[0].value = figure.userData.name;\n $('#inpTwo')[0].value = figure.userData.transcost;\n $('#inpThree')[0].value = figure.userData.addinfo;\n $('.productinfo').html(empty_prod_form)}).set('title', title).set('labels', {ok:'Ok', cancel:'Cancel'}).set('closable',false);\n })\n\n return figure\n}", "function newcommand(oldstr, newstr) {\n AMsymbols.push({ input: oldstr, tag: \"mo\", output: newstr, tex: null, ttype: DEFINITION });\n refreshSymbols(); // this may be a problem if many symbols are defined!\n }", "function newSymbols(numberClicked) {\n\t/* New symbols with level 1 */\n\tresetAll();\n\t\n\t\n\tlet level = numberClicked; // level is one number bigger than clicked star (index rules)\n\tconsole.log(`level = ${level}`);\n\t\n\t/* Normal level */\n\tif (level >= 2) {\n\t\tdocument.querySelector('.noise').style.backgroundImage = `url(/noise.svg)`;\n\t}\n\n\tfor (let i = 0; i < symbolsArray.length; i++) {\t\t\n\n\t/* Hard level */\n\t\tif (level >= 3) {\n\t\t\tsymbolsArray[i].style.filter = `blur(5px)`;\n\t\t}\n\n\t/* Very hard level */\n\t\tif (level >= 4) {\n\t\t\tsymbolsArray[i].style.transform = `rotateZ(180deg)`;\n\t\t}\n\n\t/* Impossible level */\n\t\tif (level === 5) {\n\t\t\tlet browserWidth = window.innerWidth;\n\n\t\t\tfunction FontChange(a, b) {\n\t\t\t\tlet newFontSize = Math.floor(Math.random() * a) + b;\n\t\t\t\tsymbolsArray[i].style.fontSize = `${newFontSize}px`;\n\n\t\t\t\treturn newFontSize;\n\t\t\t}\n\n\t\t/* New font size depends on recently screen width */\n\t\t\tif (browserWidth <= 480) {\n\t\t\t\tFontChange(20, 30); // new font size range 30-50 px\n\t\t\t} \n\t\t\telse if (480 < browserWidth <= 720) {\n\t\t\t\tFontChange(20, 40); // new font size range 40-60 px\n\t\t\t} \n\t\t\telse {\n\t\t\t\tFontChange(20, 50); // new font size range 50-70 px\n\t\t\t}\n\t\t}\n\t}\n\n\treturn symbolsArray;\n}", "function AMinitSymbols() {\n var i;\n var symlen = AMsymbols.length;\n for (i = 0; i < symlen; i++) {\n if (AMsymbols[i].tex && !(typeof AMsymbols[i].notexcopy == 'boolean' && AMsymbols[i].notexcopy)) {\n AMsymbols.push({\n input: AMsymbols[i].tex,\n tag: AMsymbols[i].tag,\n output: AMsymbols[i].output,\n ttype: AMsymbols[i].ttype,\n acc: AMsymbols[i].acc || false\n });\n }\n }\n refreshSymbols();\n}", "function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) {\n symbols[mode][name] = {\n font: font,\n group: group,\n replace: replace\n };\n\n if (acceptUnicodeChar && replace) {\n symbols[mode][replace] = symbols[mode][name];\n }\n} // Some abbreviations for commonly used strings.", "function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) {\n symbols[mode][name] = {\n font: font,\n group: group,\n replace: replace\n };\n\n if (acceptUnicodeChar && replace) {\n symbols[mode][replace] = symbols[mode][name];\n }\n} // Some abbreviations for commonly used strings.", "function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) {\n symbols[mode][name] = {\n font: font,\n group: group,\n replace: replace\n };\n\n if (acceptUnicodeChar && replace) {\n symbols[mode][replace] = symbols[mode][name];\n }\n} // Some abbreviations for commonly used strings.", "_createPoint(point) {\n let pointGraphic = new PIXI.Graphics();\n // pointGraphic.hitArea = new PIXI.Rectangle(0, 0, this.app.width, this.app.height);\n if (this.interaction) {\n pointGraphic.interactive = true;\n pointGraphic.buttonMode = true;\n }\n pointGraphic\n .on('pointerdown', this.pointEvent.onPointDragStart)\n .on('pointerdown', this._dragPointActivated.bind(this))\n .on('pointerup', this.pointEvent.onPointDragEnd)\n .on('pointerup', this._dragPointDeactivated.bind(this))\n .on('pointerupoutside', this.pointEvent.onPointDragEnd)\n .on('pointerupoutside', this._dragPointDeactivated.bind(this))\n .on('pointermove', this.pointEvent.onPointDragMove)\n .on('pointermove', this._updateGraphs.bind(this));\n pointGraphic.lineStyle(0);\n pointGraphic.beginFill(this.color, 1);\n pointGraphic.drawCircle(0, 0, 4);\n pointGraphic.x = point.x;\n pointGraphic.y = point.y;\n pointGraphic.endFill();\n\n const pointText = this.helperCalculus.getPositionCoordinates(point, this.width, this.height, this.scale);\n \n const richText = new PIXI.Text(`(${pointText.x},${pointText.y})`, this.style);\n pointGraphic.addChild(richText);\n\n this.app.stage.addChild(pointGraphic);\n this.pointsGraphic.push(pointGraphic);\n \n return pointGraphic;\n }", "function eSymbol(character, modifier, color)\r\n{\r\n\tthis.character = character,\r\n\tthis.modifier = modifier,\r\n\tthis.color = color;\r\n}", "function symbol(s, p) {\n var x = state.syntax[s];\n if (!x || typeof x !== \"object\") {\n state.syntax[s] = x = {\n id: s,\n lbp: p,\n value: s\n };\n }\n return x;\n }", "function Symbol(alph_index, scale, alphabet) {\n //variable prototype\n this.symbol = alphabet.get_letter(alph_index);\n this.scale = scale;\n this.colour = alphabet.get_colour(alph_index);\n //function prototype\n this.get_symbol = Symbol_get_symbol;\n this.get_scale = Symbol_get_scale;\n this.get_colour = Symbol_get_colour;\n this.toString = Symbol_to_string;\n}", "get symbolButton() {\n return {\n symbolTypes: [\"symbols\"],\n type: \"rich-text-editor-symbol-picker\",\n };\n }", "function createAddTrackTool(glyphsGB) {\n if(zenbu_embedded_view) { return; }\n var glyphset = glyphsGB.gLyphTrackSet;\n if(!glyphset) { return null; }\n\n if(glyphsGB.add_track_div) { \n glyphset.appendChild(glyphsGB.add_track_div);\n return glyphsGB.add_track_div; \n }\n \n var add_track_div = document.createElement('div');\n add_track_div.setAttribute(\"align\",\"left\");\n add_track_div.setAttribute(\"style\", \"margin: 0px 0px -2px 0px; border-width: 0px; padding: 0px 0px 0px 0px;\");\n glyphsGB.add_track_div = add_track_div;\n\n glyphset.appendChild(add_track_div);\n\n var svg = createSVG(300, 25);\n add_track_div.appendChild(svg);\n\n var defs = document.createElementNS(svgNS,'defs');\n var rg1 = document.createElementNS(svgNS,'linearGradient');\n rg1.setAttributeNS(null, 'id', 'purpLinearGradient');\n rg1.setAttributeNS(null, 'x1', '0%');\n rg1.setAttributeNS(null, 'y1', '0%');\n rg1.setAttributeNS(null, 'x2', '0%');\n rg1.setAttributeNS(null, 'y2', '100%');\n defs.appendChild(rg1);\n var stop1 = document.createElementNS(svgNS,'stop');\n stop1.setAttributeNS(null, 'offset', '0%');\n stop1.setAttributeNS(null, 'style', 'stop-opacity:1; stop-color:rgb(200,200,255);');\n rg1.appendChild(stop1);\n var stop2 = document.createElementNS(svgNS,'stop');\n stop2.setAttributeNS(null, 'offset', '100%');\n stop2.setAttributeNS(null, 'style', 'stop-opacity:1; stop-color:slateblue;');\n rg1.appendChild(stop2);\n svg.appendChild(defs);\n\n //\n // new track config\n //\n var g3 = svg.appendChild(document.createElementNS(svgNS,'g'));\n g3.onclick = function() { gLyphsAddCustomTrack(glyphsGB); }\n g3.setAttribute(\"onmouseover\", \"eedbMessageTooltip('create new custom track',150);\");\n g3.setAttribute(\"onmouseout\", \"eedbClearSearchTooltip();\");\n\n var polyback2 = document.createElementNS(svgNS,'polygon');\n polyback2.setAttributeNS(null, 'points', '0,0 130,0 130,14 65,21 0,14');\n polyback2.setAttributeNS(null, 'style', 'fill:url(#purpLinearGradient)');\n g3.appendChild(polyback2);\n\n var circle2 = document.createElementNS(svgNS,'circle');\n circle2.setAttributeNS(null, 'cx', '8px');\n circle2.setAttributeNS(null, 'cy', '8px');\n circle2.setAttributeNS(null, 'r', '5px');\n circle2.setAttributeNS(null, 'fill', 'lightgray');\n g3.appendChild(circle2);\n\n var line2 = document.createElementNS(svgNS,'path');\n line2.setAttributeNS(null, 'd', 'M4.5 8 L11.5 8 M8 4.5 L8 11.5 ');\n line2.setAttributeNS(null, 'style', 'stroke-width: 1.5px; stroke: darkslateblue;');\n g3.appendChild(line2);\n\n var label2 = document.createElementNS(svgNS,'text');\n label2.setAttributeNS(null, 'x', '20px');\n label2.setAttributeNS(null, 'y', '11px');\n label2.setAttributeNS(null, \"font-size\",\"10\");\n label2.setAttributeNS(null, \"fill\", \"black\");\n label2.setAttributeNS(null, \"font-family\", 'arial,helvetica,sans-serif');\n label2.setAttributeNS(null, \"font-weight\", 'bold');\n label2.appendChild(document.createTextNode(\"create custom track\"));\n g3.appendChild(label2);\n\n \n //\n // add predefined track\n //\n var g3 = svg.appendChild(document.createElementNS(svgNS,'g'));\n g3.onclick = function() { gLyphsPredefinedTracksPanel(glyphsGB); }\n g3.setAttribute(\"onmouseover\", \"eedbMessageTooltip('add predefined tracks to view',150);\");\n g3.setAttribute(\"onmouseout\", \"eedbClearSearchTooltip();\");\n\n var polyback2 = document.createElementNS(svgNS,'polygon');\n polyback2.setAttributeNS(null, 'points', '0,0 130,0 130,14 65,21 0,14');\n polyback2.setAttributeNS(null, 'style', 'fill:url(#purpLinearGradient)');\n g3.appendChild(polyback2);\n \n var circle2 = document.createElementNS(svgNS,'circle');\n circle2.setAttributeNS(null, 'cx', '8px');\n circle2.setAttributeNS(null, 'cy', '8px');\n circle2.setAttributeNS(null, 'r', '5px');\n circle2.setAttributeNS(null, 'fill', 'lightgray');\n g3.appendChild(circle2);\n \n var line2 = document.createElementNS(svgNS,'path');\n line2.setAttributeNS(null, 'd', 'M4.5 8 L11.5 8 M8 4.5 L8 11.5 ');\n line2.setAttributeNS(null, 'style', 'stroke-width: 1.5px; stroke: darkslateblue;');\n g3.appendChild(line2);\n \n var label2 = document.createElementNS(svgNS,'text');\n label2.setAttributeNS(null, 'x', '20px');\n label2.setAttributeNS(null, 'y', '11px');\n label2.setAttributeNS(null, \"font-size\",\"10\");\n label2.setAttributeNS(null, \"fill\", \"black\");\n label2.setAttributeNS(null, \"font-family\", 'arial,helvetica,sans-serif');\n label2.setAttributeNS(null, \"font-weight\", 'bold');\n label2.appendChild(document.createTextNode(\"add predefined tracks\"));\n g3.appendChild(label2);\n g3.setAttributeNS(null, 'transform', \"translate(170, 0)\");\n \n return add_track_div;\n}", "function createSymbol(symbolType, x, y, w, h, color, // whether to keep the ratio of w/h,\n\t keepAspect) {\n\t // TODO Support image object, DynamicImage.\n\t var isEmpty = symbolType.indexOf('empty') === 0;\n\t\n\t if (isEmpty) {\n\t symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\n\t }\n\t\n\t var symbolPath;\n\t\n\t if (symbolType.indexOf('image://') === 0) {\n\t symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n\t } else if (symbolType.indexOf('path://') === 0) {\n\t symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n\t } else {\n\t symbolPath = new SymbolClz({\n\t shape: {\n\t symbolType: symbolType,\n\t x: x,\n\t y: y,\n\t width: w,\n\t height: h\n\t }\n\t });\n\t }\n\t\n\t symbolPath.__isEmptyBrush = isEmpty; // TODO Should deprecate setColor\n\t\n\t symbolPath.setColor = symbolPathSetColor;\n\t\n\t if (color) {\n\t symbolPath.setColor(color);\n\t }\n\t\n\t return symbolPath;\n\t }", "function symbol(s, p) {\n var x = syntax[s];\n if (!x || typeof x !== 'object') {\n syntax[s] = x = {\n id: s,\n lbp: p,\n value: s\n };\n }\n return x;\n }", "function handleSymbol(symbol) {\n switch (symbol) {\n case \"C\": {\n clearScreen();\n break;\n }\n case \"←\": {\n if (buffer.length === 1) {\n buffer = \"0\";\n } else {\n buffer = buffer.slice(0, -1);\n }\n break;\n }\n case \"=\": {\n doOperation(); // Render the thing\n break;\n }\n default: {\n operator = symbol;\n total = parseInt(buffer);\n buffer = \"0\";\n }\n }\n reRender();\n}", "function update() {\n drawBG();\n for (let i = 0; symbols.length > i; i++) {\n if (symbols[i].name == \"star\" || symbols[i].name == \"sun\" || symbols[i].name == \"moon\") {\n symbols[i].rescale();\n }\n if (symbols[i].name == \"tree\") {\n symbols[i].rotate();\n }\n if (symbols[i].name == \"cloud\") {\n symbols[i].move();\n }\n symbols[i].draw();\n }\n window.requestAnimationFrame(update); //function that calls upon update after every frame \n }", "function j(e) {\n var s = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;\n var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;\n var l = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;\n if (!e) return {\n symbol: null\n };\n var t;\n if (x(e) || e instanceof _symbols_WebStyleSymbol_js__WEBPACK_IMPORTED_MODULE_32__[\"default\"]) t = e.clone();else if (\"cim\" === e.type) t = _symbols_PointSymbol3D_js__WEBPACK_IMPORTED_MODULE_27__[\"default\"].fromCIMSymbol(e);else if (e instanceof _symbols_SimpleLineSymbol_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]) t = _symbols_LineSymbol3D_js__WEBPACK_IMPORTED_MODULE_22__[\"default\"].fromSimpleLineSymbol(e);else if (e instanceof _symbols_SimpleMarkerSymbol_js__WEBPACK_IMPORTED_MODULE_30__[\"default\"]) t = _symbols_PointSymbol3D_js__WEBPACK_IMPORTED_MODULE_27__[\"default\"].fromSimpleMarkerSymbol(e);else if (e instanceof _symbols_PictureMarkerSymbol_js__WEBPACK_IMPORTED_MODULE_26__[\"default\"]) t = _symbols_PointSymbol3D_js__WEBPACK_IMPORTED_MODULE_27__[\"default\"].fromPictureMarkerSymbol(e);else if (e instanceof _symbols_SimpleFillSymbol_js__WEBPACK_IMPORTED_MODULE_29__[\"default\"]) t = _symbols_PolygonSymbol3D_js__WEBPACK_IMPORTED_MODULE_28__[\"default\"].fromSimpleFillSymbol(e);else {\n if (!(e instanceof _symbols_TextSymbol_js__WEBPACK_IMPORTED_MODULE_31__[\"default\"])) return {\n error: new _core_Error_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](\"symbol-conversion:unsupported-2d-symbol\", \"2D symbol of type '\".concat(e.type || e.declaredClass, \"' is unsupported in 3D\"), {\n symbol: e\n })\n };\n t = l ? _symbols_LabelSymbol3D_js__WEBPACK_IMPORTED_MODULE_21__[\"default\"].fromTextSymbol(e) : _symbols_PointSymbol3D_js__WEBPACK_IMPORTED_MODULE_27__[\"default\"].fromTextSymbol(e);\n }\n if (s && (t.id = e.id), r && x(t)) for (var _e246 = 0; _e246 < t.symbolLayers.length; ++_e246) {\n t.symbolLayers.getItemAt(_e246)._ignoreDrivers = !0;\n }\n return {\n symbol: t\n };\n }", "createSymbols(libMap) {\n // Initialize the svg layer in libMap\n libMap._initPathRoot();\n \n // Get the svg to create the symbols at the libs locations\n var svg = d3.select(this.divId).select(\"svg\");\n \n // Apend the libraries infos data\n LibrariesMap.libCirclesGroup = svg.selectAll(\"libCircles\")\n .data(this.libInfoSources)\n .enter();\n \n // Create info panel\n var panel = this.createInfoPanel();\n \n // Make a range for circles radius, proportional to frequentations/population_arrondissement\n var circleRadiusScale = d3.scaleLinear()\n .domain([d3.min(this.libInfoSources, function(d) { return normalizedFrequentations(d); }), \n d3.max(this.libInfoSources, function(d) { return normalizedFrequentations(d); })])\n .range([5,18]);\n \n // Draw the circles\n LibrariesMap.libCirclesGroup.append(\"circle\")\n .attr(\"r\", function(d) { return circleRadiusScale(normalizedFrequentations(d)); })\n .attr(\"class\", \"lib-circle\")\n .on(\"mouseover\", function(d) {\n // Compute cirlcle positioning for tooltip\n var circleMatrix = this.getScreenCTM().translate(+ this.getAttribute(\"cx\"), + this.getAttribute(\"cy\"));\n var cirlceRadius = +this.getAttribute(\"r\");\n // Display tooltip\n return LibrariesMap.nameTooltip.style(\"visibility\", \"visible\")\n .html(d.nom)\n .style(\"padding\", \"0 5px\")\n .style(\"left\", function () {\n // Tip div width to center tooltip\n var tipWidthOffset = this.getBoundingClientRect().width / 2;\n return (circleMatrix.e + window.pageXOffset - tipWidthOffset) + \"px\";\n } )\n .style(\"top\", (circleMatrix.f + window.pageYOffset - cirlceRadius-30) + \"px\")\n })\n .on(\"mouseout\", function(){ return LibrariesMap.nameTooltip.style(\"visibility\", \"hidden\"); })\n .on(\"click\", function(d) {\n // Hide tooltip and show selected circle\n LibrariesMap.nameTooltip.style(\"visibility\", \"hidden\");\n LibrariesMap.libCirclesGroup.selectAll(\"circle\").classed(\"circle-selected\", false);\n d3.select(this).classed(\"circle-selected\", true);\n\n // Center the map on the selected library\n libMap.setView([d.localisation.latitude, d.localisation.longitude])\n\n // Display info panel\n LibrariesMap.displayInfoPanel(panel, d);\n });\n\n // Place the circles\n LibrariesMap.updateCircles(libMap);\n }", "function Symbol() {\n}", "function xy_2_xy8shape( item, xName, x, yName, y )\n {\n item.x = x;\n item.y = y;\n item.dom.setAttributeNS( null, xName, x );\n item.dom.setAttributeNS( null, yName, y );\n }", "function createEvent(sym, eventName, opts) {\n var e = { Symbol: sym, element: sym.ele, performDefaultAction: true };\n $.extend(e, opts);\n return e;\n }", "createButton(symbol, style) {\n\t\tlet b = $('<span>')\n\t\tb.addClass('btn border small m-1 p-1')\n\t\tb.addClass(style)\n\t\tb.html(symbol)\n\t\treturn b\n\t}", "createSimpleMarkerSymbol () {\n var markerSymbol = new SimpleMarkerSymbol({\n color: [226, 119, 40],\n\n outline: new SimpleLineSymbol({\n color: [255, 255, 255],\n width: 2\n })\n });\n\n return markerSymbol;\n }", "setStartingPosition (x, y) {\n this._currSymbol.x = x;\n this._currSymbol.y = y;\n return this;\n }", "constructor() {\n this.canvas = document.getElementById(\"canvas\");\n this.ctx = this.canvas.getContext(\"2d\");\n this.bounds = this.canvas.getBoundingClientRect();\n this.color = COLORS.red;\n this.tool = TOOLS.pen;\n\n // tool customization\n this.pencilWidth = 10;\n this.eraserWidth = 10;\n this.shapeWidth = 10;\n this.fontSize = 16;\n this.fontFamily = \"Arial\";\n\n this.drawing = false;\n\n // store the mouse coordinates\n this.currentPosition = {\n x: 0,\n y: 0,\n };\n this.startPosition = {\n x: 0,\n y: 0,\n };\n\n this.savedCanvas;\n this.savedActions = [];\n\n this.draw = this.draw.bind(this);\n this.startDrawing = this.startDrawing.bind(this);\n this.stopDrawing = this.stopDrawing.bind(this);\n this.onMouseMove = this.onMouseMove.bind(this);\n this.showTextInput = this.showTextInput.bind(this);\n this.addText = this.addText.bind(this);\n this.init = this.init.bind(this);\n }", "setToRandomSymbol() {\n // frameCount built-in variable in p5.js\n if (frameCount % this.switchInterval == 0) {\n // if to frameCount einai pollaplasio\n // tou switchInterval tote allaje symbol\n this.value = String.fromCharCode(0x30A0 + round(random(0, 96)));\n }\n }", "function enterSymmetry() {\r\n\tif (! _file.symmetry){\r\n\t\t_file.symmetry = {\r\n\t\t\toperationList : createSymopSet(),\r\n\t\t\tchosenSymElement : \"\", \r\n\t\t\tchosenSymop : \"\",\r\n\t\t\tsymOffset : \"{0/1,0/1,0/1}\"\r\n\t\t}; \r\n\t \tvar symopSelection = createSelect('addSymSymop', 'doSymopSelection(value)', 0, 1, _file.symmetry.operationList);\r\n\t\tgetbyID(\"symmetryOperationSet\").innerHTML = symopSelection;\r\n\t}\r\n\tvar activateSymmetry = createButton(\"activateSymmetryButton\", \"Activate applied symmetry:\", 'doActivateSymmetry()', 0);\r\n\tgetbyID(\"activateSymmetryDiv\").innerHTML = activateSymmetry;\r\n\tvar activateAllSymmetry = createButton(\"activateAllSymmetryButton\", \"Activate all symmetry:\", 'doActivateAllSymmetry()', 0); \r\n\tgetbyID(\"activateAllSymmetryDiv\").innerHTML = activateAllSymmetry;\r\n}", "function symbolNode(value, height, depth, italic, skew, classes, style) {\n this.value = value || \"\";\n this.height = height || 0;\n this.depth = depth || 0;\n this.italic = italic || 0;\n this.skew = skew || 0;\n this.classes = classes || [];\n this.style = style || {};\n this.maxFontSize = 0;\n}", "function symbolNode(value, height, depth, italic, skew, classes, style) {\n this.value = value || \"\";\n this.height = height || 0;\n this.depth = depth || 0;\n this.italic = italic || 0;\n this.skew = skew || 0;\n this.classes = classes || [];\n this.style = style || {};\n this.maxFontSize = 0;\n}", "static draw(cfg, h, ls) {\n\n ls.d.forEach((item, j) => {\n\n let dFcn = h.configGen(this.point(), cfg, ls, item);\n let c = {\n d:dFcn(item),\n data:item,\n cfg:cfg,\n layerState:ls,\n target:'path',\n };\n\n let rv = h.configElement(c);\n let x = ls.sa.x(item) + (cfg.jitter?h.getDrawWidth(ls.sa.x(),Math.random()*cfg.jitter):0);\n rv.e.setAttribute('transform', `translate(${x} ${ls.sa.y(item)})`);\n\n // let type;\n // sym.forEach((s, i) => { // create composite symbols\n //\n // if (d3[`symbol${s}`])\n // type = d3[`symbol${s}`]; // from d3\n // else {\n // type = extra[s]; // extra from above\n // }\n //\n // var symbolGenerator = d3.symbol()\n // .type(type)\n // .size(ls.sa.size(item)**2);\n //\n // let id = `${ls.g.id}-${cfg.id}-${j}`\n // let attr = {\n // 'id':id,\n // \"d\":symbolGenerator(),\n // \"transform\":`translate(${x} ${y})`,\n // \"fill\":ls.sa.color(item),\n // ...h.parseCfgFill(ls.sa, item),\n // ...h.parseCfgStroke(ls.sa, item, cfg.stroke)\n // };\n //\n // h.eventRegister(id, ls.g.id, cfg.ev, {popup:{attr:attr, idx:j, title:cfg.title, data:ls.d}});\n // h.createElement(attr, 'path', ls.g);\n // });\n\n });\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 }", "function handleSymbol(symbol) {\n const operatorId = symbol.id;\n\n switch (operatorId) {\n case 'opClear':\n calcDisplay = '0';\n runningTotal = 0;\n break;\n case 'opEquals':\n handleEquals();\n break;\n case 'opPlus':\n case 'opMinus':\n case 'opDivide':\n case 'opMultiply':\n handleMath(operatorId);\n break;\n case 'opBack':\n handleBackBtn();\n break;\n default:\n }\n}", "start() {\n this._symbolTable = new SymbolTable();\n this._maxTemp = 0;\n }", "function sendEvent(button, pos) {\n // self.emit('mouse', {\n // x: pos.x - 32,\n // y: pos.x - 32,\n // button: button\n // });\n if (self.vt300Mouse) {\n // NOTE: Unstable.\n // http://www.vt100.net/docs/vt3xx-gp/chapter15.html\n button &= 3;\n pos.x -= 32;\n pos.y -= 32;\n var data = '\\x1b[24';\n if (button === 0)\n data += '1';\n else if (button === 1)\n data += '3';\n else if (button === 2)\n data += '5';\n else if (button === 3)\n return;\n else\n data += '0';\n data += '~[' + pos.x + ',' + pos.y + ']\\r';\n self.send(data);\n return;\n }\n if (self.decLocator) {\n // NOTE: Unstable.\n button &= 3;\n pos.x -= 32;\n pos.y -= 32;\n if (button === 0)\n button = 2;\n else if (button === 1)\n button = 4;\n else if (button === 2)\n button = 6;\n else if (button === 3)\n button = 3;\n self.send('\\x1b['\n + button\n + ';'\n + (button === 3 ? 4 : 0)\n + ';'\n + pos.y\n + ';'\n + pos.x\n + ';'\n + (pos.page || 0)\n + '&w');\n return;\n }\n if (self.urxvtMouse) {\n pos.x -= 32;\n pos.y -= 32;\n pos.x++;\n pos.y++;\n self.send('\\x1b[' + button + ';' + pos.x + ';' + pos.y + 'M');\n return;\n }\n if (self.sgrMouse) {\n pos.x -= 32;\n pos.y -= 32;\n self.send('\\x1b[<'\n + ((button & 3) === 3 ? button & ~3 : button)\n + ';'\n + pos.x\n + ';'\n + pos.y\n + ((button & 3) === 3 ? 'm' : 'M'));\n return;\n }\n var data = [];\n encode(data, button);\n encode(data, pos.x);\n encode(data, pos.y);\n self.send('\\x1b[M' + String.fromCharCode.apply(String, data));\n }", "addStrokeTag(ev){\n console.log(ev)\n var id = guid();\n var firstPoint = [ev['x'], ev['y']];\n var data = {\n 'id': id,\n 'width': 100,\n 'height': 100,\n 'placeHolder': [\n {'id':'left', 'data': {}, 'lines':[]}\n ],\n 'tagSnapped': [],\n 'position': [firstPoint[0],firstPoint[1]]\n \n }\n this.props.addTag(data)\n }", "function displaySymbol (){\n this.classList.toggle(\"open\");\n this.classList.toggle(\"show\");\n this.classList.toggle(\"disabled\");\n }", "constructor(symbols, type=Symbol.TAG){\n super()\n this.type = type\n for( var i=0; i<symbols.length; i++ )\n this[symbols.charAt(i)] = symbols.charAt(i)\n }", "constructor(pos,type='forward') {\n super(pos)\n this.type=type;\n this.setSvg()\n }", "function SymbolInstance() {\n var master = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, SymbolInstance);\n\n if (!master.sketchObject) {\n // eslint-disable-next-line no-param-reassign\n master.sketchObject = _Factory__WEBPACK_IMPORTED_MODULE_4__[\"Factory\"].createNative(SymbolInstance).alloc().initWithFrame(new _models_Rectangle__WEBPACK_IMPORTED_MODULE_2__[\"Rectangle\"](0, 0, 100, 100).asCGRect());\n }\n\n return _possibleConstructorReturn(this, _getPrototypeOf(SymbolInstance).call(this, master));\n } // Replaces the instance with a group that contains a copy of the Symbol this instance refers to. Returns null if the master contains no layers instead of inserting an empty group", "function onSvgClick(e) {\n if (state.appMode === 'drawing' && !state.isDraw && state.currentType) {\n code.hide();\n app.setIsDraw(true);\n switch (state.currentType) {\n case 'rect':\n state.newArea = new Rectangle(utils.getRightCoords(e.pageX, e.pageY));\n \n app.addEvent(domElements.container, 'mousemove', state.newArea.onDraw)\n .addEvent(domElements.container, 'click', state.newArea.onDrawStop);\n \n break;\n case 'circle':\n state.newArea = new Circle(utils.getRightCoords(e.pageX, e.pageY));\n \n app.addEvent(domElements.container, 'mousemove', state.newArea.onDraw)\n .addEvent(domElements.container, 'click', state.newArea.onDrawStop);\n \n break;\n case 'polygon':\n state.newArea = new Polygon(utils.getRightCoords(e.pageX, e.pageY));\n \n app.addEvent(domElements.container, 'mousemove', state.newArea.onDraw)\n .addEvent(domElements.container, 'click', state.newArea.onDrawAddPoint)\n .addEvent(document, 'keydown', state.newArea.onDrawStop)\n .addEvent(state.newArea.helpers[0].el, 'click', state.newArea.onDrawStop);\n \n break;\n } \n }\n }", "function Symbol(symbol, target, key){\n\n\tthis.validateRequiredKeys(symbol, key);\n\n\tsymbol.key = key;\n\n\tsymbol.pattern = this.getPattern(symbol.replaced, target);\n\n\tthis.validateOptionalKeys(symbol, key);\n\t//power hack to insert a unicode as html reference in an input via javascript\n\tsymbol.htmlSymbol = utils.convertToHtml(symbol.unicode);\n\n\tsymbol.encoded = encodeURIComponent(utils.htmlTrim(symbol.htmlSymbol));\n\n\tsymbol.before = formatSeparator(symbol.before, target);\n\n\tsymbol.after = formatSeparator(symbol.after, target);\n\n\t//inserted is html\n\tsymbol.inserted = symbol.before+symbol.htmlSymbol+symbol.after;\n\n\tsymbol.textInserted = utils.convertToText(symbol.inserted);\n\n\treturn symbol;\n}", "function applyPointShape(yID, symbol) {\r\n if (type === 'bar' || type === 'bubble') {\r\n return;\r\n }\r\n\r\n var circleSet = d3.selectAll(\".c3-circles-\" + yID);\r\n var circles = circleSet.selectAll(\"circle\")[0];\r\n if (!circles) {\r\n return;\r\n }\r\n\r\n for (var j = 0; j < circles.length; j++) {\r\n circles[j].style.opacity = 0; // hide default circle\r\n appendSymbol(\r\n circleSet,\r\n circles[j].cx.baseVal.value,\r\n circles[j].cy.baseVal.value,\r\n symbol,\r\n circles[j].style.fill\r\n );\r\n }\r\n}", "function updatePropSymbols(map, attribute, rawAttribute){\n map.eachLayer(function(layer){\n //if layer and properties present:\n if (layer.feature && layer.feature.properties[attribute]){\n //get feature properties\n var props = layer.feature.properties;\n //update each feature's radius based on new attribute values\n var radius = calcPropRadius(props[attribute]);\n layer.setRadius(radius);\n\t\t\tif(IndexCounter > 0) {\n\t\t\t}\n //call popup function to add new information as symbols are updated\n if (normalized == true) {\n createPopup(props, attribute, rawAttribute, layer, radius);\n } else {\n \tcreatePopup(props, rawAttribute, attribute, layer, radius);\n } \n };\n\t});\n\t//also want our legend to update, so call the function\n\tupdateLegend(map, attribute);\n}", "function changeOperator(symbol) {\n inputOperator = symbol;\n console.log('input operator is now', symbol);\n updateCalculatorDisplay();\n}", "function getSymbolMeta(data, dataIndex, itemModel, opt) {\n\t var layout = data.getItemLayout(dataIndex);\n\t var symbolRepeat = itemModel.get('symbolRepeat');\n\t var symbolClip = itemModel.get('symbolClip');\n\t var symbolPosition = itemModel.get('symbolPosition') || 'start';\n\t var symbolRotate = itemModel.get('symbolRotate');\n\t var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n\t var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n\t var isAnimationEnabled = itemModel.isAnimationEnabled();\n\n\t var symbolMeta = {\n\t dataIndex: dataIndex,\n\t layout: layout,\n\t itemModel: itemModel,\n\t symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n\t color: data.getItemVisual(dataIndex, 'color'),\n\t symbolClip: symbolClip,\n\t symbolRepeat: symbolRepeat,\n\t symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n\t symbolPatternSize: symbolPatternSize,\n\t rotation: rotation,\n\t animationModel: isAnimationEnabled ? itemModel : null,\n\t hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'),\n\t z2: itemModel.getShallow('z', true) || 0\n\t };\n\n\t prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n\n\t prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n\n\t prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n\n\t var symbolSize = symbolMeta.symbolSize;\n\t var symbolOffset = itemModel.get('symbolOffset');\n\t if (zrUtil.isArray(symbolOffset)) {\n\t symbolOffset = [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])];\n\t }\n\n\t prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n\n\t return symbolMeta;\n\t}", "function getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n color: data.getItemVisual(dataIndex, 'color'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'),\n z2: itemModel.getShallow('z', true) || 0\n };\n\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n\n prepareSymbolSize(\n data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength,\n symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta\n );\n\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = itemModel.get('symbolOffset');\n if (zrUtil.isArray(symbolOffset)) {\n symbolOffset = [\n parsePercent(symbolOffset[0], symbolSize[0]),\n parsePercent(symbolOffset[1], symbolSize[1])\n ];\n }\n\n prepareLayoutInfo(\n itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset,\n symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength,\n opt, symbolMeta\n );\n\n return symbolMeta;\n }", "function getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n color: data.getItemVisual(dataIndex, 'color'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = itemModel.get('symbolOffset');\n\n if (zrUtil.isArray(symbolOffset)) {\n symbolOffset = [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])];\n }\n\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.", "function getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n color: data.getItemVisual(dataIndex, 'color'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = itemModel.get('symbolOffset');\n\n if (zrUtil.isArray(symbolOffset)) {\n symbolOffset = [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])];\n }\n\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.", "function getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n color: data.getItemVisual(dataIndex, 'color'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = itemModel.get('symbolOffset');\n\n if (zrUtil.isArray(symbolOffset)) {\n symbolOffset = [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])];\n }\n\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.", "function getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n color: data.getItemVisual(dataIndex, 'color'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = itemModel.get('symbolOffset');\n\n if (zrUtil.isArray(symbolOffset)) {\n symbolOffset = [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])];\n }\n\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.", "function getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n color: data.getItemVisual(dataIndex, 'color'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = itemModel.get('symbolOffset');\n\n if (zrUtil.isArray(symbolOffset)) {\n symbolOffset = [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])];\n }\n\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.", "function getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n color: data.getItemVisual(dataIndex, 'color'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = itemModel.get('symbolOffset');\n\n if (zrUtil.isArray(symbolOffset)) {\n symbolOffset = [parsePercent(symbolOffset[0], symbolSize[0]), parsePercent(symbolOffset[1], symbolSize[1])];\n }\n\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.", "function keyPressed(){\n if (keyCode == 80)\n currentModel.addPoint();\n}", "setPosition(e) {\n\n this.mouseIsDown = true;\n this.ctx.beginPath();\n this.ctx.moveTo(e.offsetX, e.offsetY);\n\n // Ajouter un event pour commencer à dessiner lorsq'on deplace la souris //\n this.carte.signElt.addEventListener('mousemove', (e) => { this.draw(e) });\n\n }", "function printSymbol(e) {\n let obj = e.target;\n console.log(e.target.id);\n \n if(obj.id == 'period') {\n result.value += obj.textContent;\n } else if(obj.id == 'leftP') {\n result.value = obj.textContent;\n } else if (result.value != 0) {\n result.value += obj.textContent;\n }\n}", "function StackSymbol() {\r\n}", "function getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n style: data.getItemVisual(dataIndex, 'style'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = itemModel.get('symbolOffset');\n\n if (util[\"t\" /* isArray */](symbolOffset)) {\n symbolOffset = [Object(number[\"o\" /* parsePercent */])(symbolOffset[0], symbolSize[0]), Object(number[\"o\" /* parsePercent */])(symbolOffset[1], symbolSize[1])];\n }\n\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.", "function mouseClicked() {\n\t\n\n\t\t// if (osc.getType() == 'square') {\n\t\t// \tosc.setType('sine')\n\t\t// } else {\n\t\t// \tosc.setType('square')\n\t\t//}\n\t\t\n\t\n}", "function analysis_pane_register_symbols() {\n if (daceRenderer !== undefined && vscode !== undefined)\n vscode.postMessage({\n type: 'analysis.add_symbols',\n symbols: daceRenderer.sdfg.attributes.symbols,\n });\n}" ]
[ "0.7114517", "0.6466557", "0.64647657", "0.6350686", "0.6192117", "0.61857975", "0.61804456", "0.6119256", "0.6101147", "0.608549", "0.6066747", "0.6053542", "0.60369134", "0.5908789", "0.58821964", "0.58692235", "0.5861347", "0.5808533", "0.58021885", "0.5780354", "0.57715976", "0.5763875", "0.5763875", "0.57052094", "0.5699159", "0.569417", "0.5685351", "0.5683149", "0.56791085", "0.56121963", "0.5604154", "0.5592357", "0.55881536", "0.55740345", "0.55477095", "0.5540019", "0.55393624", "0.55350906", "0.55278647", "0.54909456", "0.54909456", "0.54909456", "0.54840875", "0.5464872", "0.5463025", "0.5450584", "0.54176605", "0.5399494", "0.53782934", "0.53674626", "0.53222644", "0.53104293", "0.5307196", "0.53023905", "0.5284254", "0.52768385", "0.5265505", "0.5257931", "0.5247137", "0.523498", "0.52267784", "0.51883286", "0.5186881", "0.5186646", "0.5186646", "0.51856554", "0.51799864", "0.5177454", "0.5176682", "0.5171155", "0.516124", "0.51563907", "0.51550144", "0.51511276", "0.5144823", "0.5132516", "0.5122515", "0.50917816", "0.5088453", "0.50850385", "0.5078069", "0.5076383", "0.5075448", "0.5075448", "0.5075448", "0.5075448", "0.5075448", "0.5075448", "0.507196", "0.5071671", "0.50712305", "0.5056721", "0.5055671", "0.50542325", "0.50430584" ]
0.6124609
12
Avoid that: mouse click on a elements that is over geo or graph, but roam is triggered.
function onIrrelevantElement(e, api, targetCoordSysModel) { var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem. var coordSys = model && model.coordinateSystem; return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES[model.mainType] && coordSys && coordSys.model !== targetCoordSysModel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGridToNonClickable(grid){\n grid.style.pointerEvents=\"none\";\n}", "function disableRightClick() {\n // stop zoom\n if (d3.event.button == 2) {\n console.log('No right click allowed');\n d3.event.stopImmediatePropagation();\n }\n }", "function block_user_interaction(paper) {\n paper.setInteractivity(false);\n}", "function toggleGridUnclickable() {\n grid.style.pointerEvents = \"none\";\n}", "async mouseAway() {\n await this._actions().mouseMove(this.element(), { x: -1, y: -1 }).perform();\n await this._stabilize();\n }", "function onMouseClick(event) {\n freeze = !freeze;\n }", "function mouseClicked() {\n // Ignore clicks outside window\n if (!window.ev) {\n return;\n }\n \n if (!menu_toggles.forces.parameter) return;\n \n // Delete force\n for (var i = 1; i < forcePoints.length; i++) {\n // Check if hovering over fixed forcePoint\n if (forcePoints[i].hover) {\n forcePoints.splice(i, 1);\n return;\n }\n }\n \n // Create force\n forcePoints.push(new ForcePoint(cursorPoint.center, cursorPoint.forceFactor, cursorPoint.forceExp, cursorPoint.forceIntensity, \"CONTRACTING\"));\n}", "function mousedown() {\n if (!mousedown_node && !mousedown_link) {\n // allow panning if nothing is selected\n vis.call(d3.behavior.zoom().on(\"zoom\"), rescale);\n return;\n }\n}", "function onMouseUp(event){if(preventMouseUp){event.preventDefault();}}", "_onMapClick(e) {\r\n\t const targetElement = e.originalEvent.target;\r\n\t const element = this._element;\r\n\r\n\t if (\r\n\t this._handleClick &&\r\n\t (targetElement === element || element.contains(targetElement))\r\n\t ) {\r\n\t this._handleClick();\r\n\t }\r\n\t }", "triggerLower(e) {\n //Skip if not left click\n if (e.button !== 0) {\n return false;\n }\n const mouseX = e.pageX\n const mouseY = e.pageY\n let lowerElement;\n if (!document.elementsFromPoint) document.elementsFromPoint = UTILS.elementsFromPoint\n\n lowerElement = document.elementsFromPoint(mouseX, mouseY).find((element) => {\n return element.classList.contains(\"calendar__block\")\n });\n\n if (!lowerElement) return;\n let event\n const parentElement = e.target\n switch (e.type) {\n case \"mousedown\":\n event = new MouseEvent('mousedown', {\n bubbles: true,\n });\n parentElement.style.pointerEvents = 'none'\n BreakDragHelper.addForegroundElement(parentElement)\n lowerElement.dispatchEvent(event)\n break;\n case \"mouseover\":\n if (BreakDragHelper.getMousedown()) {\n parentElement.style.pointerEvents = 'none'\n BreakDragHelper.addForegroundElement(parentElement)\n event = new MouseEvent('mouseover', {\n bubbles: true,\n });\n lowerElement.dispatchEvent(event)\n }\n break;\n default:\n break;\n }\n }", "function cClick(){\r\nif(OLloaded&&OLgateOK){OLhover=0;OLhideObject(over);o3_showingsticky=0;}\r\nreturn false;\r\n}", "function unblock_user_interaction(paper) {\n paper.setInteractivity(true);\n}", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function click() {\n d3_eventCancel();\n w.on(\"click.drag\", null);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function disableMouse(clic) {\r\n document.addEventListener(\"click\", e => {\r\n if (clic) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }, true);\r\n}", "function moveClickable() {\n // Move\n clickable.x += clickable.vx;\n clickable.y += clickable.vy;\n\n // Check if off screen and just kill the program if so\n if (clickable.x < 0 || clickable.x > width || clickable.y < 0 || clickable.y > height) {\n noLoop();\n }\n}", "function disableInteraction() {\n moving = true;\n setTimeout(function () {\n moving = false;\n }, 500);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }", "function ClickBlock() {\n // for(let i = 0; i < itemEls.length; i++){\n // itemEls[i].style.pointerEvents = 'none';\n // }\n // setTimeout(()=>{\n // for(let i = 0; i < itemEls.length; i++){\n // itemEls[i].style.pointerEvents = 'auto';\n // }\n // }, 210);\n }", "_onMapClick(e) {\n const targetElement = e.originalEvent.target;\n const element = this._element;\n\n if (\n this._handleClick &&\n (targetElement === element || element.contains(targetElement))\n ) {\n this._handleClick();\n }\n }", "function mapper_disable_dragging() {\n if( map ) map.disableDragging();\n}", "function ignorePendingMouseEvents() { ignore_mouse = guac_mouse.touchMouseThreshold; }", "function _clicked_ele_trigger(oEle,e)\r\n{\r\n\tif(isNaN(e))\r\n\t{\r\n\t\tvar mLeft = app.findMousePos(e)[0];\r\n\t}\r\n\telse\r\n\t{\r\n\t\tvar mLeft = e;\r\n\t}\r\n\r\n\tvar eleMaxRight = oEle.offsetWidth + app.eleLeft(oEle);\r\n\tvar eleMinRight = eleMaxRight - 16;\r\n\r\n\tif((mLeft>eleMinRight)&&(mLeft<eleMaxRight))\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "function toggleClickable(){\n \t\tfor (var i = 0; i < 10; i++){\n \t\t\tif (shapes[i].style.pointerEvents === 'none'){\n \t\t\t\tshapes[i].style.pointerEvents = '';\n \t\t\t}\n \t\t\telse {\n \t\t\t\tshapes[i].style.pointerEvents = 'none';\n \t\t\t}\n \t\t}\n \t}", "function gcb_clickBuster (event)\r\n{\r\n //console.log (\"Clicked \" + event.clientX + \", \" + event.clientY );\r\n if (gcb_ignoreClick(event.clientX, event.clientY))\r\n {\r\n //console.log (\"... and ignored it.\");\r\n event.stopPropagation();\r\n event.preventDefault();\r\n }\r\n}", "onMinimapDragMouseDown() {\n this.isMinimapPanning = true;\n }", "function disableClickZoom () {\n status.disableClickZoom = true;\n }", "function setGridToClickable(grid){\n grid.style.pointerEvents=\"visiblePainted\";\n}", "externalClick() {\n this._strikeClick();\n this._localPointer.x = this.getPointer().x;\n this._localPointer.y = this.getPointer().y;\n }", "function mouseClicked() {\n if (mouseY >= 620 && mouseY <= 720 && mouseX >= 1040 && mouseX <= 1280) {\n aanvalActie = false;\n aanvalKnopStatus = false;\n beweegActie = false;\n beweegKnopStatus = false;\n beurtVeranderen();\n veranderKleur(donkerblauw,wit);\n veranderKleur(lichtblauw,wit);\n }\n}", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "_moveHandler() {\n if (this.hasAttribute('dragged') && JQX.Utilities.Core.isMobile) {\n event.originalEvent.preventDefault();\n }\n }", "function mapMouseDown(event) {\n var tx, ty;\n tx = event.pageX - parseInt($(\"#map\")[0].style.marginLeft);\n ty = event.pageY - 35 - parseInt($(\"#map\")[0].style.marginTop);\n if (event.preventDefault) event.preventDefault();\n else event.returnValue = false;\n mapX = event.clientX;\n mapY = event.clientY;\n return false;\n}", "handle_mouse_click(mouse_ray) {\n if (this.disable_marker_tile || this.game_over) return;\n const width = 10, length = 10;\n // TODO: Collisions against the menu items should override any other collisions.\n let tiles = this.calculate_ray_tile_intersection(mouse_ray, width, length);\n if (!this.moving)\n this.clicked_tile = tiles;\n this.click_ray = mouse_ray;\n }", "handleMouseUp() {\n let { map, isDrawingEnabled, option } = this.state;\n\n /**\n * We track it only for \"Draw\" drawing mode\n */\n if ( ! (isDrawingEnabled && option === \"draw\") ) return;\n\n this.refs.map.leafletElement.dragging.enable();\n map.mouseDown = false;\n this.setState({\n map: map,\n isDrawingEnabled: false\n });\n }", "function mousedown() {\n \"use strict\";\n mouseclicked = !mouseclicked;\n}", "function hardClick() {\n if (hardButton.isUnderMouse(mouseX, mouseY)) {\n isUnder = true;\n hardLevel();\n levelPicked = true;\n }\n}", "function onMouseNothing(e) {\n e.preventDefault();\n e.stopPropagation();\n return false;\n}", "function onIrrelevantElement(e, api, targetCoordSysModel) {\n\t var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem.\n\t\n\t var coordSys = model && model.coordinateSystem;\n\t return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel;\n\t }", "function dontPosSelect() {\n return false;\n }", "function isMouseDown() {\n let allUnvisited = document.querySelectorAll(\".unvisited\");\n allUnvisited.forEach((point) => {\n point.addEventListener(\"mousedown\", function () {\n canDrag = true;\n });\n });\n}", "function removeMouseClick() {\n click_active = false;\n current_click = null;\n nodes_selected = nodes; //Re-instate the mouse events\n\n mouse_zoom_rect.on('mouseout', function (d) {\n if (current_hover !== null) mouseOutNode();\n }); //Release click\n\n mouseOutNode();\n hideTooltip(); //Hide the rotating circle\n\n node_hover.style('display', 'none'); //Hide the icon to the bottom right of a clicked node\n\n node_modal_group.style('display', 'none');\n } //function removeMouseClick", "function removeMouseClick() {\n click_active = false;\n current_click = null;\n nodes_selected = nodes; //Re-instate the mouse events\n\n mouse_zoom_rect.on('mouseout', function (d) {\n if (current_hover !== null) mouseOutNode();\n }); //Release click\n\n mouseOutNode();\n hideTooltip(); //Hide the rotating circle\n\n node_hover.style('display', 'none'); //Hide the icon to the bottom right of a clicked node\n\n node_modal_group.style('display', 'none');\n } //function removeMouseClick", "function ignoreDragging() {\n try {\n window.event.returnValue = false; }\n catch (e) {}\n return false; }", "function handleMouseUp(evt)\r\n{\r\n\tisClicked = false;\r\n\tmapFrame.style.cursor = \"default\";\r\n}", "function onIrrelevantElement(e, api, targetCoordSysModel) {\n var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem.\n\n var coordSys = model && model.coordinateSystem;\n return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel;\n}", "function mousePressed() {\n return false;\n}", "function avoidAreasToolClicked(e) {\n\t\t\tvar btn = e.target;\n\t\t\tvar tag = e.target.tagName;\n\t\t\tif (tag.toUpperCase() == 'IMG') {\n\t\t\t\t//we selected the image inside the button; get the parent (this will be the button).\n\t\t\t\tbtn = $(e.target).parent().get(0);\n\t\t\t}\n\n\t\t\t//will be either create, edit or remove\n\t\t\tvar mainPart = 'avoid'.length;\n\t\t\tvar toolType = btn.id.substring(mainPart).toLowerCase();\n\n\t\t\tvar btnIsActive = btn.className.indexOf('active') > -1;\n\n\t\t\t//set all btns to inactive\n\t\t\tvar allBtn = $(btn).parent().get(0).querySelectorAll('button');\n\t\t\tfor (var i = 0; i < allBtn.length; i++) {\n\t\t\t\t$(allBtn[i]).removeClass('active');\n\t\t\t}\n\t\t\t//activate current button if necessary\n\t\t\tif (!btnIsActive) {\n\t\t\t\t$(btn).addClass('active');\n\t\t\t}\n\n\t\t\ttheInterface.emit('ui:avoidAreaControls', {\n\t\t\t\ttoolType : toolType,\n\t\t\t\t//if the button has been active before, it will be de-activated now!\n\t\t\t\tactivated : !btnIsActive\n\t\t\t});\n\t\t}", "function mousePressed(){\n\treturn false;\n}", "function startClick() {\n $('maze').addEventListener('mouseleave', overBody);\n [].forEach.call($$('.boundary'), function(element){\n element.removeClassName('youlose');\n });\n [].forEach.call($$('.boundary'), function(element){\n element.observe('mouseover', overBoundary);\n });\n loser = null;\n}", "function mouseClicked() {\r\n var a = Math.floor(mouseX / w);\r\n var b = Math.floor(mouseY / h);\r\n if (grid[a][b].wall == true) {\r\n grid[a][b].wall = false;\r\n } else {\r\n if (grid[a][b] != start && grid[a][b] != end) {\r\n grid[a][b].wall = true;\r\n\r\n }\r\n }\r\n return false;\r\n}", "_onMouseUp () {\n Actions.changeDragging(false);\n }", "externalMouseDown() {\n this._strikeMouseDown();\n this._localPointer._mouseIsActive = true;\n }", "function startIgnoringMouse() {\n ignoreMouseDepth++;\n setTimeout(function () {\n ignoreMouseDepth--;\n }, _fullcalendar_core__WEBPACK_IMPORTED_MODULE_0__[\"config\"].touchMouseIgnoreWait);\n}", "handleMapClick(event) {\n //this.toggleHover(-1);\n }", "function preventMove(event) {\r\n\tevent.preventDefault();\r\n}", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "function mapper_enable_dragging() {\n if( map ) map.enableDragging();\n}", "function mouseClick(d, click_type) {\n if (d3__WEBPACK_IMPORTED_MODULE_4__[\"event\"]) d3__WEBPACK_IMPORTED_MODULE_4__[\"event\"].stopPropagation();\n click_active = true; //Call the correct drawing function\n\n if (click_type === 'element') mouseOverElement(d);else if (click_type === 'country') mouseOverCountry(d);else if (click_type === 'domain') mouseOverDomain(d);\n current_click = d;\n } //function mouseClick", "function avoidAreasError(errorous) {\n\t\t\tui.showAvoidAreasError(errorous);\n\t\t}", "function handleMouseDown(evt)\r\n{\r\n\tif (inFrame(evt.clientX,evt.clientY)) \r\n\t{\r\n\t\txOld = evt.clientX - getLeft();\r\n\t\tyOld = evt.clientY - getTop();\r\n\t\tisClicked = true;\r\n\t\tevt.preventDefault();\r\n\t}\r\n\tmapFrame.style.cursor = \"move\";\r\n}", "function mousedownForCanvas(event)\n{\n global_mouseButtonDown = true;\n event.preventDefault(); //need? (maybe not on desktop)\n}", "function toggleGridClickable() {\n grid.style.pointerEvents = \"auto\";\n}", "function handlClickLinks(ev) {\r\n ev.preventDefault();\r\n \r\n}", "function disablePointSelection(){\r\n\taddPointMode = false;\r\n}", "function onMouseUp(event) {\n if (preventMouseUp) {\n event.preventDefault();\n }\n }", "function mousePressed(e) {\n return false;\n}", "function mapaClick(mouse) {\r\n\tswitch (root.actividad) {\r\n\t\tcase 0: // Nada cargado\r\n\t\t\tbreak\r\n\r\n\t\tcase 1: // Ubicar marcas para recorte\r\n\t\t\tLogEtaCorte.agregarMarca(mouse)\r\n\t\t\tbreak\r\n\r\n\t\tcase 2: // Marcar contornos\r\n\t\t\tvar posR = posReal(mouse, mapa.escala)\r\n\t\t\tconsole.log(\"pos real: \", posR.x, posR.y)\r\n\r\n\t\t\tif (Glo.hayTrazoRojo) {\r\n\t\t\t\tmiProxy.guardarTrazo()\r\n\t\t\t\tGlo.hayTrazoVerde = true\r\n\t\t\t}\r\n\r\n\t\t\tmiProxy.marcarTrazo(\r\n\t\t\t\t\tposR.x,\tposR.y,\r\n\t\t\t\t\tNumber(pin_radio.currentText),\r\n\t\t\t\t\tNumber(pin_vecinos.currentText),\r\n\t\t\t\t\tNumber(pin_cambioAng.value) * 0.0174532925)\r\n\r\n\t\t\tGlo.hayTrazoRojo = true\r\n\t\t\tpin_btBorrarCapa.enabled = true\r\n\r\n\t\t\tmapa.actualizTrazos()\r\n\t\t\tbreak\r\n\t}\r\n}", "function mouseClick(e) {\n // pin point on plane, if applicable\n drawPinnedPoint();\n}", "function disableMouse() {\n\tnoMouse = true;\n}", "onTileClicked(e){\n var w = this.map.tilewidth;\n var h = this.map.tileheight;\n var scrollLeft = document.documentElement.scrollLeft;\n var scrollTop = document.documentElement.scrollTop;\n\n var mx = e.src.pageX-scrollLeft;\n var my = e.src.pageY-scrollTop;\n \n var nodes = document.elementsFromPoint(mx,my);\n var tilenodes = nodes;//nodes.filter(n => n.classList.contains(\"tile\"));\n console.log(\"objects in proximity of click\", tilenodes)\n var target = tilenodes.shift();\n console.log(mx,my)\n console.log(\"top most object\", target);\n // console.log(this.renderer.screenXY_to_mapXY(mx+scrollLeft,my+scrollTop));\n }", "function disableClick() {\n body.style.pointerEvents = 'none';\n setTimeout(function() {body.style.pointerEvents = 'auto';}, 1000);\n}", "function disableClick(){\r\n body.style.pointerEvents='none';\r\n setTimeout(function() {body.style.pointerEvents='auto';},1000);\r\n}", "function CALCULATE_TOUCH_UP_OR_MOUSE_UP() {\r\n \r\n GLOBAL_CLICK.CLICK_PRESSED = false;\r\n \r\n }", "function mouseClicked() {\n dropPoke();\n}", "clickUsingAction(element) {\r\n if (typeof element !== 'undefined') {\r\n element.isDisplayed(() => {\r\n element.isEnabled().then(() => {\r\n browser.actions().mouseMove(element).click().perform();\r\n return this;\r\n });\r\n });\r\n }\r\n }", "function allowUserClick() {\n blocks.forEach(function(i) {\n i.addEventListener('click', tileClicked);\n });\n\n function tileClicked() {\n this.classList.toggle('green');\n this.classList.toggle('blue');\n }\n }", "function onMouseUp(event) {\n if (preventMouseUp) {\n event.preventDefault();\n }\n }", "function onMouseUp(event) {\n if (preventMouseUp) {\n event.preventDefault();\n }\n }", "function onMouseUp(event) {\n if (preventMouseUp) {\n event.preventDefault();\n }\n }", "preventToggling(evt) {\n evt.stopPropagation();\n }", "function handleInput(e) {\n e.preventDefault();\n e.stopPropagation();\n if(inputBlocked === true) {\n console.log(\"you must wait!\");\n return;\n }\n var hole = convertMouseToHole(e);\n if(hole != null){\n console.log(\"tapped on a hole\", hole);\n holeTap(hole);\n }\n}", "function mouseMoveChart() {\n if (d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"]) {\n d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"].stopPropagation();\n m = d3__WEBPACK_IMPORTED_MODULE_6__[\"mouse\"](this);\n } else {\n current_hover = null;\n } //else\n //Find the nearest person to the mouse, within a distance of X pixels\n //Using the voronoi technique\n\n\n var found_hover = mouseNodeFind(m);\n found_edge = null;\n if (found_hover) showTooltip(found_hover); //If no node is found, check if an edge is clicked (only needed during an active click)\n\n if (click_active && !found_hover) found_edge = mouseEdgeFind(m); //Run the correct \"interaction\" event\n\n mouseMoveActions(found_hover, found_edge, m);\n } //function mouseMoveChart", "function mouseMoveChart() {\n if (d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"]) {\n d3__WEBPACK_IMPORTED_MODULE_6__[\"event\"].stopPropagation();\n m = d3__WEBPACK_IMPORTED_MODULE_6__[\"mouse\"](this);\n } else {\n current_hover = null;\n } //else\n //Find the nearest person to the mouse, within a distance of X pixels\n //Using the voronoi technique\n\n\n var found_hover = mouseNodeFind(m);\n found_edge = null;\n if (found_hover) showTooltip(found_hover); //If no node is found, check if an edge is clicked (only needed during an active click)\n\n if (click_active && !found_hover) found_edge = mouseEdgeFind(m); //Run the correct \"interaction\" event\n\n mouseMoveActions(found_hover, found_edge, m);\n } //function mouseMoveChart", "function mouseDragged() {\n if (!running) {\n var x = parseInt(mouseX / w);\n var y = parseInt(mouseY / h);\n if (pencil) {\n try {\n grid[x][y].obstacle = true;\n start.obstacle = false;\n } catch (error) {\n console.log(\"Click out of canvas\");\n }\n } else if (eraser) {\n try {\n grid[x][y].obstacle = false;\n } catch (error) {\n console.log(\"Click out of canvas\");\n }\n }\n\n if (cursorX !== x || cursorY !== y) {\n cursorX = x.valueOf();\n cursorY = y.valueOf();\n }\n }\n\n return false;\n}" ]
[ "0.6195161", "0.61032456", "0.6087628", "0.5988084", "0.5986663", "0.59572905", "0.59342206", "0.59142506", "0.5885774", "0.58741486", "0.5844347", "0.5826384", "0.5825309", "0.581425", "0.58091223", "0.5796191", "0.5796191", "0.57542074", "0.57468164", "0.5743162", "0.5732172", "0.5732172", "0.5732172", "0.5732172", "0.5732172", "0.5729759", "0.572757", "0.5719412", "0.5704381", "0.5693613", "0.56607175", "0.56462824", "0.5645809", "0.5635657", "0.56315255", "0.560683", "0.5598939", "0.55965775", "0.55965775", "0.5576144", "0.55736536", "0.5571762", "0.5568761", "0.55660206", "0.55572253", "0.5551347", "0.55480295", "0.55432904", "0.5543038", "0.5531696", "0.5531696", "0.5513198", "0.5500091", "0.54965556", "0.54886013", "0.5474725", "0.54642016", "0.5457576", "0.54515123", "0.54421943", "0.5438636", "0.543418", "0.54309297", "0.5426703", "0.5424393", "0.5421801", "0.5421235", "0.5420615", "0.54192615", "0.54181", "0.54176664", "0.54156035", "0.5415071", "0.5412024", "0.5411095", "0.5410014", "0.540891", "0.5407477", "0.540718", "0.54050905", "0.53983766", "0.53914744", "0.5391048", "0.53898424", "0.53825086", "0.53800374", "0.53800374", "0.53800374", "0.53683263", "0.5367083", "0.5360709", "0.5360709", "0.53594196" ]
0.55607754
51
globals __VUE_SSR_CONTEXT__ IMPORTANT: Do NOT use ES2015 features in this file (except for modules). This module is a runtime utility for cleaner component module output and will be included in the final webpack user bundle.
function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "extend(config, ctx) {\n // if (process.server && process.browser) {\n if (ctx.isDev && ctx.isClient) {\n config.devtool = \"source-map\";\n // if (isDev && process.isClient) {\n config.plugins.push(\n new StylelintPlugin({\n files: [\"**/*.vue\", \"**/*.scss\"],\n })\n ),\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n formatter: require(\"eslint-friendly-formatter\"),\n },\n });\n if (ctx.isDev) {\n config.mode = \"development\";\n }\n }\n for (const rule of config.module.rules) {\n if (rule.use) {\n for (const use of rule.use) {\n if (use.loader === \"sass-loader\") {\n use.options = use.options || {};\n use.options.includePaths = [\n \"node_modules/foundation-sites/scss\",\n \"node_modules/motion-ui/src\",\n ];\n }\n }\n }\n }\n // vue-svg-inline-loader\n const vueRule = config.module.rules.find((rule) =>\n rule.test.test(\".vue\")\n );\n vueRule.use = [\n {\n loader: vueRule.loader,\n options: vueRule.options,\n },\n {\n loader: \"vue-svg-inline-loader\",\n },\n ];\n delete vueRule.loader;\n delete vueRule.options;\n }", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}", "function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode, /* vue-cli only */\n components, // fixed by xxxxxx auto components\n renderjs // fixed by xxxxxx renderjs\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // fixed by xxxxxx auto components\n if (components) {\n if (!options.components) {\n options.components = {}\n }\n var hasOwn = Object.prototype.hasOwnProperty\n for (var name in components) {\n if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {\n options.components[name] = components[name]\n }\n }\n }\n // fixed by xxxxxx renderjs\n if (renderjs) {\n (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {\n this[renderjs.__module] = this\n });\n (options.mixins || (options.mixins = [])).push(renderjs)\n }\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functioal component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}" ]
[ "0.5847333", "0.57279235", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897", "0.57266897" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function createGridClipPath(cartesian, hasAnimation, seriesModel) { var rect = cartesian.getArea(); var isHorizontal = cartesian.getBaseAxis().isHorizontal(); var x = rect.x; var y = rect.y; var width = rect.width; var height = rect.height; var lineWidth = seriesModel.get('lineStyle.width') || 2; // Expand the clip path a bit to avoid the border is clipped and looks thinner x -= lineWidth / 2; y -= lineWidth / 2; width += lineWidth; height += lineWidth; // fix: https://github.com/apache/incubator-echarts/issues/11369 x = Math.floor(x); width = Math.round(width); var clipPath = new graphic.Rect({ shape: { x: x, y: y, width: width, height: height } }); if (hasAnimation) { clipPath.shape[isHorizontal ? 'width' : 'height'] = 0; graphic.initProps(clipPath, { shape: { width: width, height: height } }, seriesModel); } return clipPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1
Add animation to the view
function createGridClipShape(rect, seriesModel, cb) { var rectEl = new graphic.Rect({ shape: { x: rect.x - 10, y: rect.y - 10, width: 0, height: rect.height + 20 } }); graphic.initProps(rectEl, { shape: { width: rect.width + 20 } }, seriesModel, cb); return rectEl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Animation (){\n var animation = anime.timeline();\n \n animation.add({\n targets:'.animation',\n height:['100%',0],\n easing:'easeInOutCirc',\n delay:1200\n });\n \n \n }", "function Animation (){\n var animation = anime.timeline();\n \n animation.add({\n targets:'.animat',\n height:['100%',0],\n easing:'easeInOutCirc',\n delay:1200\n });\n \n \n }", "function animate() {\n // is element in view?\n if (inView()) {\n // element is in view, add class to element\n element.classList.add('animate');\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 }", "updateAnimation() {\n this.animator.animate();\n }", "animation() {}", "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}", "function modalAnimation() {}", "function animate(){\n\t\trequestAnimationFrame( animate );\n\t\trender();\n\t}", "function initAnimation() {\n}", "function animate(){\n\n\tanimateCloth();\n\trender();\n\trequestAnimationFrame( animate );\n\n\t\n}", "_startAnimation() {\n // @breaking-change 8.0.0 Combine with _resetAnimation.\n this._panelAnimationState = 'enter';\n }", "animate() {\n clickAnimation(\"#miracle_div\", this.target);\n }", "function initializeAnimationFramework(view) {\n view.on('frame', function() {\n for (const animation of _activeAnimations) {\n animation.step(animation);\n }\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 animate() {\r\n\r\n\trequestAnimationFrame( animate );\r\n\trender();\r\n\r\n}", "start() {\n this._enableAnimation = true;\n this._numberOfAnimationCycles = 0;\n }", "animate() {\n switch(this.options.effect) {\n case 'reveal':\n this.__reveal();\n break;\n \n case 'typewriter':\n this.__typewriter();\n break;\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}", "function animate() {\n\trequestAnimationFrame(animate);\n\trender();\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() {\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 }", "update() {\n this.animation.update()\n }", "function WR_Item_Animation() {\n\t \tif ( typeof ScrollReveal != 'undefined' ) {\n\t \t\twindow.sr = ScrollReveal().reveal( '.wr-item-animation', {\n\t \t\t\tduration: 700\n\t \t\t} );\n\t \t}\n\t }", "function animationAdded() {\n let animation = document.getElementById('addToCartAnimId');\n let delay = 1500;\n\n animation.className = 'addToCartAnimated';\n setTimeout(function () {\n animation.className = 'addToCartAnim';\n }, delay)\n}", "function doAnimation() {\n slideContainer.children[0].classList.add('moveSlide')\n slideContainer.children[1].classList.add('moveSlide')\n addAnimationEventToChild()\n}", "mounted() {\n this.animation = new Animation(this);\n this.animation.createMainTimeline();\n this.animation.play();\n }", "function animate(index){\n $rootScope.$emit('setAnimation',{index:index});\n }", "addAnimation(_animation, _frameStart = 0, _frameEnd = 0, _sound, _animWidth, _animHeight, _frameCount = 0) {\n this.animations.push({\n name: _animation,\n frameStart: _frameStart,\n frameEnd: _frameEnd,\n sound: _sound,\n animWidth: _animWidth,\n animHeight: _animHeight,\n frameCount: _frameCount\n })\n }", "function draw() {\n animationWrapper.classList.add('active')\n}", "animate(inCollection) {\n\n // Don't animate when not visible.\n if (!this.isVisible) { return; }\n\n // Adjust how often the animation occurs.\n this.frameSkipCount++;\n if (this.frameSkipCount < this.frameSkip) {\n return;\n }\n this.frameSkipCount = 0;\n\n // Hide the img of the current frame.\n this[`frame${this.currentFrame}`].style.display = \"none\";\n // Bump to the next frame, reset when it's time to wrap around.\n this.currentFrame++;\n if (this.currentFrame === this.frameCount) {\n this.currentFrame = 0;\n if (this.animationCallback) {\n this.animationCallback(inCollection);\n }\n }\n // Show the new current frame's img.\n this[`frame${this.currentFrame}`].style.display = \"\";\n\n }", "function animate() {\n requestAnimationFrame(animate);\n render();\n update();\n }", "updateAnimation() {\n return;\n }", "function animate() {\n requestAnimationFrame( animate );\n controls.update();\n render();\n }", "function animate() {\n window.requestAnimationFrame(function (now) {\n rotationDif = (now - lastFrame) * .001;\n settings.rotate += rotationDif * 2 * Math.PI * rotationSpeed;\n app.draw(settings);\n lastFrame = now;\n animate();\n });\n }", "function anim() {\r\n Loop();\r\n requestAnimFrame(anim);\r\n }", "addanimation(val,x,y){\n this.setState({\n xCor:x,\n yCor:y\n })\n if(val){\n let animateRow=document.getElementsByClassName(\"animateRow\")\n animateRow[0].classList.add(\"animateRowZIndex\")\n let animation=document.getElementsByClassName(\"animateId\")\n animation[0].classList.add(\"animateWishlistButton\");\n setTimeout(()=>{\n animateRow[0].classList.remove(\"animateRowZIndex\")\n animation[0].classList.remove(\"animateWishlistButton\");\n },1000)\n \n }\n }", "animate() {\n this.controls.update();\n if (this.motionPlayer !== null && this.vm_anim.playing) {\n this.motionPlayer.stepFrame(this.vm.vrmRoot, this.vrmRenderer);\n }\n this.renderer.render(this.scene, this.camera);\n requestAnimationFrame(() => this.animate());\n }", "function animate() {\n\trequestAnimFrame( animate );\n var scene = SceneManager.currentScene;\n scene.update();\n\trenderer.render(scene.stage);\n}", "function animate() {\n\treqAnimFrame(animate);\n\tcanvasDraw();\n}", "set importAnimation(value) {}", "function animate() {\r\n\tif (runAnim) {\r\n\t\trequestAnimationFrame(animate);\r\n\t}\r\n\trender();\r\n}", "function appModuleAnimation() {\r\n return slideFromBottom();\r\n}", "function animate() {\n requestAnimationFrame( animate );\n render();\n}", "function animate() {\n requestAnimationFrame(animate);\n update();\n render();\n }", "function wowAnimation() {\r\n new WOW({\r\n offset: 100,\r\n animateClass: \"animated\",\r\n mobile: true,\r\n }).init();\r\n }", "function animate() {\n requestAnimationFrame( animate );\n renderer.render( scene, camera );\n controls.update();\n }", "requestUpdateAnimations () {\n this.animationsUpdateNeeded = true;\n }", "function animate()\n{\n\trequestAnimationFrame(animate);\n \trenderer.render(scene, camera);\n}", "function animate() {\n requestAnimationFrame(animate);\n\n renderer.render(scene, camera);\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 Component_Animation() {\n Component_Animation.__super__.constructor.apply(this, arguments);\n this.name = \"animation\";\n }", "function animate() {\n\n window.requestAnimationFrame( animate );\n\n controls.update();\n renderer.render( scene, camera );\n\n}", "animateAppear() {\n if (defined(this._selectionIndicatorTween)) {\n if (this._selectionIndicatorIsAppearing) {\n // Already appearing; don't restart the animation.\n return;\n }\n this._selectionIndicatorTween.cancelTween();\n this._selectionIndicatorTween = undefined;\n }\n\n this._selectionIndicatorIsAppearing = true;\n\n var that = this;\n this._selectionIndicatorTween = this._tweens.add({\n startObject: {\n scale: 2.0,\n opacity: 0.0,\n rotate: -180\n },\n stopObject: {\n scale: 1.0,\n opacity: 1.0,\n rotate: 0\n },\n duration: 0.8,\n easingFunction: EasingFunction.EXPONENTIAL_OUT,\n update: function(value) {\n that.opacity = value.opacity;\n that.transform =\n \"scale(\" + value.scale + \") rotate(\" + value.rotate + \"deg)\";\n that.updateStyle();\n },\n complete: function() {\n that._selectionIndicatorTween = undefined;\n },\n cancel: function() {\n that._selectionIndicatorTween = undefined;\n }\n });\n }", "animate() {\n if (!window.actionDrivenRender)\n this.render();\n //aktualisiert die Camera\n //this.controls.update();\n //Zeichnet das Bild zum naechsten Visualisierungszeitpunkt (requestanimationFrame) und nimmt eine Callbackfunktion\n requestAnimationFrame(this.animate);\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 }", "animate() {\n this.update();\n this.draw();\n\n requestAnimationFrame(this.animationHandler);\n }", "function animationLogo() {\n logo.classList.add('logo-animate');\n}", "function addAnimation() {\n let scrollVertical = window.pageYOffset;\n if(scrollVertical > 20 && scrollVertical < 100) {\n // Projects headline animation\n headlineProject.className = \"bounce\";\n }\n if(scrollVertical > 333 && scrollVertical < 360) {\n for(let i = 0; i < 3; i++) {\n if(project[i].className === \"project\") {\n // First three project divs gets faded in, animation.\n project[i].className += \" fadeIn\";\n }\n }\n }\n if(scrollVertical > 550 && scrollVertical < 600) {\n for(let i = 3; i < project.length; i++) {\n if(project[i].className === \"project\") {\n // Last three project divs gets faded in, animation.\n project[i].className += \" fadeIn\";\n }\n }\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 }", "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 }", "didInsertElement() {\n var time = this.get('time') * 1000;\n this.$('.meter').animate({\n width: '100%'\n }, time );\n }", "animate(ctx){\n this.drawBackground(ctx);\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 }", "animate() {\r\n this.draw();\r\n\r\n this.renderer.render(this.scene, this.camera);\r\n\r\n requestAnimationFrame(this.animate.bind(this));\r\n }", "_animateIn() {\n\n setTimeout(() => {\n document.getElementById(this.id).className += \" animated zoomInLoader\";\n document.getElementById(this.id).style.display = \"\";\n }, 400);\n\n }", "function animate() {\n requestAnimationFrame(animate);\n render();\n}", "function animate() {\n requestAnimationFrame(animate);\n render();\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 animateIn() {\n\n chartRing.selectAll('.chart-ring')\n .style('opacity', 0)\n .transition()\n .duration(DURATION)\n .delay(function (d, i) {\n return (DELAY + (i * 100));\n })\n .style('opacity', 1);\n }", "function animate() {\n requestAnimationFrame(animate);\n renderer.render(stage);\n //checkHelp();\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 }", "static thumbAnimation(obj, params, name, duration) {\n const navigationAnimation = new R.AnimationClip(name, params);\n navigationAnimation.duration(duration);\n obj.animation.add(navigationAnimation);\n obj.animation.start(name);\n }", "function animate() {\n\n // Read more about requestAnimationFrame at http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n requestAnimationFrame(animate);\n \n // Render the scene.\n renderer.render(scene, camera);\n controls.update();\n\n }", "function startAnimation() {\n timerId = setInterval(updateAnimation, 16);\n }", "function addAnimation(elem, animClass) {\n elem.classList.add(animClass);\n}", "function animate() {\n requestAnimationFrame(animate);\n renderer.render(scene, camera);\n camera.orbitControls.update();\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{\r\n window.requestAnimationFrame( animate );\r\n\trender();\r\n\tTWEEN.update();\r\n}", "_enableAnimation() {\n this.isAnimatable = true;\n toggleClass(this.navEl, 'no-animation', !this.isAnimatable);\n }", "function animatie(){\n var timeline = new TimelineMax ({repeat:-1});\n timeline.to(\"#klok\", 50, {ease: Elastic.easeOut.config(10), y:6});\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 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}", "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 }", "mount() {\n this.updateAnimationControlsSubscription();\n }", "function animate() {\n\n\t\t // Read more about requestAnimationFrame at http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n\t\t requestAnimationFrame(animate);\n\t\t \n\t\t // Render the scene.\n\t\t renderer.render(scene, camera);\n\t\t controls.update();\n\n\t\t }", "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 }", "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 }", "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 }", "function animateContenedor(target){\n anime({\n targets: target,\n opacity: 1,\n easing: 'easeInOutQuad',\n delay: 80,\n autoplay: true\n });\n}", "function Animated() {\n this.payload = void 0;\n // This makes \"isAnimated\" return true.\n setAnimated(this, this);\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 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 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 }" ]
[ "0.7062568", "0.70235413", "0.6767325", "0.67139256", "0.6710684", "0.669293", "0.6676855", "0.65720755", "0.6497267", "0.6488997", "0.6447137", "0.63837045", "0.637486", "0.63446087", "0.629174", "0.62849635", "0.62760633", "0.62714154", "0.6268656", "0.6267167", "0.62433577", "0.62147284", "0.621454", "0.6191894", "0.61834997", "0.61525357", "0.61486423", "0.61464953", "0.61384106", "0.61202186", "0.6108623", "0.6093992", "0.6092458", "0.6060619", "0.6059903", "0.6055691", "0.6043276", "0.60311574", "0.60284376", "0.60252607", "0.60116684", "0.60000247", "0.5995823", "0.5991461", "0.59785134", "0.59756213", "0.59751016", "0.5974744", "0.5971124", "0.5959885", "0.5957762", "0.594503", "0.5934175", "0.5933158", "0.5929903", "0.5919675", "0.5915402", "0.59050083", "0.58995575", "0.58969396", "0.58969396", "0.58969396", "0.5896571", "0.589607", "0.58838665", "0.58838665", "0.58746535", "0.58733594", "0.5870395", "0.5870395", "0.5862028", "0.5844072", "0.584068", "0.5840618", "0.5835232", "0.5831217", "0.58309746", "0.5825137", "0.58220196", "0.5810052", "0.5807577", "0.5805321", "0.5801259", "0.5800489", "0.5800489", "0.5800489", "0.5800489", "0.57958055", "0.57951224", "0.57870096", "0.5784418", "0.5781205", "0.5781137", "0.5779713", "0.5779713", "0.5779713", "0.577864", "0.5777442", "0.5773879", "0.57682097", "0.57666594" ]
0.0
-1
FIXME performance and export for heatmap? value can be Infinity or Infinity
function getColorVisual(seriesModel, visualMapModel, value, valueState) { var mappings = visualMapModel.targetVisuals[valueState]; var visualTypes = VisualMapping.prepareVisualTypes(mappings); var resultVisual = { color: seriesModel.getData().getVisual('color') // default color. }; for (var i = 0, len = visualTypes.length; i < len; i++) { var type = visualTypes[i]; var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type]; mapping && mapping.applyVisual(value, getVisual, setVisual); } return resultVisual.color; function getVisual(key) { return resultVisual[key]; } function setVisual(key, value) { resultVisual[key] = value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeMaxRange(value) {\n let maxQuantity = sortedData[0].quantity;\n let minQuantity = sortedData[sortedData.length - 1].quantity;\n heatmap.setData(\n getWeightedPoints(sortedData, minQuantity, maxQuantity, value)\n );\n document.getElementById(\"sliderLabel\").innerHTML = value;\n}", "function heatMapColorforValue(value, maxValue){\n var h = (1.0 - value /maxValue) * 130;\n return \"hsl(\" + h + \", 100%, 50%)\";\n}", "function HeatNum(obj) {\n var value = obj.value.replace(/\\D/g, '');\n if (value > 30) {\n obj.value = 30;\n } else {\n obj.value = value;\n }\n}", "function heatMapColorforValue(value){\n const h = (1.0 - value) * 240;\n return \"hsl(\" + h + \", 100%, 50%)\";\n }", "function expand_heatmap_values(info) {\n var data = info.data, scales = info.scales, offsets = info.offsets,\n heatmap_values = [];\n for(var i = 0; i < data.lat.length; i++) {\n heatmap_values[i] = [\n data.lat[i] * scales.lat + offsets.lat,\n data.lng[i] * scales.lng + offsets.lng,\n data.val[i]\n ];\n }\n return heatmap_values;\n}", "function generateValues(normalize) {\r\n\t\t// each row\r\n\t\tfor (var y=0; y<height; y++) {\r\n\t\t\t// empty row\r\n\t\t\tvar row = [];\r\n\t\t\t// each column\r\n\t\t\tfor (var x=0; x<width; x++) {\r\n\t\t\t\t// Generate a value for the point, adjust the min/max as needed, push the value onto the row.\r\n\t\t\t\trow.push(stats(genAlgorithm(x,y)));\r\n\t\t\t}\r\n\t\t\t// Push the row onto the map.\r\n\t\t\theatMap.push(row);\r\n\t\t}\r\n\r\n\t\t// Normalize the values if requested.\r\n\t\tif (normalize) normalizeValues(this);\r\n\t}", "createValueFormatter() {\n let maxValue = 0;\n\n groupedStack(this.prepareData()).forEach((monthData) => {\n monthData.forEach((datum) => {\n datum.forEach(([lower, upper]) => {\n maxValue = Math.max(maxValue, Math.abs(lower), upper);\n });\n });\n });\n\n return this.createScaler(maxValue, this.model.get('unit'), {});\n }", "calcValueColMinMax() {\n let noNan = this.fillData.reduce((acc, cur) => {\n if (!isNaN(cur)) {\n acc.push(cur)\n }\n return acc\n }, [])\n // if the panehas a filter min and max set, scan datamin and max should be equal\n if (!isNaN(this.paneOb.valFilterMin)) {\n this.scanDatamin = this.paneOb.valFilterMin\n } else {\n /** These values are the min of the entire fillData provided to the canvas. This is used in linearly interpolating the color of the fill for a region if it has data. This is the minimum value */\n this.scanDatamin = Math.min(...noNan).toFixed(3)\n }\n if (!isNaN(this.paneOb.valFilterMax)) {\n this.scanDatamax = this.paneOb.valFilterMax\n\n } else {\n /** This is the maximum value of the fillData for the canvas. */\n this.scanDatamax = Math.max(...noNan).toFixed(3)\n }\n // this normalizes the value from the scan data into the range 0 to 1 for color interpolation\n /** color interpolators for fill */\n this.colInterpolator = interpolator()\n this.colInterpolator.setup(this.scanDatamin, 0, this.scanDatamax, 1)\n // calculate the min and maxes of the scan data for each scan\n }", "function salesHeatmap() {}", "function normalizeValues() {\r\n\t\t// each row\r\n\t\tfor (var y=0; y<height; y++) {\r\n\t\t\t// each column\r\n\t\t\tfor (var x=0; x<width; x++) {\r\n\t\t\t\t// Adjust the value based on how far it is from the minimum as a percentage of the range.\r\n\t\t\t\theatMap[x][y] = ((heatMap[x][y]-min)/(max-min));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "getValueFromView() {\n return (this.minValue + (this.valueWidth * this.getPercentage())).toFixed(0);\n }", "function maxVal(value, row){\n\n\n var max = options.scale.ticks.max;\n if ( value > max ){\n value = max;\n jQuery(row).find('.data-value').val(value);\n }\n return value;\n}", "_toPixelScale(value) {\n const rangeToTrack = this._trackTotalLength / (this.props.max - this.props.min);\n return (value - this.props.min) * rangeToTrack;\n }", "function filterMag(value) {\r\n document.getElementById(\"slider-value\").innerHTML = value;\r\n svg.selectAll(\"circle\").style(\"opacity\", function(d) {\r\n return (value < d.properties.mag) ? 1 : 0;\r\n });\r\n }", "function graphValue(value, min, max, size) {\n var scale = size / (max - min);\n return Math.floor(scale * (value - min));\n}", "function graphValue(value, min, max, size) {\n var scale = size / (max - min);\n return Math.floor(scale * (value - min));\n}", "function graphValue(value, min, max, size) {\n var scale = size / (max - min);\n return Math.floor(scale * (value - min));\n}", "set intensity(value) {}", "updateValue(value) {\n const that = this.context;\n\n value = value instanceof JQX.Utilities.BigNumber ? value : new JQX.Utilities.BigNumber(value);\n\n const renderedValue = this.validate(value, that._minObject, that._maxObject);\n let oldValue = that.value,\n valueDetail, difference;\n\n that._number = renderedValue;\n that._drawValue = that.logarithmicScale ? Math.log10(renderedValue) : renderedValue;\n\n if (that.mode === 'numeric') {\n valueDetail = value.toString();\n that.value = valueDetail;\n difference = this.compare(value, oldValue);\n }\n else {\n oldValue = JQX.Utilities.DateTime.fromFullTimeStamp(oldValue);\n that._valueDate = JQX.Utilities.DateTime.fromFullTimeStamp(value);\n that.value = value;\n value = that._valueDate;\n valueDetail = value;\n difference = value.compare(oldValue) !== 0;\n }\n\n if (!that._programmaticValueIsSet && (difference || that._scaleTypeChangedFlag)) {\n that.$.fireEvent('change', { 'value': valueDetail, 'oldValue': oldValue });\n }\n\n if (that.$.hiddenInput) {\n that.$.hiddenInput.value = value;\n }\n\n that._moveThumbBasedOnValue(that._drawValue);\n }", "function recursiveConvert(value){if(Chartist.safeHasProperty(value,'value')){// We are dealing with value object notation so we need to recurse on value property\nreturn recursiveConvert(value.value);}else if(Chartist.safeHasProperty(value,'data')){// We are dealing with series object notation so we need to recurse on data property\nreturn recursiveConvert(value.data);}else if(value instanceof Array){// Data is of type array so we need to recurse on the series\nreturn value.map(recursiveConvert);}else if(Chartist.isDataHoleValue(value)){// We're dealing with a hole in the data and therefore need to return undefined\n// We're also returning undefined for multi value output\nreturn undefined;}else {// We need to prepare multi value output (x and y data)\nif(multi){var multiValue={};// Single series value arrays are assumed to specify the Y-Axis value\n// For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n// If multi is a string then it's assumed that it specified which dimension should be filled as default\nif(typeof multi==='string'){multiValue[multi]=Chartist.getNumberOrUndefined(value);}else {multiValue.y=Chartist.getNumberOrUndefined(value);}multiValue.x=value.hasOwnProperty('x')?Chartist.getNumberOrUndefined(value.x):multiValue.x;multiValue.y=value.hasOwnProperty('y')?Chartist.getNumberOrUndefined(value.y):multiValue.y;return multiValue;}else {// We can return simple data\nreturn Chartist.getNumberOrUndefined(value);}}}", "function plotHumidity(timeValue, value){\n console.log(timeValue);\n var x = new Date(timeValue*1000).getTime();\n console.log(x);\n var y = Number(value);\n if(chartH.series[0].data.length > 40) {\n chartH.series[0].addPoint([x, y], true, true, true);\n } else {\n chartH.series[0].addPoint([x, y], true, false, true);\n }\n}", "renderSliderValues(lowestValue, highestValue) {\n const columndId = this.columnDef && this.columnDef.id;\n const lowerElm = document.querySelector(`.lowest-range-${columndId}`);\n const highestElm = document.querySelector(`.highest-range-${columndId}`);\n if (lowerElm && lowerElm.innerHTML) {\n lowerElm.innerHTML = lowestValue.toString();\n }\n if (highestElm && highestElm.innerHTML) {\n highestElm.innerHTML = highestValue.toString();\n }\n }", "renderSliderValues(lowestValue, highestValue) {\n const columndId = this.columnDef && this.columnDef.id;\n const lowerElm = document.querySelector(`.lowest-range-${columndId}`);\n const highestElm = document.querySelector(`.highest-range-${columndId}`);\n if (lowerElm && lowerElm.innerHTML) {\n lowerElm.innerHTML = lowestValue.toString();\n }\n if (highestElm && highestElm.innerHTML) {\n highestElm.innerHTML = highestValue.toString();\n }\n }", "function statisticFilterFunction(d, i){\r\n\t\t/*$scope.chartIgnoreZeroValues = $scope.chartIgnoreZeroValues ? $scope.chartIgnoreZeroValues : false*/\r\n\t\tif($scope.chartIgnoreZeroValues===\"true\"){\r\n\t\t\t if (typeof(parseFloat(d.VALUE)) === 'number' && parseFloat(d.VALUE) > 0) {\r\n\t \t\treturn true;\r\n\t \t\t} else {\t\t\r\n\t\t \treturn false;\r\n\t \t\t}\r\n \t\t}\r\n \t\treturn true;\r\n\t}", "function handleUniqueBrushValue() {\n if (ctrl.brush.empty()) {\n var min = ctrl.brush.extent()[0];\n var max = ctrl.brush.extent()[1];\n var exp = '1e-' + (nbDecimals + 2);\n svg.select('.brush').call(ctrl.brush.clear().extent([min, max + Number(exp)]));\n }\n }", "function scaleInvert(value, maxVal, height)\n{\n return (1 - value/maxVal) * height;\n}", "function filterTics(value) {\r\n var ticMajor;\r\n if ($(\".slider\").attr(\"data-tickMajor\") != null) {\r\n ticMajor = parseInt($(\".slider\").attr(\"data-tickMajor\"));\r\n }\r\n if (ticMajor) {\r\n value = value % ticMajor ? 0 : 1;\r\n } else {\r\n value = 0;\r\n }\r\n\r\n return value;\r\n }", "createValueLabels(data) {\n\n if (!data || data.length === 0) return;\n\n this.svg.selectAll('.value').data(data).enter().append('text')\n .attr('class', 'value')\n .attr('x', (d) => {return this.x(d.x)})\n .attr('y', (d) => {if (d.y === 0) return; return this.y(d.y) - this.textPaddingV})\n .attr('fill', this.theme.value)\n .style('text-anchor', 'middle')\n .style('font-size', 12)\n .text((d) => {return this.props.valueLabelTransform(d.y)})\n\n }", "function scaleInvert(value, minVal, maxVal, height) {\n return (1 - (value - minVal) / (maxVal - minVal)) * height\n}", "full(value)\n\t{\n\t\tthis.rows.push({\n\t\t\ttype: 'full',\n\t\t\tdata: String(value),\n\t\t\tdiv: false\n\t\t});\n\n\t\tthis.width = Math.max(this.width, 1);\n\t}", "function convertOthers(data) {\n // Get max value to plot\n var maxX = 0\n for(var i = 0; i < data.length; i++) {\n var d = data[i]\n if(d.limit > maxX) maxX = d.limit\n if(d.max > maxX) maxX = d.max\n if(d.cpu > maxX) maxX = d.cpu\n if(d.ewma > maxX) maxX = d.ewma\n if(d.reject > maxX) maxX = d.reject\n }\n // Convert all values to a [0,1] range\n for(var i = 0; i < data.length; i++) {\n var d = data[i]\n d.limit /= maxX\n d.max /= maxX\n d.cpu /= maxX\n d.ewma /= maxX\n d.reject /= maxX\n }\n return data\n}", "function heatmapOnChange(val) {\n val = val.getFullYear()\n if (prevVal !== val){\n var isChange = Math.abs(prevVal - val) > 3\n updateMap(val, isChange)\n prevVal = val;\n }\n}", "function choropleth(props, colorScale){\n var value = parseFloat(props[expressed]);\n\n if(isNaN(value)){\n return \"grey\";//no value\n } else if (value==0){\n return \"lightgrey\";//for case of Political_Filtering with a score of 0\n } else{\n return colorScale(value);\n }\n }", "function recursiveConvert(value) {\n\t if(Chartist.isFalseyButZero(value)) {\n\t // This is a hole in data and we should return undefined\n\t return undefined;\n\t } else if((value.data || value) instanceof Array) {\n\t return (value.data || value).map(recursiveConvert);\n\t } else if(value.hasOwnProperty('value')) {\n\t return recursiveConvert(value.value);\n\t } else {\n\t if(multi) {\n\t var multiValue = {};\n\t\n\t // Single series value arrays are assumed to specify the Y-Axis value\n\t // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n\t // If multi is a string then it's assumed that it specified which dimension should be filled as default\n\t if(typeof multi === 'string') {\n\t multiValue[multi] = Chartist.getNumberOrUndefined(value);\n\t } else {\n\t multiValue.y = Chartist.getNumberOrUndefined(value);\n\t }\n\t\n\t multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n\t multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\t\n\t return multiValue;\n\t\n\t } else {\n\t return Chartist.getNumberOrUndefined(value);\n\t }\n\t }\n\t }", "renderer({ value, cellElement }) {\n value = value || 0;\n\n if (!cellElement.percentBarElement) {\n cellElement.percentBarElement = DomHelper.createElement(\n {\n tag: 'div',\n className: 'b-percent-bar-outer',\n parent: cellElement,\n children: [\n {\n tag: 'div',\n className: 'b-percent-bar',\n html: '%'\n }\n ]\n },\n true\n )[1];\n }\n\n const { percentBarElement } = cellElement;\n\n percentBarElement.classList[value === 0 ? 'add' : 'remove']('b-zero');\n\n percentBarElement.classList[value < this.lowThreshold ? 'add' : 'remove']('b-low');\n\n percentBarElement.style.width = value + '%';\n percentBarElement.firstChild.data = value + '%';\n }", "function drawHeatMapValues(heatMapValues, outputStride, canvas) {\n var ctx = canvas.getContext('2d');\n var radius = 5;\n var scaledValues = heatMapValues.mul(tf.scalar(outputStride, 'int32'));\n drawPoints(ctx, scaledValues, radius, color);\n}", "function showValue(evt, obj) {\n //Using showValue attribute to show hide gauge value\n if(showVal.checked) {\n fuelWidget.setChartAttribute('showValue', 1);\n }\n else{\n fuelWidget.setChartAttribute('showValue', 0);\n }\n }", "function getZForValueAndRange(val, range) {\n var d = width > height ? width : height;\n\n return ( d / 10 * val / range[1] );\n }", "function valueDistortion(value) {\n return value;\n }", "get value(){ \r\n return { \r\n min : this._value[ 0 ], \r\n max : this._value[ 1 ]\r\n };\r\n }", "function getPositivePercentValue(val) { return val / currentSerie.maxRange * 100; }", "function scale_one_dot(height, value, dataMax, dataMin) {\n return (height * ((value - dataMin) / (dataMax - dataMin)));\n}", "updateValue(value) {\n const that = this.context,\n renderedValue = this.validate(value, that._minObject, that._maxObject),\n oldActualValue = that.value;\n\n if (value.toString() !== oldActualValue.toString() || that._scaleTypeChangedFlag) {\n that.value = value.toString();\n that._number = renderedValue;\n\n if (!that._programmaticValueIsSet) {\n that.$.fireEvent('change', { 'value': that.value, 'oldValue': oldActualValue });\n }\n }\n else {\n that.value = typeof (value) === 'string' ? value : value.toString();\n }\n\n that._drawValue = that.logarithmicScale ? Math.log10(renderedValue).toString() : renderedValue.toString();\n that._moveThumbBasedOnValue(that._drawValue);\n\n if (that.$.hiddenInput) {\n that.$.hiddenInput.value = that.value;\n }\n }", "static emptyHeatmapJson() {\n let max_time = 14*6; //14 hours in 10 minute increments\n let incrementLabels = []//new Array(max_time).fill(' ');\n let noon = 24; // 4*2*3 = 4 hours in 30 minute chunks\n let mins = ':00'\n for (let i = 0, hours = 8; i < max_time; i += 6) {\n let ampm = i < noon ? 'a': 'p';\n if (i && i % 6 == 0)\n hours = (hours % 12) + 1;\n\n //mins = i % 2 == 0 ? ':00' : ':30';\n incrementLabels.push(hours + mins + ampm);\n }\n \n let empty_heatmap = [...Array(max_time)].map(() => Array(5).fill(0));\n console.log(JSON.stringify(empty_heatmap));\n\n let heatmap_data = {\n init: \"init\",\n weekdayNames: [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\"],\n timeIncrements: incrementLabels,\n heatmap: empty_heatmap\n };\n return heatmap_data;\n }", "function zoom(value) {\n return value * zoomLevel;\n}", "function recursiveConvert(value) {\n if (Chartist.isFalseyButZero(value)) {\n // This is a hole in data and we should return undefined\n return undefined;\n } else if ((value.data || value) instanceof Array) {\n return (value.data || value).map(recursiveConvert);\n } else if (value.hasOwnProperty('value')) {\n return recursiveConvert(value.value);\n } else {\n if (multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if (typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }", "get_heatmap_value(timestep,data){\n data = data.filter(function(d){\n return +d.x == timestep;\n });\n\n return data.length;\n }", "function undoColorStretch(val) {\n return Math.pow(val, POPULATION_VIS_NONLINEARITY) * POPULATION_VIS_MAX_VALUE;\n}", "ValueToPosition(value){\n\t\tif(typeof this.settings.min !== 'undefined' \n\t\t&& typeof this.settings.max !== 'undefined'){\n\t\t\treturn ((value-this.settings.min)/(this.settings.max - this.settings.min))*100\n\t\t}\n\t\treturn 0\n\t}", "defaultRenderer({ value }) {\n value = value || 0;\n\n return {\n className : 'b-percent-bar-outer',\n children : [\n {\n tag : 'div',\n className : {\n 'b-percent-bar' : 1,\n 'b-zero' : value === 0,\n 'b-low' : value < this.lowThreshold\n },\n style : {\n width : value + '%'\n },\n html : value + '%'\n }\n ]\n };\n }", "function getNegativePercentValue(val) { return val / Math.abs(currentSerie.minRange) * 100; }", "function recursiveConvert(value) {\n if (Chartist.safeHasProperty(value, 'value')) {\n // We are dealing with value object notation so we need to recurse on value property\n return recursiveConvert(value.value);\n } else if (Chartist.safeHasProperty(value, 'data')) {\n // We are dealing with series object notation so we need to recurse on data property\n return recursiveConvert(value.data);\n } else if (value instanceof Array) {\n // Data is of type array so we need to recurse on the series\n return value.map(recursiveConvert);\n } else if (Chartist.isDataHoleValue(value)) {\n // We're dealing with a hole in the data and therefore need to return undefined\n // We're also returning undefined for multi value output\n return undefined;\n } else {\n // We need to prepare multi value output (x and y data)\n if (multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if (typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n // We can return simple data\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }", "function fillXAxis(maxVal, params) {\n params.xStart = CHART_RECT.left;\n params.xDiff = 1;\n params.xSize = maxVal;\n }", "snpMDG(v) {\n // console.log(v)\n // console.log(Math.round(v/this.cellSize/this.scale) * this.cellSize/this.scale)\n return Math.round(v/this.cellSize) * this.cellSize\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "writeValue(value) {\n this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n }", "function recursiveConvert(value) {\n if (Chartist.safeHasProperty(value, 'value')) {\n // We are dealing with value object notation so we need to recurse on value property\n return recursiveConvert(value.value);\n } else if (Chartist.safeHasProperty(value, 'data')) {\n // We are dealing with series object notation so we need to recurse on data property\n return recursiveConvert(value.data);\n } else if (value instanceof Array) {\n // Data is of type array so we need to recurse on the series\n return value.map(recursiveConvert);\n } else if (Chartist.isDataHoleValue(value)) {\n // We're dealing with a hole in the data and therefore need to return undefined\n // We're also returning undefined for multi value output\n return undefined;\n } else {\n // We need to prepare multi value output (x and y data)\n if (multi) {\n var multiValue = {}; // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n\n if (typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n return multiValue;\n } else {\n // We can return simple data\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }", "function plotTemperature(timeValue, value){\n console.log(timeValue);\n var x = new Date(timeValue*1000).getTime();\n console.log(x);\n var y = Number(value);\n if(chartT.series[0].data.length > 40) {\n chartT.series[0].addPoint([x, y], true, true, true);\n } else {\n chartT.series[0].addPoint([x, y], true, false, true);\n }\n}", "get unknownValuePlotting() {\r\n return this.i.ov;\r\n }", "function EW_WriteParamValues(){\n if(state ==\"fixed_values\"){\n var index = cutoff_arr.length-1;\n var val = Number((cutoff_arr[index]).toFixed(2))\n // $(\"#graphparam1\").text(\"Max Ew: \"+max_ew);\n $(\"#graphparam2\").text(\"Cutoff Frequency: \"+val);\n }\n else if(state ==\"range_values\"){ \n // $(\"#graphparam1\").text(\"\");\n $(\"#graphparam2\").text(\"\");\n }\n}", "get intensity() {}", "get unknownValuePlotting() {\n return this.i.ou;\n }", "function render_value(val) {\n if (_.isNumber(val)) {\n val = Math.round(val * 100) / 100;\n return val < 0 ? '<span class=\"negval\">(' + Math.abs(val) + ')</span>' : val;\n } else {\n return val;\n }\n }", "function choropleth(props, colorScale){\n var val = parseFloat(props[expressed]);\n \n if (typeof val == 'number' && !isNaN(val)){\n return colorScale(val);\n } else {\n return \"#CCC\";\n };\n }", "getHeatMap() {\n\n if(this.activePollutant == null || this.stateDataArray == null || this.stateDataArray.length == 0) return null;\n\n switch(this.activePollutant.toUpperCase()) {\n\n case 'CARBON MONOXIDE' :\n return d3.scaleLinear()\n .domain([0,d3.max(this.stateDataArray, function(d) { if(d) return d['CO'] })])\n .interpolate(d3.interpolateRgb)\n .range([\"#f9fbe7\",\"#c0ca33\"]);\n break;\n\n case 'SULPHUR DIOXIDE' :\n return d3.scaleLinear()\n .domain([0,d3.max(this.stateDataArray, function(d) { if(d) return d['SO2'] })])\n .interpolate(d3.interpolateRgb)\n .range([\"#ffeda0\",\"#f03b20\"]);\n break;\n\n case 'NITROUS OXIDE' :\n return d3.scaleLinear()\n .domain([0,d3.max(this.stateDataArray, function(d) { if(d) return d['NO2'] })])\n .interpolate(d3.interpolateRgb)\n .range([\"#fde0dd\",\"#c51b8a\"]);\n break;\n\n case 'OZONE' :\n return d3.scaleLinear()\n .domain([0,d3.max(this.stateDataArray, function(d) { if(d) return d['O3'] })])\n .interpolate(d3.interpolateRgb)\n .range([\"#ece2f0\",\"#1c9099\"]);\n\n default: return null;\n }\n \n }", "buildValue (hoveredCell) {\r\n const { radius, angle, angle0 } = hoveredCell\r\n const truedAngle = (angle + angle0) / 2\r\n return {\r\n x: radius * Math.cos(truedAngle),\r\n y: radius * Math.sin(truedAngle)\r\n }\r\n }", "function heatmapLayer(values) {\n var data = new ol.source.Vector();\n\n for (var i = 0; i< values.length; i++) {\n var v = values[i];\n var coord = ol.proj.transform([v[0], v[1]],'EPSG:4326', 'EPSG:3857');\n var lonLat = new ol.geom.Point(coord);\n var pointFeature = new ol.Feature({\n geometry: lonLat,\n weight:v[2]\n });\n\n data.addFeature(pointFeature);\n }\n \n //building the heatmap layer\n var heatmapLayer = new ol.layer.Heatmap({\n source:data,\n radius:50,\n opacity:0.9\n });\n\n return heatmapLayer;\n}", "writeValue(value) {\n this.setProperty('value', parseFloat(value));\n }", "function buildHeatmapCellTooltip (pValue, tstatistic, foldChange) {\n\n return \"<table class='gxaWebpackTableGrid' style='margin: 0; padding: 0;'>\" +\n \"<thead>\" +\n (pValue !== undefined ?\n \"<th class='gxaWebpackHeaderCell'>Adjusted <i>p</i>-value</th>\" : \"\") +\n (tstatistic !== undefined ?\n \"<th class='gxaWebpackHeaderCell'><i>t</i>-statistic</th>\" : \"\") +\n \"<th class='gxaWebpackHeaderCell'>Log<sub>2</sub>-fold change</th>\" +\n \"</thead>\" +\n \"<tbody>\" +\n \"<tr>\" +\n (pValue !== undefined ?\n \"<td style='padding:6px'>\" + ReactDOMServer.renderToStaticMarkup(NumberFormat.scientificNotation(pValue)) + \"</td>\" : \"\") +\n (tstatistic !== undefined ?\n \"<td style='padding:6px'>\" + tstatistic + \"</td>\" : \"\") +\n \"<td style='padding:6px'>\" + foldChange + \"</td>\" +\n \"</tr>\" +\n \"</tbody>\" +\n \"</table>\";\n }", "validateColorRange(value) {\n const that = this.context;\n\n if (that._wordLengthNumber < 64) {\n return super.validateColorRange(value);\n }\n\n if (that.mode === 'numeric') {\n value = new JQX.Utilities.BigNumber(value);\n }\n else {\n value = JQX.Utilities.DateTime.validateDate(value);\n value = value.getTimeStamp();\n }\n\n const bigMin = new JQX.Utilities.BigNumber(that.min),\n bigMax = new JQX.Utilities.BigNumber(that.max);\n\n if (value.compare(bigMin) === -1) {\n value = bigMin;\n }\n\n if (value.compare(bigMax) === 1) {\n value = bigMax;\n }\n\n return value;\n }", "set Charting(value) {}", "function formatValue(outputValue) {\n if (outputValue.displayType === \"chart\") {\n return (React.createElement(chart_1.Chart, { chartDef: outputValue.data }));\n }\n if (outputValue.displayType === \"table\") {\n return (React.createElement(table_1.Table, { data: outputValue.data.rows, columnNames: outputValue.data.columnNames }));\n }\n if (outputValue.displayType === \"dataframe\") {\n let df = data_forge_1.DataFrame.deserialize(outputValue.data);\n const columnNames = df.getColumnNames();\n const amt = df.count();\n df = df.zip(df.getIndex().head(amt), (row, index) => {\n row.__index__ = index;\n return row;\n });\n return (React.createElement(table_1.Table, { data: df.toArray(), columnNames: [\"__index__\"].concat(columnNames) }));\n }\n if (outputValue.displayType === \"series\") {\n const df = data_forge_1.DataFrame.deserialize(outputValue.data); //TODO: be nice to just be able to deserialize a series.\n const series = df.getSeries(\"__value__\");\n const amt = series.count();\n const df2 = series.inflate((value) => ({ __value__: value }))\n .zip(series.getIndex().head(amt), (row, index) => {\n row.__index__ = index;\n return row;\n });\n return (React.createElement(table_1.Table, { data: df2.toArray(), columnNames: [\"__index__\", \"__value__\"] }));\n }\n if (outputValue.displayType === \"object\") {\n return React.createElement(json_1.JsonViewer, { model: outputValue.data });\n }\n if (outputValue.displayType === \"array\") {\n return React.createElement(json_1.JsonViewer, { model: outputValue.data });\n }\n if (outputValue.displayType === \"string\") {\n return React.createElement(general_1.General, { value: outputValue.data });\n }\n if (outputValue.displayType === \"html\") {\n return React.createElement(html_1.Html, { value: outputValue.data });\n }\n // Default.\n return React.createElement(general_1.General, { value: outputValue.data.toString() });\n}", "defaultRenderer({\n value\n }) {\n value = value || 0;\n return {\n className: 'b-percent-bar-outer',\n children: [{\n tag: 'div',\n className: {\n 'b-percent-bar': 1,\n 'b-zero': value === 0,\n 'b-low': value < this.lowThreshold\n },\n style: {\n width: value + '%'\n },\n html: value + '%'\n }]\n };\n }", "remap(value) {\n\t\tif (!FormatUtils.isNumber(value) && !FormatUtils.canBeNumber(value)) \n\t\t\treturn null;\n\n\t\tvalue = Number(value);\n\t\tlet remapped = null;\n\t\tif (value >= 0.0 && value <= 1.0)\n\t\t\tremapped = this.#min + value * this.#range; \n\n\t\treturn remapped;\n\t}", "function computeValues() {\n\t\t\t\n\t\t\tvar scaler;\n\t\t\t// deal with loop\n\t\t\tif (repeat > 0) {\n\t\t\t\t// not first run, save last scale ratio\n\t\t\t\txFrom = xTo;\n\t\t\t\tyFrom = yTo;\n\t\t\t\tratioFrom = ratioTo;\n\t\t\t} else {\n\t\t\t\t// get the scaler using conf options\n\t\t\t\tscaler = $.pixelentity.Geom.getScaler(zoom == \"out\" ? \"fill\" : \"none\",align.w,align.h,w,h,tw,th);\n\t\t\t\txFrom = scaler.offset.w;\n\t\t\t\tyFrom = scaler.offset.h;\n\t\t\t\tratioFrom = scaler.ratio;\n\t\t\t}\n\t\t\t\n\t\t\tscaler = $.pixelentity.Geom.getScaler(zoom == \"in\" ? \"fill\" : \"none\",pan.w,pan.h,w,h,tw,th);\n\t\t\txTo = scaler.offset.w;\n\t\t\tyTo = scaler.offset.h;\n\t\t\tratioTo = scaler.ratio;\n\t\t\t\n\t\t\txPrev = 0;\n\t\t\tyPrev = 0;\n\t\t\t\n\t\t\tduration = parseFloat(normalized)*33;\n\t\t\t\n\t\t\t// reset counter\n\t\t\tcounter = 0;\n\t\t\t\n\t\t\t// update runs count\n\t\t\trepeat++;\n\t\t\t\n\t\t}", "function valueMapRange(value, inValueX, inValueY, outValueX, outValueY) {\n return (value - inValueX) * (outValueY - outValueX) / (inValueY - inValueX) + outValueX;\n}", "mapDataPoint (value, in_min, in_max, out_min, out_max) {\n // Shift negative values up into positive range\n if (in_min < 0 || in_max < 0) {\n in_max = in_max + -in_min\n value = value + -in_min\n in_min = in_min + -in_min\n }\n return out_min + (out_max - out_min) * ((value - in_min) / (in_max - in_min))\n }", "function recursiveConvert(value) {\n if(Chartist.safeHasProperty(value, 'value')) {\n // We are dealing with value object notation so we need to recurse on value property\n return recursiveConvert(value.value);\n } else if(Chartist.safeHasProperty(value, 'data')) {\n // We are dealing with series object notation so we need to recurse on data property\n return recursiveConvert(value.data);\n } else if(value instanceof Array) {\n // Data is of type array so we need to recurse on the series\n return value.map(recursiveConvert);\n } else if(Chartist.isDataHoleValue(value)) {\n // We're dealing with a hole in the data and therefore need to return undefined\n // We're also returning undefined for multi value output\n return undefined;\n } else {\n // We need to prepare multi value output (x and y data)\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n // We can return simple data\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }", "function recursiveConvert(value) {\n if(Chartist.safeHasProperty(value, 'value')) {\n // We are dealing with value object notation so we need to recurse on value property\n return recursiveConvert(value.value);\n } else if(Chartist.safeHasProperty(value, 'data')) {\n // We are dealing with series object notation so we need to recurse on data property\n return recursiveConvert(value.data);\n } else if(value instanceof Array) {\n // Data is of type array so we need to recurse on the series\n return value.map(recursiveConvert);\n } else if(Chartist.isDataHoleValue(value)) {\n // We're dealing with a hole in the data and therefore need to return undefined\n // We're also returning undefined for multi value output\n return undefined;\n } else {\n // We need to prepare multi value output (x and y data)\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n // We can return simple data\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }", "function recursiveConvert(value) {\n if(Chartist.safeHasProperty(value, 'value')) {\n // We are dealing with value object notation so we need to recurse on value property\n return recursiveConvert(value.value);\n } else if(Chartist.safeHasProperty(value, 'data')) {\n // We are dealing with series object notation so we need to recurse on data property\n return recursiveConvert(value.data);\n } else if(value instanceof Array) {\n // Data is of type array so we need to recurse on the series\n return value.map(recursiveConvert);\n } else if(Chartist.isDataHoleValue(value)) {\n // We're dealing with a hole in the data and therefore need to return undefined\n // We're also returning undefined for multi value output\n return undefined;\n } else {\n // We need to prepare multi value output (x and y data)\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n // We can return simple data\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }", "function recursiveConvert(value) {\n if(Chartist.safeHasProperty(value, 'value')) {\n // We are dealing with value object notation so we need to recurse on value property\n return recursiveConvert(value.value);\n } else if(Chartist.safeHasProperty(value, 'data')) {\n // We are dealing with series object notation so we need to recurse on data property\n return recursiveConvert(value.data);\n } else if(value instanceof Array) {\n // Data is of type array so we need to recurse on the series\n return value.map(recursiveConvert);\n } else if(Chartist.isDataHoleValue(value)) {\n // We're dealing with a hole in the data and therefore need to return undefined\n // We're also returning undefined for multi value output\n return undefined;\n } else {\n // We need to prepare multi value output (x and y data)\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n // We can return simple data\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }", "function recursiveConvert(value) {\n if(Chartist.safeHasProperty(value, 'value')) {\n // We are dealing with value object notation so we need to recurse on value property\n return recursiveConvert(value.value);\n } else if(Chartist.safeHasProperty(value, 'data')) {\n // We are dealing with series object notation so we need to recurse on data property\n return recursiveConvert(value.data);\n } else if(value instanceof Array) {\n // Data is of type array so we need to recurse on the series\n return value.map(recursiveConvert);\n } else if(Chartist.isDataHoleValue(value)) {\n // We're dealing with a hole in the data and therefore need to return undefined\n // We're also returning undefined for multi value output\n return undefined;\n } else {\n // We need to prepare multi value output (x and y data)\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n // We can return simple data\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }", "function recursiveConvert(value) {\n if(Chartist.safeHasProperty(value, 'value')) {\n // We are dealing with value object notation so we need to recurse on value property\n return recursiveConvert(value.value);\n } else if(Chartist.safeHasProperty(value, 'data')) {\n // We are dealing with series object notation so we need to recurse on data property\n return recursiveConvert(value.data);\n } else if(value instanceof Array) {\n // Data is of type array so we need to recurse on the series\n return value.map(recursiveConvert);\n } else if(Chartist.isDataHoleValue(value)) {\n // We're dealing with a hole in the data and therefore need to return undefined\n // We're also returning undefined for multi value output\n return undefined;\n } else {\n // We need to prepare multi value output (x and y data)\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n // We can return simple data\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }", "getCoercedValue(value, useDrawVariables, logarithmicGauge) {\n const that = this.context;\n\n if (!that.coerce) {\n return value;\n }\n\n const normalScale = !that.logarithmicScale;\n\n value = value instanceof JQX.Utilities.BigNumber ? value : new JQX.Utilities.BigNumber(value);\n\n let minValue, maxValue;\n\n if (that.customInterval) {\n const customTicks = that.customTicks;\n\n if (customTicks.length === 0) {\n return value;\n }\n\n let difference, closestValue;\n\n if (normalScale || logarithmicGauge) {\n minValue = that._minObject;\n difference = minValue.subtract(value).abs();\n closestValue = minValue;\n\n for (let i = 0; i < customTicks.length; i++) {\n const currentTickObject = this.createDescriptor(customTicks[i]),\n currentDifference = currentTickObject.subtract(value).abs();\n\n if (currentDifference.compare(difference) === -1) {\n difference = currentDifference;\n closestValue = currentTickObject;\n }\n }\n }\n else {\n minValue = that._drawMin;\n difference = Math.abs(minValue - parseFloat(value.toString()));\n closestValue = minValue;\n\n for (let i = 0; i < customTicks.length; i++) {\n const currentTickObject = Math.log10(customTicks[i]),\n currentDifference = Math.abs(currentTickObject - value);\n\n if (currentDifference < difference) {\n difference = currentDifference;\n closestValue = currentTickObject;\n }\n }\n\n closestValue = new JQX.Utilities.BigNumber(closestValue);\n }\n\n return closestValue;\n }\n\n let interval = that._validInterval;\n\n if (that.mode === 'date') {\n if (that._dateIncrementMethod === 'addYears') {\n return this.coerceYear(value);\n }\n else if (that._dateIncrementMethod === 'addMonths') {\n return this.coerceMonth(value);\n }\n else {\n interval = new JQX.Utilities.BigNumber(that._dateIntervalNumber).multiply(interval);\n }\n }\n\n if (useDrawVariables !== false) {\n minValue = new JQX.Utilities.BigNumber(that._drawMin);\n maxValue = new JQX.Utilities.BigNumber(that._drawMax);\n }\n else {\n minValue = new JQX.Utilities.BigNumber(that.min);\n maxValue = new JQX.Utilities.BigNumber(that.max);\n }\n\n let noMin = value.subtract(minValue),\n remainder = noMin.mod(interval);\n\n if (remainder.compare(0) === 0) {\n return value;\n }\n\n let lowerValue = noMin.subtract(remainder),\n greaterValue = lowerValue.add(interval);\n\n if ((noMin.subtract(lowerValue)).abs().compare((noMin.subtract(greaterValue)).abs()) < 0) {\n return lowerValue.add(minValue);\n }\n else {\n const biggerValue = greaterValue.add(minValue);\n\n return biggerValue.compare(maxValue) <= 0 ? biggerValue : lowerValue.add(minValue);\n }\n }", "function Greenhouse() {\r\n const opts = {\r\n options: {\r\n chart: {\r\n fontFamily: chartFont,\r\n zoom: {\r\n enabled: false,\r\n },\r\n },\r\n dataLabels: {\r\n enabled: false\r\n },\r\n stroke: {\r\n width: 2,\r\n curve: 'smooth',\r\n },\r\n title: {\r\n text: 'Methane vs N₂O concentration growth',\r\n style: titleStyle\r\n },\r\n subtitle: {\r\n text: 'Source: Global Warming API',\r\n },\r\n colors: ['#008FFB', '#FF4560'],\r\n xaxis: {\r\n type: 'category',\r\n categories: res_df.greenhouse.category,\r\n tickAmount: 8,\r\n },\r\n yaxis: {\r\n title: {\r\n text: 'Concentration growth, %'\r\n },\r\n min: 100,\r\n max: Math.max(...res_df.greenhouse.methane.data.filter(filterNaN),\r\n ...res_df.greenhouse.nitrous.data.filter(filterNaN)) + 2,\r\n labels: {\r\n formatter: function (val) {\r\n return round(val);\r\n }\r\n }\r\n },\r\n annotations: {\r\n yaxis: [{\r\n y: 100,\r\n borderColor: '#000',\r\n label: {\r\n borderColor: '#000',\r\n style: {\r\n color: '#fff',\r\n background: '#000',\r\n },\r\n text: 'Minimal level',\r\n }\r\n }]\r\n },\r\n fill: {\r\n opacity: 1\r\n },\r\n tooltip: {\r\n y: {\r\n formatter: function (val, {dataPointIndex, series, seriesIndex, w}) {\r\n const v = w.config.series[seriesIndex].level[dataPointIndex],\r\n m = round(v - w.config.series[seriesIndex].min);\r\n\r\n return !filterNaN(val) ? 'No data' : `${val}% (${m}/${v} ppm)`;\r\n }\r\n }\r\n }\r\n },\r\n series: [{\r\n name: 'Methane growth',\r\n data: res_df.greenhouse.methane.data,\r\n level: res_df.greenhouse.methane.level,\r\n min: res_df.greenhouse.methane.min,\r\n }, {\r\n name: 'N₂O growth',\r\n data: res_df.greenhouse.nitrous.data,\r\n level: res_df.greenhouse.nitrous.level,\r\n min: res_df.greenhouse.nitrous.min,\r\n }]\r\n };\r\n\r\n return (\r\n <ReactApexChart options={opts.options} series={opts.series} type='line' height={400} />\r\n );\r\n}", "render() {\n const total = this.values.reduce((a, b) => a + b, 0);\n\n const rest = 100 - total;\n const dataset = rest > 0 ? [...this.values, rest] : this.values;\n\n this._renderSvg();\n this._renderGroups(dataset, rest);\n this._renderRects(dataset);\n this._renderMarkers();\n }", "function get_Infinity()\n{\n x = 2E310; //floating point number for infinity\n y = -3E310; //floating point number for negative infinity\n document.getElementById(\"infin\").innerHTML = x + \" \" + y; //Display x and y on the p element with the id infin\n}", "function displayCompactSeries(key, value) {\n // Add the ul for the series\n var displayed = $('#series').append($('#compact_series').template({\n series_key: value.key,\n series_name: value.name})).find('#' + value.key);\n ajaxifyAddValue(value);\n function plot() {\n displayed.find(\".chart\").show();\n var series = value.values.map(function(val) {\n return [ val.time.getTime(), val.value ];\n });\n var options = {\n xaxis : {\n mode : \"time\",\n grid : {\n length : false\n }\n },\n yaxis : {\n grid : {\n length : false\n }\n },\n grid : {\n borderMode : \"onAxes\",\n color : \"#FFFFFF\"\n }\n };\n if (series.length == 1) {\n var x = series[0][0], y = series[0][1];\n $.plot(displayed.find(\".chart\"), [ series ], $.extend(true,\n options, {\n xaxis : {\n min : x - 1,\n max : x + 1,\n ticks : [ x ]\n },\n yaxis : {\n min : y - 1,\n max : y + 1,\n ticks : [ y ]\n },\n series : {\n points : {\n show : true\n }\n }\n }));\n } else {\n $.plot(displayed.find(\".chart\"), [ series ], $.extend(true,\n options, {\n xaxis : {\n ticks : function(range) {\n return [ range.min, range.max];\n }\n },\n yaxis : {\n autoscaleMargin : 0.1,\n ticks : function(range) {\n return [ range.min, range.max ];\n }\n }\n }));\n }\n displayed.find(\".add_value\").css(\"padding-top\", \"40px\");\n }\n function resize() {\n var width = $.viewportWidth() * .75;\n displayed.find(\".chart\").width(width);\n displayed.find(\".chart\").height(width * .2);\n displayed.closest(\".cb\").width(width + 100);\n displayed.closest(\".cb\").height(width * .3);\n if(value.values.size() > 0) {\n plot();\n } else {\n displayed.find(\".chart\").hide();\n }\n }\n $(window).resize(resize);\n value.values.addPushListener(plot);\n contentSwitchListeners.add(function() {\n value.values.removePushListener(plot);\n return false;\n });\n\n displayed.find('.series_name').click(function() { displaySeries(value); });\n cbb.transform(displayed);\n resize();\n }", "function updateTileJustValue(tileId, data, config) {\n var tile = Tipboard.Dashboard.id2node(tileId);\n JustValue.setDataByKeys(tileId, data, 'all');\n var highlighterNode = $('#' + tileId + '-just-value').parent();\n Tipboard.DisplayUtils.applyHighlighterConfig(\n highlighterNode, config['just-value-color'], config.fading_background\n );\n Tipboard.TileDisplayDecorator.runAllDecorators(tile);\n}", "adjustHighAndLow() {\n if (this.red + this.green > 510 - MAX_DATABITS) {\n this.red = 255 - (MAX_DATABITS >>> 1)\n this.green = 255 - (MAX_DATABITS - (MAX_DATABITS >>> 1))\n } else if (this.red + this.green < MAX_DATABITS) {\n this.red = MAX_DATABITS >>> 1\n this.green = MAX_DATABITS - (MAX_DATABITS >>> 1)\n }\n }", "getCoercedValue(value, useDrawVariables, logarithmicGauge) {\n const that = this.context;\n\n if (!that.coerce) {\n return value;\n }\n\n let normalScale = !that.logarithmicScale,\n minValue, maxValue;\n\n if (that.customInterval) {\n const customTicks = that.customTicks;\n\n if (customTicks.length === 0) {\n return value;\n }\n\n normalScale = normalScale || logarithmicGauge;\n\n if (useDrawVariables !== false) {\n minValue = parseFloat(that._drawMin);\n }\n else {\n minValue = that._minObject;\n }\n\n let difference = Math.abs(minValue - value),\n closestValue = minValue;\n\n for (let i = 0; i < customTicks.length; i++) {\n const currentTickObject = this.createDescriptor(customTicks[i]),\n currentTickValue = normalScale ? currentTickObject : Math.log10(currentTickObject),\n currentDifference = Math.abs(currentTickValue - value);\n\n if (currentDifference < difference) {\n difference = currentDifference;\n closestValue = currentTickValue;\n }\n }\n\n return closestValue;\n }\n\n if (useDrawVariables !== false) {\n minValue = parseFloat(that._drawMin);\n maxValue = parseFloat(that._drawMax);\n }\n else {\n minValue = parseFloat(that.min);\n maxValue = parseFloat(that.max);\n }\n\n let noMin = value - minValue,\n remainder = this.getPreciseModulo(noMin, parseFloat(that.interval)),\n coef = this.roundCoefficient;\n\n if (remainder === 0) {\n return value;\n }\n\n if (this.roundCoefficient === 0) {\n coef = 12;\n }\n\n let lowerValue = parseFloat((noMin - remainder).toFixed(coef)),\n greaterValue = lowerValue + parseFloat(that.interval);\n\n if (((that.max - that.min) <= parseFloat(that.interval)) && normalScale) {\n let min = minValue,\n max = maxValue;\n\n return value >= min + (max - min) / 2 ? max : min;\n }\n\n if (Math.abs(noMin - lowerValue) < Math.abs(noMin - greaterValue)) {\n return lowerValue + minValue;\n }\n else {\n const biggerValue = greaterValue + minValue;\n\n return biggerValue > maxValue ? lowerValue + minValue : biggerValue;\n }\n }", "_getSingleActualValue(value) {\n if (this.logarithmicScale) {\n return parseFloat(Math.pow(10, value).toFixed(11));\n }\n\n return value.toString();\n }", "function snap_to_zero(source_group) {\n return {\n all:function () {\n return source_group.all().map(function(d) {\n return {key: d.key,\n value: (Math.abs(d.value)<1e-6) ? 0 : d.value};\n });\n }\n };\n }", "function processOneAxisValue(feed)\r\n {\r\n var dataset = [];\r\n var i, j, k;\r\n var measureData;\r\n if (feed.values.length <= 0){\r\n return dataset;\r\n }\r\n if (hasMND && !bMNDOnColor)\r\n {\r\n for(j = 0; j < feed.values[0].rows.length; ++j)\r\n { \r\n measureData = new Array(feed.values.length * feed.values[0].rows[0].length);\r\n for(k = 0; k < feed.values[0].rows[0].length; ++k)\r\n {\r\n for(i = 0 ; i < feed.values.length; ++i)\r\n {\r\n var dataPoint = {};\r\n dataPoint.val = feed.values[i].rows[j][k].val;\r\n dataPoint.ctx = feed.values[i].rows[j][k].ctx;\r\n dataPoint.info = feed.values[i].rows[j][k].info;\r\n if(bMNDInner){\r\n measureData[k * feed.values.length + i] = dataPoint;\r\n } else {\r\n measureData[i * feed.values[0].rows[0].length + k] = dataPoint; \r\n }\r\n }\r\n }\r\n dataset.push(measureData);\r\n } \r\n }\r\n else // MND on Region color or no MND\r\n {\r\n dataset = new Array(feed.values.length * feed.values[0].rows.length);\r\n\r\n for(i = 0 ; i < feed.values.length; ++i)\r\n {\r\n for(j = 0; j < feed.values[0].rows.length; ++j)\r\n { \r\n measureData = feed.values[i].rows[j];\r\n if(!hasMND || !bMNDInner){\r\n dataset[i * feed.values[0].rows.length + j] = measureData;\r\n } else {\r\n dataset[j * feed.values.length + i] = measureData;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return dataset;\r\n }", "function coverageData() {\n return [\n {\n key: \"Abia\",\n values: [{x: 1422658800000, y: 0.225804093207},{x: 1425078000000, y: 0.260536172138},{x: 1427756400000, y: 0.7162465726},{x: 1430348400000, y: 0.286972662663},{x: 1433026800000, y: 0.294721289196},{x: 1435618800000, y: 0.334558345608},{x: 1438297200000, y: 0.419519756536},{x: 1440975600000, y: 0.330911933122},{x: 1443567600000, y: 0.346318025876},{x: 1446246000000, y: 0.306936771025},{x: 1448838000000, y: 0.297273777937},{x: 1451516400000, y: 0.469657928221},{x: 1454194800000, y: 1.16582179057},]\n },\n \n {\n key: \"Anambra\",\n values: [{x: 1422658800000, y: 0.273874110915},{x: 1425078000000, y: 0.297014934669},{x: 1427756400000, y: 0.296584121461},{x: 1430348400000, y: 0.296276397741},{x: 1433026800000, y: 0.327048769754},{x: 1435618800000, y: 0.409334092516},{x: 1438297200000, y: 0.43659841412},{x: 1440975600000, y: 0.306431280505},{x: 1443567600000, y: 0.289321841666},{x: 1446246000000, y: 0.279228503646},{x: 1448838000000, y: 0.286552328185},{x: 1451516400000, y: 0.516791215586},{x: 1454194800000, y: 1.33177528297},]\n },\n {\n key: \"Delta\",\n values: [{x: 1422658800000, y: 0.116827039904},{x: 1425078000000, y: 0.28189428905},{x: 1427756400000, y: 0.308036980667},{x: 1430348400000, y: 0.281532034663},{x: 1433026800000, y: 0.20696800661},{x: 1435618800000, y: 0.257743996563},{x: 1438297200000, y: 0.260219401543},{x: 1440975600000, y: 0.451006712187},{x: 1443567600000, y: 0.255691221702},{x: 1446246000000, y: 0.256294979014},{x: 1448838000000, y: 0.244461335696},{x: 1451516400000, y: 0.220431794672},{x: 1454194800000, y: 0.373954976616},]\n },\n {\n key: \"Edo\",\n values: [{x: 1422658800000, y: 0.341663779224},{x: 1425078000000, y: 0.265052154627},{x: 1427756400000, y: 0.363243388665},{x: 1430348400000, y: 0.395973800012},{x: 1433026800000, y: 0.362521394298},{x: 1435618800000, y: 0.385304327686},{x: 1438297200000, y: 0.488068192721},{x: 1440975600000, y: 0.338856023349},{x: 1443567600000, y: 0.330031647741},{x: 1446246000000, y: 0.363082945473},{x: 1448838000000, y: 0.336048267473},{x: 1451516400000, y: 0.334283392352},{x: 1454194800000, y: 0.950628109753},]\n },\n {\n key: \"Imo\",\n values: [{x: 1422658800000, y: 0.191992677651},{x: 1425078000000, y: 0.220946463085},{x: 1427756400000, y: 0.208808631637},{x: 1430348400000, y: 0.234664741337},{x: 1433026800000, y: 0.226256764344},{x: 1435618800000, y: 0.234222216232},{x: 1438297200000, y: 0.302244646641},{x: 1440975600000, y: 0.206027045263},{x: 1443567600000, y: 0.194394956792},{x: 1446246000000, y: 0.201665012086},{x: 1448838000000, y: 0.219176362666},{x: 1451516400000, y: 0.211653435882},{x: 1454194800000, y: 0.425188445283},]\n },\n {\n key: \"Osun\",\n values: [{x: 1422658800000, y: 0.417894177829},{x: 1425078000000, y: 0.43838559813},{x: 1427756400000, y: 0.414769599557},{x: 1430348400000, y: 0.434970361413},{x: 1433026800000, y: 0.413897624225},{x: 1435618800000, y: 0.287751859538},{x: 1438297200000, y: 0.305118701566},{x: 1440975600000, y: 0.556610920218},{x: 1443567600000, y: 0.468105424027},{x: 1446246000000, y: 0.484309632278},{x: 1448838000000, y: 0.474281915961},{x: 1451516400000, y: 0.628984872768},{x: 1454194800000, y: 0.78959462153},]\n },\n {\n key: \"Oyo\",\n values: [{x: 1422658800000, y: 0.385489282742},{x: 1425078000000, y: 0.51188709565},{x: 1427756400000, y: 0.499645176724},{x: 1430348400000, y: 0.475554829124},{x: 1433026800000, y: 0.435069054391},{x: 1435618800000, y: 0.493961428652},{x: 1438297200000, y: 0.638897004504},{x: 1440975600000, y: 0.47883391455},{x: 1443567600000, y: 0.757206406693},{x: 1446246000000, y: 0.810721080854},{x: 1448838000000, y: 0.755894772522},{x: 1451516400000, y: 0.490113968418},{x: 1454194800000, y: 1.0401727749},]\n }\n ];\n }", "function getTempColor(value) {\n var sRes = \"white\";\n var iValue = parseFloat(value);\n\n\n if (iValue >= 35) {\n sRes = \"#EF0F06\";\n } else if (iValue >= 27) {\n sRes = \"#E6940F\";\n } else if (iValue >= 22) {\n sRes = \"#ABCD23\";\n } else if (iValue >= 15) {\n sRes = \"#CCE566\";\n } else if (iValue >= 10) {\n sRes = \"#73E265\";\n } else if (iValue >= 3) {\n sRes = \"#C9F4C3\";\n } else if (iValue >= -5) {\n sRes = \"#E8EEF8\";\n } else if (iValue >= -10) {\n sRes = \"#B5C9E8\";\n } else if (iValue >= -20) {\n sRes = \"#6F95D3\";\n }\n\n return sRes;\n}" ]
[ "0.6321663", "0.62352866", "0.61463577", "0.6028201", "0.60187906", "0.5925194", "0.5866573", "0.5861707", "0.5716331", "0.56969607", "0.5683294", "0.56568146", "0.5613327", "0.55940735", "0.55808884", "0.55808884", "0.55808884", "0.55783063", "0.5574813", "0.55676407", "0.5547632", "0.55403376", "0.55403376", "0.5499588", "0.5492905", "0.54885733", "0.5488282", "0.5481312", "0.54739267", "0.54695433", "0.5464462", "0.5454577", "0.54541403", "0.54419935", "0.5413386", "0.54081506", "0.54031205", "0.54026353", "0.54011744", "0.53806156", "0.5370795", "0.5366134", "0.5351934", "0.5336482", "0.5320674", "0.53140265", "0.5311625", "0.530871", "0.53084916", "0.5299952", "0.5293533", "0.528573", "0.528081", "0.52807313", "0.52795476", "0.52795476", "0.52795476", "0.52795476", "0.52795476", "0.52795476", "0.52795476", "0.5276142", "0.52649516", "0.5263784", "0.52637637", "0.5250315", "0.5224124", "0.5213423", "0.5212171", "0.5206724", "0.5205605", "0.5201475", "0.51993984", "0.5198846", "0.5189781", "0.51805115", "0.517159", "0.5170297", "0.51577115", "0.5129872", "0.51231617", "0.51112515", "0.5109354", "0.5109354", "0.5109354", "0.5109354", "0.5109354", "0.5109354", "0.51076424", "0.5106748", "0.5106132", "0.51056415", "0.5105619", "0.51051843", "0.5099367", "0.506435", "0.50610197", "0.50442404", "0.5030872", "0.50293326", "0.5027193" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function Cartesian2D(name) { Cartesian.call(this, name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "started () {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "function SigV4Utils() { }", "started() {\r\n\r\n\t}", "static get NOT_READY () {return 0}", "initialize() {\n\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "heartbeat () {\n }", "static final private internal function m106() {}", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53504926", "0.4896905", "0.48514667", "0.48116106", "0.4775166", "0.4743932", "0.47342455", "0.47035336", "0.4694186", "0.4694186", "0.46744877", "0.46453032", "0.46394095", "0.4629355", "0.46211302", "0.45832416", "0.45812932", "0.45752546", "0.45698234", "0.45625272", "0.4557475", "0.4549714", "0.45494938", "0.4545794", "0.45383474", "0.4523037", "0.45180768", "0.45005357", "0.4496748", "0.4486438", "0.447462", "0.44716924", "0.4468301", "0.44601226", "0.4456266", "0.4455926", "0.44557476", "0.4445067", "0.44378054", "0.44258687", "0.44258553", "0.4424118", "0.44097725", "0.4406038", "0.4404498", "0.4404498", "0.4404498", "0.43926418", "0.43781474", "0.43708664", "0.43657827", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43526813", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4349645", "0.43450522", "0.43440443", "0.43390423", "0.43347356", "0.43347356", "0.43332103", "0.43318707" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. / Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(ecModel) { var legendModels = ecModel.findComponents({ mainType: 'legend' }); if (legendModels && legendModels.length) { ecModel.filterSeries(function (series) { // If in any legend component the status is not selected. // Because in legend series is assumed selected when it is not in the legend data. for (var i = 0; i < legendModels.length; i++) { if (!legendModels[i].isSelected(series.name)) { return false; } } return true; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onChildAppStart () {\n\n }", "get Android() {}", "onMessageStart() { }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "createStream () {\n\n }", "onComponentMount() {\n\n }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "didMount() {\n }", "requestContainerInfo() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "function bridgeAndroidAndIOS() {\r\n\r\n //ios\r\n function setupWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n return callback(WebViewJavascriptBridge);\r\n }\r\n if (window.WVJBCallbacks) {\r\n return window.WVJBCallbacks.push(callback);\r\n }\r\n window.WVJBCallbacks = [callback];\r\n var WVJBIframe = document.createElement('iframe');\r\n WVJBIframe.style.display = 'none';\r\n WVJBIframe.src = 'https://__bridge_loaded__';\r\n document.documentElement.appendChild(WVJBIframe);\r\n setTimeout(function() {\r\n document.documentElement.removeChild(WVJBIframe)\r\n }, 0)\r\n }\r\n\r\n //安卓\r\n function connectWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n callback(WebViewJavascriptBridge)\r\n } else {\r\n document.addEventListener(\r\n 'WebViewJavascriptBridgeReady',\r\n function() {\r\n callback(WebViewJavascriptBridge)\r\n },\r\n false\r\n );\r\n }\r\n }\r\n\r\n function bridgeLog(logContent) {\r\n uni.showModal({\r\n title: \"原始数据\",\r\n content: logContent,\r\n })\r\n }\r\n\r\n switch (uni.getSystemInfoSync().platform) {\r\n case 'android':\r\n connectWebViewJavascriptBridge(function(bridge) {\r\n bridge.init();\r\n bridge.registerHandler(\"GetUser\", function(data, responseCallback) {\r\n if(JSON.parse(data).guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: JSON.parse(data).guid,\r\n token: JSON.parse(data).token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: JSON.parse(data).activityID,\r\n AppCode: JSON.parse(data).AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: JSON.parse(data).Authorization,\r\n statusBarHeight: Number.parseInt(JSON.parse(data).statusBarHeight),\r\n };\r\n });\r\n\r\n })\r\n break;\r\n case 'ios':\r\n setupWebViewJavascriptBridge(function(bridge) {\r\n bridge.registerHandler('GetUser', function(data, responseCallback) {\r\n if(data.guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: data.guid,\r\n token: data.token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: data.activityID,\r\n AppCode: data.AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: data.Authorization,\r\n productID: data.productID,\r\n statusBarHeight: data.statusBarHeight,\r\n };\r\n })\r\n })\r\n break;\r\n default:\r\n console.log('运行在开发者工具上')\r\n break;\r\n }\r\n\r\n}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "constructor(speechCallback, clientId, streamId) {\n console.log(\"in gcloud\");\n const useOpus = false;\n this.clientId = clientId;\n this.streamId = streamId;\n this.isOpen = true;\n\n // Note: \n // 1) The client side detects silence and does a startStream, and endStream\n // The streamId is incremented everytime this happens, \n // so a combination of clientId + streamId can uniquely identify a stream.\n // The server will be transcribing each client's stream in parallel.\n //\n // 2) The streaming API has a limit of 5 minutes. So just before 5 minutes are up\n // there will timer that will close and reopen the stream. Any non final results will\n // we sent again to be re-transcribed,\n // The restartCounter will be incremented every time the stream is restarted. However\n // the streamId will remain the same.\n //\n // 3) Every stream will have set of results. Some results will be final and some won't be\n // After a result is final, that portion of the audio will not be transcribed again by the API\n // each final result will have resultEndTime, - this is time in seconds (and nanoseconds) \n // from the time the stream was started/restarted.\n // Results don'd have a startTime, it is implicit that the startTime is resultEndTime\n // of the last final stream, or 0 if there was no final stream before this\n // We augment the result to add this startTime\n //\n // We also keep a cumulative restartTime, which is the difference betwen the beginning of \n // stream start and begining of the most recent stream restart. And add this to \n // the startTime and endTime. This way the client is completely unaware of the internal restarts\n // \n \n // Have we started/restarted a new stream ?\n this.newStream = true;\n\n // number of times the stream has been restarted\n this.restartCounter = 0;\n\n // audio Input is any array of chunks (buffer)\n this.audioInput = [];\n this.audioInputSize = 0; // total size of all the buffers\n\n // the end time (in seconds) of the last result. \n // the End time is calculated from the beginning of start/restart stream\n this.resultEndTime = 0;\n\n // the end time of the last final result.\n this.finalEndTime = 0;\n\n // the start time (in seconds) of the current result. \n // It is calculated fom beginning of start/restart stream\n this.startTime = 0;\n \n // the time between the of beginning of start stream and the beginning of the most current restart stream.\n this.restartTime = 0;\n\n\n this.lastTranscriptWasFinal = false;\n\n this.restartTimer = null;\n\n this.config = {\n encoding: useOpus ? 'OGG_OPUS' : 'LINEAR16',\n sampleRateHertz: useOpus ? 48000 : 16000,\n languageCode: 'en_us',\n enableAutomaticPunctuation: true,\n speechContexts: [{ phrases: phrases}],\n };\n\n this.request = {\n config : this.config,\n interimResults: true,\n };\n\n this.startStreamInternal();\n }", "constructor() {\n }", "constructor(info) {\n super();\n\n _defineProperty(this, \"_peerConnectionId\", void 0);\n\n _defineProperty(this, \"_reactTag\", void 0);\n\n _defineProperty(this, \"_id\", void 0);\n\n _defineProperty(this, \"_label\", void 0);\n\n _defineProperty(this, \"_maxPacketLifeTime\", void 0);\n\n _defineProperty(this, \"_maxRetransmits\", void 0);\n\n _defineProperty(this, \"_negotiated\", void 0);\n\n _defineProperty(this, \"_ordered\", void 0);\n\n _defineProperty(this, \"_protocol\", void 0);\n\n _defineProperty(this, \"_readyState\", void 0);\n\n _defineProperty(this, \"_subscriptions\", []);\n\n _defineProperty(this, \"binaryType\", 'arraybuffer');\n\n _defineProperty(this, \"bufferedAmount\", 0);\n\n _defineProperty(this, \"bufferedAmountLowThreshold\", 0);\n\n this._peerConnectionId = info.peerConnectionId;\n this._reactTag = info.reactTag;\n this._label = info.label;\n this._id = info.id === -1 ? null : info.id; // null until negotiated.\n\n this._ordered = Boolean(info.ordered);\n this._maxPacketLifeTime = info.maxPacketLifeTime;\n this._maxRetransmits = info.maxRetransmits;\n this._protocol = info.protocol || '';\n this._negotiated = Boolean(info.negotiated);\n this._readyState = info.readyState;\n\n this._registerEvents();\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onChildAppSourceChangeRestart () {\n\n }", "constructor() {\n\n\t}", "async componentDidUpdate() {\n console.log(this.props.directory);\n //this needs to be replaced with environment variable\n const beginingUrl = \"http://10.34.1.30:8080/songs/\";\n const songLoc = this.props.directory + \"/outputlist.m3u8\";\n var hlsUrl = beginingUrl + songLoc;\n var audio = this.player;\n\n //Should this logic be loacated here??This looks hacky,\n const token = await getToken();\n let bearerTokenString = \"Bearer \" + token;\n\n if (Hls.isSupported()) {\n var hls = new Hls({\n // This configuration is required to insure that only the\n // viewer can access the content by sending a session cookie\n // to api.video service\n xhrSetup: function (xhr, url) {\n xhr.setRequestHeader(\"Authorization\", bearerTokenString);\n },\n });\n hls.loadSource(hlsUrl);\n hls.attachMedia(audio);\n hls.on(Hls.Events.MANIFEST_PARSED, function () {\n audio.play();\n });\n } else if (audio.canPlayType(\"application/vnd.apple.mpegurl\")) {\n console.log(\"Nigga we here!!\");\n audio.src = hlsUrl;\n audio.addEventListener(\"loadedmetadata\", function () {\n audio.play();\n });\n }\n }", "onMessageReceive() {}", "constructor() {\n\t}", "constructor() {\n\t}", "componentWillMount() {\n //CodePush.disallowRestart();\n //Alert.alert(\"mounted cool vite OK OK MAINTENANT CA MARCHE !!!!!\");\n/*CodePush.sync(\n{\ndeploymentKey: 'giMb817KrtTFkIuOg4i5ohnEUDyoBJvD1i-VN',\nupdateDialog: true,\ninstallMode: CodePush.InstallMode.IMMEDIATE,\n},\nthis.CodePushStatusDidChange.bind(this),\nthis.CodePushDownloadDidProgress.bind(this)\n);*/\n /* Animated.loop(\n Animated.sequence([\n Animated.timing(this.animatedValue, { toValue: 1, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n Animated.timing(this.animatedValue, { toValue: 0, duration: 3000, easing: Easing.ease, useNativeDriver: true }),\n ])).start();*/\n //this.toggleLike(); \n //CodePush.notifyApplicationReady();\n this._onLoadStart();\n }", "function version(){ return \"0.13.0\" }", "get supportStreaming() { return exists && has(WA.instantiateStreaming); }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "onChildAppRestart (/* reason */) {\n\n }", "_init(config) {\n this.name = config.name;\n this.appId = config.appid || config.appId;\n this.serverUrl = config.server_url + '/sync_xcx';\n this.autoTrackProperties = {};\n // cache commands.\n this._queue = [];\n\n if (config.isChildInstance) {\n this._state = {};\n } else {\n logger.enabled = config.enableLog;\n this.instances = []; // 子实例名称\n this._state = {\n getSystemInfo: false,\n initComplete: false,\n };\n systemInfo.getSystemInfo(() => {\n this._updateState({\n getSystemInfo: true,\n });\n });\n\n if (config.autoTrack) {\n this.autoTrack = PlatformAPI.initAutoTrackInstance(this, config);\n } else {\n var launchOptions = PlatformAPI.getAppOptions((options) => {\n if (options && options.scene) {\n this._setAutoTrackProperties({\n '#scene': options.scene,\n });\n }\n\n });\n if (launchOptions.scene) {\n this._setAutoTrackProperties({\n '#scene': launchOptions.scene,\n });\n }\n }\n }\n\n this.store = new ThinkingDataPersistence(config, () => {\n if (this.config.asyncPersistence && _.isFunction(this.config.persistenceComplete)) {\n this.config.persistenceComplete(this);\n }\n this._updateState();\n });\n }", "_addHMRClientCode(data) {\n// If we have it, grab supporting code...\n let prependage = fs.readFileSync('./lib/hmr/clientSocket.js'),\n appendage = fs.readFileSync('./lib/hmr/hmr.js')\n\n// Prepend clientSocket.js to bundle.... Append hmr runtime to bundle\n return `${prependage}${data}${appendage}`\n }", "componentDidMount() {\n this.setState({\n configuration: {\n flow: {\n name: \"sample1\",\n id: \"01\",\n components: [\n {\n type: \"http-listener\",\n id: \"http-list-01\",\n properties: {\n method: \"get\",\n port: 8000,\n path: \"http://localhost\"\n }\n },\n {\n type: \"logger\",\n id: \"logger-01\",\n properties: {\n level: \"info\"\n }\n },\n {\n type: \"file-writer\",\n id: \"file-write-01\",\n properties: {\n location: \"xx\",\n username: \"sachith\",\n password: \"\",\n filename: \"hello.txt\"\n }\n }\n ]\n }\n }\n\n });\n }", "componentWillUnmount(){\n Streaming.disconnect();\n }", "pushStart() {\n Cordova.exec(\n () => {},\n () => {},\n 'SparkProxy',\n 'pushStart',\n []);\n }", "async onReady() {\n // Initialize your adapter here\n // Subsribe to all state changes\n this.subscribeStates('*');\n this.axiosInstance = axios_1.default.create({\n baseURL: `http://${this.config.host}/api/v1/`,\n timeout: 1000\n });\n // try to ping volumio\n const connectionSuccess = await this.pingVolumio();\n if (this.config.checkConnection) {\n let interval = this.config.checkConnectionInterval;\n if (!interval || !isNumber(interval)) {\n this.log.error(`Invalid connection check interval setting. Will be set to 30s`);\n interval = 30;\n }\n this.checkConnectionInterval = setInterval(this.checkConnection, interval * 1000, this);\n }\n // get system infos\n if (connectionSuccess) {\n this.apiGet('getSystemInfo').then(sysInfo => {\n this.setStateAsync('info.id', sysInfo.id, true);\n this.setStateAsync('info.host', sysInfo.host, true);\n this.setStateAsync('info.name', sysInfo.name, true);\n this.setStateAsync('info.type', sysInfo.type, true);\n this.setStateAsync('info.serviceName', sysInfo.serviceName, true);\n this.setStateAsync('info.systemversion', sysInfo.systemversion, true);\n this.setStateAsync('info.builddate', sysInfo.builddate, true);\n this.setStateAsync('info.variant', sysInfo.variant, true);\n this.setStateAsync('info.hardware', sysInfo.hardware, true);\n });\n // get inital player state\n this.updatePlayerState();\n }\n if (this.config.subscribeToStateChanges && this.config.subscriptionPort && connectionSuccess) {\n this.log.debug('Subscription mode is activated');\n try {\n this.httpServerInstance = this.httpServer.listen(this.config.subscriptionPort);\n this.log.debug(`Server is listening on ${ip_1.default.address()}:${this.config.subscriptionPort}`);\n this.subscribeToVolumioNotifications();\n }\n catch (error) {\n this.log.error(`Starting server on ${this.config.subscriptionPort} for subscription mode failed: ${error.message}`);\n }\n }\n else if (this.config.subscribeToStateChanges && !this.config.subscriptionPort) {\n this.log.error('Subscription mode is activated, but port is not configured.');\n }\n else if (!this.config.subscribeToStateChanges && connectionSuccess) {\n this.unsubscribeFromVolumioNotifications();\n }\n this.httpServer.post('/volumiostatus', (req, res) => {\n this.onVolumioStateChange(req.body);\n res.sendStatus(200);\n });\n }", "function IbtRealTimeSJ(){/***********************************************************\n\t * @attributes\n\t ***********************************************************/var appKey;// application key\n\tvar authToken;// authentication token\n\tvar clusterUrl;// cluster URL to connect\n\tvar waitingClusterResponse;// indicates whether is waiting for a cluster response\n\tvar connectionTimeout;// connection timeout in milliseconds\n\tvar messageMaxSize;// message maximum size in bytes\n\tvar channelMaxSize;// channel maximum size in bytes\n\tvar channelsMaxSize;// maximum of channels for batchSend\n\tvar messagesBuffer;// buffer to hold the message parts\n\tvar id;// object identifier\n\tvar isConnected;// indicates whether the client object is connected\n\tvar isConnecting;// indicates whether the client object is connecting\n\tvar alreadyConnectedFirstTime;// indicates whether the client already connected for the first time\n\tvar stopReconnecting;// indicates whether the user disconnected (stop the reconnecting proccess)\n\tvar ortc;// represents the object itself\n\tvar sockjs;// socket connected to\n\tvar url;// URL to connect\n\tvar userPerms;// user permissions\n\tvar connectionMetadata;// connection metadata used to identify the client\n\tvar announcementSubChannel;// announcement subchannel\n\tvar subscribedChannels;// subscribed/subscribing channels\n\tvar lastKeepAlive;// holds the time of the last keep alive received\n\tvar invalidConnection;// indicates whether the connection is valid\n\tvar reconnectIntervalId;// id used for the reconnect interval\n\tvar reconnectStartedAt;// the time which the reconnect started\n\tvar validatedTimeoutId;// id used for the validated timeout\n\tvar validatedArrived;// indicates whether the validated message arrived\n\tvar retryingWithSsl;// indicates whether the connection is being retried with SSL\n\tvar protocol;// protocol to use\n\tvar sslSessionCookieName;// the SSL session cookie name\n\tvar sessionCookieName;// the session cookie name\n\tvar sessionId;// the session ID\n\tvar registrationId;// browser device token for push notifications\n\tvar pushPlatform;// push notifications platform\n\t/***********************************************************\n\t * @attributes initialization\n\t ***********************************************************/sslSessionCookieName=\"ortcssl\";sessionCookieName=\"ortcsession-\";connectionTimeout=5000;messageMaxSize=800;channelMaxSize=100;connectionMetadataMaxSize=256;channelsMaxSize=50;// Time in seconds\n\tvar heartbeatDefaultTime=15;// Heartbeat default interval time\n\tvar heartbeatDefaultFails=3;// Heartbeat default max fails\n\tvar heartbeatMaxTime=60;var heartbeatMinTime=10;var heartbeatMaxFails=6;var heartbeatMinFails=1;var heartbeatTime=heartbeatDefaultTime;// Heartbeat interval time\n\tvar heartbeatFails=heartbeatDefaultFails;// Heartbeat max fails\n\tvar heartbeatInterval=null;// Heartbeat interval\n\tvar heartbeatActive=false;messagesBuffer={};subscribedChannels={};isConnected=false;isConnecting=false;alreadyConnectedFirstTime=false;invalidConnection=false;waitingClusterResponse=false;validatedArrived=false;retryingWithSsl=false;ortc=this;lastKeepAlive=null;userPerms=null;reconnectStartedAt=null;protocol=undefined;pushPlatform=\"GCM\";var delegateExceptionCallback=function(ortcArg,event){if(ortcArg!==null&&ortcArg.onException!==null){ortcArg.onException(ortcArg,event);}};/***********************************************************\n\t * @properties\n\t ***********************************************************/this.getId=function(){return id;};this.setId=function(newId){id=newId;};this.getUrl=function(){return url;};this.setUrl=function(newUrl){url=newUrl;clusterUrl=null;};this.getClusterUrl=function(){return clusterUrl;};this.setClusterUrl=function(newUrl){clusterUrl=newUrl;url=null;};this.getConnectionTimeout=function(){return connectionTimeout;};this.setConnectionTimeout=function(newTimeout){connectionTimeout=newTimeout;};this.getIsConnected=function(){return isConnected&&ortc.sockjs!==null;};this.getConnectionMetadata=function(){return connectionMetadata;};this.setConnectionMetadata=function(newConnectionMetadata){connectionMetadata=newConnectionMetadata;};this.getAnnouncementSubChannel=function(){return announcementSubChannel;};this.setAnnouncementSubChannel=function(newAnnouncementSubChannel){announcementSubChannel=newAnnouncementSubChannel;};this.getProtocol=function(){return protocol;};this.setProtocol=function(newProtocol){protocol=newProtocol;};this.getSessionId=function(){return sessionId;};/*\n\t * Get heartbeat interval.\n\t */this.getHeartbeatTime=function(){return heartbeatTime;};/*\n\t * Set heartbeat interval.\n\t */this.setHeartbeatTime=function(newHeartbeatTime){if(newHeartbeatTime&&!isNaN(newHeartbeatTime)){if(newHeartbeatTime>heartbeatMaxTime||newHeartbeatTime<heartbeatMinTime){delegateExceptionCallback(ortc,`Heartbeat time is out of limits - Min: ${heartbeatMinTime} | Max: ${heartbeatMaxTime}`);}else{heartbeatTime=newHeartbeatTime;}}else{delegateExceptionCallback(ortc,`Invalid heartbeat time ${newHeartbeatTime}`);}};/*\n\t * Get how many times can the client fail the heartbeat.\n\t */this.getHeartbeatFails=function(){return heartbeatFails;};/*\n\t * Set heartbeat fails. Defines how many times can the client fail the heartbeat.\n\t */this.setHeartbeatFails=function(newHeartbeatFails){if(newHeartbeatFails&&!isNaN(newHeartbeatFails)){if(newHeartbeatFails>heartbeatMaxFails||newHeartbeatFails<heartbeatMinFails){delegateExceptionCallback(ortc,`Heartbeat fails is out of limits - Min: ${heartbeatMinFails} | Max: ${heartbeatMaxFails}`);}else{heartbeatFails=newHeartbeatFails;}}else{delegateExceptionCallback(ortc,`Invalid heartbeat fails ${newHeartbeatFails}`);}};/*\n\t * Get heart beat active.\n\t */this.getHeartbeatActive=function(){return heartbeatActive;};/*\n\t * Set heart beat active. Heart beat provides better accuracy for presence data.\n\t */this.setHeartbeatActive=function(active){heartbeatActive=active;};/***********************************************************\n\t * @events\n\t ***********************************************************/this.onConnected=null;this.onDisconnected=null;this.onSubscribed=null;this.onUnsubscribed=null;this.onException=null;this.onReconnecting=null;this.onReconnected=null;/***********************************************************\n\t * @public methods\n\t ***********************************************************//*\n\t * Connects to the gateway with the application key and authentication token.\n\t */this.connect=function(appKey,authToken){/*\n\t Sanity Checks\n\t */if(isConnected){delegateExceptionCallback(ortc,\"Already connected\");}else if(!url&&!clusterUrl){delegateExceptionCallback(ortc,\"URL and Cluster URL are null or empty\");}else if(!appKey){delegateExceptionCallback(ortc,\"Application Key is null or empty\");}else if(!authToken){delegateExceptionCallback(ortc,\"Authentication Token is null or empty\");}else if(url&&!ortcIsValidUrl(url)){delegateExceptionCallback(ortc,\"Invalid URL\");}else if(clusterUrl&&!ortcIsValidUrl(clusterUrl)){delegateExceptionCallback(ortc,\"Invalid Cluster URL\");}else if(!ortcIsValidInput(appKey)){delegateExceptionCallback(ortc,\"Application Key has invalid characters\");}else if(!ortcIsValidInput(authToken)){delegateExceptionCallback(ortc,\"Authentication Token has invalid characters\");}else if(!ortcIsValidInput(announcementSubChannel)){delegateExceptionCallback(ortc,\"Announcement Subchannel has invalid characters\");}else if(connectionMetadata&&connectionMetadata.length>connectionMetadataMaxSize){delegateExceptionCallback(ortc,\"Connection metadata size exceeds the limit of \"+connectionMetadataMaxSize+\" characters\");}else{ortc.appKey=appKey;ortc.authToken=authToken;isConnecting=true;stopReconnecting=false;validatedArrived=false;clearValidatedTimeout(self);// Read SSL session cookie\n\t//var sslConn = readCookie(sslSessionCookieName);\n\tvar sslConn=false;if(sslConn){changeUrlSsl();}if(clusterUrl&&clusterUrl!=null){clusterUrl=clusterUrl.ortcTreatUrl();clusterConnection();}else{url=url.ortcTreatUrl();ortc.sockjs=createSocketConnection(url);}//If ssl connection increase connection timeout\n\tif(clusterUrl&&clusterUrl!=null&&clusterUrl.indexOf(\"/ssl\")>=0||url&&url.indexOf(\"https\")>=0){if(!retryingWithSsl){ortc.setConnectionTimeout(30*1000);}else{if(ortc.getConnectionTimeout()<300*1000){if(ortc.getConnectionTimeout()<30*1000){ortc.setConnectionTimeout(30*1000);}else{ortc.setConnectionTimeout((ortc.getConnectionTimeout()+10)*1000);}}else{stopReconnecting=true;clearReconnectInterval();}}}if(!ortc.reconnectIntervalId&&!stopReconnecting){// Interval to reconnect\n\tortc.reconnectIntervalId=setInterval(function(){if(stopReconnecting){clearReconnectInterval();}else{var currentDateTime=new Date();if(ortc.sockjs==null&&!waitingClusterResponse){reconnectSocket();}// 35 seconds\n\tif(lastKeepAlive!=null&&lastKeepAlive+35000<new Date().getTime()){lastKeepAlive=null;// Server went down\n\tif(isConnected){disconnectSocket();}}}},ortc.getConnectionTimeout());}}};this.setNotificationConfig=function(config){config.cmd=\"config\";this.sendMessageToServiceWorker(config);};this.showNotification=function(notification){notification.cmd=\"notification\";this.sendMessageToServiceWorker(notification);};this.sendMessageToServiceWorker=function(message){return new Promise(function(resolve,reject){var messageChannel=new MessageChannel();messageChannel.port1.onmessage=function(event){if(event.data.error){reject(event.data.error);}else{resolve(event.data);}};navigator.serviceWorker.controller.postMessage(message,[messageChannel.port2]);});};/*\n\t * Subscribes to the channel so the client object can receive all messages sent to it by other clients with Notifications.\n\t */this.subscribeWithNotifications=function(channel,subscribeOnReconnected,regId,onMessageCallback){ortc.registrationId=regId;this._subscribe(channel,subscribeOnReconnected,regId,null,onMessageCallback);};/*\n\t * Subscribes to the channel so the client object can receive all messages sent that are valid according to the given filter\n\t */this.subscribeWithFilter=function(channel,subscribeOnReconnected,filter,onMessageCallback){this._subscribe(channel,subscribeOnReconnected,null,filter,onMessageCallback);};/*\n\t * Subscribes to the channel so the client object can receive all messages sent to it by other clients.\n\t */this.subscribe=function(channel,subscribeOnReconnected,onMessageCallback){this._subscribe(channel,subscribeOnReconnected,null,null,onMessageCallback);};this._subscribe=function(channel,subscribeOnReconnected,regId,filter,onMessageCallback){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribing){delegateExceptionCallback(ortc,\"Already subscribing to the channel \\\"\"+channel+\"\\\"\");}else if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed){delegateExceptionCallback(ortc,\"Already subscribed to the channel \\\"\"+channel+\"\\\"\");}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else if(!ortcIsValidBoolean(subscribeOnReconnected)){delegateExceptionCallback(ortc,\"The argument \\\"subscribeOnReconnected\\\" must be a boolean\");}else if(!ortcIsFunction(onMessageCallback)){delegateExceptionCallback(ortc,\"The argument \\\"onMessageCallback\\\" must be a function\");}else{if(ortc.sockjs!=null){var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){delegateExceptionCallback(ortc,\"No permission found to subscribe to the channel \\\"\"+channel+\"\\\"\");}else{if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=true;subscribedChannels[channel].isSubscribed=false;subscribedChannels[channel].subscribeOnReconnected=subscribeOnReconnected;subscribedChannels[channel].onMessageCallback=onMessageCallback;subscribedChannels[channel].filter=filter;}else{subscribedChannels[channel]={\"isSubscribing\":true,\"isSubscribed\":false,\"subscribeOnReconnected\":subscribeOnReconnected,\"onMessageCallback\":onMessageCallback,\"filter\":filter};}if(regId){subscribedChannels[channel].withNotifications=true;ortc.sockjs.send(\"subscribe;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+regId+\";\"+pushPlatform);}else{subscribedChannels[channel].withNotifications=false;if(filter){ortc.sockjs.send(\"subscribefilter;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+filter);}else{ortc.sockjs.send(\"subscribe;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm);}}}}}};/*\n\t * Unsubscribes from the channel so the client object stops receiving messages sent to it.\n\t */this.unsubscribe=function(channel){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(!subscribedChannels[channel]||subscribedChannels[channel]&&!subscribedChannels[channel].isSubscribed){delegateExceptionCallback(ortc,\"Not subscribed to the channel \"+channel);}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else{if(ortc.sockjs!=null){if(subscribedChannels[channel].withNotifications==true){ortc.sockjs.send(\"unsubscribe;\"+ortc.appKey+\";\"+channel+\";\"+ortc.registrationId+\";\"+pushPlatform);}else{ortc.sockjs.send(\"unsubscribe;\"+ortc.appKey+\";\"+channel);}}}};/*\n\t * Sends the message to the channel.\n\t */this.send=function(channel,message){/*\n\t Sanity Checks\n\t */if(!isConnected||ortc.sockjs==null){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else if(!message){delegateExceptionCallback(ortc,\"Message is null or empty\");}else if(!ortcIsString(message)){delegateExceptionCallback(ortc,\"Message must be a string\");}else if(channel.length>channelMaxSize){delegateExceptionCallback(ortc,\"Channel size exceeds the limit of \"+channelMaxSize+\" characters\");}else{var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){delegateExceptionCallback(ortc,\"No permission found to send to the channel \\\"\"+channel+\"\\\"\");}else{// Multi part\n\tvar messageParts=[];var messageId=generateId(8);var i;var allowedMaxSize=messageMaxSize-channel.length;for(i=0;i<message.length;i=i+allowedMaxSize){// Just one part\n\tif(message.length<=allowedMaxSize){messageParts.push(message);break;}if(message.substring(i,i+allowedMaxSize)){messageParts.push(message.substring(i,i+allowedMaxSize));}}for(var j=1;j<=messageParts.length;j++){ortc.sockjs.send(\"send;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+channel+\";\"+hashPerm+\";\"+messageId+\"_\"+j+\"-\"+messageParts.length+\"_\"+messageParts[j-1]);}}}};/*\n\t * Sends the message to multiple channels.\n\t */this.batchSend=function(channels,message){/*\n\t Sanity Checks\n\t */channels=ortcStrToArray(channels);if(!isConnected||ortc.sockjs==null){delegateExceptionCallback(ortc,\"Not connected\");}else if(!ortcIsArray(channels)){delegateExceptionCallback(ortc,\"Channels must be a array\");}else if(!message){delegateExceptionCallback(ortc,\"Message is null or empty\");}else if(!ortcIsString(message)){delegateExceptionCallback(ortc,\"Message must be a string\");}else if(channels.length<=0){delegateExceptionCallback(ortc,\"Channels must be an array at least with one channel\");}else if(channels.length>channelsMaxSize){channels=[];delegateExceptionCallback(ortc,\"The channel maximum was reached (>\"+channelsMaxSize+\")\");}for(i=0;i<channels.length;i++){var channel=channels[i];if(channel.length>channelMaxSize){channels.splice(i,1);delegateExceptionCallback(ortc,\"Channel \"+channel+\" size exceeds the limit of \"+channelMaxSize+\" characters\");}}if(channels.length>0){var arrayHashPerm=[];for(i=0;i<channels.length;i++){var channel=channels[i];var domainChannelCharacterIndex=channel.indexOf(\":\");var channelToValidate=channel;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=channel.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[channel];}if(userPerms&&userPerms!=null&&!hashPerm){channels.splice(i,1);delegateExceptionCallback(ortc,\"No permission found to send to the channel \\\"\"+channel+\"\\\"\");}else{arrayHashPerm.push(hashPerm);}}if(channels.length>0){var messageParts=[];var messageId=generateId(8);var allowedMaxSize=messageMaxSize-channels.toString().length;for(i=0;i<message.length;i=i+allowedMaxSize){// Just one part\n\tif(message.length<=allowedMaxSize){messageParts.push(message);break;}if(message.substring(i,i+allowedMaxSize)){messageParts.push(message.substring(i,i+allowedMaxSize));}}for(j=1;j<=messageParts.length;j++){ortc.sockjs.send(\"batchSend;\"+ortc.appKey+\";\"+ortc.authToken+\";\"+JSON.stringify(channels)+\";\"+JSON.stringify(arrayHashPerm)+\";\"+messageId+\"_\"+j+\"-\"+messageParts.length+\"_\"+messageParts[j-1]);}}}};/*\n\t * Disconnects from the gateway.\n\t */this.disconnect=function(){clearReconnectInterval();stopReconnectProcess();// Clear subscribed channels\n\tsubscribedChannels={};/*\n\t Sanity Checks\n\t */if(!isConnected&&!invalidConnection){delegateExceptionCallback(ortc,\"Not connected\");}else{disconnectSocket();}};/*\n\t * Gets a value indicating whether this client object is subscribed to the channel.\n\t */this.isSubscribed=function(channel){/*\n\t Sanity Checks\n\t */if(!isConnected){delegateExceptionCallback(ortc,\"Not connected\");}else if(!channel){delegateExceptionCallback(ortc,\"Channel is null or empty\");}else if(!ortcIsValidInput(channel)){delegateExceptionCallback(ortc,\"Channel has invalid characters\");}else{if(subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed){return subscribedChannels[channel].isSubscribed;}else{return false;}}};/*\n\t * Gets a json indicating the subscriptions in a channel.\n\t */this.presence=function(parameters,callback){try{var requestUrl=null,isCluster=false,appKey=ortc.appKey,authToken=ortc.authToken;if(parameters.url){requestUrl=parameters.url.ortcTreatUrl();isCluster=parameters.isCluster;appKey=parameters.applicationKey;authToken=parameters.authenticationToken;}else{if(clusterUrl&&clusterUrl!=null){requestUrl=clusterUrl;isCluster=true;}else{requestUrl=url.ortcTreatUrl();;}}getServerUrl({requestUrl:requestUrl,isCluster:isCluster,appKey:appKey},function(error,serverUrl){if(error){callback(error,null);}else{jsonp(serverUrl+\"/presence/\"+appKey+\"/\"+authToken+\"/\"+parameters.channel,callback);}});}catch(e){callback(\"Unable to get presence data\",null);}};var getServerUrl=function(parameters,callback){if(parameters.requestUrl&&parameters.isCluster){var guid=generateGuid();var queryString=\"guid=\"+generateGuid();queryString=parameters.appKey?queryString+\"&appkey=\"+parameters.appKey:queryString;loadClusterServerScript(parameters.requestUrl+\"/?\"+queryString,guid,function(clusterServerResolved,scriptGuid){if(clusterServerResolved){var resultUrl=SOCKET_SERVER;callback(null,resultUrl);}else{callback(null,\"Unable to get server from cluster\");}try{clearScripts(scriptGuid);}catch(loadError){}});}else{var resultUrl=parameters.requestUrl.ortcTreatUrl();callback(null,resultUrl);}};/*\n\t * Adds the Webspectator bootstrap script for the outmost frame on the same domain.\n\t */this.setMonetizerId=function(publicId){var tempWin;var win=tempWin=window;while(tempWin!=window.top){try{if(tempWin.frameElement){win=tempWin.parent;}}catch(e){}tempWin=tempWin.parent;}if(!win._WS_BOOT){var s=document.createElement(\"SCRIPT\");s.src=\"//wfpscripts.webspectator.com/bootstrap/ws-\"+publicId+\".js\";document.getElementsByTagName(\"head\")[0].appendChild(s);}};/***********************************************************\n\t * @private methods\n\t ***********************************************************//*\n\t * Change the current URL to use SSL\n\t */var changeUrlSsl=function(){if(!(\"ActiveXObject\"in window)){if(clusterUrl&&clusterUrl!=null){//clusterUrl = clusterUrl.replace(\"http://\", \"https://\");\n\tif(clusterUrl.indexOf(\"ssl/\")<0){var slashAtTheEnd=clusterUrl.search(/\\/([\\d.]*)\\/$/);if(slashAtTheEnd>-1){clusterUrl=clusterUrl.substring(0,slashAtTheEnd+1)+\"ssl/\"+clusterUrl.substring(slashAtTheEnd+1,clusterUrl.length);}else{clusterUrl=clusterUrl.substring(0,clusterUrl.lastIndexOf(\"/\")+1)+\"ssl/\"+clusterUrl.substring(clusterUrl.lastIndexOf(\"/\")+1);}}}else{url=url.replace(\"http://\",\"https://\");}}// Create session cookie\n\t//createSessionCookie(sslSessionCookieName, 1);\n\t};/*\n\t * Clear the reconnecting interval\n\t */var clearReconnectInterval=function(){if(ortc.reconnectIntervalId){clearInterval(ortc.reconnectIntervalId);ortc.reconnectIntervalId=null;}};/*\n\t * Clear the validated timeout\n\t */var clearValidatedTimeout=function(self){if(self.validatedTimeoutId){clearTimeout(self.validatedTimeoutId);self.validatedTimeoutId=null;}};/*\n\t * Stop the reconnecting process\n\t */var stopReconnectProcess=function(){stopReconnecting=true;alreadyConnectedFirstTime=false;};var startHeartBeatInterval=function(self){if(!self.heartbeatInterval&&heartbeatActive){self.sockjs.send(\"b\");self.heartbeatInterval=setInterval(function(){if(!heartbeatActive){stopHeartBeatInterval(self);}else{self.sockjs.send(\"b\");}},heartbeatTime*1000);}};var stopHeartBeatInterval=function(self){if(self.heartbeatInterval){clearInterval(self.heartbeatInterval);self.heartbeatInterval=null;}};/*\n\t * Creates a cookie with expiration time.\n\t */var createExpireCookie=function(name,value,minutes){var expires=\"\";if(minutes){var date=new Date();date.setTime(date.getTime()+minutes*60*1000);expires=\"; expires=\"+date.toGMTString();}document.cookie=name+\"=\"+value+expires+\"; path=/\";};/*\n\t * Creates a session cookie.\n\t */var createSessionCookie=function(name,value){document.cookie=name+\"=\"+value+\"; path=/\";};/*\n\t * Reads a cookie.\n\t */var readCookie=function(name){var nameEQ=name+\"=\";var ca=document.cookie.split(\";\");var result=null;for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==\" \"){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)==0){result=c.substring(nameEQ.length,c.length);break;}}return result;};/*\n\t * Generates an ID.\n\t */var generateId=function(size){var result=\"\";var S4=function(){return((1+Math.random())*0x10000|0).toString(16).substring(1);};for(var i=0;i<size/4;i++){result+=S4();}return result;};/*\n\t * Disconnects the socket.\n\t */var disconnectSocket=function(){stopHeartBeatInterval(ortc);reconnectStartedAt=null;isConnected=false;isConnecting=false;validatedArrived=false;retryingWithSsl=false;clearValidatedTimeout(self);if(ortc.sockjs!=null){ortc.sockjs.close();ortc.sockjs=null;}};/*\n\t * Reconnects the socket.\n\t */var reconnectSocket=function(){stopHeartBeatInterval(ortc);if(isConnecting){delegateExceptionCallback(ortc,\"Unable to connect\");}isConnecting=true;delegateReconnectingCallback(ortc);reconnectStartedAt=new Date().getTime();if(clusterUrl&&clusterUrl!=null){clusterConnection();}else{ortc.sockjs=createSocketConnection(url);}};/*\n\t * Tries a connection through the cluster gateway with the application key and authentication token.\n\t */var clusterConnection=function(){var guid=generateGuid();var queryString=\"guid=\"+generateGuid();queryString=ortc.appKey?queryString+\"&appkey=\"+ortc.appKey:queryString;loadClusterServerScript(clusterUrl+\"/?\"+queryString,guid,function(clusterServerResolved,scriptGuid){if(clusterServerResolved){url=SOCKET_SERVER;sockjs=createSocketConnection(ortc.getUrl());}try{clearScripts(scriptGuid);}catch(loadError){}});};/*\n\t * Clears the javascript scripts previously loaded into the page.\n\t */var clearScripts=function(guid){var headChildren=document.getElementsByTagName(\"head\")[0].children;var childrenToRemove=[];for(var i=0;i<headChildren.length;i++){if(headChildren[i].attributes!=null&&headChildren[i].attributes[\"ortcScriptId\"]&&headChildren[i].attributes[\"ortcScriptId\"].value==guid){childrenToRemove.push(i);}}for(var child in childrenToRemove){document.getElementsByTagName(\"head\")[0].removeChild(headChildren[childrenToRemove[child]]);}};/*\n\t * Loads the cluster server javascript script into the page.\n\t */var loadClusterServerScript=function(scriptUrl,guid,callback){var script=document.createElement(\"script\");script.type=\"text/javascript\";script.setAttribute(\"ortcScriptId\",guid);waitingClusterResponse=true;if(script.readyState){// IE\n\tscript.onreadystatechange=function(){if(script.readyState==\"loaded\"||script.readyState==\"complete\"){waitingClusterResponse=false;script.onreadystatechange=null;if(typeof SOCKET_SERVER!=\"undefined\"&&SOCKET_SERVER.indexOf(\"undefined\")<0&&SOCKET_SERVER.indexOf(\"unknown_server\")<0){callback(true,guid);}else{callback(false,guid);}}};}else{// Others\n\tscript.onload=function(){waitingClusterResponse=false;if(typeof SOCKET_SERVER!=\"undefined\"&&SOCKET_SERVER.indexOf(\"undefined\")<0&&SOCKET_SERVER.indexOf(\"unknown_server\")<0){callback(true,guid);}else{callback(false,guid);}};}script.onerror=function(){waitingClusterResponse=false;};script.src=scriptUrl;document.getElementsByTagName(\"head\")[0].appendChild(script);};/*\n\t * Generates a GUID.\n\t */var generateGuid=function(){var S4=function(){return((1+Math.random())*0x10000|0).toString(16).substring(1);};return S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4();};/*\n\t * Count the dictionary keys.\n\t */var countKeys=function(dic){var count=0;for(var i in dic){count++;}return count;};/*\n\t * Creates a socket connection.\n\t */var createSocketConnection=function(connectionUrl){var self=ortc;if(self.sockjs==null){if(navigator&&navigator.userAgent&&navigator.userAgent.indexOf(\"PlayStation Vita\")>=0){protocol=\"jsonp-polling\";}self.sockjs=new SockJS(connectionUrl+\"/broadcast\",protocol);// Timeout to receive the validated message\n\tif(!self.sslFallback){var validateTimeoutTime=5000;self.validatedTimeoutId=setTimeout(function(){self.sslFallback=true;stopReconnectProcess();disconnectSocket();invalidConnection=true;retryingWithSsl=true;if(connectionUrl.indexOf(\"https://\")>=0){// We are already using SSL, try streaming\n\tprotocol=\"xhr-streaming\";}else{protocol=undefined;}changeUrlSsl();},validateTimeoutTime);}else if(!self.xhrStreamingFallback){// The SSL fallback failed. Try xhr-streaming\n\tvar validateSslTimeoutTime=5000;self.validatedTimeoutId=setTimeout(function(){self.xhrStreamingFallback=true;stopReconnectProcess();disconnectSocket();invalidConnection=true;retryingWithSsl=true;protocol=\"xhr-streaming\";},validateSslTimeoutTime);}// Connect handler\n\tself.sockjs.onopen=function(){protocol=self.sockjs.protocol;// Update last keep alive time\n\tlastKeepAlive=new Date().getTime();// If is a reconnect do not count session\n\tif(alreadyConnectedFirstTime){sessionId=\"\";}else{// Read session cookie\n\tsessionId=readCookie(sessionCookieName+self.appKey+\"-s\");if(!sessionId){// Read expiration cookie\n\tsessionId=readCookie(sessionCookieName+self.appKey);if(!sessionId){sessionId=generateId(16);}// Create session cookie\n\tcreateSessionCookie(sessionCookieName+self.appKey+\"-s\",sessionId);// Check if session cookie was created\n\tif(!readCookie(sessionCookieName+self.appKey+\"-s\")){sessionId=\"\";}}}var heartbeatDetails=heartbeatActive?\";\"+self.getHeartbeatTime()+\";\"+self.getHeartbeatFails()+\";\":\"\";self.sockjs.send(\"validate;\"+self.appKey+\";\"+self.authToken+\";\"+(announcementSubChannel?announcementSubChannel:\"\")+\";\"+sessionId+\";\"+connectionMetadata+heartbeatDetails);};// Disconnect handler\n\tself.sockjs.onclose=function(e){// e.code=1000 - e.reason=Normal closure\n\t// e.code=1006 - e.reason=WebSocket connection broken\n\t// e.code=2000 - e.reason=All transports failed\n\tstopHeartBeatInterval(ortc);if(ortc.sockjs!=null){ortc.sockjs.close();ortc.sockjs=null;}// Clear user permissions\n\tuserPerms=null;if(e.code!=1000){if(isConnected){isConnected=false;isConnecting=false;protocol=undefined;delegateDisconnectedCallback(self);}if(!stopReconnecting){if(!reconnectStartedAt||reconnectStartedAt+connectionTimeout<new Date().getTime()){reconnectSocket();}}}else{if(!invalidConnection){isConnected=false;isConnecting=false;protocol=undefined;delegateDisconnectedCallback(self);}}if(retryingWithSsl){self.connect(self.appKey,self.authToken);retryingWithSsl=false;}invalidConnection=false;};// Receive handler\n\tself.sockjs.onmessage=function(e){// Update last keep alive time\n\tlastKeepAlive=new Date().getTime();var data=e.data;var channel=data.ch;var message=data.m;var filtered=data.f;// Multi part\n\tvar regexPattern=/^(\\w[^_]*)_{1}(\\d*)-{1}(\\d*)_{1}([\\s\\S.]*)$/;var match=regexPattern.exec(message);var messageId=null;var messageCurrentPart=1;var messageTotalPart=1;var lastPart=false;if(match&&match.length>0){if(match[1]){messageId=match[1];}if(match[2]){messageCurrentPart=match[2];}if(match[3]){messageTotalPart=match[3];}if(match[4]){message=match[4];}}if(messageId){if(!messagesBuffer[messageId]){messagesBuffer[messageId]={};}messagesBuffer[messageId][messageCurrentPart]=message;if(countKeys(messagesBuffer[messageId])==messageTotalPart){lastPart=true;}}else{lastPart=true;}if(lastPart){if(messageId){message=\"\";for(var i=1;i<=messageTotalPart;i++){message+=messagesBuffer[messageId][i];delete messagesBuffer[messageId][i];}delete messagesBuffer[messageId];}delegateMessagesCallback(self,channel,filtered,message);}};self.sockjs.onortcsubscribed=function(e){lastKeepAlive=new Date().getTime();var channel=e.data;if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;subscribedChannels[channel].isSubscribed=true;}delegateSubscribedCallback(self,channel);};self.sockjs.onortcunsubscribed=function(e){lastKeepAlive=new Date().getTime();var channel=e.data;if(subscribedChannels[channel]){subscribedChannels[channel].isSubscribed=false;}delegateUnsubscribedCallback(self,channel);};self.sockjs.onheartbeat=function(){lastKeepAlive=new Date().getTime();};self.sockjs.onortcvalidated=function(e){var sessionExpirationTime=30;if(e.data){userPerms=e.data;}if(e.set){sessionExpirationTime=e.set;}clearValidatedTimeout(self);validatedArrived=true;retryingWithSsl=false;isConnecting=false;isConnected=true;reconnectStartedAt=null;if(sessionId){if(!readCookie(sessionCookieName+self.appKey+\"-s\")){createSessionCookie(sessionCookieName+self.appKey+\"-s\",sessionId);}if(!readCookie(sessionCookieName+self.appKey)){createExpireCookie(sessionCookieName+self.appKey,sessionId,sessionExpirationTime);}}if(alreadyConnectedFirstTime){var channelsToRemove={};// Subscribe to the previously subscribed channels\n\tfor(var key in subscribedChannels){// Subscribe again\n\tif(subscribedChannels[key].subscribeOnReconnected==true&&(subscribedChannels[key].isSubscribing||subscribedChannels[key].isSubscribed)){subscribedChannels[key].isSubscribing=true;subscribedChannels[key].isSubscribed=false;var domainChannelCharacterIndex=key.indexOf(\":\");var channelToValidate=key;var hashPerm=null;if(domainChannelCharacterIndex>0){channelToValidate=key.substring(0,domainChannelCharacterIndex+1)+\"*\";}if(userPerms&&userPerms!=null){hashPerm=userPerms[channelToValidate]?userPerms[channelToValidate]:userPerms[key];}if(subscribedChannels[key].filter){self.sockjs.send(\"subscribefilter;\"+self.appKey+\";\"+self.authToken+\";\"+key+\";\"+hashPerm+\";\"+subscribedChannels[key].filter);}else{self.sockjs.send(\"subscribe;\"+self.appKey+\";\"+self.authToken+\";\"+key+\";\"+hashPerm);}}else{channelsToRemove[key]=key;}}for(var keyToRemove in channelsToRemove){delete subscribedChannels[keyToRemove];}messagesBuffer={};delegateReconnectedCallback(self);}else{alreadyConnectedFirstTime=true;delegateConnectedCallback(self);}};self.sockjs.onortcerror=function(e){lastKeepAlive=new Date().getTime();var data=e.data;var operation=data.op;var channel=data.ch;var error=data.ex?data.ex:data;delegateExceptionCallback(self,error);switch(operation){case\"validate\":if(error.indexOf(\"busy\")<0){invalidConnection=true;clearValidatedTimeout(self);retryingWithSsl=false;stopReconnectProcess();}else{clearValidatedTimeout(self);retryingWithSsl=false;}break;case\"subscribe\":if(channel&&subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;}break;case\"subscribe_maxsize\":case\"unsubscribe_maxsize\":case\"shutdown\":clearValidatedTimeout(self);retryingWithSsl=false;break;case\"send_maxsize\":if(channel&&subscribedChannels[channel]){subscribedChannels[channel].isSubscribing=false;}stopReconnectProcess();break;default:break;}};}return self.sockjs;};var jsonp=function(url,callback){var head=document.head?document.head:document.getElementsByTagName(\"head\")[0];var script=document.createElement(\"script\");var guid=\"ortcJsonp\"+ +new Date();var jsonpCallTimeout=setTimeout(function(){try{callback(\"Unable to get data\",null);window[guid]=undefined;delete window[guid];head.removeChild(script);}catch(e){}},15*1000);window[guid]=function(data){clearTimeout(jsonpCallTimeout);if(data.error){callback(data.error,null);}else{callback(null,data.content);}try{window[guid]=undefined;delete window[guid];head.removeChild(script);}catch(e){}};script.setAttribute(\"src\",url+\"?callback=\"+guid);head.appendChild(script);};var delegateConnectedCallback=function(ortc){if(ortc!=null&&ortc.onConnected!=null){startHeartBeatInterval(ortc);ortc.onConnected(ortc);}};var delegateDisconnectedCallback=function(ortc){if(ortc!=null&&ortc.onDisconnected!=null){ortc.onDisconnected(ortc);}};var delegateSubscribedCallback=function(ortc,channel){if(ortc!=null&&ortc.onSubscribed!=null&&channel!=null){ortc.onSubscribed(ortc,channel);}};var delegateUnsubscribedCallback=function(ortc,channel){if(ortc!=null&&ortc.onUnsubscribed!=null&&channel!=null){ortc.onUnsubscribed(ortc,channel);}};var delegateMessagesCallback=function(ortc,channel,filtered,message){if(ortc!=null&&subscribedChannels[channel]&&subscribedChannels[channel].isSubscribed&&subscribedChannels[channel].onMessageCallback!=null){if(filtered==null){// regular subscription\n\tsubscribedChannels[channel].onMessageCallback(ortc,channel,message);}else{// filtered subscription\n\tsubscribedChannels[channel].onMessageCallback(ortc,channel,filtered,message);}}};var delegateExceptionCallback=function(ortc,event){if(ortc!=null&&ortc.onException!=null){ortc.onException(ortc,event);}};var delegateReconnectingCallback=function(ortc){if(ortc!=null&&ortc.onReconnecting!=null){ortc.onReconnecting(ortc);}};var delegateReconnectedCallback=function(ortc){if(ortc!=null&&ortc.onReconnected!=null){startHeartBeatInterval(ortc);ortc.onReconnected(ortc);}};}", "componentDidMount() {\n //setLocalNotification();\n }", "function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\n\t\tMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n\t\t{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\t\t\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n\t\t(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n<s.length;n++)g=s[n],f==\"a.contentType\"?(h&&(h+=\",\"+g),w[g]=e[f]):a==\"view\"||a==\"segmentView\"||a==\"clicked\"||a==\"complete\"||a==\"timePlayed\"||a==\"CPM\"?(d&&(d+=\",\"+\r\n\t\tg),a==\"timePlayed\"||a==\"CPM\"?e[f]&&(w.events2+=(w.events2?\",\":\"\")+g+\"=\"+e[f]):e[f]&&(w.events2+=(w.events2?\",\":\"\")+g)):a==\"segment\"&&e[f+\"Num\"]?(h&&(h+=\",\"+g),w[g]=e[f+\"Num\"]+\":\"+e[f]):(h&&(h+=\",\"+g),w[g]=e[f])}else if(a==\"milestones\"||a==\"offsetMilestones\")f=f.substring(0,f.length-1),e[f]&&m.contextDataMapping[f+\"s\"][e[f]]&&(d&&(d+=\",\"+m.contextDataMapping[f+\"s\"][e[f]]),w.events2+=(w.events2?\",\":\"\")+m.contextDataMapping[f+\"s\"][e[f]]);e[f]&&(e[f]=0);a==\"segment\"&&e[f+\"Num\"]&&(e[f+\"Num\"]=0)}}w.linkTrackVars=\r\n\t\th;w.linkTrackEvents=d};m.g=function(w,b,c,h,d){var a={},g=(new Date).getTime()/1E3,e,f,s=m.trackVars,n=m.trackEvents,o=m.trackSeconds,p=m.trackMilestones,q=m.trackOffsetMilestones,r=m.segmentByMilestones,t=m.segmentByOffsetMilestones,k,j,l=1,i={},u;if(!m.channel)m.channel=m.s.w.location.hostname;if(a=w&&m.list&&m.list[w]?m.list[w]:0){if(a.l)o=m.adTrackSeconds,p=m.adTrackMilestones,q=m.adTrackOffsetMilestones,r=m.adSegmentByMilestones,t=m.adSegmentByOffsetMilestones;c<0&&(c=a.j==1&&a.r>0?g-a.r+a.a:\r\n\t\ta.a);a.length>0&&(c=c<a.length?c:a.length);c<0&&(c=0);a.u=c;if(a.length>0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\t\t\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f/a.length*100<e&&a.c>=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f<e&&c>=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j<k.length;j++)if(e=k[j]?parseFloat(\"\"+\r\n\t\tk[j]):0){if(a.c<e)h=j+1,d=\"M:\"+f+\"-\"+e,j=k.length;f=e}}}else if(t&&q&&(k=q.split(\",\"))){k.push(\"\"+(a.length>0?a.length:\"E\"));for(j=f=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)||k[j]==\"E\"){if(c<e||k[j]==\"E\")h=j+1,d=\"O:\"+f+\"-\"+e,j=k.length;f=e}}if(d)a.K=!0}if((d||a.e)&&d!=a.e){a.D=!0;if(!a.e)a.m=h,a.e=d;a.k>=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a<c)a.L+=c-a.a,a.f+=c-a.a;if(b<=2||b==3&&!a.j)a.B+=(b==1||b==3?\"S\":\"E\")+Math.floor(c),a.j=b==3?1:b;if(!l&&a.k>=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\t\t\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\n\t\ta.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\n\t\tb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\n\t\tb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b<w.length;b++)m.attach(w[b])};m.i(s,\"load\",m.N)}", "constructor(httpClient) {\n this.httpClient = httpClient;\n //public url_base = \"http://localhost:8080\";\n this.url_base = \"https://yaoyuan333.wm.r.appspot.com\";\n }", "function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\nMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n<s.length;n++)g=s[n],f==\"a.contentType\"?(h&&(h+=\",\"+g),w[g]=e[f]):a==\"view\"||a==\"segmentView\"||a==\"clicked\"||a==\"complete\"||a==\"timePlayed\"||a==\"CPM\"?(d&&(d+=\",\"+\r\ng),a==\"timePlayed\"||a==\"CPM\"?e[f]&&(w.events2+=(w.events2?\",\":\"\")+g+\"=\"+e[f]):e[f]&&(w.events2+=(w.events2?\",\":\"\")+g)):a==\"segment\"&&e[f+\"Num\"]?(h&&(h+=\",\"+g),w[g]=e[f+\"Num\"]+\":\"+e[f]):(h&&(h+=\",\"+g),w[g]=e[f])}else if(a==\"milestones\"||a==\"offsetMilestones\")f=f.substring(0,f.length-1),e[f]&&m.contextDataMapping[f+\"s\"][e[f]]&&(d&&(d+=\",\"+m.contextDataMapping[f+\"s\"][e[f]]),w.events2+=(w.events2?\",\":\"\")+m.contextDataMapping[f+\"s\"][e[f]]);e[f]&&(e[f]=0);a==\"segment\"&&e[f+\"Num\"]&&(e[f+\"Num\"]=0)}}w.linkTrackVars=\r\nh;w.linkTrackEvents=d};m.g=function(w,b,c,h,d){var a={},g=(new Date).getTime()/1E3,e,f,s=m.trackVars,n=m.trackEvents,o=m.trackSeconds,p=m.trackMilestones,q=m.trackOffsetMilestones,r=m.segmentByMilestones,t=m.segmentByOffsetMilestones,k,j,l=1,i={},u;if(!m.channel)m.channel=m.s.w.location.hostname;if(a=w&&m.list&&m.list[w]?m.list[w]:0){if(a.l)o=m.adTrackSeconds,p=m.adTrackMilestones,q=m.adTrackOffsetMilestones,r=m.adSegmentByMilestones,t=m.adSegmentByOffsetMilestones;c<0&&(c=a.j==1&&a.r>0?g-a.r+a.a:\r\na.a);a.length>0&&(c=c<a.length?c:a.length);c<0&&(c=0);a.u=c;if(a.length>0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f/a.length*100<e&&a.c>=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)&&f<e&&c>=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j<k.length;j++)if(e=k[j]?parseFloat(\"\"+\r\nk[j]):0){if(a.c<e)h=j+1,d=\"M:\"+f+\"-\"+e,j=k.length;f=e}}}else if(t&&q&&(k=q.split(\",\"))){k.push(\"\"+(a.length>0?a.length:\"E\"));for(j=f=0;j<k.length;j++)if((e=k[j]?parseFloat(\"\"+k[j]):0)||k[j]==\"E\"){if(c<e||k[j]==\"E\")h=j+1,d=\"O:\"+f+\"-\"+e,j=k.length;f=e}}if(d)a.K=!0}if((d||a.e)&&d!=a.e){a.D=!0;if(!a.e)a.m=h,a.e=d;a.k>=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a<c)a.L+=c-a.a,a.f+=c-a.a;if(b<=2||b==3&&!a.j)a.B+=(b==1||b==3?\"S\":\"E\")+Math.floor(c),a.j=b==3?1:b;if(!l&&a.k>=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\na.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\nb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\nb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b<w.length;b++)m.attach(w[b])};m.i(s,\"load\",m.N)}", "create () {\r\n // Send a create-job message to the native-app.\r\n openPort();\r\n return browser.storage.local.get({ props: {} }).then(result => {\r\n // Get a cookie jar for the job.\r\n return getCookieJarForVideo(this.props.videoUrl).then(cookieJar => {\r\n state.port.postMessage({\r\n topic: 'create-job',\r\n data: {\r\n jobId: this.id,\r\n // Merge the default props and the job props.\r\n props: Object.assign({ cookieJar }, result.props, this.props)\r\n }\r\n });\r\n \r\n // Flag this job as active.\r\n this.state = 'active';\r\n \r\n // Make the icon blue because a job is running.\r\n browser.browserAction.setIcon({\r\n path: 'icons/film-blue.svg'\r\n });\r\n });\r\n });\r\n }", "supportsPlatform() {\n return true;\n }", "function FileSystemService($http, $q, $log) {\n var _directory = LocalFileSystem.PERSISTENT;\n var _fs = null;\n var _that = this;\n\n this.isInitalized = false;\n\n function errorHandler(e) {\n var msg = '';\n\n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n msg = 'QUOTA_EXCEEDED_ERR';\n break;\n case FileError.NOT_FOUND_ERR:\n msg = 'NOT_FOUND_ERR';\n break;\n case FileError.SECURITY_ERR:\n msg = 'SECURITY_ERR';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n msg = 'INVALID_MODIFICATION_ERR';\n break;\n case FileError.INVALID_STATE_ERR:\n msg = 'INVALID_STATE_ERR';\n break;\n default:\n msg = 'Unknown Error';\n break;\n };\n\n $log.error('FileSystemService: ' + msg);\n }\n\n // startup\n window.requestFileSystem(_directory, 0, function(fs){\n _fs = fs;\n _that.isInitalized = true;\n }, errorHandler);\n\n\n /**\n * Checks if file is in persistent storage\n */\n this.fileExists = function(filename) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n //var uri = _directory + \"/\" + filename;\n //return $http.get(uri);\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {}, function(fileEntry) {\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n deferred.resolve(e.target.result);\n };\n\n reader.readAsDataURL(file);\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n\n /**\n * Get File from perstistent storage\n */\n this.getFile = function(filename) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n //var uri = _directory + \"/\" + filename;\n //return $http.get(uri);\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {}, function(fileEntry) {\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n deferred.resolve(e.target.result);\n };\n\n reader.readAsDataURL(file);\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n\n /**\n * Save data into file (and create that if necessary).\n */\n this.saveFile = function(filename, data) {\n // fs not initialised\n if(!_that.isInitalized)\n return;\n\n var deferred = $q.defer();\n\n _fs.root.getFile(filename, {create: true}, function(fileEntry) {\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function(fileWriter) {\n\n fileWriter.onwriteend = function(e) {\n $log.log('Write completed.');\n deferred.resolve();\n };\n\n fileWriter.onerror = function(e) {\n deferred.reject(e);\n $log.error('FileSystemService: write failed, ' + e.toString());\n };\n\n // Create a new Blob and write it to log.txt.\n var blob = new Blob([data], {type: 'text/plain'});\n\n fileWriter.write(blob);\n\n }, errorHandler);\n }, errorHandler);\n\n return deferred.promise;\n }\n}", "static initialize(app, changeLogService, deviceService, deviceFileService, deviceFileUploadService, file, httpService, localDBManagementService, localDbService, networkService, securityService) {\n if (this.initialized) {\n return;\n }\n deviceService.addStartUpService({\n serviceName: 'OfflineStartupService',\n start: () => {\n if (window['SQLitePlugin']) {\n localDBManagementService.setLogSQl((sessionStorage.getItem('wm.logSql') === 'true') || (sessionStorage.getItem('debugMode') === 'true'));\n window.logSql = (flag = true) => {\n localDBManagementService.setLogSQl(flag);\n sessionStorage.setItem('wm.logSql', flag ? 'true' : 'false');\n };\n window.executeLocalSql = (dbName, query, params) => {\n localDBManagementService.executeSQLQuery(dbName, query, params, true);\n };\n return localDBManagementService.loadDatabases().then(() => {\n changeLogService.addWorker(new IdResolver(localDBManagementService));\n changeLogService.addWorker(new ErrorBlocker(localDBManagementService));\n changeLogService.addWorker(new FileHandler());\n changeLogService.addWorker(new MultiPartParamTransformer(deviceFileService, localDBManagementService));\n new LiveVariableOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService, localDbService).add();\n new FileUploadOfflineBehaviour(changeLogService, deviceFileService, deviceFileUploadService, file, networkService, deviceFileService.getUploadDirectory()).add();\n new NamedQueryExecutionOfflineBehaviour(changeLogService, httpService, localDBManagementService, networkService).add();\n localDBManagementService.registerCallback(new UploadedFilesImportAndExportService(changeLogService, deviceFileService, localDBManagementService, file));\n changeLogService.addWorker({\n onAddCall: () => {\n if (!networkService.isConnected()) {\n networkService.disableAutoConnect();\n }\n },\n postFlush: stats => {\n if (stats.totalTaskCount > 0) {\n localDBManagementService.close()\n .catch(noop)\n .then(() => {\n location.assign(window.location.origin + window.location.pathname);\n });\n }\n }\n });\n });\n }\n return Promise.resolve();\n }\n });\n new SecurityOfflineBehaviour(app, file, deviceService, networkService, securityService).add();\n }", "constructor(){\n\t\t//console.log('API START');\n\t}", "get deviceServiceUUID() { return this._deviceServiceUUID ? this._deviceServiceUUID : 'FFE0'; }", "constructor () {\r\n\t\t\r\n\t}", "_sdkCompatibility() {\n // WebSocket\n // http://caniuse.com/#feat=websockets\n var canCreateWebSocket = 'WebSocket' in window;\n console.log('Native WebSocket capability: ' +\n canCreateWebSocket);\n\n if (!canCreateWebSocket) {\n throw new Error('No WebSocket capabilities');\n }\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x330b4067;\n this.SUBCLASS_OF_ID = 0xd3262a4a;\n\n this.phonecallsEnabled = args.phonecallsEnabled || null;\n this.defaultP2pContacts = args.defaultP2pContacts || null;\n this.preloadFeaturedStickers = args.preloadFeaturedStickers || null;\n this.ignorePhoneEntities = args.ignorePhoneEntities || null;\n this.revokePmInbox = args.revokePmInbox || null;\n this.blockedMode = args.blockedMode || null;\n this.pfsEnabled = args.pfsEnabled || null;\n this.date = args.date;\n this.expires = args.expires;\n this.testMode = args.testMode;\n this.thisDc = args.thisDc;\n this.dcOptions = args.dcOptions;\n this.dcTxtDomainName = args.dcTxtDomainName;\n this.chatSizeMax = args.chatSizeMax;\n this.megagroupSizeMax = args.megagroupSizeMax;\n this.forwardedCountMax = args.forwardedCountMax;\n this.onlineUpdatePeriodMs = args.onlineUpdatePeriodMs;\n this.offlineBlurTimeoutMs = args.offlineBlurTimeoutMs;\n this.offlineIdleTimeoutMs = args.offlineIdleTimeoutMs;\n this.onlineCloudTimeoutMs = args.onlineCloudTimeoutMs;\n this.notifyCloudDelayMs = args.notifyCloudDelayMs;\n this.notifyDefaultDelayMs = args.notifyDefaultDelayMs;\n this.pushChatPeriodMs = args.pushChatPeriodMs;\n this.pushChatLimit = args.pushChatLimit;\n this.savedGifsLimit = args.savedGifsLimit;\n this.editTimeLimit = args.editTimeLimit;\n this.revokeTimeLimit = args.revokeTimeLimit;\n this.revokePmTimeLimit = args.revokePmTimeLimit;\n this.ratingEDecay = args.ratingEDecay;\n this.stickersRecentLimit = args.stickersRecentLimit;\n this.stickersFavedLimit = args.stickersFavedLimit;\n this.channelsReadMediaPeriod = args.channelsReadMediaPeriod;\n this.tmpSessions = args.tmpSessions || null;\n this.pinnedDialogsCountMax = args.pinnedDialogsCountMax;\n this.pinnedInfolderCountMax = args.pinnedInfolderCountMax;\n this.callReceiveTimeoutMs = args.callReceiveTimeoutMs;\n this.callRingTimeoutMs = args.callRingTimeoutMs;\n this.callConnectTimeoutMs = args.callConnectTimeoutMs;\n this.callPacketTimeoutMs = args.callPacketTimeoutMs;\n this.meUrlPrefix = args.meUrlPrefix;\n this.autoupdateUrlPrefix = args.autoupdateUrlPrefix || null;\n this.gifSearchUsername = args.gifSearchUsername || null;\n this.venueSearchUsername = args.venueSearchUsername || null;\n this.imgSearchUsername = args.imgSearchUsername || null;\n this.staticMapsProvider = args.staticMapsProvider || null;\n this.captionLengthMax = args.captionLengthMax;\n this.messageLengthMax = args.messageLengthMax;\n this.webfileDcId = args.webfileDcId;\n this.suggestedLangCode = args.suggestedLangCode || null;\n this.langPackVersion = args.langPackVersion || null;\n this.baseLangPackVersion = args.baseLangPackVersion || null;\n }", "static _getName() {\n return 'ContentPlayback';\n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "start(callback){\n \n }", "onStartHeaders() {}", "async componentWillMount() {\n var _this = this\n _this.setUpUserDataFromFB()\n\n //ASK FOR CAMERA ONLT IF IS PREVIEW TRUE AND SHOWBARCODE TRUE\n if (Config.isPreview && Config.showBCScanner) {\n const { status } = await Permissions.askAsync(Permissions.CAMERA);\n this.setState({ hasCameraPermission: status === 'granted' });\n }\n\n\n\n AppEventEmitter.addListener('user.state.changes', this.alterUserState);\n if (Config.isTesterApp) {\n this.listenForUserAuth();\n } else if (Config.isPreview && !Config.isTesterApp) {\n //Load list of apps\n _this.retreiveAppDemos(\"apps\");\n }\n\n if (!Config.isPreview && !Config.isTesterApp) {\n\n //Load the data automatically, this is normal app and refister for Push notification\n this.registerForPushNotificationsAsync();\n Notifications.addListener(this._handleNotification);\n this.retreiveMeta();\n }\n\n\n await Font.loadAsync({\n //\"Material Icons\": require(\"@expo/vector-icons/fonts/MaterialIcons.ttf\"),\n //\"Ionicons\": require(\"@expo/vector-icons/fonts/Ionicons.ttf\"),\n // \"Feather\": require(\"@expo/vector-icons/fonts/Feather.ttf\"),\n 'open-sans': require('./assets/fonts/OpenSans-Regular.ttf'),\n 'lato-light': require('./assets/fonts/Lato-Light.ttf'),\n 'lato-regular': require('./assets/fonts/Lato-Regular.ttf'),\n 'lato-bold': require('./assets/fonts/Lato-Bold.ttf'),\n 'lato-black': require('./assets/fonts/Lato-Black.ttf'),\n 'roboto-medium': require('./assets/fonts/Roboto-Medium.ttf'),\n 'roboto-bold': require('./assets/fonts/Roboto-Bold.ttf'),\n 'roboto-light': require('./assets/fonts/Roboto-Light.ttf'),\n 'roboto-thin': require('./assets/fonts/Roboto-Thin.ttf'),\n\n });\n\n this.setState({ isReady: true, fontLoaded: true });\n }", "function writeHeader() {\n seekHead = createSeekHead();\n \n let\n ebmlHeader = {\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [\n {\n \"id\": 0x4286, // EBMLVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f7, // EBMLReadVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f2, // EBMLMaxIDLength\n \"data\": 4\n },\n {\n \"id\": 0x42f3, // EBMLMaxSizeLength\n \"data\": 8\n },\n {\n \"id\": 0x4282, // DocType\n \"data\": \"webm\"\n },\n {\n \"id\": 0x4287, // DocTypeVersion\n \"data\": 2\n },\n {\n \"id\": 0x4285, // DocTypeReadVersion\n \"data\": 2\n }\n ]\n },\n \n segmentInfo = {\n \"id\": 0x1549a966, // Info\n \"data\": [\n {\n \"id\": 0x2ad7b1, // TimecodeScale\n \"data\": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)\n },\n {\n \"id\": 0x4d80, // MuxingApp\n \"data\": \"webm-writer-js\",\n },\n {\n \"id\": 0x5741, // WritingApp\n \"data\": \"webm-writer-js\"\n },\n segmentDuration // To be filled in later\n ]\n },\n \n videoProperties = [\n {\n \"id\": 0xb0, // PixelWidth\n \"data\": videoWidth\n },\n {\n \"id\": 0xba, // PixelHeight\n \"data\": videoHeight\n }\n ];\n \n if (options.transparent) {\n videoProperties.push(\n {\n \"id\": 0x53C0, // AlphaMode\n \"data\": 1\n }\n );\n }\n \n let\n tracks = {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [\n {\n \"id\": 0xae, // TrackEntry\n \"data\": [\n {\n \"id\": 0xd7, // TrackNumber\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x73c5, // TrackUID\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x9c, // FlagLacing\n \"data\": 0\n },\n {\n \"id\": 0x22b59c, // Language\n \"data\": \"und\"\n },\n {\n \"id\": 0x86, // CodecID\n \"data\": \"V_VP8\"\n },\n {\n \"id\": 0x258688, // CodecName\n \"data\": \"VP8\"\n },\n {\n \"id\": 0x83, // TrackType\n \"data\": 1\n },\n {\n \"id\": 0xe0, // Video\n \"data\": videoProperties\n }\n ]\n }\n ]\n };\n \n ebmlSegment = {\n \"id\": 0x18538067, // Segment\n \"size\": -1, // Unbounded size\n \"data\": [\n seekHead,\n segmentInfo,\n tracks,\n ]\n };\n \n let\n bufferStream = new ArrayBufferDataStream(256);\n \n writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);\n blobBuffer.write(bufferStream.getAsDataArray());\n \n // Now we know where these top-level elements lie in the file:\n seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);\n seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);\n \n\t writtenHeader = true;\n }", "function AppMeasurement(){var s=this;s.version=\"1.0.3\";var w=window;if(!w.s_c_in)w.s_c_il=[],w.s_c_in=0;s._il=w.s_c_il;s._in=w.s_c_in;s._il[s._in]=s;w.s_c_in++;s._c=\"s_c\";var n=w,g,k;try{g=n.parent;for(k=n.location;g&&g.location&&k&&\"\"+g.location!=\"\"+k&&n.location&&\"\"+g.location!=\"\"+n.location&&g.location.host==k.host;)n=g,g=n.parent}catch(o){}s.za=function(s){try{console.log(s)}catch(a){}};s.ba=function(s){return\"\"+parseInt(s)==\"\"+s};s.replace=function(s,a,c){if(!s||s.indexOf(a)<0)return s;return s.split(a).join(c)};\r\ns.escape=function(b){var a,c;if(!b)return b;b=encodeURIComponent(b);for(a=0;a<7;a++)c=\"+~!*()'\".substring(a,a+1),b.indexOf(c)>=0&&(b=s.replace(b,c,\"%\"+c.charCodeAt(0).toString(16).toUpperCase()));return b};s.unescape=function(b){if(!b)return b;b=b.indexOf(\"+\")>=0?s.replace(b,\"+\",\" \"):b;try{return decodeURIComponent(b)}catch(a){}return unescape(b)};s.pa=function(){var b=w.location.hostname,a=s.fpCookieDomainPeriods,c;if(!a)a=s.cookieDomainPeriods;if(b&&!s.U&&!/^[0-9.]+$/.test(b)&&(a=a?parseInt(a):\r\n2,a=a>2?a:2,c=b.lastIndexOf(\".\"),c>=0)){for(;c>=0&&a>1;)c=b.lastIndexOf(\".\",c-1),a--;s.U=c>0?b.substring(c):b}return s.U};s.c_r=s.cookieRead=function(b){b=s.escape(b);var a=\" \"+s.d.cookie,c=a.indexOf(\" \"+b+\"=\"),e=c<0?c:a.indexOf(\";\",c);b=c<0?\"\":s.unescape(a.substring(c+2+b.length,e<0?a.length:e));return b!=\"[[B]]\"?b:\"\"};s.c_w=s.cookieWrite=function(b,a,c){var e=s.pa(),d=s.cookieLifetime,f;a=\"\"+a;d=d?(\"\"+d).toUpperCase():\"\";c&&d!=\"SESSION\"&&d!=\"NONE\"&&((f=a!=\"\"?parseInt(d?d:0):-60)?(c=new Date,c.setTime(c.getTime()+\r\nf*1E3)):c==1&&(c=new Date,f=c.getYear(),c.setYear(f+5+(f<1900?1900:0))));if(b&&d!=\"NONE\")return s.d.cookie=b+\"=\"+s.escape(a!=\"\"?a:\"[[B]]\")+\"; path=/;\"+(c&&d!=\"SESSION\"?\" expires=\"+c.toGMTString()+\";\":\"\")+(e?\" domain=\"+e+\";\":\"\"),s.cookieRead(b)==a;return 0};s.v=[];s.V=function(b,a){if(s.W)return 0;if(!s.maxDelay)s.maxDelay=250;var c=0,e=(new Date).getTime()+s.maxDelay,d=s.d.Ma,f=[\"webkitvisibilitychange\",\"visibilitychange\"];if(!d)d=s.d.Na;if(d&&d==\"prerender\"){if(!s.G){s.G=1;for(c=0;c<f.length;c++)s.d.addEventListener(f[c],\r\nfunction(){var b=s.d.Ma;if(!b)b=s.d.Na;if(b==\"visible\")s.G=0,s.delayReady()})}c=1;e=0}else s.u(\"_d\")&&(c=1);c&&(s.v.push({m:b,a:a,t:e}),s.G||setTimeout(s.delayReady,s.maxDelay));return c};s.delayReady=function(){var b=(new Date).getTime(),a=0,c;for(s.u(\"_d\")&&(a=1);s.v.length>0;){c=s.v.shift();if(a&&!c.t&&c.t>b){s.v.unshift(c);setTimeout(s.delayReady,parseInt(s.maxDelay/2));break}s.W=1;s[c.m].apply(s,c.a);s.W=0}};s.setAccount=s.sa=function(b){var a,c;if(!s.V(\"setAccount\",arguments))if(s.account=b,\r\ns.allAccounts){a=s.allAccounts.concat(b.split(\",\"));s.allAccounts=[];a.sort();for(c=0;c<a.length;c++)(c==0||a[c-1]!=a[c])&&s.allAccounts.push(a[c])}else s.allAccounts=b.split(\",\")};s.P=function(b,a,c,e,d){var f=\"\",i,j,w,q,g=0;b==\"contextData\"&&(b=\"c\");if(a){for(i in a)if(!Object.prototype[i]&&(!d||i.substring(0,d.length)==d)&&a[i]&&(!c||c.indexOf(\",\"+(e?e+\".\":\"\")+i+\",\")>=0)){w=!1;if(g)for(j=0;j<g.length;j++)i.substring(0,g[j].length)==g[j]&&(w=!0);if(!w&&(f==\"\"&&(f+=\"&\"+b+\".\"),j=a[i],d&&(i=i.substring(d.length)),\r\ni.length>0))if(w=i.indexOf(\".\"),w>0)j=i.substring(0,w),w=(d?d:\"\")+j+\".\",g||(g=[]),g.push(w),f+=s.P(j,a,c,e,w);else if(typeof j==\"boolean\"&&(j=j?\"true\":\"false\"),j){if(e==\"retrieveLightData\"&&d.indexOf(\".contextData.\")<0)switch(w=i.substring(0,4),q=i.substring(4),i){case \"transactionID\":i=\"xact\";break;case \"channel\":i=\"ch\";break;case \"campaign\":i=\"v0\";break;default:s.ba(q)&&(w==\"prop\"?i=\"c\"+q:w==\"eVar\"?i=\"v\"+q:w==\"list\"?i=\"l\"+q:w==\"hier\"&&(i=\"h\"+q,j=j.substring(0,255)))}f+=\"&\"+s.escape(i)+\"=\"+s.escape(j)}}f!=\r\n\"\"&&(f+=\"&.\"+b)}return f};s.ra=function(){var b=\"\",a,c,e,d,f,i,j,w,g=\"\",n=\"\",k=c=\"\";if(s.lightProfileID)a=s.J,(g=s.lightTrackVars)&&(g=\",\"+g+\",\"+s.ea.join(\",\")+\",\");else{a=s.e;if(s.pe||s.linkType)if(g=s.linkTrackVars,n=s.linkTrackEvents,s.pe&&(c=s.pe.substring(0,1).toUpperCase()+s.pe.substring(1),s[c]))g=s[c].Va,n=s[c].Ua;g&&(g=\",\"+g+\",\"+s.C.join(\",\")+\",\");n&&(n=\",\"+n+\",\",g&&(g+=\",events,\"));s.events2&&(k+=(k!=\"\"?\",\":\"\")+s.events2)}for(c=0;c<a.length;c++){d=a[c];f=s[d];e=d.substring(0,4);i=d.substring(4);\r\n!f&&d==\"events\"&&k&&(f=k,k=\"\");if(f&&(!g||g.indexOf(\",\"+d+\",\")>=0)){switch(d){case \"timestamp\":d=\"ts\";break;case \"dynamicVariablePrefix\":d=\"D\";break;case \"visitorID\":d=\"vid\";break;case \"pageURL\":d=\"g\";if(f.length>255)s.pageURLRest=f.substring(255),f=f.substring(0,255);break;case \"pageURLRest\":d=\"-g\";break;case \"referrer\":d=\"r\";break;case \"vmk\":case \"visitorMigrationKey\":d=\"vmt\";break;case \"visitorMigrationServer\":d=\"vmf\";s.ssl&&s.visitorMigrationServerSecure&&(f=\"\");break;case \"visitorMigrationServerSecure\":d=\r\n\"vmf\";!s.ssl&&s.visitorMigrationServer&&(f=\"\");break;case \"charSet\":d=\"ce\";break;case \"visitorNamespace\":d=\"ns\";break;case \"cookieDomainPeriods\":d=\"cdp\";break;case \"cookieLifetime\":d=\"cl\";break;case \"variableProvider\":d=\"vvp\";break;case \"currencyCode\":d=\"cc\";break;case \"channel\":d=\"ch\";break;case \"transactionID\":d=\"xact\";break;case \"campaign\":d=\"v0\";break;case \"resolution\":d=\"s\";break;case \"colorDepth\":d=\"c\";break;case \"javascriptVersion\":d=\"j\";break;case \"javaEnabled\":d=\"v\";break;case \"cookiesEnabled\":d=\r\n\"k\";break;case \"browserWidth\":d=\"bw\";break;case \"browserHeight\":d=\"bh\";break;case \"connectionType\":d=\"ct\";break;case \"homepage\":d=\"hp\";break;case \"plugins\":d=\"p\";break;case \"events\":k&&(f+=(f!=\"\"?\",\":\"\")+k);if(n){i=f.split(\",\");f=\"\";for(e=0;e<i.length;e++)j=i[e],w=j.indexOf(\"=\"),w>=0&&(j=j.substring(0,w)),w=j.indexOf(\":\"),w>=0&&(j=j.substring(0,w)),n.indexOf(\",\"+j+\",\")>=0&&(f+=(f?\",\":\"\")+i[e])}break;case \"events2\":f=\"\";break;case \"contextData\":b+=s.P(\"c\",s[d],g,d);f=\"\";break;case \"lightProfileID\":d=\r\n\"mtp\";break;case \"lightStoreForSeconds\":d=\"mtss\";s.lightProfileID||(f=\"\");break;case \"lightIncrementBy\":d=\"mti\";s.lightProfileID||(f=\"\");break;case \"retrieveLightProfiles\":d=\"mtsr\";break;case \"deleteLightProfiles\":d=\"mtsd\";break;case \"retrieveLightData\":s.retrieveLightProfiles&&(b+=s.P(\"mts\",s[d],g,d));f=\"\";break;default:s.ba(i)&&(e==\"prop\"?d=\"c\"+i:e==\"eVar\"?d=\"v\"+i:e==\"list\"?d=\"l\"+i:e==\"hier\"&&(d=\"h\"+i,f=f.substring(0,255)))}f&&(b+=\"&\"+d+\"=\"+(d.substring(0,3)!=\"pev\"?s.escape(f):f))}d==\"pev3\"&&s.g&&\r\n(b+=s.g)}return b};s.p=function(s){var a=s.tagName;if(\"\"+s.Ta!=\"undefined\"||\"\"+s.Ea!=\"undefined\"&&(\"\"+s.Ea).toUpperCase()!=\"HTML\")return\"\";a=a&&a.toUpperCase?a.toUpperCase():\"\";a==\"SHAPE\"&&(a=\"\");a&&((a==\"INPUT\"||a==\"BUTTON\")&&s.type&&s.type.toUpperCase?a=s.type.toUpperCase():!a&&s.href&&(a=\"A\"));return a};s.Y=function(s){var a=s.href?s.href:\"\",c,e,d;c=a.indexOf(\":\");e=a.indexOf(\"?\");d=a.indexOf(\"/\");if(a&&(c<0||e>=0&&c>e||d>=0&&c>d))e=s.protocol&&s.protocol.length>1?s.protocol:l.protocol?l.protocol:\r\n\"\",c=l.pathname.lastIndexOf(\"/\"),a=(e?e+\"//\":\"\")+(s.host?s.host:l.host?l.host:\"\")+(h.substring(0,1)!=\"/\"?l.pathname.substring(0,c<0?0:c)+\"/\":\"\")+a;return a};s.z=function(b){var a=s.p(b),c,e,d=\"\",f=0;if(a){c=b.protocol;e=b.onclick;if(b.href&&(a==\"A\"||a==\"AREA\")&&(!e||!c||c.toLowerCase().indexOf(\"javascript\")<0))d=s.Y(b);else if(e)d=s.replace(s.replace(s.replace(s.replace(\"\"+e,\"\\r\",\"\"),\"\\n\",\"\"),\"\\t\",\"\"),\" \",\"\"),f=2;else if(a==\"INPUT\"||a==\"SUBMIT\"){if(b.value)d=b.value;else if(b.innerText)d=b.innerText;\r\nelse if(b.textContent)d=b.textContent;f=3}else if(b.src&&a==\"IMAGE\")d=b.src;if(d)return{id:d.substring(0,100),type:f}}return 0};s.Qa=function(b){for(var a=s.p(b),c=s.z(b);b&&!c&&a!=\"BODY\";)if(b=b.parentElement?b.parentElement:b.parentNode)a=s.p(b),c=s.z(b);if(!c||a==\"BODY\")b=0;if(b&&(a=b.onclick?\"\"+b.onclick:\"\",a.indexOf(\".tl(\")>=0||a.indexOf(\".trackLink(\")>=0))b=0;return b};s.Ca=function(){var b,a,c=s.linkObject,e=s.linkType,d=s.linkURL,f,i;s.K=1;if(!c)s.K=0,c=s.j;if(c){b=s.p(c);for(a=s.z(c);c&&\r\n!a&&b!=\"BODY\";)if(c=c.parentElement?c.parentElement:c.parentNode)b=s.p(c),a=s.z(c);if(!a||b==\"BODY\")c=0;if(c){var j=c.onclick?\"\"+c.onclick:\"\";if(j.indexOf(\".tl(\")>=0||j.indexOf(\".trackLink(\")>=0)c=0}}else s.K=1;!d&&c&&(d=s.Y(c));d&&!s.linkLeaveQueryString&&(f=d.indexOf(\"?\"),f>=0&&(d=d.substring(0,f)));if(!e&&d){var g=0,n=0,k;if(s.trackDownloadLinks&&s.linkDownloadFileTypes){j=d.toLowerCase();f=j.indexOf(\"?\");i=j.indexOf(\"#\");f>=0?i>=0&&i<f&&(f=i):f=i;f>=0&&(j=j.substring(0,f));f=s.linkDownloadFileTypes.toLowerCase().split(\",\");\r\nfor(i=0;i<f.length;i++)(k=f[i])&&j.substring(j.length-(k.length+1))==\".\"+k&&(e=\"d\")}if(s.trackExternalLinks&&!e&&(j=d.toLowerCase(),s.aa(j))){if(!s.linkInternalFilters)s.linkInternalFilters=w.location.hostname;f=0;s.linkExternalFilters?(f=s.linkExternalFilters.toLowerCase().split(\",\"),g=1):s.linkInternalFilters&&(f=s.linkInternalFilters.toLowerCase().split(\",\"));if(f){for(i=0;i<f.length;i++)k=f[i],j.indexOf(k)>=0&&(n=1);n?g&&(e=\"e\"):g||(e=\"e\")}}}s.linkObject=c;s.linkURL=d;s.linkType=e;if(s.trackClickMap||\r\ns.trackInlineStats)if(s.g=\"\",c){e=s.pageName;d=1;c=c.sourceIndex;if(!e)e=s.pageURL,d=0;if(w.s_objectID)a.id=w.s_objectID,c=a.type=1;if(e&&a&&a.id&&b)s.g=\"&pid=\"+s.escape(e.substring(0,255))+(d?\"&pidt=\"+d:\"\")+\"&oid=\"+s.escape(a.id.substring(0,100))+(a.type?\"&oidt=\"+a.type:\"\")+\"&ot=\"+b+(c?\"&oi=\"+c:\"\")}};s.ta=function(){var b=s.K,a=s.linkType,c=s.linkURL,e=s.linkName;if(a&&(c||e))a=a.toLowerCase(),a!=\"d\"&&a!=\"e\"&&(a=\"o\"),s.pe=\"lnk_\"+a,s.pev1=c?s.escape(c):\"\",s.pev2=e?s.escape(e):\"\",b=1;s.abort&&(b=0);\r\nif(s.trackClickMap||s.trackInlineStats){a={};c=0;var d=s.cookieRead(\"s_sq\"),f=d?d.split(\"&\"):0,i,j,w;d=0;if(f)for(i=0;i<f.length;i++)j=f[i].split(\"=\"),e=s.unescape(j[0]).split(\",\"),j=s.unescape(j[1]),a[j]=e;e=s.account.split(\",\");if(b||s.g){b&&!s.g&&(d=1);for(j in a)if(!Object.prototype[j])for(i=0;i<e.length;i++){d&&(w=a[j].join(\",\"),w==s.account&&(s.g+=(j.charAt(0)!=\"&\"?\"&\":\"\")+j,a[j]=[],c=1));for(f=0;f<a[j].length;f++)w=a[j][f],w==e[i]&&(d&&(s.g+=\"&u=\"+s.escape(w)+(j.charAt(0)!=\"&\"?\"&\":\"\")+j+\"&u=0\"),\r\na[j].splice(f,1),c=1)}b||(c=1);if(c){d=\"\";i=2;!b&&s.g&&(d=s.escape(e.join(\",\"))+\"=\"+s.escape(s.g),i=1);for(j in a)!Object.prototype[j]&&i>0&&a[j].length>0&&(d+=(d?\"&\":\"\")+s.escape(a[j].join(\",\"))+\"=\"+s.escape(j),i--);s.cookieWrite(\"s_sq\",d)}}}return b};s.ua=function(){if(!s.Ka){var b=new Date,a=n.location,c,e,d,f=d=e=c=\"\",i=\"\",w=\"\",g=\"1.2\",k=s.cookieWrite(\"s_cc\",\"true\",0)?\"Y\":\"N\",o=\"\",p=\"\",r=0;if(b.setUTCDate&&(g=\"1.3\",r.toPrecision&&(g=\"1.5\",c=[],c.forEach))){g=\"1.6\";d=0;e={};try{d=new Iterator(e),\r\nd.next&&(g=\"1.7\",c.reduce&&(g=\"1.8\",g.trim&&(g=\"1.8.1\",Date.parse&&(g=\"1.8.2\",Object.create&&(g=\"1.8.5\")))))}catch(t){}}c=screen.width+\"x\"+screen.height;d=navigator.javaEnabled()?\"Y\":\"N\";e=screen.pixelDepth?screen.pixelDepth:screen.colorDepth;i=s.w.innerWidth?s.w.innerWidth:s.d.documentElement.offsetWidth;w=s.w.innerHeight?s.w.innerHeight:s.d.documentElement.offsetHeight;b=navigator.plugins;try{s.b.addBehavior(\"#default#homePage\"),o=s.b.Ra(a)?\"Y\":\"N\"}catch(u){}try{s.b.addBehavior(\"#default#clientCaps\"),\r\np=s.b.connectionType}catch(x){}if(b)for(;r<b.length&&r<30;){if(a=b[r].name)a=a.substring(0,100)+\";\",f.indexOf(a)<0&&(f+=a);r++}s.resolution=c;s.colorDepth=e;s.javascriptVersion=g;s.javaEnabled=d;s.cookiesEnabled=k;s.browserWidth=i;s.browserHeight=w;s.connectionType=p;s.homepage=o;s.plugins=f;s.Ka=1}};s.B={};s.loadModule=function(b,a){s.B[b]||(s[b]=w[\"AppMeasurement_Module_\"+b]?new w[\"AppMeasurement_Module_\"+b](s):{},s.B[b]=s[b]);a&&(s[b+\"_onLoad\"]=a,delayCall(b+\"_onLoad\",[s,m],1)||a(s,m))};s.u=function(b){var a,\r\nc;for(a in s.B)if(!Object.prototype[a]&&(c=s.B[a])&&c[b]&&c[b]())return 1;return 0};s.xa=function(){var b=Math.floor(Math.random()*1E13),a=s.visitorSampling,c=s.visitorSamplingGroup;c=\"s_vsn_\"+(s.visitorNamespace?s.visitorNamespace:s.account)+(c?\"_\"+c:\"\");var e=s.cookieRead(c);if(a){e&&(e=parseInt(e));if(!e){if(!s.cookieWrite(c,b))return 0;e=b}if(e%1E4>v)return 0}return 1};s.Q=function(b,a){var c,e,d,f,i,w;for(c=0;c<2;c++){e=c>0?s.R:s.e;for(d=0;d<e.length;d++)if(f=e[d],(i=b[f])||b[\"!\"+f]){if(!a&&\r\n(f==\"contextData\"||f==\"retrieveLightData\")&&s[f])for(w in s[f])i[w]||(i[w]=s[f][w]);s[f]=i}}};s.La=function(b){var a,c,e,d;for(a=0;a<2;a++){c=a>0?s.R:s.e;for(e=0;e<c.length;e++)d=c[e],b[d]=s[d],b[d]||(b[\"!\"+d]=1)}};s.oa=function(s){var a,c,e,d,f,w=0,g,n=\"\",k=\"\";if(s&&s.length>255&&(a=\"\"+s,c=a.indexOf(\"?\"),c>0&&(g=a.substring(c+1),a=a.substring(0,c),d=a.toLowerCase(),e=0,d.substring(0,7)==\"http://\"?e+=7:d.substring(0,8)==\"https://\"&&(e+=8),c=d.indexOf(\"/\",e),c>0&&(d=d.substring(e,c),f=a.substring(c),\r\na=a.substring(0,c),d.indexOf(\"google\")>=0?w=\",q,ie,start,search_key,word,kw,cd,\":d.indexOf(\"yahoo.co\")>=0&&(w=\",p,ei,\"),w&&g)))){if((s=g.split(\"&\"))&&s.length>1){for(e=0;e<s.length;e++)d=s[e],c=d.indexOf(\"=\"),c>0&&w.indexOf(\",\"+d.substring(0,c)+\",\")>=0?n+=(n?\"&\":\"\")+d:k+=(k?\"&\":\"\")+d;n&&k?g=n+\"&\"+k:k=\"\"}c=253-(g.length-k.length)-a.length;s=a+(c>0?f.substring(0,c):\"\")+\"?\"+g}return s};s.qa=function(){var b=s.cookieRead(\"s_fid\"),a=\"\",c=\"\",e;e=8;var d=4;if(!b||b.indexOf(\"-\")<0){for(b=0;b<16;b++)e=Math.floor(Math.random()*\r\ne),a+=\"0123456789ABCDEF\".substring(e,e+1),e=Math.floor(Math.random()*d),c+=\"0123456789ABCDEF\".substring(e,e+1),e=d=16;b=a+\"-\"+c}s.cookieWrite(\"s_fid\",b,1)||(b=0);return b};s.t=s.track=function(b){var a,c=new Date,e=\"s\"+Math.floor(c.getTime()/108E5)%10+Math.floor(Math.random()*1E13),d=c.getYear();d=\"t=\"+s.escape(c.getDate()+\"/\"+c.getMonth()+\"/\"+(d<1900?d+1900:d)+\" \"+c.getHours()+\":\"+c.getMinutes()+\":\"+c.getSeconds()+\" \"+c.getDay()+\" \"+c.getTimezoneOffset());if(!s.V(\"track\",arguments)){b&&(a={},s.La(a),\r\ns.Q(b));if(s.xa()&&(s.fid=s.qa(),s.Ca(),s.usePlugins&&s.doPlugins&&s.doPlugins(s),s.account)){if(!s.abort){if(s.trackOffline&&!s.timestamp)s.timestamp=Math.floor(c.getTime()/1E3);c=w.location;if(!s.pageURL)s.pageURL=c.href?c.href:c;if(!s.referrer&&!s.ia)s.referrer=n.document.referrer,s.ia=1;s.referrer=s.oa(s.referrer);s.u(\"_g\")}s.ta()&&!s.abort&&(s.ua(),d+=s.ra(),s.Ba(e,d));s.abort||s.u(\"_t\")}b&&s.Q(a,1);s.timestamp=s.linkObject=s.j=s.linkURL=s.linkName=s.linkType=w.Sa=s.pe=s.pev1=s.pev2=s.pev3=s.g=\r\n0}};s.tl=s.trackLink=function(b,a,c,e,d){s.linkObject=b;s.linkType=a;s.linkName=c;if(d)s.i=b,s.l=d;return s.track(e)};s.trackLight=function(b,a,c,e){s.lightProfileID=b;s.lightStoreForSeconds=a;s.lightIncrementBy=c;return s.track(e)};s.clearVars=function(){var b,a;for(b=0;b<s.e.length;b++)if(a=s.e[b],a.substring(0,4)==\"prop\"||a.substring(0,4)==\"eVar\"||a.substring(0,4)==\"hier\"||a.substring(0,4)==\"list\"||a==\"channel\"||a==\"events\"||a==\"eventList\"||a==\"products\"||a==\"productList\"||a==\"purchaseID\"||a==\r\n\"transactionID\"||a==\"state\"||a==\"zip\"||a==\"campaign\")s[a]=void 0};s.Ba=function(b,a){var c,e=s.trackingServer;c=\"\";var d=s.dc,f=\"sc.\",w=s.visitorNamespace;if(e){if(s.trackingServerSecure&&s.ssl)e=s.trackingServerSecure}else{if(!w)w=s.account,e=w.indexOf(\",\"),e>=0&&(w=w.Oa(0,e)),w=w.replace(/[^A-Za-z0-9]/g,\"\");c||(c=\"2o7.net\");d=d?(\"\"+d).toLowerCase():\"d1\";c==\"2o7.net\"&&(d==\"d1\"?d=\"112\":d==\"d2\"&&(d=\"122\"),f=\"\");e=w+\".\"+d+\".\"+f+c}c=s.ssl?\"https://\":\"http://\";c+=e+\"/b/ss/\"+s.account+\"/\"+(s.mobile?\"5.\":\r\n\"\")+\"1/JS-\"+s.version+(s.Ja?\"T\":\"\")+\"/\"+b+\"?AQB=1&ndh=1&\"+a+\"&AQE=1\";s.wa&&(c=c.substring(0,2047));s.ma(c);s.H()};s.ma=function(b){s.c||s.va();s.c.push(b);s.I=s.o();s.ha()};s.va=function(){s.c=s.ya();if(!s.c)s.c=[]};s.ya=function(){var b,a;if(s.M()){try{(a=w.localStorage.getItem(s.L()))&&(b=w.JSON.parse(a))}catch(c){}return b}};s.M=function(){var b=!0;if(!s.trackOffline||!s.offlineFilename||!w.localStorage||!w.JSON)b=!1;return b};s.Z=function(){var b=0;if(s.c)b=s.c.length;s.q&&b++;return b};s.H=function(){if(!s.q)if(s.$=\r\nnull,s.fa)s.I>s.A&&s.ga(s.c),s.O(500);else{var b=s.ja();if(b>0)s.O(b);else if(b=s.X())s.q=1,s.Aa(b),s.Fa(b)}};s.O=function(b){if(!s.$)b||(b=0),s.$=setTimeout(s.H,b)};s.ja=function(){var b;if(!s.trackOffline||s.offlineThrottleDelay<=0)return 0;b=s.o()-s.da;if(s.offlineThrottleDelay<b)return 0;return s.offlineThrottleDelay-b};s.X=function(){if(s.c.length>0)return s.c.shift()};s.Aa=function(b){if(s.debugTracking){var a=\"AppMeasurement Debug: \"+b;b=b.split(\"&\");var c;for(c=0;c<b.length;c++)a+=\"\\n\\t\"+\r\ns.unescape(b[c]);s.za(a)}};s.Fa=function(b){var a;a||(a=new Image);a.T=function(){try{if(s.N)clearTimeout(s.N),s.N=0;if(a.timeout)clearTimeout(a.timeout),a.timeout=0}catch(b){}};a.onload=a.Ia=function(){a.T();s.la();s.D();s.q=0;s.H()};a.onabort=a.onerror=a.na=function(){a.T();s.q&&s.c.unshift(s.ka);s.q=0;s.I>s.A&&s.ga(s.c);s.D();s.O(500)};a.onreadystatechange=function(){a.readyState==4&&(a.status==200?a.Ia():a.na())};s.da=s.o();a.src=b;if(a.abort)s.N=setTimeout(a.abort,5E3);s.ka=b;s.Pa=w[\"s_i_\"+s.replace(s.account,\r\n\",\",\"_\")]=a;if(s.useForcedLinkTracking&&s.r||s.l){if(!s.forcedLinkTrackingTimeout)s.forcedLinkTrackingTimeout=250;s.F=setTimeout(s.D,s.forcedLinkTrackingTimeout)}};s.la=function(){if(s.M()&&!(s.ca>s.A))try{w.localStorage.removeItem(s.L()),s.ca=s.o()}catch(b){}};s.ga=function(b){if(s.M()){s.ha();try{w.localStorage.setItem(s.L(),w.JSON.stringify(b)),s.A=s.o()}catch(a){}}};s.ha=function(){if(s.trackOffline){if(!s.offlineLimit||s.offlineLimit<=0)s.offlineLimit=10;for(;s.c.length>s.offlineLimit;)s.X()}};\r\ns.forceOffline=function(){s.fa=!0};s.forceOnline=function(){s.fa=!1};s.L=function(){return s.offlineFilename+\"-\"+s.visitorNamespace+s.account};s.o=function(){return(new Date).getTime()};s.aa=function(s){s=s.toLowerCase();if(s.indexOf(\"#\")!=0&&s.indexOf(\"about:\")!=0&&s.indexOf(\"javascript:\")!=0)return!0;return!1};s.setTagContainer=function(b){var a,c,e;s.Ja=b;for(a=0;a<s._il.length;a++)if((c=s._il[a])&&c._c==\"s_l\"&&c.tagContainerName==b){s.Q(c);if(c.lmq)for(a=0;a<c.lmq.length;a++)e=c.lmq[a],s.loadModule(e.n);\r\nif(c.ml)for(e in c.ml)if(s[e])for(a in b=s[e],e=c.ml[e],e)if(!Object.prototype[a]&&(typeof e[a]!=\"function\"||(\"\"+e[a]).indexOf(\"s_c_il\")<0))b[a]=e[a];if(c.mmq)for(a=0;a<c.mmq.length;a++)e=c.mmq[a],s[e.m]&&(b=s[e.m],b[e.f]&&typeof b[e.f]==\"function\"&&(e.a?b[e.f].apply(b,e.a):b[e.f].apply(b)));if(c.tq)for(a=0;a<c.tq.length;a++)s.track(c.tq[a]);c.s=s;break}};s.Util={urlEncode:s.escape,urlDecode:s.unescape,cookieRead:s.cookieRead,cookieWrite:s.cookieWrite,getQueryParam:function(b,a,c){var e;a||(a=s.pageURL?\r\ns.pageURL:w.location);c||(c=\"&\");if(b&&a&&(a=\"\"+a,e=a.indexOf(\"?\"),e>=0&&(a=c+a.substring(e+1)+c,e=a.indexOf(c+b+\"=\"),e>=0&&(a=a.substring(e+c.length+b.length+1),e=a.indexOf(c),e>=0&&(a=a.substring(0,e)),a.length>0))))return s.unescape(a);return\"\"}};s.C=[\"timestamp\",\"dynamicVariablePrefix\",\"visitorID\",\"anonymousVisitorID\",\"globalVisitorID\",\"globalLocationHint\",\"fid\",\"vmk\",\"visitorMigrationKey\",\"visitorMigrationServer\",\"visitorMigrationServerSecure\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\r\n\"fpCookieDomainPeriods\",\"cookieLifetime\",\"pageName\",\"pageURL\",\"referrer\",\"contextData\",\"currencyCode\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\",\"retrieveLightProfiles\",\"deleteLightProfiles\",\"retrieveLightData\",\"pe\",\"pev1\",\"pev2\",\"pev3\",\"pageURLRest\"];s.e=s.C.concat([\"purchaseID\",\"variableProvider\",\"channel\",\"server\",\"pageType\",\"transactionID\",\"campaign\",\"state\",\"zip\",\"events\",\"events2\",\"products\",\"tnt\"]);s.ea=[\"timestamp\",\"charSet\",\"visitorNamespace\",\"cookieDomainPeriods\",\"cookieLifetime\",\r\n\"contextData\",\"lightProfileID\",\"lightStoreForSeconds\",\"lightIncrementBy\"];s.J=s.ea.slice(0);s.R=[\"account\",\"allAccounts\",\"debugTracking\",\"visitor\",\"trackOffline\",\"offlineLimit\",\"offlineThrottleDelay\",\"offlineFilename\",\"usePlugins\",\"doPlugins\",\"configURL\",\"visitorSampling\",\"s.visitorSamplingGroup\",\"linkObject\",\"linkURL\",\"linkName\",\"linkType\",\"trackDownloadLinks\",\"trackExternalLinks\",\"trackClickMap\",\"trackInlineStats\",\"linkLeaveQueryString\",\"linkTrackVars\",\"linkTrackEvents\",\"linkDownloadFileTypes\",\r\n\"linkExternalFilters\",\"linkInternalFilters\",\"useForcedLinkTracking\",\"forcedLinkTrackingTimeout\",\"trackingServer\",\"trackingServerSecure\",\"ssl\",\"abort\",\"mobile\",\"dc\",\"lightTrackVars\",\"maxDelay\"];for(g=0;g<=75;g++)s.e.push(\"prop\"+g),s.J.push(\"prop\"+g),s.e.push(\"eVar\"+g),s.J.push(\"eVar\"+g),g<6&&s.e.push(\"hier\"+g),g<4&&s.e.push(\"list\"+g);g=[\"resolution\",\"colorDepth\",\"javascriptVersion\",\"javaEnabled\",\"cookiesEnabled\",\"browserWidth\",\"browserHeight\",\"connectionType\",\"homepage\",\"plugins\"];s.e=s.e.concat(g);\r\ns.C=s.C.concat(g);s.ssl=w.location.protocol.toLowerCase().indexOf(\"https\")>=0;s.charSet=\"UTF-8\";s.contextData={};s.offlineThrottleDelay=0;s.offlineFilename=\"AppMeasurement.offline\";s.da=0;s.I=0;s.A=0;s.ca=0;s.linkDownloadFileTypes=\"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";s.w=w;s.d=w.document;try{s.wa=navigator.appName==\"Microsoft Internet Explorer\"}catch(p){}s.D=function(){if(s.F)w.clearTimeout(s.F),s.F=null;s.i&&s.r&&s.i.dispatchEvent(s.r);if(s.l)if(typeof s.l==\"function\")s.l();\r\nelse if(s.i&&s.i.href)s.d.location=s.i.href;s.i=s.r=s.l=0};s.Ga=function(){s.b=s.d.body;if(s.b)if(s.k=function(b){var a,c,e,d,f;if(!(s.d&&s.d.getElementById(\"cppXYctnr\")||b&&b.Da)){if(s.S)if(s.useForcedLinkTracking)s.b.removeEventListener(\"click\",s.k,!1);else{s.b.removeEventListener(\"click\",s.k,!0);s.S=s.useForcedLinkTracking=0;return}else s.useForcedLinkTracking=0;s.j=b.srcElement?b.srcElement:b.target;try{if(s.j&&(s.j.tagName||s.j.parentElement||s.j.parentNode))if(e=s.Z(),s.track(),e<s.Z()&&s.useForcedLinkTracking&&\r\nb.target){for(d=b.target;d&&d!=s.b&&d.tagName.toUpperCase()!=\"A\"&&d.tagName.toUpperCase()!=\"AREA\";)d=d.parentNode;if(d&&(f=d.href,s.aa(f)||(f=0),c=d.target,b.target.dispatchEvent&&f&&(!c||c==\"_self\"||c==\"_top\"||c==\"_parent\"||w.name&&c==w.name))){try{a=s.d.createEvent(\"MouseEvents\")}catch(g){a=new w.MouseEvent}if(a){try{a.initMouseEvent(\"click\",b.bubbles,b.cancelable,b.view,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget)}catch(j){a=\r\n0}if(a)a.Da=1,b.stopPropagation(),b.Ha&&b.Ha(),b.preventDefault(),s.i=b.target,s.r=a}}}}catch(k){}s.j=0}},s.b&&s.b.attachEvent)s.b.attachEvent(\"onclick\",s.k);else{if(s.b&&s.b.addEventListener){if(navigator&&(navigator.userAgent.indexOf(\"WebKit\")>=0&&s.d.createEvent||navigator.userAgent.indexOf(\"Firefox/2\")>=0&&w.MouseEvent))s.S=1,s.useForcedLinkTracking=1,s.b.addEventListener(\"click\",s.k,!0);s.b.addEventListener(\"click\",s.k,!1)}}else setTimeout(setupBody,30)};s.Ga()}", "function getVersion(){return _VERSION}", "InitVsaEngine() {\n\n }", "constructor() {\n this.systemLog = false\n this.appName = '@codedungeon/messenger'\n this.logToFile = false\n this.methods = [\n 'write',\n 'critical',\n 'lblCritical',\n 'danger',\n 'lblDanger',\n 'debug',\n 'error',\n 'lblError',\n 'important',\n 'lblImportant',\n 'info',\n 'lblInfo',\n 'log',\n 'note',\n 'notice',\n 'lblNotice',\n 'status',\n 'success',\n 'lblSuccess',\n 'warn',\n 'lblWarn',\n 'warning',\n 'lblWarning'\n ]\n }", "private internal function m248() {}", "function WebSocketRpcConnection()\n{\nvar self = this;\n\nvar isNodeJs = (typeof window === \"undefined\" ? true : false);\n\nvar lib = null;\nvar SpaceifyError = null;\nvar SpaceifyUtility = null;\nvar RpcCommunicator = null;\n//var SpaceifyLogger = null;\nvar WebSocketConnection = null;\n\nif (isNodeJs)\n\t{\n\tlib = \"/var/lib/spaceify/code/\";\n\n\tSpaceifyError = require(lib + \"spaceifyerror\");\n\t//SpaceifyLogger = require(lib + \"spaceifylogger\");\n\tSpaceifyUtility = require(lib + \"spaceifyutility\");\n\tRpcCommunicator = require(lib + \"rpccommunicator\");\n\tWebSocketConnection = require(lib + \"websocketconnection\");\n\t}\nelse\n\t{\n\tlib = (window.WEBPACK_MAIN_LIBRARY ? window.WEBPACK_MAIN_LIBRARY : window);\n\n\t//SpaceifyLogger = lib.SpaceifyLogger;\n\tSpaceifyError = lib.SpaceifyError;\n\tSpaceifyUtility = lib.SpaceifyUtility;\n\tRpcCommunicator = lib.RpcCommunicator;\n\tWebSocketConnection = lib.WebSocketConnection;\n\t}\n\nvar errorc = new SpaceifyError();\nvar utility = new SpaceifyUtility();\nvar communicator = new RpcCommunicator();\nvar connection = new WebSocketConnection();\n//var logger = new SpaceifyLogger(\"WebSocketRpcConnection\");\n\nself.connect = function(options, callback)\n\t{\n\tconnection.connect(options, function(err, data)\n\t\t{\n\t\tif(!err)\n\t\t\t{\n\t\t\tcommunicator.addConnection(connection);\n\n\t\t\tif(callback)\n\t\t\t\tcallback(null, true);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif(callback)\n\t\t\t\tcallback(errorc.makeErrorObject(\"wsrpcc\", \"Failed to open WebsocketRpcConnection.\", \"WebSocketRpcConnection::connect\"), null);\n\t\t\t}\n\t\t});\n\t};\n\nself.close = function()\n\t{\n\t};\n\nself.getCommunicator = function()\n\t{\n\treturn communicator;\n\t};\n\nself.getConnection = function()\n\t{\n\treturn connection;\n\t};\n\n// Inherited methods\nself.getIsOpen = function()\n\t{\n\treturn connection.getIsOpen();\n\t}\n\nself.getIsSecure = function()\n\t{\n\treturn connection.getIsSecure();\n\t}\n\nself.getPort = function()\n\t{\n\treturn connection.getPort();\n\t}\n\nself.getId = function()\n\t{\n\treturn connection.getId();\n\t}\n\nself.connectionExists = function(connectionId)\n\t{\n\treturn communicator.connectionExists(connectionId);\n\t}\n\nself.exposeRpcMethod = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethod(name, object, method);\n\t}\n\nself.exposeRpcMethodSync = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethodSync(name, object, method);\n\t}\n\nself.callRpc = function(method, params, object, listener)\n\t{\n\treturn communicator.callRpc(method, params, object, listener, connection.getId());\n\t}\n\n// External event listeners\nself.setConnectionListener = function(listener)\n\t{\n\tcommunicator.setConnectionListener(listener);\n\t};\n\nself.setDisconnectionListener = function(listener)\n\t{\n\tcommunicator.setDisconnectionListener(listener);\n\t};\n\n}", "heartbeat () {\n }", "function _____SHARED_functions_____(){}", "onShareAppMessage() {\n\n }", "function getString(key, params) {\n var result = WEB_PLATFORM.getString(\"org_opensds_storage_devices\", key, params);\n if(result == null){\n return key;\n }else{\n return result;\n }\n }", "componentDidMount(){\n console.info(this.constructor.name+ 'Component mount process finished');\n }", "onMessage() {}", "onMessage() {}", "requestThumbnails() {\n let position = this.state.position;\n let ed = this.state.ed;\n let ts = position == 'start' ? ed.start : ed.end;\n\n this.props.socket.emit('frameSelect',{ ts: ts } );\n }", "static get tag(){return\"hal-9000\"}", "constructor(t){const e={...t};this.connectionState=new h,this.server=\"https://hub-server-2.heatgenius.co.uk\",this.username=\"\",this.signature=\"\",this.auth={header:{}},this.lastQueryTime=null,this._axios=i.a.create({}),this.logger=e.logger?e.logger:console,this.debug=!!e.debug&&e.debug}", "started() {\r\n\r\n\t}", "get EXTERNAL_API() {\n return ['setUsageMode',\n 'setBackupMode',\n 'setLocationMode',\n 'setUsageOptinHidden',\n ];\n }", "getVideoDataBuffer() {\n return this.videoDataBuffer;\n }", "addTPKLayer(){\n //<editor-fold desc=\"old code to eliminate\">\n /* if (typeof local == 'undefined') {\n\n //todo: maybe based on this url we could decide if taking the tpk from File API or form URL\n var xhrRequest = new XMLHttpRequest();\n var _this = this;\n xhrRequest.open(\"GET\", url, true);\n xhrRequest.responseType = \"blob\";\n xhrRequest.onprogress = function(evt){\n var percent = 0;\n if(/!*evt.hasOwnProperty(\"total\")*!/typeof evt[\"total\"] !== 'undefined'){\n percent = (parseFloat(evt.loaded / evt.total) * 100).toFixed(0);\n }\n else{\n percent = (parseFloat(evt.loaded / evt.totalSize) * 100).toFixed(0);\n }\n\n console.log(\"Get file via url \" + percent + \"%\");\n console.log(\"Begin downloading remote tpk file...\");\n };\n\n xhrRequest.error = function(err){\n console.log(\"ERROR retrieving TPK file: \" + err.toString());\n alert(\"There was a problem retrieve the file.\");\n };\n var __this = _this;\n xhrRequest.onload = function(oEvent) {\n if(this.status === 200) {\n console.log(\"Remote tpk download finished.\" + oEvent);\n __this.zipParser(this.response);\n }\n else{\n alert(\"There was a problem loading the file. \" + this.status + \": \" + this.statusText );\n }\n };\n xhrRequest.send();\n }\n*/\n //</editor-fold>\n if (this.get('ermesCordova').isNative()){\n\n var basemapName = this.get('parcels').get('basemapName');\n var store = cordova.file.dataDirectory;\n var fileName = basemapName;\n this.set(\"loading\", true);\n this.getBaseMapZip (store, fileName).then((binary)=>{\n if (binary!== null) {\n this.zipParser(binary);\n }\n else {\n Ember.debug(\"getBaseMapZip: error loading the zip file\");\n }\n });\n }\n\n }", "private public function m246() {}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "async onReady() {\n try {\n // Initialize your adapter here\n //Logging of adapter start\n this.log.info('start fb-checkpresence: ip-address: \"' + this.config.ipaddress + '\" - interval devices: ' + this.config.interval + ' Min.' + ' - interval members: ' + this.config.intervalFamily + ' s');\n this.log.debug('configuration user: <' + this.config.username + '>');\n this.log.debug('configuration history: <' + this.config.history + '>');\n this.log.debug('configuration dateformat: <' + this.config.dateformat + '>');\n this.log.debug('configuration familymembers: ' + JSON.stringify(this.config.familymembers));\n this.log.debug('configuration fb-devices ' + this.config.fbdevices);\n this.log.debug('configuratuion mesh info: ' + this.config.meshinfo); \n\n //decrypt fritzbox password\n const sysObj = await this.getForeignObjectAsync('system.config');\n if (sysObj && sysObj.native && sysObj.native.secret) {\n this.config.password = this.decrypt(sysObj.native.secret, this.config.password);\n } else {\n this.config.password = this.decrypt('SdoeQ85NTrg1B0FtEyzf', this.config.password);\n }\n\n //Configuration changes if needed\n let adapterObj = (await this.getForeignObjectAsync(`system.adapter.${this.namespace}`));\n let adapterObjChanged = false; //for changes\n \n //if interval <= 0 than set to 1\n if (this.config.interval <= 0) {\n adapterObj.native.interval = 1;\n adapterObjChanged = true;\n this.config.interval = 1;\n this.log.warn('interval is less than 1. Set to 1 Min.');\n }\n\n //if interval <= 0 than set to 1\n if (this.config.intervalFamily <= 9) {\n adapterObj.native.intervalFamily = 10;\n adapterObjChanged = true;\n this.config.intervalFamily = 10;\n this.log.warn('interval is less than 10. Set to 10s.');\n }\n\n //create new configuration items -> workaround for older versions\n for(let i=0;i<this.config.familymembers.length;i++){\n if (this.config.familymembers[i].useip == undefined) {\n adapterObj.native.familymembers[i].useip = false;\n adapterObj.native.familymembers[i].ipaddress = '';\n adapterObjChanged = true;\n }\n }\n\n if (adapterObjChanged === true){ //Save changes\n await this.setForeignObjectAsync(`system.adapter.${this.namespace}`, adapterObj);\n }\n\n const cfg = {\n ip: this.config.ipaddress,\n port: '49000',\n iv: this.config.interval,\n history: this.config.history,\n dateFormat: this.config.dateformat,\n uid: this.config.username,\n pwd: this.config.password,\n members: this.config.familymembers,\n wl: this.config.whitelist\n };\n \n const cron = cfg.iv * 60;\n const cronFamily = this.config.intervalFamily;\n \n const devInfo = {\n host: this.config.ipaddress,\n port: '49000',\n sslPort: null,\n uid: this.config.username,\n pwd: this.config.password\n };\n\n this.Fb = await fb.Fb.init(devInfo, this);\n if(this.Fb.services === null) {\n this.log.error('Can not get services! Adapter stops');\n this.stopAdapter();\n }\n\n //Check if services/actions are supported\n this.GETPATH = await this.Fb.chkService('X_AVM-DE_GetHostListPath', 'Hosts1', 'X_AVM-DE_GetHostListPath');\n this.GETMESHPATH = await this.Fb.chkService('X_AVM-DE_GetMeshListPath', 'Hosts1', 'X_AVM-DE_GetMeshListPath');\n this.GETBYMAC = await this.Fb.chkService('GetSpecificHostEntry', 'Hosts1', 'GetSpecificHostEntry');\n this.GETBYIP = await this.Fb.chkService('X_AVM-DE_GetSpecificHostEntryByIP', 'Hosts1', 'X_AVM-DE_GetSpecificHostEntryByIP');\n this.GETPORT = await this.Fb.chkService('GetSecurityPort', 'DeviceInfo1', 'GetSecurityPort');\n this.GETEXTIP = await this.Fb.chkService('GetInfo', 'WANPPPConnection1', 'GetInfo');\n if ( this.GETEXTIP == false) this.GETEXTIP = await this.Fb.chkService('GetInfo', 'WANIPConnection1', 'GetInfo');\n this.SETENABLE = await this.Fb.chkService('SetEnable', 'WLANConfiguration3', 'SetEnable');\n this.WLAN3INFO = await this.Fb.chkService('GetInfo', 'WLANConfiguration3', 'WLANConfiguration3-GetInfo');\n this.DEVINFO = await this.Fb.chkService('GetInfo', 'DeviceInfo1', 'DeviceInfo1-GetInfo');\n this.DISALLOWWANACCESSBYIP = await this.Fb.chkService('DisallowWANAccessByIP', 'X_AVM-DE_HostFilter', 'DisallowWANAccessByIP');\n this.GETWANACCESSBYIP = await this.Fb.chkService('GetWANAccessByIP', 'X_AVM-DE_HostFilter', 'GetWANAccessByIP');\n this.REBOOT = await this.Fb.chkService('Reboot', 'DeviceConfig1', 'Reboot');\n \n //const test = await Fb.soapAction(Fb, '/upnp/control/deviceconfig', 'urn:dslforum-org:service:DeviceConfig:1', 'X_AVM-DE_CreateUrlSID', null);\n\n //Create global objects\n await obj.createGlobalObjects(this, this.HTML+this.HTML_END, this.HTML_GUEST+this.HTML_END, this.enabled);\n await obj.createMemberObjects(this, cfg, this.HTML_HISTORY + this.HTML_END, this.enabled);\n\n //create Fb devices\n if (this.GETPATH != null && this.GETPATH == true && this.config.fbdevices == true){\n const items = await this.Fb.getDeviceList(this, cfg, this.Fb);\n if (items != null){\n let res = await obj.createFbDeviceObjects(this, items, this.enabled);\n if (res === true) this.log.info('createFbDeviceObjects finished successfully');\n res = await obj.createMeshObjects(this, items, 0, this.enabled); //create channel 0 as default interface\n if (res === true) this.log.info('createMeshObjects finished successfully');\n }else{\n this.log.error('createFbDeviceObjects -> ' + \"can't read devices from fritzbox! Adapter stops\");\n adapterObj = await this.getForeignObjectAsync(`system.adapter.${this.namespace}`);\n adapterObj.common.enabled = false; // Adapter ausschalten\n await this.setForeignObjectAsync(`system.adapter.${this.namespace}`, adapterObj);\n }\n await this.resyncFbObjects(items);\n }\n\n // states changes inside the adapters namespace are subscribed\n if (this.SETENABLE === true && this.WLAN3INFO === true) this.subscribeStates(`${this.namespace}` + '.guest.wlan');\n if (this.DISALLOWWANACCESSBYIP === true && this.GETWANACCESSBYIP === true) this.subscribeStates(`${this.namespace}` + '.fb-devices.*.disabled'); \n if (this.REBOOT === true) this.subscribeStates(`${this.namespace}` + '.reboot'); \n\n //get uuid for transaction\n //const sSid = await Fb.soapAction(Fb, '/upnp/control/deviceconfig', urn + 'DeviceConfig:1', 'X_GenerateUUID', null);\n //const uuid = sSid['NewUUID'].replace('uuid:', '');\n this.loop(10, 55, cronFamily, cron, cfg);\n } catch (error) {\n this.showError('onReady: ' + error);\n }\n }", "async onReady() {\n // Initialize your adapter here\n\n this.setState(\"info.connection\", false, true);\n // Reset the connection indicator during startup\n this.type = \"VW\";\n this.country = \"DE\";\n this.clientId = \"9496332b-ea03-4091-a224-8c746b885068%40apps_vw-dilab_com\";\n this.xclientId = \"38761134-34d0-41f3-9a73-c4be88d7d337\";\n this.scope = \"openid%20profile%20mbb%20email%20cars%20birthdate%20badge%20address%20vin\";\n this.redirect = \"carnet%3A%2F%2Fidentity-kit%2Flogin\";\n this.xrequest = \"de.volkswagen.carnet.eu.eremote\";\n this.responseType = \"id_token%20token%20code\";\n this.xappversion = \"5.1.2\";\n this.xappname = \"eRemote\";\n if (this.config.type === \"id\") {\n this.type = \"Id\";\n this.country = \"DE\";\n this.clientId = \"a24fba63-34b3-4d43-b181-942111e6bda8@apps_vw-dilab_com\";\n this.xclientId = \"\";\n this.scope = \"openid profile badge cars dealers birthdate vin\";\n this.redirect = \"weconnect://authenticated\";\n this.xrequest = \"com.volkswagen.weconnect\";\n this.responseType = \"code id_token token\";\n this.xappversion = \"\";\n this.xappname = \"\";\n }\n if (this.config.type === \"skoda\") {\n this.type = \"Skoda\";\n this.country = \"CZ\";\n this.clientId = \"7f045eee-7003-4379-9968-9355ed2adb06%40apps_vw-dilab_com\";\n this.xclientId = \"28cd30c6-dee7-4529-a0e6-b1e07ff90b79\";\n this.scope = \"openid%20profile%20phone%20address%20cars%20email%20birthdate%20badge%20dealers%20driversLicense%20mbb\";\n this.redirect = \"skodaconnect%3A%2F%2Foidc.login%2F\";\n this.xrequest = \"cz.skodaauto.connect\";\n this.responseType = \"code%20id_token\";\n this.xappversion = \"3.2.6\";\n this.xappname = \"cz.skodaauto.connect\";\n }\n if (this.config.type === \"seat\") {\n this.type = \"Seat\";\n this.country = \"ES\";\n this.clientId = \"50f215ac-4444-4230-9fb1-fe15cd1a9bcc@apps_vw-dilab_com\";\n this.xclientId = \"9dcc70f0-8e79-423a-a3fa-4065d99088b4\";\n this.scope = \"openid profile mbb cars birthdate nickname address phone\";\n this.redirect = \"seatconnect://identity-kit/login\";\n this.xrequest = \"cz.skodaauto.connect\";\n this.responseType = \"code%20id_token\";\n this.xappversion = \"1.1.29\";\n this.xappname = \"SEATConnect\";\n }\n if (this.config.type === \"audi\") {\n this.type = \"Audi\";\n this.country = \"DE\";\n this.clientId = \"09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com\";\n this.xclientId = \"77869e21-e30a-4a92-b016-48ab7d3db1d8\";\n this.scope = \"address profile badge birthdate birthplace nationalIdentifier nationality profession email vin phone nickname name picture mbb gallery openid\";\n this.redirect = \"myaudi:///\";\n this.xrequest = \"de.myaudi.mobile.assistant\";\n this.responseType = \"token%20id_token\";\n // this.responseType = \"code\";\n this.xappversion = \"3.22.0\";\n this.xappname = \"myAudi\";\n }\n if (this.config.type === \"go\") {\n this.type = \"\";\n this.country = \"\";\n this.clientId = \"ac42b0fa-3b11-48a0-a941-43a399e7ef84@apps_vw-dilab_com\";\n this.xclientId = \"\";\n this.scope = \"openid%20profile%20address%20email%20phone\";\n this.redirect = \"vwconnect%3A%2F%2Fde.volkswagen.vwconnect%2Foauth2redirect%2Fidentitykit\";\n this.xrequest = \"\";\n this.responseType = \"code\";\n this.xappversion = \"\";\n this.xappname = \"\";\n }\n if (this.config.interval === 0) {\n this.log.info(\"Interval of 0 is not allowed reset to 1\");\n this.config.interval = 1;\n }\n this.login()\n .then(() => {\n this.log.debug(\"Login successful\");\n this.setState(\"info.connection\", true, true);\n this.getPersonalData()\n .then(() => {\n this.getVehicles()\n .then(() => {\n if (this.config.type !== \"go\") {\n this.vinArray.forEach((vin) => {\n if (this.config.type === \"id\") {\n this.getIdStatus(vin).catch(() => {\n this.log.error(\"get id status Failed\");\n });\n } else {\n this.getHomeRegion(vin)\n .catch(() => {\n this.log.debug(\"get home region Failed\");\n })\n .finally(() => {\n this.getVehicleData(vin).catch(() => {\n this.log.error(\"get vehicle data Failed\");\n });\n this.getVehicleRights(vin).catch(() => {\n this.log.error(\"get vehicle rights Failed\");\n });\n this.requestStatusUpdate(vin)\n .finally(() => {\n this.statesArray.forEach((state) => {\n this.getVehicleStatus(vin, state.url, state.path, state.element, state.element2, state.element3, state.element4).catch(() => {\n this.log.debug(\"error while getting \" + state.url);\n });\n });\n })\n .catch(() => {\n this.log.error(\"status update Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Error getting home region\");\n });\n }\n });\n }\n\n this.updateInterval = setInterval(() => {\n if (this.config.type === \"go\") {\n this.getVehicles();\n return;\n } else if (this.config.type === \"id\") {\n this.vinArray.forEach((vin) => {\n this.getIdStatus(vin).catch(() => {\n this.log.error(\"get id status Failed\");\n this.refreshIDToken().catch(() => {});\n });\n this.getWcData();\n });\n return;\n } else {\n this.vinArray.forEach((vin) => {\n this.statesArray.forEach((state) => {\n this.getVehicleStatus(vin, state.url, state.path, state.element, state.element2).catch(() => {\n this.log.debug(\"error while getting \" + state.url);\n });\n });\n });\n }\n }, this.config.interval * 60 * 1000);\n\n if (this.config.forceinterval > 0) {\n this.fupdateInterval = setInterval(() => {\n if (this.config.type === \"go\") {\n this.getVehicles();\n return;\n }\n this.vinArray.forEach((vin) => {\n this.requestStatusUpdate(vin).catch(() => {\n this.log.error(\"force status update Failed\");\n });\n });\n }, this.config.forceinterval * 60 * 1000);\n }\n })\n .catch(() => {\n this.log.error(\"Get Vehicles Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"get personal data Failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Login Failed\");\n });\n this.subscribeStates(\"*\");\n }", "started () {}", "_specializedInitialisation()\r\n\t{\r\n\t\tLogger.log(\"Specialisation for service AVTransport\", LogType.Info);\r\n\t\tvar relativeTime = this.getVariableByName(\"RelativeTimePosition\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!relativeTime)\r\n\t\t\trelativeTime = this.getVariableByName(\"A_ARG_TYPE_GetPositionInfo_RelTime\");\r\n\t\tvar transportState = this.getVariableByName(\"TransportState\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!transportState)\r\n\t\t\ttransportState = this.getVariableByName(\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\");\r\n\r\n\t\tif (transportState)\r\n\t\t{\r\n\t\t\ttransportState.on('updated', (variable, newVal) =>\r\n\t\t\t{\r\n\t\t\t\tLogger.log(\"On transportStateUpdate : \" + newVal, LogType.DEBUG);\r\n\t\t\t\tvar actPosInfo = this.getActionByName(\"GetPositionInfo\");\r\n\t\t\t\tvar actMediaInfo = this.getActionByName(\"GetMediaInfo\");\r\n\t\t\t\t/*\r\n\t\t\t\t“STOPPED” R\r\n\t\t\t\t“PLAYING” R\r\n\t\t\t\t“TRANSITIONING” O\r\n\t\t\t\t”PAUSED_PLAYBACK” O\r\n\t\t\t\t“PAUSED_RECORDING” O\r\n\t\t\t\t“RECORDING” O\r\n\t\t\t\t“NO_MEDIA_PRESENT”\r\n\t\t\t\t */\r\n\t\t\t\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this._intervalUpdateRelativeTime)\r\n\t\t\t\t\t\tclearInterval(this._intervalUpdateRelativeTime);\r\n\t\t\t\t\tif (newVal == \"PLAYING\" || newVal == \"RECORDING\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t} );\r\n\t\t\t\t\t\t//Déclenche la maj toutes les 4 secondes\r\n\t\t\t\t\t\tthis._intervalUpdateRelativeTime = setInterval(() =>{\r\n\t\t\t\t\t\t\t\t//Logger.log(\"On autoUpdate\", LogType.DEBUG);\r\n\t\t\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t}\t);\r\n\t\t\t\t\t\t\t}, 4000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//else if (newVal == \"STOPPED\" || newVal == \"PAUSED_PLAYBACK\" || newVal == \"PAUSED_RECORDING\" || newVal == \"NO_MEDIA_PRESENT\")\r\n\t\t\t\t//{\r\n\t\t\t\t//\r\n\t\t\t\t//}\r\n\t\t\t\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\r\n\t\t\t\tif (newVal == \"TRANSITIONING\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{InstanceID: 0}\t);\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{InstanceID: 0} );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newVal == \"STOPPED\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t});\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{\tInstanceID: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}", "loadComponent(nodeURI, baseURI, callback_async /* nodeDescriptor */, errback_async /* errorMessage */) { // TODO: turn this into a generic xhr loader exposed as a kernel function?\n\n let self = this;\n\n if (nodeURI == self.kutility.protoNodeURI) {\n\n callback_async(self.kutility.protoNodeDescriptor);\n\n } else if (nodeURI.match(RegExp(\"^data:application/json;base64,\"))) {\n\n // Primarly for testing, parse one specific form of data URIs. We need to parse\n // these ourselves since Chrome can't load data URIs due to cross origin\n // restrictions.\n\n callback_async(JSON.parse(atob(nodeURI.substring(29)))); // TODO: support all data URIs\n\n } else {\n\n self.virtualTime.suspend(\"while loading \" + nodeURI); // suspend the queue\n\n let fetchUrl = self.remappedURI(nodeURI, baseURI);\n let dbName = fetchUrl.split(\".\").join(\"_\");\n\n const parseComp = function (f) {\n\n let result = JSON.parse(f);\n\n let nativeObject = result;\n // console.log(nativeObject);\n\n if (nativeObject) {\n callback_async(nativeObject);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n\n } else {\n\n self.logger.warnx(\"loadComponent\", \"error loading\", nodeURI + \":\", error);\n errback_async(error);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n }\n\n }\n\n\n //var fileName = \"\";\n // let userDB = _LCSDB.user(_LCS_WORLD_USER.pub); \n if (dbName.includes(\"proxy\")) {\n //userDB = await window._LCS_SYS_USER.get('proxy').then();\n let proxyDB = self.proxy ? _LCSDB.user(self.proxy) : _LCSDB.user(_LCS_WORLD_USER.pub);\n let fileName = dbName + '_json';\n let dbNode = proxyDB.get('proxy').get(fileName);\n let nodeProm = new Promise(res => dbNode.once(res));\n\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n\n } else {\n var worldName = dbName.split('/')[1];\n var fileName = dbName.split('/')[2];\n //+ '_json';\n\n if (!fileName) {\n worldName = self.helpers.appPath\n fileName = dbName + '_json';\n } else {\n fileName = fileName + '_json';\n }\n\n let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName);\n\n let nodeProm = new Promise(res => dbNode.once(res))\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n }\n\n //console.log(source);\n\n //userDB.get(fileName).once(async function(res) {\n\n\n\n\n // }, {wait: 1000})\n }\n\n }", "async onReady() {\n // Initialize your adapter here\n await this.setObjectNotExistsAsync('speed', {\n type: 'channel',\n common: {\n name: 'speed'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.download', {\n type: 'state',\n common: {\n name: 'download',\n role: 'info.status',\n type: 'number',\n desc: 'Download speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.upload', {\n type: 'state',\n common: {\n name: 'upload',\n role: 'info.status',\n type: 'number',\n desc: 'Upload speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.ping', {\n type: 'state',\n common: {\n name: 'ping',\n role: 'info.status',\n type: 'number',\n desc: 'Ping Latency',\n def: 0,\n read: true,\n write: false,\n unit: 'ms',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.progress', {\n type: 'state',\n common: {\n name: 'progress',\n role: 'info.status',\n type: 'number',\n desc: 'Progress',\n def: 0,\n read: true,\n write: false,\n unit: '%',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('speed.speedcheck', {\n type: 'state',\n common: {\n name: 'Run speed test',\n type: 'boolean',\n read: true,\n role: 'button',\n write: true,\n def: false\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress', {\n type: 'channel',\n common: {\n name: 'speed'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.download', {\n type: 'state',\n common: {\n name: 'download',\n role: 'info.status',\n type: 'number',\n desc: 'Download speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.upload', {\n type: 'state',\n common: {\n name: 'upload',\n role: 'info.status',\n type: 'number',\n desc: 'Upload speed',\n def: 0,\n read: true,\n write: false,\n unit: 'Mbit/s',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.ping', {\n type: 'state',\n common: {\n name: 'ping',\n role: 'info.status',\n type: 'number',\n desc: 'Ping Latency',\n def: 0,\n read: true,\n write: false,\n unit: 'ms',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.progress', {\n type: 'state',\n common: {\n name: 'progress',\n role: 'info.status',\n type: 'number',\n desc: 'Progress',\n def: 0,\n read: true,\n write: false,\n unit: '%',\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('progress.speedcheck', {\n type: 'state',\n common: {\n name: 'Run speed test',\n type: 'boolean',\n read: true,\n role: 'button',\n write: true,\n def: false\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info', {\n type: 'channel',\n common: {\n name: 'Information'\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info.externalip', {\n type: 'state',\n common: {\n name: 'External IP',\n role: 'info.status',\n type: 'string',\n desc: 'External IP',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setObjectNotExistsAsync('info.internalip', {\n type: 'state',\n common: {\n name: 'Internal IP',\n role: 'info.status',\n type: 'string',\n desc: 'Internal IP',\n read: true,\n write: false,\n },\n native: {},\n });\n this.subscribeStates('*');\n await this.setStateAsync('info.connection', { val: true, ack: true });\n // let result = await this.checkPasswordAsync('admin', 'iobroker');\n // this.log.info('check user admin pw iobroker: ' + result);\n // result = await this.checkGroupAsync('admin', 'admin');\n // this.log.info('check group user admin group admin: ' + result);\n if (this.config.polltime > 1) {\n this.log.info('Checking internet speed every ' + this.config.polltime + ' minutes');\n } else {\n this.log.info('Checking internet speed every ' + this.config.polltime + ' minute');\n }\n await this.start(this.config.polltime);\n }", "enqueue() {\n\n }", "started() { }", "onBrowserStart(browser) {\n\n }", "getPort2() {\n return 0;\n }", "requestReceived(request,response){\n if(this.config.log){\n const logData={\n method : request.method,\n url : request.url,\n headers : request.headers\n };\n\n this.config.logFunction(\n logData\n );\n }\n\n let uri = url.parse(request.url);\n uri.protocol='http';\n uri.host=uri.hostname=request.headers.host;\n uri.port=80;\n uri.query=querystring.parse(uri.query);\n\n if(request.connection.encrypted){\n uri.protocol='https';\n uri.port=443;\n }\n\n (\n function(){\n if(!uri.host){\n return;\n }\n const host=uri.host.split(':');\n\n if(!host[1]){\n return;\n }\n uri.host=uri.hostname=host[0];\n uri.port=host[1];\n }\n )();\n\n for(let key in uri){\n if(uri[key]!==null){\n continue;\n }\n uri[key]='';\n }\n\n request.uri=uri;\n\n if(\n this.onRawRequest(\n request,\n response,\n completeServing.bind(this)\n )\n ){\n return;\n };\n\n uri=uri.pathname;\n\n if (uri=='/'){\n uri=`/${this.config.server.index}`;\n }\n\n let hostname= [];\n\n if (request.headers.host !== undefined){\n hostname = request.headers.host.split(':');\n }\n\n let root = this.config.root;\n\n if(this.config.verbose){\n console.log(`${this.config.logID} REQUEST ###\\n\\n`,\n request.headers,'\\n',\n uri,'\\n\\n',\n hostname,'\\n\\n'\n );\n }\n\n if(this.config.domain!='0.0.0.0' && hostname.length > 0 && hostname[0]!=this.config.domain){\n if(!this.config.domains[hostname[0]]){\n if(this.config.verbose){\n console.log(`${this.config.logID} INVALID HOST ###\\n\\n`);\n }\n this.serveFile(hostname[0],false,response);\n return;\n }\n root=this.config.domains[hostname[0]];\n }\n\n\n if(this.config.verbose){\n console.log(`${this.config.logID} USING ROOT : ${root}###\\n\\n`);\n }\n\n if(uri.slice(-1)=='/'){\n uri+=this.config.server.index;\n }\n\n request.url=uri;\n request.serverRoot=root;\n\n request.body='';\n\n request.on(\n 'data',\n function(chunk){\n request.body+=chunk;\n }.bind(this)\n ).on(\n 'end',\n function(){\n if(this.config.verbose){\n console.log(`###REQUEST BODY :\n ${request.body}\n ###\n `);\n }\n\n requestBodyComplete.bind(this,request,response)();\n }.bind(this)\n );\n }", "function OnChannelOpen()\n{\n}", "connect() {\n throw new Error(\n 'The Message Bus is not currently supported in browser environments'\n );\n }", "constructor() {\n throw new Error('Not implemented');\n }", "constructor() {\n this._connectionResolver = new pip_services3_components_node_1.ConnectionResolver();\n this._maxKeySize = 250;\n this._maxExpiration = 2592000;\n this._maxValue = 1048576;\n this._poolSize = 5;\n this._reconnect = 10000;\n this._timeout = 5000;\n this._retries = 5;\n this._failures = 5;\n this._retry = 30000;\n this._remove = false;\n this._idle = 5000;\n this._client = null;\n }", "componentDidMount()\n {\n\n }", "function OfflineStreamProcessor(config) {\n config = config || {};\n var context = this.context;\n var eventBus = config.eventBus;\n var events = config.events;\n var errors = config.errors;\n var debug = config.debug;\n var constants = config.constants;\n var settings = config.settings;\n var dashConstants = config.dashConstants;\n var manifestId = config.id;\n var type = config.type;\n var streamInfo = config.streamInfo;\n var errHandler = config.errHandler;\n var mediaPlayerModel = config.mediaPlayerModel;\n var abrController = config.abrController;\n var playbackController = config.playbackController;\n var adapter = config.adapter;\n var dashMetrics = config.dashMetrics;\n var baseURLController = config.baseURLController;\n var timelineConverter = config.timelineConverter;\n var bitrate = config.bitrate;\n var offlineStoreController = config.offlineStoreController;\n var completedCb = config.callbacks && config.callbacks.completed;\n var progressCb = config.callbacks && config.callbacks.progression;\n var instance, logger, mediaInfo, indexHandler, representationController, fragmentModel, updating, downloadedSegments, isInitialized, segmentsController, isStopped;\n\n function setup() {\n resetInitialSettings();\n logger = debug.getLogger(instance);\n segmentsController = Object(_dash_controllers_SegmentsController__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(context).create({\n events: events,\n eventBus: eventBus,\n streamInfo: streamInfo,\n timelineConverter: timelineConverter,\n dashConstants: dashConstants,\n segmentBaseController: config.segmentBaseController,\n type: type\n });\n indexHandler = Object(_dash_DashHandler__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(context).create({\n streamInfo: streamInfo,\n type: type,\n timelineConverter: timelineConverter,\n dashMetrics: dashMetrics,\n mediaPlayerModel: mediaPlayerModel,\n baseURLController: baseURLController,\n errHandler: errHandler,\n settings: settings,\n // boxParser: boxParser,\n eventBus: eventBus,\n events: events,\n debug: debug,\n requestModifier: Object(_streaming_utils_RequestModifier__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(context).getInstance(),\n dashConstants: dashConstants,\n constants: constants,\n segmentsController: segmentsController,\n urlUtils: Object(_streaming_utils_URLUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).getInstance()\n });\n representationController = Object(_dash_controllers_RepresentationController__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(context).create({\n streamInfo: streamInfo,\n type: type,\n abrController: abrController,\n dashMetrics: dashMetrics,\n playbackController: playbackController,\n timelineConverter: timelineConverter,\n dashConstants: dashConstants,\n events: events,\n eventBus: eventBus,\n errors: errors,\n segmentsController: segmentsController\n });\n fragmentModel = Object(_streaming_models_FragmentModel__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(context).create({\n streamInfo: streamInfo,\n dashMetrics: dashMetrics,\n fragmentLoader: Object(_streaming_FragmentLoader__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(context).create({\n dashMetrics: dashMetrics,\n mediaPlayerModel: mediaPlayerModel,\n errHandler: errHandler,\n requestModifier: Object(_streaming_utils_RequestModifier__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(context).getInstance(),\n settings: settings,\n eventBus: eventBus,\n events: events,\n errors: errors,\n constants: constants,\n dashConstants: dashConstants,\n urlUtils: Object(_streaming_utils_URLUtils__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).getInstance()\n }),\n debug: debug,\n eventBus: eventBus,\n events: events\n });\n eventBus.on(events.STREAM_REQUESTING_COMPLETED, onStreamRequestingCompleted, instance);\n eventBus.on(events.FRAGMENT_LOADING_COMPLETED, onFragmentLoadingCompleted, instance);\n }\n\n function initialize(_mediaInfo) {\n mediaInfo = _mediaInfo;\n indexHandler.initialize(false);\n updateRepresentation(mediaInfo);\n }\n\n function isInitRequest(request) {\n return request.type === 'InitializationSegment';\n }\n\n function onFragmentLoadingCompleted(e) {\n if (e.sender !== fragmentModel) {\n return;\n }\n\n if (e.request !== null) {\n var isInit = isInitRequest(e.request);\n var suffix = isInit ? 'init' : e.request.index;\n var fragmentName = e.request.representationId + '_' + suffix;\n offlineStoreController.storeFragment(manifestId, fragmentName, e.response).then(function () {\n if (!isInit) {\n // store current index and downloadedSegments number\n offlineStoreController.setRepresentationCurrentState(manifestId, e.request.representationId, {\n index: e.request.index,\n downloaded: downloadedSegments\n });\n }\n });\n }\n\n if (e.error && e.request.serviceLocation && !isStopped) {\n fragmentModel.executeRequest(e.request);\n } else {\n downloadedSegments++;\n download();\n }\n }\n\n function onStreamRequestingCompleted(e) {\n if (e.fragmentModel !== fragmentModel) {\n return;\n }\n\n logger.info(\"[\".concat(manifestId, \"] Stream is complete\"));\n stop();\n completedCb();\n }\n\n function getRepresentationController() {\n return representationController;\n }\n\n function getRepresentationId() {\n return representationController.getCurrentRepresentation().id;\n }\n /**\n * Stops download of fragments\n * @memberof OfflineStreamProcessor#\n */\n\n\n function stop() {\n if (isStopped) {\n return;\n }\n\n isStopped = true;\n }\n\n function removeExecutedRequestsBeforeTime(time) {\n if (fragmentModel) {\n fragmentModel.removeExecutedRequestsBeforeTime(time);\n }\n }\n /**\n * Execute init request for the represenation\n * @memberof OfflineStreamProcessor#\n */\n\n\n function getInitRequest() {\n if (!representationController.getCurrentRepresentation()) {\n return null;\n }\n\n return indexHandler.getInitRequest(getMediaInfo(), representationController.getCurrentRepresentation());\n }\n /**\n * Get next request\n * @memberof OfflineStreamProcessor#\n */\n\n\n function getNextRequest() {\n return indexHandler.getNextSegmentRequest(getMediaInfo(), representationController.getCurrentRepresentation());\n }\n /**\n * Start download\n * @memberof OfflineStreamProcessor#\n */\n\n\n function start() {\n if (representationController) {\n if (!representationController.getCurrentRepresentation()) {\n throw new Error('Start denied to OfflineStreamProcessor');\n }\n\n isStopped = false;\n offlineStoreController.getRepresentationCurrentState(manifestId, representationController.getCurrentRepresentation().id).then(function (state) {\n if (state) {\n indexHandler.setCurrentIndex(state.index);\n downloadedSegments = state.downloaded;\n }\n\n download();\n })[\"catch\"](function () {\n // start from beginining\n download();\n });\n }\n }\n /**\n * Performs download of fragment according to type\n * @memberof OfflineStreamProcessor#\n */\n\n\n function download() {\n if (isStopped) {\n return;\n }\n\n if (isNaN(representationController.getCurrentRepresentation())) {\n var request = null;\n\n if (!isInitialized) {\n request = getInitRequest();\n isInitialized = true;\n } else {\n request = getNextRequest(); // update progression : done here because availableSegmentsNumber is done in getNextRequest from dash handler\n\n updateProgression();\n }\n\n if (request) {\n logger.info(\"[\".concat(manifestId, \"] download request : \").concat(request.url));\n fragmentModel.executeRequest(request);\n } else {\n logger.info(\"[\".concat(manifestId, \"] no request to be downloaded\"));\n }\n }\n }\n /**\n * Update representation\n * @param {Object} mediaInfo - mediaInfo\n * @memberof OfflineStreamProcessor#\n */\n\n\n function updateRepresentation(mediaInfo) {\n updating = true;\n var voRepresentations = adapter.getVoRepresentations(mediaInfo); // get representation VO according to id.\n\n var quality = voRepresentations.findIndex(function (representation) {\n return representation.id === bitrate.id;\n });\n\n if (type !== constants.VIDEO && type !== constants.AUDIO && type !== constants.TEXT) {\n updating = false;\n return;\n }\n\n representationController.updateData(null, voRepresentations, type, mediaInfo.isFragmented, quality);\n }\n\n function isUpdating() {\n return updating;\n }\n\n function getType() {\n return type;\n }\n\n function getMediaInfo() {\n return mediaInfo;\n }\n\n function getAvailableSegmentsNumber() {\n return representationController.getCurrentRepresentation().availableSegmentsNumber + 1; // do not forget init segment\n }\n\n function updateProgression() {\n if (progressCb) {\n progressCb(instance, downloadedSegments, getAvailableSegmentsNumber());\n }\n }\n\n function resetInitialSettings() {\n isInitialized = false;\n downloadedSegments = 0;\n updating = false;\n }\n /**\n * Reset\n * @memberof OfflineStreamProcessor#\n */\n\n\n function reset() {\n resetInitialSettings();\n indexHandler.reset();\n eventBus.off(events.STREAM_REQUESTING_COMPLETED, onStreamRequestingCompleted, instance);\n eventBus.off(events.FRAGMENT_LOADING_COMPLETED, onFragmentLoadingCompleted, instance);\n }\n\n instance = {\n initialize: initialize,\n getMediaInfo: getMediaInfo,\n getRepresentationController: getRepresentationController,\n removeExecutedRequestsBeforeTime: removeExecutedRequestsBeforeTime,\n getType: getType,\n getRepresentationId: getRepresentationId,\n isUpdating: isUpdating,\n start: start,\n stop: stop,\n getAvailableSegmentsNumber: getAvailableSegmentsNumber,\n reset: reset\n };\n setup();\n return instance;\n}", "constructor() {\r\n }", "constructor() {\n\t\t// ...\n\t}", "static get STATUS() {\n return 0;\n }", "onReady() {\n return __awaiter(this, void 0, void 0, function* () {\n this.logger = new log_1.ioBrokerLogger(this.log);\n yield this.setObjectNotExistsAsync(\"verify_code\", {\n type: \"state\",\n common: {\n name: \"2FA verification code\",\n type: \"number\",\n role: \"state\",\n read: true,\n write: true,\n },\n native: {},\n });\n yield this.setObjectNotExistsAsync(\"info\", {\n type: \"channel\",\n common: {\n name: \"info\"\n },\n native: {},\n });\n yield this.setObjectNotExistsAsync(\"info.connection\", {\n type: \"state\",\n common: {\n name: \"Global connection\",\n type: \"boolean\",\n role: \"indicator.connection\",\n read: true,\n write: false,\n },\n native: {},\n });\n yield this.setStateAsync(\"info.connection\", { val: false, ack: true });\n yield this.setObjectNotExistsAsync(\"info.push_connection\", {\n type: \"state\",\n common: {\n name: \"Push notification connection\",\n type: \"boolean\",\n role: \"indicator.connection\",\n read: true,\n write: false,\n },\n native: {},\n });\n // Remove old states of previous adapter versions\n try {\n const schedule_modes = yield this.getStatesAsync(\"*.schedule_mode\");\n Object.keys(schedule_modes).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const push_notifications = yield this.getStatesAsync(\"push_notification.*\");\n Object.keys(push_notifications).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n yield this.delObjectAsync(\"push_notification\");\n }\n catch (error) {\n }\n try {\n const last_camera_url = yield this.getStatesAsync(\"*.last_camera_url\");\n Object.keys(last_camera_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const captured_pic_url = yield this.getStatesAsync(\"*.captured_pic_url\");\n Object.keys(captured_pic_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const person_identified = yield this.getStatesAsync(\"*.person_identified\");\n Object.keys(person_identified).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const last_captured_pic_url = yield this.getStatesAsync(\"*.last_captured_pic_url\");\n Object.keys(last_captured_pic_url).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n try {\n const last_captured_pic_html = yield this.getStatesAsync(\"*.last_captured_pic_html\");\n Object.keys(last_captured_pic_html).forEach((id) => __awaiter(this, void 0, void 0, function* () {\n yield this.delObjectAsync(id);\n }));\n }\n catch (error) {\n }\n // End\n // Reset event states if necessary (for example because of an unclean exit)\n yield this.initializeEvents(types_1.CameraStateID.PERSON_DETECTED);\n yield this.initializeEvents(types_1.CameraStateID.MOTION_DETECTED);\n yield this.initializeEvents(types_1.DoorbellStateID.RINGING);\n yield this.initializeEvents(types_1.IndoorCameraStateID.CRYING_DETECTED);\n yield this.initializeEvents(types_1.IndoorCameraStateID.SOUND_DETECTED);\n yield this.initializeEvents(types_1.IndoorCameraStateID.PET_DETECTED);\n try {\n if (fs.statSync(this.persistentFile).isFile()) {\n const fileContent = fs.readFileSync(this.persistentFile, \"utf8\");\n this.persistentData = JSON.parse(fileContent);\n }\n }\n catch (err) {\n this.logger.debug(\"No stored data from last exit found.\");\n }\n //TODO: Temporary Test to be removed!\n /*await this.setObjectNotExistsAsync(\"test_button\", {\n type: \"state\",\n common: {\n name: \"Test button\",\n type: \"boolean\",\n role: \"button\",\n read: false,\n write: true,\n },\n native: {},\n });\n this.subscribeStates(\"test_button\");\n await this.setObjectNotExistsAsync(\"test_button2\", {\n type: \"state\",\n common: {\n name: \"Test button2\",\n type: \"boolean\",\n role: \"button\",\n read: false,\n write: true,\n },\n native: {},\n });\n this.subscribeStates(\"test_button2\");*/\n // END\n this.subscribeStates(\"verify_code\");\n const systemConfig = yield this.getForeignObjectAsync(\"system.config\");\n let countryCode = undefined;\n let languageCode = undefined;\n if (systemConfig) {\n countryCode = i18n_iso_countries_1.getAlpha2Code(systemConfig.common.country, \"en\");\n if (i18n_iso_languages_1.isValid(systemConfig.common.language))\n languageCode = systemConfig.common.language;\n }\n try {\n const adapter_info = yield this.getForeignObjectAsync(`system.adapter.${this.namespace}`);\n if (adapter_info && adapter_info.common && adapter_info.common.version) {\n if (this.persistentData.version !== adapter_info.common.version) {\n const currentVersion = Number.parseFloat(utils_1.removeLastChar(adapter_info.common.version, \".\"));\n const previousVersion = this.persistentData.version !== \"\" && this.persistentData.version !== undefined ? Number.parseFloat(utils_1.removeLastChar(this.persistentData.version, \".\")) : 0;\n this.logger.debug(`Handling of adapter update - currentVersion: ${currentVersion} previousVersion: ${previousVersion}`);\n if (previousVersion < currentVersion) {\n yield utils_1.handleUpdate(this, this.logger, previousVersion);\n this.persistentData.version = adapter_info.common.version;\n this.writePersistentData();\n }\n }\n }\n }\n catch (error) {\n this.logger.error(`Handling of adapter update - Error:`, error);\n }\n this.eufy = new EufySecurityAPI.EufySecurity(this, this.logger, countryCode, languageCode);\n this.eufy.on(\"stations\", (stations) => this.handleStations(stations));\n this.eufy.on(\"devices\", (devices) => this.handleDevices(devices));\n this.eufy.on(\"push message\", (messages) => this.handlePushNotification(messages));\n this.eufy.on(\"connect\", () => this.onConnect());\n this.eufy.on(\"close\", () => this.onClose());\n this.eufy.on(\"livestream start\", (station, device, url) => this.onStartLivestream(station, device, url));\n this.eufy.on(\"livestream stop\", (station, device) => this.onStopLivestream(station, device));\n this.eufy.on(\"push connect\", () => this.onPushConnect());\n this.eufy.on(\"push close\", () => this.onPushClose());\n const api = this.eufy.getApi();\n if (this.persistentData.api_base && this.persistentData.api_base != \"\") {\n this.logger.debug(`Load previous api_base: ${this.persistentData.api_base}`);\n api.setAPIBase(this.persistentData.api_base);\n }\n if (this.persistentData.login_hash && this.persistentData.login_hash != \"\") {\n this.logger.debug(`Load previous login_hash: ${this.persistentData.login_hash}`);\n if (utils_1.md5(`${this.config.username}:${this.config.password}`) != this.persistentData.login_hash) {\n this.logger.info(`Authentication properties changed, invalidate saved cloud token.`);\n this.persistentData.cloud_token = \"\";\n this.persistentData.cloud_token_expiration = 0;\n this.persistentData.api_base = \"\";\n }\n }\n else {\n this.persistentData.cloud_token = \"\";\n this.persistentData.cloud_token_expiration = 0;\n }\n if (this.persistentData.cloud_token && this.persistentData.cloud_token != \"\") {\n this.logger.debug(`Load previous token: ${this.persistentData.cloud_token} token_expiration: ${this.persistentData.cloud_token_expiration}`);\n api.setToken(this.persistentData.cloud_token);\n api.setTokenExpiration(new Date(this.persistentData.cloud_token_expiration));\n }\n if (!this.persistentData.openudid || this.persistentData.openudid == \"\") {\n this.persistentData.openudid = utils_1.generateUDID();\n this.logger.debug(`Generated new openudid: ${this.persistentData.openudid}`);\n }\n api.setOpenUDID(this.persistentData.openudid);\n if (!this.persistentData.serial_number || this.persistentData.serial_number == \"\") {\n this.persistentData.serial_number = utils_1.generateSerialnumber(12);\n this.logger.debug(`Generated new serial_number: ${this.persistentData.serial_number}`);\n }\n api.setSerialNumber(this.persistentData.serial_number);\n yield this.eufy.logon();\n });\n }", "function AppMeasurement(r){var a=this;a.version=\"2.8.2\";var k=window;k.s_c_in||(k.s_c_il=[],k.s_c_in=0);a._il=k.s_c_il;a._in=k.s_c_in;a._il[a._in]=a;k.s_c_in++;a._c=\"s_c\";var p=k.AppMeasurement.Xb;p||(p=null);var n=k,m,s;try{for(m=n.parent,s=n.location;m&&m.location&&s&&\"\"+m.location!=\"\"+s&&n.location&&\"\"+m.location!=\"\"+n.location&&m.location.host==s.host;)n=m,m=n.parent}catch(u){}a.F=function(a){try{console.log(a)}catch(b){}};a.Oa=function(a){return\"\"+parseInt(a)==\"\"+a};a.replace=function(a,b,d){return!a||\r\n0>a.indexOf(b)?a:a.split(b).join(d)};a.escape=function(c){var b,d;if(!c)return c;c=encodeURIComponent(c);for(b=0;7>b;b++)d=\"+~!*()'\".substring(b,b+1),0<=c.indexOf(d)&&(c=a.replace(c,d,\"%\"+d.charCodeAt(0).toString(16).toUpperCase()));return c};a.unescape=function(c){if(!c)return c;c=0<=c.indexOf(\"+\")?a.replace(c,\"+\",\" \"):c;try{return decodeURIComponent(c)}catch(b){}return unescape(c)};a.Fb=function(){var c=k.location.hostname,b=a.fpCookieDomainPeriods,d;b||(b=a.cookieDomainPeriods);if(c&&!a.Ga&&!/^[0-9.]+$/.test(c)&&\r\n(b=b?parseInt(b):2,b=2<b?b:2,d=c.lastIndexOf(\".\"),0<=d)){for(;0<=d&&1<b;)d=c.lastIndexOf(\".\",d-1),b--;a.Ga=0<d?c.substring(d):c}return a.Ga};a.c_r=a.cookieRead=function(c){c=a.escape(c);var b=\" \"+a.d.cookie,d=b.indexOf(\" \"+c+\"=\"),f=0>d?d:b.indexOf(\";\",d);c=0>d?\"\":a.unescape(b.substring(d+2+c.length,0>f?b.length:f));return\"[[B]]\"!=c?c:\"\"};a.c_w=a.cookieWrite=function(c,b,d){var f=a.Fb(),e=a.cookieLifetime,g;b=\"\"+b;e=e?(\"\"+e).toUpperCase():\"\";d&&\"SESSION\"!=e&&\"NONE\"!=e&&((g=\"\"!=b?parseInt(e?e:0):-60)?\r\n(d=new Date,d.setTime(d.getTime()+1E3*g)):1==d&&(d=new Date,g=d.getYear(),d.setYear(g+5+(1900>g?1900:0))));return c&&\"NONE\"!=e?(a.d.cookie=a.escape(c)+\"=\"+a.escape(\"\"!=b?b:\"[[B]]\")+\"; path=/;\"+(d&&\"SESSION\"!=e?\" expires=\"+d.toUTCString()+\";\":\"\")+(f?\" domain=\"+f+\";\":\"\"),a.cookieRead(c)==b):0};a.Cb=function(){var c=a.Util.getIeVersion();\"number\"===typeof c&&10>c&&(a.unsupportedBrowser=!0,a.rb(a,function(){}))};a.rb=function(a,b){for(var d in a)a.hasOwnProperty(d)&&\"function\"===typeof a[d]&&(a[d]=b)};\r\na.L=[];a.ja=function(c,b,d){if(a.Ha)return 0;a.maxDelay||(a.maxDelay=250);var f=0,e=(new Date).getTime()+a.maxDelay,g=a.d.visibilityState,h=[\"webkitvisibilitychange\",\"visibilitychange\"];g||(g=a.d.webkitVisibilityState);if(g&&\"prerender\"==g){if(!a.ka)for(a.ka=1,d=0;d<h.length;d++)a.d.addEventListener(h[d],function(){var c=a.d.visibilityState;c||(c=a.d.webkitVisibilityState);\"visible\"==c&&(a.ka=0,a.delayReady())});f=1;e=0}else d||a.p(\"_d\")&&(f=1);f&&(a.L.push({m:c,a:b,t:e}),a.ka||setTimeout(a.delayReady,\r\na.maxDelay));return f};a.delayReady=function(){var c=(new Date).getTime(),b=0,d;for(a.p(\"_d\")?b=1:a.za();0<a.L.length;){d=a.L.shift();if(b&&!d.t&&d.t>c){a.L.unshift(d);setTimeout(a.delayReady,parseInt(a.maxDelay/2));break}a.Ha=1;a[d.m].apply(a,d.a);a.Ha=0}};a.setAccount=a.sa=function(c){var b,d;if(!a.ja(\"setAccount\",arguments))if(a.account=c,a.allAccounts)for(b=a.allAccounts.concat(c.split(\",\")),a.allAccounts=[],b.sort(),d=0;d<b.length;d++)0!=d&&b[d-1]==b[d]||a.allAccounts.push(b[d]);else a.allAccounts=\r\nc.split(\",\")};a.foreachVar=function(c,b){var d,f,e,g,h=\"\";e=f=\"\";if(a.lightProfileID)d=a.P,(h=a.lightTrackVars)&&(h=\",\"+h+\",\"+a.oa.join(\",\")+\",\");else{d=a.g;if(a.pe||a.linkType)h=a.linkTrackVars,f=a.linkTrackEvents,a.pe&&(e=a.pe.substring(0,1).toUpperCase()+a.pe.substring(1),a[e]&&(h=a[e].Vb,f=a[e].Ub));h&&(h=\",\"+h+\",\"+a.H.join(\",\")+\",\");f&&h&&(h+=\",events,\")}b&&(b=\",\"+b+\",\");for(f=0;f<d.length;f++)e=d[f],(g=a[e])&&(!h||0<=h.indexOf(\",\"+e+\",\"))&&(!b||0<=b.indexOf(\",\"+e+\",\"))&&c(e,g)};a.r=function(c,\r\nb,d,f,e){var g=\"\",h,l,k,q,m=0;\"contextData\"==c&&(c=\"c\");if(b){for(h in b)if(!(Object.prototype[h]||e&&h.substring(0,e.length)!=e)&&b[h]&&(!d||0<=d.indexOf(\",\"+(f?f+\".\":\"\")+h+\",\"))){k=!1;if(m)for(l=0;l<m.length;l++)h.substring(0,m[l].length)==m[l]&&(k=!0);if(!k&&(\"\"==g&&(g+=\"&\"+c+\".\"),l=b[h],e&&(h=h.substring(e.length)),0<h.length))if(k=h.indexOf(\".\"),0<k)l=h.substring(0,k),k=(e?e:\"\")+l+\".\",m||(m=[]),m.push(k),g+=a.r(l,b,d,f,k);else if(\"boolean\"==typeof l&&(l=l?\"true\":\"false\"),l){if(\"retrieveLightData\"==\r\nf&&0>e.indexOf(\".contextData.\"))switch(k=h.substring(0,4),q=h.substring(4),h){case \"transactionID\":h=\"xact\";break;case \"channel\":h=\"ch\";break;case \"campaign\":h=\"v0\";break;default:a.Oa(q)&&(\"prop\"==k?h=\"c\"+q:\"eVar\"==k?h=\"v\"+q:\"list\"==k?h=\"l\"+q:\"hier\"==k&&(h=\"h\"+q,l=l.substring(0,255)))}g+=\"&\"+a.escape(h)+\"=\"+a.escape(l)}}\"\"!=g&&(g+=\"&.\"+c)}return g};a.usePostbacks=0;a.Ib=function(){var c=\"\",b,d,f,e,g,h,l,k,q=\"\",m=\"\",n=e=\"\";if(a.lightProfileID)b=a.P,(q=a.lightTrackVars)&&(q=\",\"+q+\",\"+a.oa.join(\",\")+\r\n\",\");else{b=a.g;if(a.pe||a.linkType)q=a.linkTrackVars,m=a.linkTrackEvents,a.pe&&(e=a.pe.substring(0,1).toUpperCase()+a.pe.substring(1),a[e]&&(q=a[e].Vb,m=a[e].Ub));q&&(q=\",\"+q+\",\"+a.H.join(\",\")+\",\");m&&(m=\",\"+m+\",\",q&&(q+=\",events,\"));a.events2&&(n+=(\"\"!=n?\",\":\"\")+a.events2)}if(a.visitor&&a.visitor.getCustomerIDs){e=p;if(g=a.visitor.getCustomerIDs())for(d in g)Object.prototype[d]||(f=g[d],\"object\"==typeof f&&(e||(e={}),f.id&&(e[d+\".id\"]=f.id),f.authState&&(e[d+\".as\"]=f.authState)));e&&(c+=a.r(\"cid\",\r\ne))}a.AudienceManagement&&a.AudienceManagement.isReady()&&(c+=a.r(\"d\",a.AudienceManagement.getEventCallConfigParams()));for(d=0;d<b.length;d++){e=b[d];g=a[e];f=e.substring(0,4);h=e.substring(4);g||(\"events\"==e&&n?(g=n,n=\"\"):\"marketingCloudOrgID\"==e&&a.visitor&&(g=a.visitor.marketingCloudOrgID));if(g&&(!q||0<=q.indexOf(\",\"+e+\",\"))){switch(e){case \"customerPerspective\":e=\"cp\";break;case \"marketingCloudOrgID\":e=\"mcorgid\";break;case \"supplementalDataID\":e=\"sdid\";break;case \"timestamp\":e=\"ts\";break;case \"dynamicVariablePrefix\":e=\r\n\"D\";break;case \"visitorID\":e=\"vid\";break;case \"marketingCloudVisitorID\":e=\"mid\";break;case \"analyticsVisitorID\":e=\"aid\";break;case \"audienceManagerLocationHint\":e=\"aamlh\";break;case \"audienceManagerBlob\":e=\"aamb\";break;case \"authState\":e=\"as\";break;case \"pageURL\":e=\"g\";255<g.length&&(a.pageURLRest=g.substring(255),g=g.substring(0,255));break;case \"pageURLRest\":e=\"-g\";break;case \"referrer\":e=\"r\";break;case \"vmk\":case \"visitorMigrationKey\":e=\"vmt\";break;case \"visitorMigrationServer\":e=\"vmf\";a.ssl&&\r\na.visitorMigrationServerSecure&&(g=\"\");break;case \"visitorMigrationServerSecure\":e=\"vmf\";!a.ssl&&a.visitorMigrationServer&&(g=\"\");break;case \"charSet\":e=\"ce\";break;case \"visitorNamespace\":e=\"ns\";break;case \"cookieDomainPeriods\":e=\"cdp\";break;case \"cookieLifetime\":e=\"cl\";break;case \"variableProvider\":e=\"vvp\";break;case \"currencyCode\":e=\"cc\";break;case \"channel\":e=\"ch\";break;case \"transactionID\":e=\"xact\";break;case \"campaign\":e=\"v0\";break;case \"latitude\":e=\"lat\";break;case \"longitude\":e=\"lon\";break;\r\ncase \"resolution\":e=\"s\";break;case \"colorDepth\":e=\"c\";break;case \"javascriptVersion\":e=\"j\";break;case \"javaEnabled\":e=\"v\";break;case \"cookiesEnabled\":e=\"k\";break;case \"browserWidth\":e=\"bw\";break;case \"browserHeight\":e=\"bh\";break;case \"connectionType\":e=\"ct\";break;case \"homepage\":e=\"hp\";break;case \"events\":n&&(g+=(\"\"!=g?\",\":\"\")+n);if(m)for(h=g.split(\",\"),g=\"\",f=0;f<h.length;f++)l=h[f],k=l.indexOf(\"=\"),0<=k&&(l=l.substring(0,k)),k=l.indexOf(\":\"),0<=k&&(l=l.substring(0,k)),0<=m.indexOf(\",\"+l+\",\")&&(g+=\r\n(g?\",\":\"\")+h[f]);break;case \"events2\":g=\"\";break;case \"contextData\":c+=a.r(\"c\",a[e],q,e);g=\"\";break;case \"lightProfileID\":e=\"mtp\";break;case \"lightStoreForSeconds\":e=\"mtss\";a.lightProfileID||(g=\"\");break;case \"lightIncrementBy\":e=\"mti\";a.lightProfileID||(g=\"\");break;case \"retrieveLightProfiles\":e=\"mtsr\";break;case \"deleteLightProfiles\":e=\"mtsd\";break;case \"retrieveLightData\":a.retrieveLightProfiles&&(c+=a.r(\"mts\",a[e],q,e));g=\"\";break;default:a.Oa(h)&&(\"prop\"==f?e=\"c\"+h:\"eVar\"==f?e=\"v\"+h:\"list\"==\r\nf?e=\"l\"+h:\"hier\"==f&&(e=\"h\"+h,g=g.substring(0,255)))}g&&(c+=\"&\"+e+\"=\"+(\"pev\"!=e.substring(0,3)?a.escape(g):g))}\"pev3\"==e&&a.e&&(c+=a.e)}a.na&&(c+=\"&lrt=\"+a.na,a.na=null);return c};a.D=function(a){var b=a.tagName;if(\"undefined\"!=\"\"+a.$b||\"undefined\"!=\"\"+a.Qb&&\"HTML\"!=(\"\"+a.Qb).toUpperCase())return\"\";b=b&&b.toUpperCase?b.toUpperCase():\"\";\"SHAPE\"==b&&(b=\"\");b&&((\"INPUT\"==b||\"BUTTON\"==b)&&a.type&&a.type.toUpperCase?b=a.type.toUpperCase():!b&&a.href&&(b=\"A\"));return b};a.Ka=function(a){var b=k.location,\r\nd=a.href?a.href:\"\",f,e,g;f=d.indexOf(\":\");e=d.indexOf(\"?\");g=d.indexOf(\"/\");d&&(0>f||0<=e&&f>e||0<=g&&f>g)&&(e=a.protocol&&1<a.protocol.length?a.protocol:b.protocol?b.protocol:\"\",f=b.pathname.lastIndexOf(\"/\"),d=(e?e+\"//\":\"\")+(a.host?a.host:b.host?b.host:\"\")+(\"/\"!=d.substring(0,1)?b.pathname.substring(0,0>f?0:f)+\"/\":\"\")+d);return d};a.M=function(c){var b=a.D(c),d,f,e=\"\",g=0;return b&&(d=c.protocol,f=c.onclick,!c.href||\"A\"!=b&&\"AREA\"!=b||f&&d&&!(0>d.toLowerCase().indexOf(\"javascript\"))?f?(e=a.replace(a.replace(a.replace(a.replace(\"\"+\r\nf,\"\\r\",\"\"),\"\\n\",\"\"),\"\\t\",\"\"),\" \",\"\"),g=2):\"INPUT\"==b||\"SUBMIT\"==b?(c.value?e=c.value:c.innerText?e=c.innerText:c.textContent&&(e=c.textContent),g=3):\"IMAGE\"==b&&c.src&&(e=c.src):e=a.Ka(c),e)?{id:e.substring(0,100),type:g}:0};a.Yb=function(c){for(var b=a.D(c),d=a.M(c);c&&!d&&\"BODY\"!=b;)if(c=c.parentElement?c.parentElement:c.parentNode)b=a.D(c),d=a.M(c);d&&\"BODY\"!=b||(c=0);c&&(b=c.onclick?\"\"+c.onclick:\"\",0<=b.indexOf(\".tl(\")||0<=b.indexOf(\".trackLink(\"))&&(c=0);return c};a.Pb=function(){var c,b,d=a.linkObject,\r\nf=a.linkType,e=a.linkURL,g,h;a.pa=1;d||(a.pa=0,d=a.clickObject);if(d){c=a.D(d);for(b=a.M(d);d&&!b&&\"BODY\"!=c;)if(d=d.parentElement?d.parentElement:d.parentNode)c=a.D(d),b=a.M(d);b&&\"BODY\"!=c||(d=0);if(d&&!a.linkObject){var l=d.onclick?\"\"+d.onclick:\"\";if(0<=l.indexOf(\".tl(\")||0<=l.indexOf(\".trackLink(\"))d=0}}else a.pa=1;!e&&d&&(e=a.Ka(d));e&&!a.linkLeaveQueryString&&(g=e.indexOf(\"?\"),0<=g&&(e=e.substring(0,g)));if(!f&&e){var m=0,q=0,n;if(a.trackDownloadLinks&&a.linkDownloadFileTypes)for(l=e.toLowerCase(),\r\ng=l.indexOf(\"?\"),h=l.indexOf(\"#\"),0<=g?0<=h&&h<g&&(g=h):g=h,0<=g&&(l=l.substring(0,g)),g=a.linkDownloadFileTypes.toLowerCase().split(\",\"),h=0;h<g.length;h++)(n=g[h])&&l.substring(l.length-(n.length+1))==\".\"+n&&(f=\"d\");if(a.trackExternalLinks&&!f&&(l=e.toLowerCase(),a.Na(l)&&(a.linkInternalFilters||(a.linkInternalFilters=k.location.hostname),g=0,a.linkExternalFilters?(g=a.linkExternalFilters.toLowerCase().split(\",\"),m=1):a.linkInternalFilters&&(g=a.linkInternalFilters.toLowerCase().split(\",\")),g))){for(h=\r\n0;h<g.length;h++)n=g[h],0<=l.indexOf(n)&&(q=1);q?m&&(f=\"e\"):m||(f=\"e\")}}a.linkObject=d;a.linkURL=e;a.linkType=f;if(a.trackClickMap||a.trackInlineStats)a.e=\"\",d&&(f=a.pageName,e=1,d=d.sourceIndex,f||(f=a.pageURL,e=0),k.s_objectID&&(b.id=k.s_objectID,d=b.type=1),f&&b&&b.id&&c&&(a.e=\"&pid=\"+a.escape(f.substring(0,255))+(e?\"&pidt=\"+e:\"\")+\"&oid=\"+a.escape(b.id.substring(0,100))+(b.type?\"&oidt=\"+b.type:\"\")+\"&ot=\"+c+(d?\"&oi=\"+d:\"\")))};a.Jb=function(){var c=a.pa,b=a.linkType,d=a.linkURL,f=a.linkName;b&&(d||\r\nf)&&(b=b.toLowerCase(),\"d\"!=b&&\"e\"!=b&&(b=\"o\"),a.pe=\"lnk_\"+b,a.pev1=d?a.escape(d):\"\",a.pev2=f?a.escape(f):\"\",c=1);a.abort&&(c=0);if(a.trackClickMap||a.trackInlineStats||a.ActivityMap){var b={},d=0,e=a.cookieRead(\"s_sq\"),g=e?e.split(\"&\"):0,h,l,k,e=0;if(g)for(h=0;h<g.length;h++)l=g[h].split(\"=\"),f=a.unescape(l[0]).split(\",\"),l=a.unescape(l[1]),b[l]=f;f=a.account.split(\",\");h={};for(k in a.contextData)k&&!Object.prototype[k]&&\"a.activitymap.\"==k.substring(0,14)&&(h[k]=a.contextData[k],a.contextData[k]=\r\n\"\");a.e=a.r(\"c\",h)+(a.e?a.e:\"\");if(c||a.e){c&&!a.e&&(e=1);for(l in b)if(!Object.prototype[l])for(k=0;k<f.length;k++)for(e&&(g=b[l].join(\",\"),g==a.account&&(a.e+=(\"&\"!=l.charAt(0)?\"&\":\"\")+l,b[l]=[],d=1)),h=0;h<b[l].length;h++)g=b[l][h],g==f[k]&&(e&&(a.e+=\"&u=\"+a.escape(g)+(\"&\"!=l.charAt(0)?\"&\":\"\")+l+\"&u=0\"),b[l].splice(h,1),d=1);c||(d=1);if(d){e=\"\";h=2;!c&&a.e&&(e=a.escape(f.join(\",\"))+\"=\"+a.escape(a.e),h=1);for(l in b)!Object.prototype[l]&&0<h&&0<b[l].length&&(e+=(e?\"&\":\"\")+a.escape(b[l].join(\",\"))+\r\n\"=\"+a.escape(l),h--);a.cookieWrite(\"s_sq\",e)}}}return c};a.Kb=function(){if(!a.Tb){var c=new Date,b=n.location,d,f,e=f=d=\"\",g=\"\",h=\"\",l=\"1.2\",k=a.cookieWrite(\"s_cc\",\"true\",0)?\"Y\":\"N\",m=\"\",p=\"\";if(c.setUTCDate&&(l=\"1.3\",(0).toPrecision&&(l=\"1.5\",c=[],c.forEach))){l=\"1.6\";f=0;d={};try{f=new Iterator(d),f.next&&(l=\"1.7\",c.reduce&&(l=\"1.8\",l.trim&&(l=\"1.8.1\",Date.parse&&(l=\"1.8.2\",Object.create&&(l=\"1.8.5\")))))}catch(r){}}d=screen.width+\"x\"+screen.height;e=navigator.javaEnabled()?\"Y\":\"N\";f=screen.pixelDepth?\r\nscreen.pixelDepth:screen.colorDepth;g=a.w.innerWidth?a.w.innerWidth:a.d.documentElement.offsetWidth;h=a.w.innerHeight?a.w.innerHeight:a.d.documentElement.offsetHeight;try{a.b.addBehavior(\"#default#homePage\"),m=a.b.Zb(b)?\"Y\":\"N\"}catch(s){}try{a.b.addBehavior(\"#default#clientCaps\"),p=a.b.connectionType}catch(t){}a.resolution=d;a.colorDepth=f;a.javascriptVersion=l;a.javaEnabled=e;a.cookiesEnabled=k;a.browserWidth=g;a.browserHeight=h;a.connectionType=p;a.homepage=m;a.Tb=1}};a.Q={};a.loadModule=function(c,\r\nb){var d=a.Q[c];if(!d){d=k[\"AppMeasurement_Module_\"+c]?new k[\"AppMeasurement_Module_\"+c](a):{};a.Q[c]=a[c]=d;d.kb=function(){return d.qb};d.sb=function(b){if(d.qb=b)a[c+\"_onLoad\"]=b,a.ja(c+\"_onLoad\",[a,d],1)||b(a,d)};try{Object.defineProperty?Object.defineProperty(d,\"onLoad\",{get:d.kb,set:d.sb}):d._olc=1}catch(f){d._olc=1}}b&&(a[c+\"_onLoad\"]=b,a.ja(c+\"_onLoad\",[a,d],1)||b(a,d))};a.p=function(c){var b,d;for(b in a.Q)if(!Object.prototype[b]&&(d=a.Q[b])&&(d._olc&&d.onLoad&&(d._olc=0,d.onLoad(a,d)),d[c]&&\r\nd[c]()))return 1;return 0};a.Mb=function(){var c=Math.floor(1E13*Math.random()),b=a.visitorSampling,d=a.visitorSamplingGroup,d=\"s_vsn_\"+(a.visitorNamespace?a.visitorNamespace:a.account)+(d?\"_\"+d:\"\"),f=a.cookieRead(d);if(b){b*=100;f&&(f=parseInt(f));if(!f){if(!a.cookieWrite(d,c))return 0;f=c}if(f%1E4>b)return 0}return 1};a.R=function(c,b){var d,f,e,g,h,l;for(d=0;2>d;d++)for(f=0<d?a.Ca:a.g,e=0;e<f.length;e++)if(g=f[e],(h=c[g])||c[\"!\"+g]){if(!b&&(\"contextData\"==g||\"retrieveLightData\"==g)&&a[g])for(l in a[g])h[l]||\r\n(h[l]=a[g][l]);a[g]=h}};a.Ya=function(c,b){var d,f,e,g;for(d=0;2>d;d++)for(f=0<d?a.Ca:a.g,e=0;e<f.length;e++)g=f[e],c[g]=a[g],b||c[g]||(c[\"!\"+g]=1)};a.Eb=function(a){var b,d,f,e,g,h=0,l,k=\"\",m=\"\";if(a&&255<a.length&&(b=\"\"+a,d=b.indexOf(\"?\"),0<d&&(l=b.substring(d+1),b=b.substring(0,d),e=b.toLowerCase(),f=0,\"http://\"==e.substring(0,7)?f+=7:\"https://\"==e.substring(0,8)&&(f+=8),d=e.indexOf(\"/\",f),0<d&&(e=e.substring(f,d),g=b.substring(d),b=b.substring(0,d),0<=e.indexOf(\"google\")?h=\",q,ie,start,search_key,word,kw,cd,\":\r\n0<=e.indexOf(\"yahoo.co\")&&(h=\",p,ei,\"),h&&l)))){if((a=l.split(\"&\"))&&1<a.length){for(f=0;f<a.length;f++)e=a[f],d=e.indexOf(\"=\"),0<d&&0<=h.indexOf(\",\"+e.substring(0,d)+\",\")?k+=(k?\"&\":\"\")+e:m+=(m?\"&\":\"\")+e;k&&m?l=k+\"&\"+m:m=\"\"}d=253-(l.length-m.length)-b.length;a=b+(0<d?g.substring(0,d):\"\")+\"?\"+l}return a};a.eb=function(c){var b=a.d.visibilityState,d=[\"webkitvisibilitychange\",\"visibilitychange\"];b||(b=a.d.webkitVisibilityState);if(b&&\"prerender\"==b){if(c)for(b=0;b<d.length;b++)a.d.addEventListener(d[b],\r\nfunction(){var b=a.d.visibilityState;b||(b=a.d.webkitVisibilityState);\"visible\"==b&&c()});return!1}return!0};a.fa=!1;a.J=!1;a.ub=function(){a.J=!0;a.j()};a.da=!1;a.V=!1;a.pb=function(c){a.marketingCloudVisitorID=c;a.V=!0;a.j()};a.ga=!1;a.W=!1;a.vb=function(c){a.visitorOptedOut=c;a.W=!0;a.j()};a.aa=!1;a.S=!1;a.$a=function(c){a.analyticsVisitorID=c;a.S=!0;a.j()};a.ca=!1;a.U=!1;a.bb=function(c){a.audienceManagerLocationHint=c;a.U=!0;a.j()};a.ba=!1;a.T=!1;a.ab=function(c){a.audienceManagerBlob=c;a.T=\r\n!0;a.j()};a.cb=function(c){a.maxDelay||(a.maxDelay=250);return a.p(\"_d\")?(c&&setTimeout(function(){c()},a.maxDelay),!1):!0};a.ea=!1;a.I=!1;a.za=function(){a.I=!0;a.j()};a.isReadyToTrack=function(){var c=!0,b=a.visitor,d,f,e;a.fa||a.J||(a.eb(a.ub)?a.J=!0:a.fa=!0);if(a.fa&&!a.J)return!1;b&&b.isAllowed()&&(a.da||a.marketingCloudVisitorID||!b.getMarketingCloudVisitorID||(a.da=!0,a.marketingCloudVisitorID=b.getMarketingCloudVisitorID([a,a.pb]),a.marketingCloudVisitorID&&(a.V=!0)),a.ga||a.visitorOptedOut||\r\n!b.isOptedOut||(a.ga=!0,a.visitorOptedOut=b.isOptedOut([a,a.vb]),a.visitorOptedOut!=p&&(a.W=!0)),a.aa||a.analyticsVisitorID||!b.getAnalyticsVisitorID||(a.aa=!0,a.analyticsVisitorID=b.getAnalyticsVisitorID([a,a.$a]),a.analyticsVisitorID&&(a.S=!0)),a.ca||a.audienceManagerLocationHint||!b.getAudienceManagerLocationHint||(a.ca=!0,a.audienceManagerLocationHint=b.getAudienceManagerLocationHint([a,a.bb]),a.audienceManagerLocationHint&&(a.U=!0)),a.ba||a.audienceManagerBlob||!b.getAudienceManagerBlob||(a.ba=\r\n!0,a.audienceManagerBlob=b.getAudienceManagerBlob([a,a.ab]),a.audienceManagerBlob&&(a.T=!0)),c=a.da&&!a.V&&!a.marketingCloudVisitorID,b=a.aa&&!a.S&&!a.analyticsVisitorID,d=a.ca&&!a.U&&!a.audienceManagerLocationHint,f=a.ba&&!a.T&&!a.audienceManagerBlob,e=a.ga&&!a.W,c=c||b||d||f||e?!1:!0);a.ea||a.I||(a.cb(a.za)?a.I=!0:a.ea=!0);a.ea&&!a.I&&(c=!1);return c};a.o=p;a.u=0;a.callbackWhenReadyToTrack=function(c,b,d){var f;f={};f.zb=c;f.yb=b;f.wb=d;a.o==p&&(a.o=[]);a.o.push(f);0==a.u&&(a.u=setInterval(a.j,\r\n100))};a.j=function(){var c;if(a.isReadyToTrack()&&(a.tb(),a.o!=p))for(;0<a.o.length;)c=a.o.shift(),c.yb.apply(c.zb,c.wb)};a.tb=function(){a.u&&(clearInterval(a.u),a.u=0)};a.mb=function(c){var b,d,f=p,e=p;if(!a.isReadyToTrack()){b=[];if(c!=p)for(d in f={},c)f[d]=c[d];e={};a.Ya(e,!0);b.push(f);b.push(e);a.callbackWhenReadyToTrack(a,a.track,b);return!0}return!1};a.Gb=function(){var c=a.cookieRead(\"s_fid\"),b=\"\",d=\"\",f;f=8;var e=4;if(!c||0>c.indexOf(\"-\")){for(c=0;16>c;c++)f=Math.floor(Math.random()*f),\r\nb+=\"0123456789ABCDEF\".substring(f,f+1),f=Math.floor(Math.random()*e),d+=\"0123456789ABCDEF\".substring(f,f+1),f=e=16;c=b+\"-\"+d}a.cookieWrite(\"s_fid\",c,1)||(c=0);return c};a.t=a.track=function(c,b){var d,f=new Date,e=\"s\"+Math.floor(f.getTime()/108E5)%10+Math.floor(1E13*Math.random()),g=f.getYear(),g=\"t=\"+a.escape(f.getDate()+\"/\"+f.getMonth()+\"/\"+(1900>g?g+1900:g)+\" \"+f.getHours()+\":\"+f.getMinutes()+\":\"+f.getSeconds()+\" \"+f.getDay()+\" \"+f.getTimezoneOffset());a.visitor&&a.visitor.getAuthState&&(a.authState=\r\na.visitor.getAuthState());a.p(\"_s\");a.mb(c)||(b&&a.R(b),c&&(d={},a.Ya(d,0),a.R(c)),a.Mb()&&!a.visitorOptedOut&&(a.analyticsVisitorID||a.marketingCloudVisitorID||(a.fid=a.Gb()),a.Pb(),a.usePlugins&&a.doPlugins&&a.doPlugins(a),a.account&&(a.abort||(a.trackOffline&&!a.timestamp&&(a.timestamp=Math.floor(f.getTime()/1E3)),f=k.location,a.pageURL||(a.pageURL=f.href?f.href:f),a.referrer||a.Za||(f=a.Util.getQueryParam(\"adobe_mc_ref\",null,null,!0),a.referrer=f||void 0===f?void 0===f?\"\":f:n.document.referrer),\r\na.Za=1,a.referrer=a.Eb(a.referrer),a.p(\"_g\")),a.Jb()&&!a.abort&&(a.visitor&&!a.supplementalDataID&&a.visitor.getSupplementalDataID&&(a.supplementalDataID=a.visitor.getSupplementalDataID(\"AppMeasurement:\"+a._in,a.expectSupplementalData?!1:!0)),a.Kb(),g+=a.Ib(),a.ob(e,g),a.p(\"_t\"),a.referrer=\"\"))),c&&a.R(d,1));a.abort=a.supplementalDataID=a.timestamp=a.pageURLRest=a.linkObject=a.clickObject=a.linkURL=a.linkName=a.linkType=k.s_objectID=a.pe=a.pev1=a.pev2=a.pev3=a.e=a.lightProfileID=0};a.Ba=[];a.registerPreTrackCallback=\r\nfunction(c){for(var b=[],d=1;d<arguments.length;d++)b.push(arguments[d]);\"function\"==typeof c?a.Ba.push([c,b]):a.debugTracking&&a.F(\"DEBUG: Non function type passed to registerPreTrackCallback\")};a.hb=function(c){a.xa(a.Ba,c)};a.Aa=[];a.registerPostTrackCallback=function(c){for(var b=[],d=1;d<arguments.length;d++)b.push(arguments[d]);\"function\"==typeof c?a.Aa.push([c,b]):a.debugTracking&&a.F(\"DEBUG: Non function type passed to registerPostTrackCallback\")};a.gb=function(c){a.xa(a.Aa,c)};a.xa=function(c,\r\nb){if(\"object\"==typeof c)for(var d=0;d<c.length;d++){var f=c[d][0],e=c[d][1];e.unshift(b);if(\"function\"==typeof f)try{f.apply(null,e)}catch(g){a.debugTracking&&a.F(g.message)}}};a.tl=a.trackLink=function(c,b,d,f,e){a.linkObject=c;a.linkType=b;a.linkName=d;e&&(a.l=c,a.A=e);return a.track(f)};a.trackLight=function(c,b,d,f){a.lightProfileID=c;a.lightStoreForSeconds=b;a.lightIncrementBy=d;return a.track(f)};a.clearVars=function(){var c,b;for(c=0;c<a.g.length;c++)if(b=a.g[c],\"prop\"==b.substring(0,4)||\r\n\"eVar\"==b.substring(0,4)||\"hier\"==b.substring(0,4)||\"list\"==b.substring(0,4)||\"channel\"==b||\"events\"==b||\"eventList\"==b||\"products\"==b||\"productList\"==b||\"purchaseID\"==b||\"transactionID\"==b||\"state\"==b||\"zip\"==b||\"campaign\"==b)a[b]=void 0};a.tagContainerMarker=\"\";a.ob=function(c,b){var d=a.ib()+\"/\"+c+\"?AQB=1&ndh=1&pf=1&\"+(a.ya()?\"callback=s_c_il[\"+a._in+\"].doPostbacks&et=1&\":\"\")+b+\"&AQE=1\";a.hb(d);a.fb(d);a.X()};a.ib=function(){var c=a.jb();return\"http\"+(a.ssl?\"s\":\"\")+\"://\"+c+\"/b/ss/\"+a.account+\"/\"+\r\n(a.mobile?\"5.\":\"\")+(a.ya()?\"10\":\"1\")+\"/JS-\"+a.version+(a.Sb?\"T\":\"\")+(a.tagContainerMarker?\"-\"+a.tagContainerMarker:\"\")};a.ya=function(){return a.AudienceManagement&&a.AudienceManagement.isReady()||0!=a.usePostbacks};a.jb=function(){var c=a.dc,b=a.trackingServer;b?a.trackingServerSecure&&a.ssl&&(b=a.trackingServerSecure):(c=c?(\"\"+c).toLowerCase():\"d1\",\"d1\"==c?c=\"112\":\"d2\"==c&&(c=\"122\"),b=a.lb()+\".\"+c+\".2o7.net\");return b};a.lb=function(){var c=a.visitorNamespace;c||(c=a.account.split(\",\")[0],c=c.replace(/[^0-9a-z]/gi,\r\n\"\"));return c};a.Xa=/{(%?)(.*?)(%?)}/;a.Wb=RegExp(a.Xa.source,\"g\");a.Db=function(c){if(\"object\"==typeof c.dests)for(var b=0;b<c.dests.length;++b){var d=c.dests[b];if(\"string\"==typeof d.c&&\"aa.\"==d.id.substr(0,3))for(var f=d.c.match(a.Wb),e=0;e<f.length;++e){var g=f[e],h=g.match(a.Xa),k=\"\";\"%\"==h[1]&&\"timezone_offset\"==h[2]?k=(new Date).getTimezoneOffset():\"%\"==h[1]&&\"timestampz\"==h[2]&&(k=a.Hb());d.c=d.c.replace(g,a.escape(k))}}};a.Hb=function(){var c=new Date,b=new Date(6E4*Math.abs(c.getTimezoneOffset()));\r\nreturn a.k(4,c.getFullYear())+\"-\"+a.k(2,c.getMonth()+1)+\"-\"+a.k(2,c.getDate())+\"T\"+a.k(2,c.getHours())+\":\"+a.k(2,c.getMinutes())+\":\"+a.k(2,c.getSeconds())+(0<c.getTimezoneOffset()?\"-\":\"+\")+a.k(2,b.getUTCHours())+\":\"+a.k(2,b.getUTCMinutes())};a.k=function(a,b){return(Array(a+1).join(0)+b).slice(-a)};a.ua={};a.doPostbacks=function(c){if(\"object\"==typeof c)if(a.Db(c),\"object\"==typeof a.AudienceManagement&&\"function\"==typeof a.AudienceManagement.isReady&&a.AudienceManagement.isReady()&&\"function\"==typeof a.AudienceManagement.passData)a.AudienceManagement.passData(c);\r\nelse if(\"object\"==typeof c&&\"object\"==typeof c.dests)for(var b=0;b<c.dests.length;++b){var d=c.dests[b];\"object\"==typeof d&&\"string\"==typeof d.c&&\"string\"==typeof d.id&&\"aa.\"==d.id.substr(0,3)&&(a.ua[d.id]=new Image,a.ua[d.id].alt=\"\",a.ua[d.id].src=d.c)}};a.fb=function(c){a.i||a.Lb();a.i.push(c);a.ma=a.C();a.Va()};a.Lb=function(){a.i=a.Nb();a.i||(a.i=[])};a.Nb=function(){var c,b;if(a.ta()){try{(b=k.localStorage.getItem(a.qa()))&&(c=k.JSON.parse(b))}catch(d){}return c}};a.ta=function(){var c=!0;a.trackOffline&&\r\na.offlineFilename&&k.localStorage&&k.JSON||(c=!1);return c};a.La=function(){var c=0;a.i&&(c=a.i.length);a.q&&c++;return c};a.X=function(){if(a.q&&(a.B&&a.B.complete&&a.B.G&&a.B.wa(),a.q))return;a.Ma=p;if(a.ra)a.ma>a.O&&a.Ta(a.i),a.va(500);else{var c=a.xb();if(0<c)a.va(c);else if(c=a.Ia())a.q=1,a.Ob(c),a.Rb(c)}};a.va=function(c){a.Ma||(c||(c=0),a.Ma=setTimeout(a.X,c))};a.xb=function(){var c;if(!a.trackOffline||0>=a.offlineThrottleDelay)return 0;c=a.C()-a.Ra;return a.offlineThrottleDelay<c?0:a.offlineThrottleDelay-\r\nc};a.Ia=function(){if(0<a.i.length)return a.i.shift()};a.Ob=function(c){if(a.debugTracking){var b=\"AppMeasurement Debug: \"+c;c=c.split(\"&\");var d;for(d=0;d<c.length;d++)b+=\"\\n\\t\"+a.unescape(c[d]);a.F(b)}};a.nb=function(){return a.marketingCloudVisitorID||a.analyticsVisitorID};a.Z=!1;var t;try{t=JSON.parse('{\"x\":\"y\"}')}catch(w){t=null}t&&\"y\"==t.x?(a.Z=!0,a.Y=function(a){return JSON.parse(a)}):k.$&&k.$.parseJSON?(a.Y=function(a){return k.$.parseJSON(a)},a.Z=!0):a.Y=function(){return null};a.Rb=function(c){var b,\r\nd,f;a.nb()&&2047<c.length&&(\"undefined\"!=typeof XMLHttpRequest&&(b=new XMLHttpRequest,\"withCredentials\"in b?d=1:b=0),b||\"undefined\"==typeof XDomainRequest||(b=new XDomainRequest,d=2),b&&(a.AudienceManagement&&a.AudienceManagement.isReady()||0!=a.usePostbacks)&&(a.Z?b.Da=!0:b=0));!b&&a.Wa&&(c=c.substring(0,2047));!b&&a.d.createElement&&(0!=a.usePostbacks||a.AudienceManagement&&a.AudienceManagement.isReady())&&(b=a.d.createElement(\"SCRIPT\"))&&\"async\"in b&&((f=(f=a.d.getElementsByTagName(\"HEAD\"))&&f[0]?\r\nf[0]:a.d.body)?(b.type=\"text/javascript\",b.setAttribute(\"async\",\"async\"),d=3):b=0);b||(b=new Image,b.alt=\"\",b.abort||\"undefined\"===typeof k.InstallTrigger||(b.abort=function(){b.src=p}));b.Sa=Date.now();b.Fa=function(){try{b.G&&(clearTimeout(b.G),b.G=0)}catch(a){}};b.onload=b.wa=function(){b.Sa&&(a.na=Date.now()-b.Sa);a.gb(c);b.Fa();a.Bb();a.ha();a.q=0;a.X();if(b.Da){b.Da=!1;try{a.doPostbacks(a.Y(b.responseText))}catch(d){}}};b.onabort=b.onerror=b.Ja=function(){b.Fa();(a.trackOffline||a.ra)&&a.q&&\r\na.i.unshift(a.Ab);a.q=0;a.ma>a.O&&a.Ta(a.i);a.ha();a.va(500)};b.onreadystatechange=function(){4==b.readyState&&(200==b.status?b.wa():b.Ja())};a.Ra=a.C();if(1==d||2==d){var e=c.indexOf(\"?\");f=c.substring(0,e);e=c.substring(e+1);e=e.replace(/&callback=[a-zA-Z0-9_.\\[\\]]+/,\"\");1==d?(b.open(\"POST\",f,!0),b.send(e)):2==d&&(b.open(\"POST\",f),b.send(e))}else if(b.src=c,3==d){if(a.Pa)try{f.removeChild(a.Pa)}catch(g){}f.firstChild?f.insertBefore(b,f.firstChild):f.appendChild(b);a.Pa=a.B}b.G=setTimeout(function(){b.G&&\r\n(b.complete?b.wa():(a.trackOffline&&b.abort&&b.abort(),b.Ja()))},5E3);a.Ab=c;a.B=k[\"s_i_\"+a.replace(a.account,\",\",\"_\")]=b;if(a.useForcedLinkTracking&&a.K||a.A)a.forcedLinkTrackingTimeout||(a.forcedLinkTrackingTimeout=250),a.ia=setTimeout(a.ha,a.forcedLinkTrackingTimeout)};a.Bb=function(){if(a.ta()&&!(a.Qa>a.O))try{k.localStorage.removeItem(a.qa()),a.Qa=a.C()}catch(c){}};a.Ta=function(c){if(a.ta()){a.Va();try{k.localStorage.setItem(a.qa(),k.JSON.stringify(c)),a.O=a.C()}catch(b){}}};a.Va=function(){if(a.trackOffline){if(!a.offlineLimit||\r\n0>=a.offlineLimit)a.offlineLimit=10;for(;a.i.length>a.offlineLimit;)a.Ia()}};a.forceOffline=function(){a.ra=!0};a.forceOnline=function(){a.ra=!1};a.qa=function(){return a.offlineFilename+\"-\"+a.visitorNamespace+a.account};a.C=function(){return(new Date).getTime()};a.Na=function(a){a=a.toLowerCase();return 0!=a.indexOf(\"#\")&&0!=a.indexOf(\"about:\")&&0!=a.indexOf(\"opera:\")&&0!=a.indexOf(\"javascript:\")?!0:!1};a.setTagContainer=function(c){var b,d,f;a.Sb=c;for(b=0;b<a._il.length;b++)if((d=a._il[b])&&\"s_l\"==\r\nd._c&&d.tagContainerName==c){a.R(d);if(d.lmq)for(b=0;b<d.lmq.length;b++)f=d.lmq[b],a.loadModule(f.n);if(d.ml)for(f in d.ml)if(a[f])for(b in c=a[f],f=d.ml[f],f)!Object.prototype[b]&&(\"function\"!=typeof f[b]||0>(\"\"+f[b]).indexOf(\"s_c_il\"))&&(c[b]=f[b]);if(d.mmq)for(b=0;b<d.mmq.length;b++)f=d.mmq[b],a[f.m]&&(c=a[f.m],c[f.f]&&\"function\"==typeof c[f.f]&&(f.a?c[f.f].apply(c,f.a):c[f.f].apply(c)));if(d.tq)for(b=0;b<d.tq.length;b++)a.track(d.tq[b]);d.s=a;break}};a.Util={urlEncode:a.escape,urlDecode:a.unescape,\r\ncookieRead:a.cookieRead,cookieWrite:a.cookieWrite,getQueryParam:function(c,b,d,f){var e,g=\"\";b||(b=a.pageURL?a.pageURL:k.location);d=d?d:\"&\";if(!c||!b)return g;b=\"\"+b;e=b.indexOf(\"?\");if(0>e)return g;b=d+b.substring(e+1)+d;if(!f||!(0<=b.indexOf(d+c+d)||0<=b.indexOf(d+c+\"=\"+d))){e=b.indexOf(\"#\");0<=e&&(b=b.substr(0,e)+d);e=b.indexOf(d+c+\"=\");if(0>e)return g;b=b.substring(e+d.length+c.length+1);e=b.indexOf(d);0<=e&&(b=b.substring(0,e));0<b.length&&(g=a.unescape(b));return g}},getIeVersion:function(){if(document.documentMode)return document.documentMode;\r\nfor(var a=7;4<a;a--){var b=document.createElement(\"div\");b.innerHTML=\"\\x3c!--[if IE \"+a+\"]><span></span><![endif]--\\x3e\";if(b.getElementsByTagName(\"span\").length)return a}return null}};a.H=\"supplementalDataID timestamp dynamicVariablePrefix visitorID marketingCloudVisitorID analyticsVisitorID audienceManagerLocationHint authState fid vmk visitorMigrationKey visitorMigrationServer visitorMigrationServerSecure charSet visitorNamespace cookieDomainPeriods fpCookieDomainPeriods cookieLifetime pageName pageURL customerPerspective referrer contextData currencyCode lightProfileID lightStoreForSeconds lightIncrementBy retrieveLightProfiles deleteLightProfiles retrieveLightData\".split(\" \");\r\na.g=a.H.concat(\"purchaseID variableProvider channel server pageType transactionID campaign state zip events events2 products audienceManagerBlob tnt\".split(\" \"));a.oa=\"timestamp charSet visitorNamespace cookieDomainPeriods cookieLifetime contextData lightProfileID lightStoreForSeconds lightIncrementBy\".split(\" \");a.P=a.oa.slice(0);a.Ca=\"account allAccounts debugTracking visitor visitorOptedOut trackOffline offlineLimit offlineThrottleDelay offlineFilename usePlugins doPlugins configURL visitorSampling visitorSamplingGroup linkObject clickObject linkURL linkName linkType trackDownloadLinks trackExternalLinks trackClickMap trackInlineStats linkLeaveQueryString linkTrackVars linkTrackEvents linkDownloadFileTypes linkExternalFilters linkInternalFilters useForcedLinkTracking forcedLinkTrackingTimeout trackingServer trackingServerSecure ssl abort mobile dc lightTrackVars maxDelay expectSupplementalData usePostbacks registerPreTrackCallback registerPostTrackCallback AudienceManagement\".split(\" \");\r\nfor(m=0;250>=m;m++)76>m&&(a.g.push(\"prop\"+m),a.P.push(\"prop\"+m)),a.g.push(\"eVar\"+m),a.P.push(\"eVar\"+m),6>m&&a.g.push(\"hier\"+m),4>m&&a.g.push(\"list\"+m);m=\"pe pev1 pev2 pev3 latitude longitude resolution colorDepth javascriptVersion javaEnabled cookiesEnabled browserWidth browserHeight connectionType homepage pageURLRest marketingCloudOrgID\".split(\" \");a.g=a.g.concat(m);a.H=a.H.concat(m);a.ssl=0<=k.location.protocol.toLowerCase().indexOf(\"https\");a.charSet=\"UTF-8\";a.contextData={};a.offlineThrottleDelay=\r\n0;a.offlineFilename=\"AppMeasurement.offline\";a.Ra=0;a.ma=0;a.O=0;a.Qa=0;a.linkDownloadFileTypes=\"exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx\";a.w=k;a.d=k.document;try{if(a.Wa=!1,navigator){var v=navigator.userAgent;if(\"Microsoft Internet Explorer\"==navigator.appName||0<=v.indexOf(\"MSIE \")||0<=v.indexOf(\"Trident/\")&&0<=v.indexOf(\"Windows NT 6\"))a.Wa=!0}}catch(x){}a.ha=function(){a.ia&&(k.clearTimeout(a.ia),a.ia=p);a.l&&a.K&&a.l.dispatchEvent(a.K);a.A&&(\"function\"==typeof a.A?a.A():\r\na.l&&a.l.href&&(a.d.location=a.l.href));a.l=a.K=a.A=0};a.Ua=function(){a.b=a.d.body;a.b?(a.v=function(c){var b,d,f,e,g;if(!(a.d&&a.d.getElementById(\"cppXYctnr\")||c&&c[\"s_fe_\"+a._in])){if(a.Ea)if(a.useForcedLinkTracking)a.b.removeEventListener(\"click\",a.v,!1);else{a.b.removeEventListener(\"click\",a.v,!0);a.Ea=a.useForcedLinkTracking=0;return}else a.useForcedLinkTracking=0;a.clickObject=c.srcElement?c.srcElement:c.target;try{if(!a.clickObject||a.N&&a.N==a.clickObject||!(a.clickObject.tagName||a.clickObject.parentElement||\r\na.clickObject.parentNode))a.clickObject=0;else{var h=a.N=a.clickObject;a.la&&(clearTimeout(a.la),a.la=0);a.la=setTimeout(function(){a.N==h&&(a.N=0)},1E4);f=a.La();a.track();if(f<a.La()&&a.useForcedLinkTracking&&c.target){for(e=c.target;e&&e!=a.b&&\"A\"!=e.tagName.toUpperCase()&&\"AREA\"!=e.tagName.toUpperCase();)e=e.parentNode;if(e&&(g=e.href,a.Na(g)||(g=0),d=e.target,c.target.dispatchEvent&&g&&(!d||\"_self\"==d||\"_top\"==d||\"_parent\"==d||k.name&&d==k.name))){try{b=a.d.createEvent(\"MouseEvents\")}catch(l){b=\r\nnew k.MouseEvent}if(b){try{b.initMouseEvent(\"click\",c.bubbles,c.cancelable,c.view,c.detail,c.screenX,c.screenY,c.clientX,c.clientY,c.ctrlKey,c.altKey,c.shiftKey,c.metaKey,c.button,c.relatedTarget)}catch(m){b=0}b&&(b[\"s_fe_\"+a._in]=b.s_fe=1,c.stopPropagation(),c.stopImmediatePropagation&&c.stopImmediatePropagation(),c.preventDefault(),a.l=c.target,a.K=b)}}}}}catch(n){a.clickObject=0}}},a.b&&a.b.attachEvent?a.b.attachEvent(\"onclick\",a.v):a.b&&a.b.addEventListener&&(navigator&&(0<=navigator.userAgent.indexOf(\"WebKit\")&&\r\na.d.createEvent||0<=navigator.userAgent.indexOf(\"Firefox/2\")&&k.MouseEvent)&&(a.Ea=1,a.useForcedLinkTracking=1,a.b.addEventListener(\"click\",a.v,!0)),a.b.addEventListener(\"click\",a.v,!1))):setTimeout(a.Ua,30)};a.Cb();a.ac||(r?a.setAccount(r):a.F(\"Error, missing Report Suite ID in AppMeasurement initialization\"),a.Ua(),a.loadModule(\"ActivityMap\"))}" ]
[ "0.47174537", "0.4658246", "0.45285463", "0.45032862", "0.44835344", "0.44350168", "0.4382653", "0.43627265", "0.43324777", "0.4301593", "0.42541128", "0.42418656", "0.4221815", "0.42179117", "0.41816333", "0.41801563", "0.41795337", "0.417805", "0.4176735", "0.41745046", "0.4172715", "0.416532", "0.4140857", "0.4140857", "0.4125978", "0.41207212", "0.41181394", "0.41115952", "0.41091898", "0.41079316", "0.41062677", "0.41049024", "0.41027054", "0.41022694", "0.410083", "0.4095065", "0.40917927", "0.40812904", "0.40807405", "0.40791658", "0.40771678", "0.40754294", "0.40733093", "0.407272", "0.40688023", "0.40591353", "0.40538645", "0.40534827", "0.4049118", "0.40481293", "0.40477178", "0.40440556", "0.40431336", "0.4041285", "0.40409878", "0.4040742", "0.4034237", "0.40251347", "0.4021832", "0.401967", "0.40185636", "0.40154555", "0.40134138", "0.40127307", "0.40119314", "0.40104625", "0.40068188", "0.40068188", "0.40059087", "0.4004625", "0.3991457", "0.3990997", "0.39907634", "0.39872354", "0.3983524", "0.39815342", "0.39802438", "0.39802438", "0.39802438", "0.39799574", "0.39766735", "0.39765778", "0.39743623", "0.39739642", "0.39738163", "0.39735964", "0.396918", "0.3966224", "0.39611036", "0.39610842", "0.3960728", "0.3956596", "0.39565182", "0.39551875", "0.3950826", "0.39456856", "0.3944749", "0.39428768", "0.39405105", "0.39404854", "0.39403772" ]
0.0
-1
Event `rendered` is triggered when zr rendered. It is useful for realtime snapshot (reflect animation). Event `finished` is triggered when: (1) zrender rendering finished. (2) initial animation finished. (3) progressive rendering finished. (4) no pending action. (5) no delayed setOption needs to be processed.
function bindRenderedEvent(zr, ecIns) { zr.on('rendered', function () { ecIns.trigger('rendered'); // The `finished` event should not be triggered repeatly, // so it should only be triggered when rendering indeed happend // in zrender. (Consider the case that dipatchAction is keep // triggering when mouse move). if ( // Although zr is dirty if initial animation is not finished // and this checking is called on frame, we also check // animation finished for robustness. zr.animation.isFinished() && !ecIns[OPTION_UPDATED] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) { ecIns.trigger('finished'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function completeRender() {\n var afterRender = options.afterRender;\n\n if (afterRender) {\n afterRender.call(root, root);\n }\n\n // Always emit an afterRender event.\n root.trigger(\"afterRender\", root);\n }", "function completeRender() {\n var afterRender = options.afterRender;\n\n if (afterRender) {\n afterRender.call(root, root);\n }\n\n // Always emit an afterRender event.\n root.trigger(\"afterRender\", root);\n }", "IsFinishedRendering() {}", "function viewRenderComplete() {\n $container.trigger(topologyConstants.events.viewRenderComplete, {}); // Private Event\n }", "handleRendered_() {\n\t\tthis.isRendered_ = true;\n\t}", "function _renderComplete( videoElement ) {\n videoElement.addClass( 'rendered' );\n fxcm.limelight.setThumbnailSize( videoElement );\n\n // description handler\n checkForCaption(videoElement);\n\n }", "onRender(scene, time) {}", "render(...args) {\n if (this._render) {\n this.__notify(EV.BEFORE_RENDER);\n this._render(...args);\n this.__notify(EV.RENDERED);\n }\n\n this.rendered = true;\n }", "afterRender() { }", "afterRender() { }", "function completeRender() {\n var console = window.console;\n var afterRender = root.afterRender;\n\n if (afterRender) {\n afterRender.call(root, root);\n }\n\n // Always emit an afterRender event.\n root.trigger(\"afterRender\", root);\n\n // If there are multiple top level elements and `el: false` is used,\n // display a warning message and a stack trace.\n if (manager.noel && root.$el.length > 1) {\n // Do not display a warning while testing or if warning suppression\n // is enabled.\n if (_.isFunction(console.warn) && !root.suppressWarnings) {\n console.warn(\"`el: false` with multiple top level elements is \" +\n \"not supported.\");\n\n // Provide a stack trace if available to aid with debugging.\n if (_.isFunction(console.trace)) {\n console.trace();\n }\n }\n }\n }", "done() {\n this.calc();\n this.stop();\n\n this.el.fire('drawdone');\n }", "function completeRender() {\n\t\t\t\t\t\tvar console = window.console;\n\t\t\t\t\t\tvar afterRender = root.afterRender;\n\n\t\t\t\t\t\tif (afterRender) {\n\t\t\t\t\t\t\tafterRender.call(root, root);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Always emit an afterRender event.\n\t\t\t\t\t\t */\n\t\t\t\t\t\troot.trigger(\"afterRender\", root);\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * If there are multiple top level elements and `el: false` is used,\n\t\t\t\t\t\t * display a warning message and a stack trace.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (manager.noel && root.$el.length > 1) {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Do not display a warning while testing or if warning suppression\n\t\t\t\t\t\t\t * is enabled.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (_.isFunction(console.warn) && !root.suppressWarnings) {\n\t\t\t\t\t\t\t\tconsole.warn(\"`el: false` with multiple top level elements is \" +\n\t\t\t\t\t\t\t\t\t\t\"not supported.\");\n\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Provide a stack trace if available to aid with debugging.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tif (_.isFunction(console.trace)) {\n\t\t\t\t\t\t\t\t\tconsole.trace();\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}", "_onFinishedEvent() {\n this._finished += 1;\n\n if (this._finished === this._babylonNumAnimations) {\n this._looped = 0;\n this._finished = 0;\n\n // Pause the animations\n this._babylonAnimatables.forEach(animatable => {\n animatable.speedRatio = 0;\n });\n\n this._promises.play.resolve();\n\n // Stop evaluating interpolators if they have already completed\n if (!this.weightPending && !this.timeScalePending) {\n this._paused = true;\n }\n }\n }", "function render() {\n\n isRendered = true;\n\n renderSource();\n\n }", "didRender() {\n console.log('didRender ejecutado!');\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "_onEnd() {\n this._duringDisplayAnim = false;\n // - need to re render at the end of the display animation\n this._setAnimParams();\n }", "static finishedRenderingComponent() {\n\t\trenderingComponents_.pop();\n\t}", "onAfterRendering() {}", "function handleRender() {\n\t view._isRendered = true;\n\t triggerDOMRefresh();\n\t }", "function postInitialization() {\n console.info(finished);\n}", "render() {\n\n // Calculate delta\n if (!this.lastFrameTime) this.lastFrameTime = Date.now()\n this.delta = Math.min(1, (Date.now() - this.lastFrameTime) / 1000)\n this.lastFrameTime = Date.now()\n\n // Check if should be rendering\n if (!this.isRendering)\n return\n\n // Request another frame\n requestAnimationFrame(this.render)\n\n }", "function render() {\n\n\t\t\tisRendered = true;\n\n\t\t\trenderSource();\n\n\t\t}", "complete() {\n if (this.element.renderTransform) {\n this.refreshTransforms();\n this.element.renderTransform.reset();\n }\n }", "postrender() {\n this.gl.flush();\n }", "function render() {\n\tvar delta = clock.getDelta();\n\tcameraControls.update(delta);\n\tTWEEN.update();\n\trenderer.render(scene, camera);\n\tif(hasFinishedInit == true)\n\t{\n\t\tmirror.visible = false;\n\t\tmirrorCamera.updateCubeMap( renderer, scene );\n\t\tif(topDownPOV == false)\n\t\t{\n\t\t\tmirror.visible = true;\n\t\t}\n\t}\n}", "onBeforeRendering() {}", "_finished( ) { \n\n\t\tif( this.verbose ) { this.log( \"All stages finished.\" ); }\n\n\t\tif( this.rollback ) {\n\t\t\tif( this.verbose ) { this.log( \"Processing failed.\" ); }\n\t\t\tthis.callback.failure( \"failed because of stage \\\"\" + this.failed + \"\\\"\" );\n\t\t} else {\n\t\t\tif( this.verbose ) { this.log( \"Processing succeeded.\" ); }\n\t\t\tthis.callback.success( this.results ); \n\t\t}\n\t\t\n\t}", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "onRender()/*: void*/ {\n this.render();\n }", "function onRenderEnd(callback) {\n\t return _baseStreams2.default.onValue(this.devStreams.renderEndStream, _lib2.default.baconTryD(callback));\n\t}", "render (timestamp = window.performance.now()) {\n const progress = this._prevTimestamp ? timestamp - this._prevTimestamp : 0\n this.camera.update()\n const volcanoesTransition = this.volcanoes.update(progress)\n const earthquakesTransition = this.earthquakes.update(progress)\n const eruptionsTransition = this.eruptions.update(progress)\n const transitionInProgress = volcanoesTransition || earthquakesTransition || eruptionsTransition\n renderer.render(this.scene, this.camera.camera)\n // Reset timestamp if transition has just ended, so when it starts next time, `progress` value starts from 0 again.\n this._prevTimestamp = transitionInProgress ? timestamp : null\n return transitionInProgress\n }", "function RenderEvent() {}", "function render(layerName, type, duration, finishedCB) {\n\tconst layer = new Vivus('map-container', {\n\t\tfile: 'maps/' + layerName + '.svg',\n\t\ttype: type, //\"scenario-sync\",\n\t\tstart: \"autostart\",\n\t\tduration: duration,\n\t\tdashGap: 10,\n\t\treverseStack: true,\n\t\tforceRender: false\n\t}, finishedCB);\n}", "function renderFinalResult() {\n //console.log('Final result is being rendered');\n $('.result').html(generateFinalResult());\n}", "willRender() {\n console.log('willRender ejecutado!');\n }", "function onFinish() {\n console.log('finished!');\n}", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "function ifComplete() {\r\n\t\t\t\t\tif (isFinished == false) {\r\n\t\t\t\t\t\tisFinished = true;\r\n\r\n\t\t\t\t\t\t// show the flag animation when a car reaches the finish line\r\n\t\t\t\t\t\tfinishedImage.attr('src', 'Assets/img/finish.gif');\r\n\r\n\t\t\t\t\t\t// add a background shadow effect while the flag animation is on\r\n\t\t\t\t\t\t$('#raceTrack').addClass('shadow');\r\n\r\n\t\t\t\t\t\t// timeout function for removal of flag animation and enable the buttons\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\r\n\t\t\t\t\t\t\t// remove flag animation and background shadow\r\n\t\t\t\t\t\t\tfinishedImage.attr('src', '');\r\n\t\t\t\t\t\t\t$('#raceTrack').removeClass('shadow');\r\n\r\n\t\t\t\t\t\t\t// set buttons to enable when the animation and race finish\r\n\t\t\t\t\t\t\traceBtn.prop(\"disabled\", false);\r\n\t\t\t\t\t\t\trestartBtn.prop(\"disabled\", false);\r\n\t\t\t\t\t\t}, 3500);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfinishedIn = 'second';\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "_didRender(props) {\n\t\tthis.hexAnimation = new NeonHexAnimation(this.shadowRoot.querySelector('canvas').getContext('2d'), props);\n\t\tthis.hexAnimation.init();\n\t}", "function render() {\n\trequestAnimationFrame(render);\n\n\tstats.update();\n\t//scene.getCameraControls().update();\n\tscene.animate(GUIcontrols);\n\n\trenderer.render(scene, scene.getCamera(scene.r2d2.fp));\n}", "render(deltaTime=0.01) {\n this.controls.update()\n for (let renderer of this.renderers) renderer.render(deltaTime)\n this.composer.render(deltaTime)\n requestAnimationFrame(() => this.render(this.clock.getDelta())) }", "function render() {\n\t if(stopped || scene.contextLost) {\n\t return\n\t }\n\t requestAnimationFrame(render)\n\t redraw()\n\t }", "function render() {\n\t if(stopped || scene.contextLost) {\n\t return\n\t }\n\t requestAnimationFrame(render)\n\t redraw()\n\t }", "rendererReady() {\n const message = new Message(Message.rendererReadyTitle, 'void').toString();\n this.ipc.send('update-message', message);\n }", "function render()\n\t{\n\t\t// only render\n\t\tif(renderer) {\n\t\t\trenderer.render(scene, camera);\n\t\t}\n\t\t\n\t\t// set up the next frame\n\t\tif(running) {\n\t\t\tupdate();\n\t\t}\n\t}", "onRender() {\n if ( !this.mRunning )\n return;\n\n if ( SPE_USES_PREVIEW_IMAGE ) {\n document.querySelector( '.spline-preview-image-container' ).style.display = 'none';\n\n SPE_USES_PREVIEW_IMAGE = false;\n }\n\n if ( this.mPlayHandler && !this.mPlayHandler.isEnable ) {\n this.mPlayHandler.activate();\n }\n\n if ( this.mOrbitControls ) {\n this.mOrbitControls.update();\n }\n if ( this.mScene && this.mMainCamera ) {\n this.mRenderer.autoClear = true;\n this.mRenderer.render( this.mScene, this.mMainCamera );\n }\n }", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_587( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function render () {\n requestAnimationFrame( render );\n renderer.render(scene, scene.getActiveCamera());\n if(!scene.endedGame)\n scene.animate(GUIcontrols);\n}", "function done(context, template) {\n // Store the rendered template someplace so it can be re-assignable.\n var rendered;\n\n // Trigger this once the render method has completed.\n manager.callback = function(rendered) {\n // Clean up asynchronous manager properties.\n delete manager.isAsync;\n delete manager.callback;\n\n root._applyTemplate(rendered, manager, def);\n };\n\n // Ensure the cache is up-to-date.\n LayoutManager.cache(url, template);\n\n // Render the View into the el property.\n if (template) {\n rendered = root.renderTemplate.call(root, template, context);\n }\n\n // If the function was synchronous, continue execution.\n if (!manager.isAsync) {\n root._applyTemplate(rendered, manager, def);\n }\n }", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_412( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function _triggerAfterRender() {\n _trigger(docma.Event.Render, [docma.currentRoute]);\n if (_initialLoad) {\n _trigger(docma.Event.Ready);\n _initialLoad = false;\n }\n }", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_577( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_475( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_452( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "onRender () {\n\n }", "function render() {\n\t\tcontrols.update(clock.getDelta());\n\t\trenderer.render( scene, camera );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_330( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_520( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_457( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function render()\n {\n renderer.render(scene, camera);\n }", "transitionCompleted() {\n // implement if needed\n }", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_488( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "render() {\n\t\trenderer.render(scene, camera);\n\t}", "render() {\n\t\trenderer.render(scene, camera);\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_332( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_395( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_429( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onViewRendered(domEl) {\n setDOMElement(domEl);\n // from the ViewMixinEventDelegator\n if (this.delegateEvents) {\n this.delegateEvents();\n }\n\n if (this.viewDidMount) {\n this.viewDidMount();\n }\n }", "function render() {\n stats.update();\n requestAnimationFrame(render);\n renderer.render(scene, camera);\n}", "render() {\n\t\tif (!this.component_.element) {\n\t\t\tthis.component_.element = document.createElement('div');\n\t\t}\n\t\tthis.emit('rendered', !this.isRendered_);\n\t}", "function render() {\n renderer.render(scene, camera);\n requestAnimationFrame(render);\n cameraControls.update();\n stats.update();\n }", "function render() {\n if(stopped || scene.contextLost) {\n return\n }\n requestAnimationFrame(render)\n redraw()\n }", "function render() {\n placeSelector();\n renderer.render(scene, camera);\n}", "OnAnimationEnd() {\n // If the animation is complete (and not stopped), then rerender to restore any flourishes hidden during animation.\n if (!this.AnimationStopped) {\n this._container.removeChildren();\n\n // Finally, re-layout and render the component\n var availSpace = new Rectangle(0, 0, this.Width, this.Height);\n this.Layout(availSpace);\n this.Render(this._container, availSpace);\n\n // Reselect the nodes using the selection handler's state\n var selectedNodes = this._selectionHandler ? this._selectionHandler.getSelection() : [];\n for (var i = 0; i < selectedNodes.length; i++) selectedNodes[i].setSelected(true);\n }\n\n // : Force full angle extent in case the display animation didn't complete\n if (this._angleExtent < 2 * Math.PI) this._animateAngleExtent(2 * Math.PI);\n\n // Delegate to the superclass to clear common things\n super.OnAnimationEnd();\n }", "render() {\n // TODO should also return when no need to update.\n if (!this.coordinates.isInitialized()) {\n return;\n }\n\n // Return if the car mesh is not loaded yet, or the ground is not\n // loaded yet.\n if (!this.adc.mesh || !this.ground.mesh) {\n return;\n }\n\n // Upon the first time in render() it sees car mesh loaded,\n // added it to the scene.\n if (!this.adcMeshAddedToScene) {\n this.adcMeshAddedToScene = true;\n this.scene.add(this.adc.mesh);\n }\n\n // Upon the first time in render() it sees ground mesh loaded,\n // added it to the scene.\n if (!this.ground.initialized) {\n this.ground.initialize(this.coordinates);\n this.scene.add(this.ground.mesh);\n }\n\n this.adjustCameraWithTarget(this.adc.mesh);\n this.renderer.render(this.scene, this.camera);\n }", "function render() {\n \trequestAnimationFrame( render );\n control.update(0.5);\n \trenderer.render( scene, camera );\n }", "function render() {\n \trequestAnimationFrame( render );\n control.update(0.5);\n \trenderer.render( scene, camera );\n }", "function finishedRenderingComponent_() {\n\trenderingComponents_.pop();\n\tif (renderingComponents_.length === 0) {\n\t\t(0, _unused.disposeUnused)();\n\t}\n}", "function doSomethingAfterRendering(){\n displayLoading() // 로딩화면 보여주기\n fetchServer(); // 서버에서 데이터 가져오기\n }", "function _render(scene) {\n renderer.update(scene);\n }", "function render() {\n\t\t\trequestAnimationFrame( render );\n\n\t\t\t\t// Render scene\n\t\t\t\trenderer.render( scene, camera);\n\t\t\t\tcontrols.update();\n\t\t}", "function afterRenderActions(){\r\n var section = $(SECTION_ACTIVE_SEL)[0];\r\n\r\n addClass(section, COMPLETELY);\r\n\r\n lazyLoad(section);\r\n playMedia(section);\r\n\r\n if(options.scrollOverflow){\r\n options.scrollOverflowHandler.afterLoad();\r\n }\r\n\r\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\r\n fireCallback('afterLoad', {\r\n activeSection: null,\r\n element: section,\r\n direction: null,\r\n\r\n //for backwards compatibility callback (to be removed in a future!)\r\n anchorLink: section.getAttribute('data-anchor'),\r\n sectionIndex: index(section, SECTION_SEL)\r\n });\r\n }\r\n\r\n if(isFunction(options.afterRender)){\r\n fireCallback('afterRender');\r\n }\r\n }", "function renderCall() {\n // Repaint?\n if (needs_repaint === true) {\n needs_repaint = false;\n\n ctx.clearRect(0, 0, canvas_el.width, canvas_el.height);\n\n renderTimeXAxis();\n renderElementsMargin();\n\n renderRows();\n\n renderCurrentTimePoint();\n\n }\n }", "onBeforeRender () {\n\n }", "function afterRenderActions() {\n var section = $(SECTION_ACTIVE_SEL)[0];\n addClass(section, COMPLETELY);\n lazyLoad(section);\n lazyLoadOthers();\n playMedia(section);\n\n if (options.scrollOverflow) {\n options.scrollOverflowHandler.afterLoad();\n }\n\n if (isDestinyTheStartingSection() && isFunction(options.afterLoad)) {\n fireCallback('afterLoad', {\n activeSection: section,\n element: section,\n direction: null,\n //for backwards compatibility callback (to be removed in a future!)\n anchorLink: section.getAttribute('data-anchor'),\n sectionIndex: index(section, SECTION_SEL)\n });\n }\n\n if (isFunction(options.afterRender)) {\n fireCallback('afterRender');\n }\n }", "function afterRenderActions(){\r\n var section = $(SECTION_ACTIVE_SEL)[0];\r\n\r\n addClass(section, COMPLETELY);\r\n\r\n lazyLoad(section);\r\n lazyLoadOthers();\r\n playMedia(section);\r\n\r\n if(options.scrollOverflow){\r\n options.scrollOverflowHandler.afterLoad();\r\n }\r\n\r\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\r\n fireCallback('afterLoad', {\r\n activeSection: section,\r\n element: section,\r\n direction: null,\r\n\r\n //for backwards compatibility callback (to be removed in a future!)\r\n anchorLink: section.getAttribute('data-anchor'),\r\n sectionIndex: index(section, SECTION_SEL)\r\n });\r\n }\r\n\r\n if(isFunction(options.afterRender)){\r\n fireCallback('afterRender');\r\n }\r\n }", "function afterRenderActions(){\n var section = $(SECTION_ACTIVE_SEL)[0];\n\n addClass(section, COMPLETELY);\n\n lazyLoad(section);\n lazyLoadOthers();\n playMedia(section);\n\n if(options.scrollOverflow){\n options.scrollOverflowHandler.afterLoad();\n }\n\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\n fireCallback('afterLoad', {\n activeSection: section,\n element: section,\n direction: null,\n\n //for backwards compatibility callback (to be removed in a future!)\n anchorLink: section.getAttribute('data-anchor'),\n sectionIndex: index(section, SECTION_SEL)\n });\n }\n\n if(isFunction(options.afterRender)){\n fireCallback('afterRender');\n }\n }", "function afterRenderActions(){\n var section = $(SECTION_ACTIVE_SEL)[0];\n\n addClass(section, COMPLETELY);\n\n lazyLoad(section);\n lazyLoadOthers();\n playMedia(section);\n\n if(options.scrollOverflow){\n options.scrollOverflowHandler.afterLoad();\n }\n\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\n fireCallback('afterLoad', {\n activeSection: section,\n element: section,\n direction: null,\n\n //for backwards compatibility callback (to be removed in a future!)\n anchorLink: section.getAttribute('data-anchor'),\n sectionIndex: index(section, SECTION_SEL)\n });\n }\n\n if(isFunction(options.afterRender)){\n fireCallback('afterRender');\n }\n }", "function afterRenderActions(){\n var section = $(SECTION_ACTIVE_SEL)[0];\n\n addClass(section, COMPLETELY);\n\n lazyLoad(section);\n lazyLoadOthers();\n playMedia(section);\n\n if(options.scrollOverflow){\n options.scrollOverflowHandler.afterLoad();\n }\n\n if(isDestinyTheStartingSection() && isFunction(options.afterLoad) ){\n fireCallback('afterLoad', {\n activeSection: section,\n element: section,\n direction: null,\n\n //for backwards compatibility callback (to be removed in a future!)\n anchorLink: section.getAttribute('data-anchor'),\n sectionIndex: index(section, SECTION_SEL)\n });\n }\n\n if(isFunction(options.afterRender)){\n fireCallback('afterRender');\n }\n }", "function render() {\n // Check for canvas resize\n if (checkCanvasAndViewportResize(gl) || needToRender) {\n needToRender = false;\n draw(gl, resolutionUniformLocation, colorLocation);\n }\n requestAnimationFrame(render);\n }", "_firstRendered() { }" ]
[ "0.62800556", "0.62800556", "0.61154693", "0.5770559", "0.57210225", "0.56043696", "0.55688053", "0.55178016", "0.54195154", "0.54195154", "0.53873533", "0.5357347", "0.5353915", "0.5351276", "0.5306065", "0.52924037", "0.525221", "0.525221", "0.52222323", "0.52076024", "0.51999587", "0.518154", "0.5173468", "0.5170657", "0.5142005", "0.51142013", "0.5110046", "0.50983906", "0.5089822", "0.5064456", "0.5057009", "0.50244147", "0.50049585", "0.49980867", "0.49936584", "0.49711135", "0.49697438", "0.4938491", "0.49379346", "0.49119392", "0.49119392", "0.49119392", "0.4910795", "0.49104506", "0.49082527", "0.48980132", "0.48894358", "0.48894358", "0.4889013", "0.48803204", "0.48733136", "0.48716125", "0.4860823", "0.4858591", "0.4858166", "0.4855899", "0.4847831", "0.4846353", "0.4842308", "0.48356643", "0.48311636", "0.48269212", "0.48240393", "0.4819288", "0.4819258", "0.48176673", "0.48172456", "0.4814416", "0.4814416", "0.4813211", "0.48095077", "0.480414", "0.48033872", "0.4799647", "0.4797622", "0.47929358", "0.4789687", "0.47866783", "0.47863424", "0.4783288", "0.47756937", "0.47756937", "0.47683296", "0.47657683", "0.47563836", "0.47546574", "0.4751508", "0.47453213", "0.4741855", "0.47363868", "0.47275627", "0.4725987", "0.4725987", "0.4725987", "0.47199753", "0.47045705" ]
0.71350354
3
Render each chart and component
function renderSeries(ecIns, ecModel, api, payload, dirtyMap) { // Render all charts var scheduler = ecIns._scheduler; var unfinished; ecModel.eachSeries(function (seriesModel) { var chartView = ecIns._chartsMap[seriesModel.__viewId]; chartView.__alive = true; var renderTask = chartView.renderTask; scheduler.updatePayload(renderTask, payload); if (dirtyMap && dirtyMap.get(seriesModel.uid)) { renderTask.dirty(); } unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask)); chartView.group.silent = !!seriesModel.get('silent'); updateZ(seriesModel, chartView); updateBlend(seriesModel, chartView); }); scheduler.unfinished |= unfinished; // If use hover layer updateHoverLayerStatus(ecIns, ecModel); // Add aria aria(ecIns._zr.dom, ecModel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderComponents() {\n this.algedonodeActivators.forEach(aa => {\n aa.render(this.renderer)\n })\n this.dials.forEach(d => {\n d.render(this.renderer)\n })\n this.strips.forEach(s => {\n s.render(this.renderer)\n })\n this.rows.forEach(r => {\n r.forEach(c => {\n c.render(this.renderer)\n })\n })\n this.lights.forEach(lightPair => {\n lightPair.forEach(light => light.render(this.renderer))\n })\n }", "function renderAll() {\n chart.each((method, index, arr) => {\n render(method, index, arr);\n });\n drawAllValueNumbers();\n }", "_renderChartsCanvas() {\n let json = this.get('getJsonCharts')();\n let canvas = this.get('_chartsCanvas');\n this.get('_chartsRenderer').renderOnChartsCanvas({\n canvas: canvas,\n json: json\n });\n }", "render() {\n const total = this.values.reduce((a, b) => a + b, 0);\n\n const rest = 100 - total;\n const dataset = rest > 0 ? [...this.values, rest] : this.values;\n\n this._renderSvg();\n this._renderGroups(dataset, rest);\n this._renderRects(dataset);\n this._renderMarkers();\n }", "function render() {\n // Render pie chart.\n if (angular.isDefined(vm.dataset)) {\n renderChart(vm.dataset.summary, $scope.meters.listAll);\n }\n }", "function render() {\n renderPlots1D();\n renderPlots2D();\n}", "init () {\n this.renderPieCharts(40,100,300,300);\n }", "function renderAll() {\n\t\tchart.each(render);\n\t\ttimeline1.updateData(bornDate.top(99999));\n\t}", "render() {\n\t\t\t\treturn Chart;\n\t\t\t}", "render() {\n\t\t\t\treturn Chart;\n\t\t\t}", "function ChartsContainer() {\n return (\n <div className=\"row\">\n <AreaChart />\n <PieChart />\n </div>\n );\n}", "render() {\n\t\t\t\trendered = true\n\n\t\t\t\tif (data.location != 'blank'){\n\n\t\t\t\t\t// add div for chart\n\t\t\t\t\tconst $container = $sel.append('div')\n\t\t\t\t\t\t.attr('class', 'container')\n\t\t\t\t\t\t.style('height', `${containerHeight}px`)\n\n\t\t\t\t\t// add containers for imports and exports\n\t\t\t\t\tconst $imports = $container.append('div')\n\t\t\t\t\t\t.attr('class', 'container-imports')\n\n\t\t\t\t\tconst $exports = $container.append('div')\n\t\t\t\t\t\t.attr('class', 'container-exports')\n\n\t\t\t\t\t// add state name\n\t\t\t\t\tconst $nameDiv = $sel.append('div').attr('class', 'name-div')\n\t\t\t\t\t$nameDiv.append('span').text(data.abbreviation).attr('class', 'name name-upper')\n\n\t\t\t\t\taddDogBlocks({$imports, $exports, factor})\n\n\t\t\t\t\t// if the data exists for that state, add dogs\n\t\t\t\t\t// if (data.count){\n \t\t\t// \t\t$imports.selectAll('.import dog')\n \t\t\t// \t\t\t.data(d3.range(data.count.imported / factor))\n \t\t\t// \t\t\t.join(enter => {\n \t\t\t// \t\t\t\tenter.append('div')\n \t\t\t// \t\t\t\t\t.attr('class', 'import')\n \t\t\t// \t\t\t})\n\t\t\t\t\t//\n\t\t\t\t\t// \t$exports.selectAll('.export dog')\n\t\t\t\t\t// \t\t.data(d3.range(data.count.exported / factor))\n\t\t\t\t\t// \t\t.join(enter => {\n\t\t\t\t\t// \t\t\tenter.append('div')\n\t\t\t\t\t// \t\t\t\t.attr('class', 'export')\n\t\t\t\t\t// \t\t})\n\t\t\t\t\t// }\n\n\n\t\t\t\t}\n\n\t\t\t\treturn Chart;\n\t\t\t}", "function renderAll() {\n chart.each(render);\n list.each(render);\n d3.select('#active').text(formatNumber(all.value()));\n }", "_initializeComponent() {\n //Heade\n this.elements.header = document.createElement(\"div\");\n this.elements.title = document.createElement(\"span\");\n this.elements.range = document.createElement(\"span\");\n\n this.elements.header.className = \"chart-header\";\n this.elements.title.className = \"chart-title\";\n this.elements.range.className = \"chart-range\";\n\n this.elements.header.appendChild(this.elements.title);\n this.elements.header.appendChild(this.elements.range);\n\n //Tooltip\n this.elements.tooltip = document.createElement(\"div\");\n this.elements.date = document.createElement(\"span\");\n this.elements.values = document.createElement(\"div\");\n\n this.elements.tooltip.className = \"chart-tooltip\";\n this.elements.date.className = \"chart-tooltip-date\";\n this.elements.values.className = \"chart-tooltip-values\";\n\n this.elements.tooltip.appendChild(this.elements.date);\n this.elements.tooltip.appendChild(this.elements.values);\n\n //Render\n this.elements.render = document.createElement(\"div\");\n this.elements.chart = document.createElement(\"canvas\");\n this.elements.layout = document.createElement(\"canvas\");\n\n this.elements.render.className = \"chart-render\";\n this.elements.chart.className = \"chart-render-chart\";\n this.elements.layout.className = \"chart-render-layout\";\n\n this.elements.render.appendChild(this.elements.chart);\n this.elements.render.appendChild(this.elements.layout);\n\n //Preview\n this.elements.control = document.createElement(\"div\");\n this.elements.preview = document.createElement(\"canvas\");\n this.elements.select = document.createElement(\"div\");\n this.elements.draggerLeft = document.createElement(\"div\");\n this.elements.draggerRight = document.createElement(\"div\");\n this.elements.coverLeft = document.createElement(\"div\");\n this.elements.coverRight = document.createElement(\"div\");\n\n this.elements.control.className = \"chart-control\";\n this.elements.preview.className = \"chart-preview\";\n this.elements.select.className = \"chart-select\";\n this.elements.draggerLeft.className = \"chart-dragger chart-dragger-left\";\n this.elements.draggerRight.className = \"chart-dragger chart-dragger-right\";\n this.elements.coverLeft.className = \"chart-cover chart-cover-left\";\n this.elements.coverRight.className = \"chart-cover chart-cover-right\";\n\n this.elements.control.appendChild(this.elements.preview);\n this.elements.control.appendChild(this.elements.coverLeft);\n this.elements.control.appendChild(this.elements.select);\n this.elements.select.appendChild(this.elements.draggerLeft);\n this.elements.select.appendChild(this.elements.draggerRight);\n this.elements.control.appendChild(this.elements.coverRight);\n\n //Graph buttons container\n this.elements.graphs = document.createElement(\"div\");\n\n this.elements.graphs.className = \"chart-graphs\";\n\n //Main container\n this.elements.container.className += \" chart-container\";\n\n this.elements.container.appendChild(this.elements.header);\n this.elements.container.appendChild(this.elements.tooltip);\n this.elements.container.appendChild(this.elements.render);\n this.elements.container.appendChild(this.elements.control);\n this.elements.container.appendChild(this.elements.graphs);\n }", "function renderAll() {\n chart.each(render);\n d3.select(\"#active\").text(formatNumber(all.value()));\n }", "function render() {\n if (window._env === 'development') console.debug('RENDER');\n initDynamicSentence();\n initMapChart();\n initHighcharts();\n initBubbleChart();\n initSankeyChart();\n initBubbleChart();\n initTableBody();\n }", "render() {\n DvtChartEventUtils.addPlotAreaDnDBackground(this.chart, this, this._frame, true);\n\n if (!this.contains(this._shapesContainer)) {\n if (!this._shapesContainer) {\n this._shapesContainer = new dvt.Container(this.getCtx());\n }\n this.addChild(this._shapesContainer);\n }\n\n // Set each slice's angle start and angle extent\n // The order in which these slices are rendered is determined in the later call to orderSlicesForRendering\n DvtChartPie._layoutSlices(this._slices, this._anchorOffset);\n\n // create the physical surface objects and labels\n var pieCircumference = 2 * Math.PI * this.getRadiusX();\n var prevEndCoord = 0;\n var thinSlices = {};\n var hasLargeSeriesCount = this.chart.getOptionsCache().getFromCache('hasLargeSeriesCount');\n for (var i = 0; i < this._slices.length; i++) {\n // Skip rendering some of the thin slices for charts with large series counts\n if (hasLargeSeriesCount) {\n var angleExtent = this._slices[i].getAngleExtent();\n var sliceArc = (angleExtent / 360) * pieCircumference;\n var endCoord = ((this._slices[i].getAngleStart() + angleExtent) / 360) * pieCircumference;\n if (\n sliceArc < this._MIN_ARC_LENGTH &&\n Math.abs(prevEndCoord - endCoord) < this._MIN_ARC_LENGTH\n ) {\n thinSlices[this._slices[i].getSeriesIndex()] = true;\n continue; // skip pre render\n } else prevEndCoord = endCoord;\n }\n this._slices[i].preRender();\n }\n\n // we order the slices for rendering, such that\n // the \"front-most\" slice, the one closest to the user\n // is redered last. each slice is then responsible\n // for properly ordering each of its surfaces before\n // the surfaces are rendered.\n var zOrderedSlices = DvtChartPie._orderSlicesForRendering(this._slices);\n\n if (!this._duringDisplayAnim) {\n DvtChartPieLabelUtils.createPieCenter(this);\n DvtChartPieLabelUtils.layoutLabelsAndFeelers(this);\n }\n\n // now that everything has been laid out, tell the slices to\n // render their surfaces\n for (var i = 0; i < zOrderedSlices.length; i++) {\n if (!thinSlices[zOrderedSlices[i].getSeriesIndex()])\n zOrderedSlices[i].render(this._duringDisplayAnim);\n }\n\n // perform initial selection\n this.setInitialSelection();\n\n // Initial Highlighting\n this.highlight(DvtChartDataUtils.getHighlightedCategories(this.chart));\n }", "function renderAll() {\n chart.each(render);\n updateMarkers();\n redrawMap();\n // list.each(render);\n d3.select(\"#active\").text(formatNumber(all.value()));\n }", "render() {\n this.renderCells();\n this.paintCells();\n this.setFigures();\n }", "render () {\n\t\t\t\t//Clear the entire canvas every render\n\t\tthis\n\t\t\t\t\t\t.context\n\t\t\t\t\t\t.clearRect( 0, 0, this.width, this.height );\n\n\t\t\t\t//Trigger the render function on every child element\n\t\tfor ( let i = 0; i < this.circleContainers.length; i++ ) {\n\t\t\tthis\n\t\t\t\t\t\t\t\t.circleContainers[i]\n\t\t\t\t\t\t\t\t.render();\n\t\t}\n\t}", "function render() {\n\n var\n //scaleOverflowLabel = i18n( 'FormEditorMojit.el_properties_panel.LBL_EE_SCALEOVERFLOW' ),\n //maxLengthLabel = i18n( 'FormEditorMojit.el_properties_panel.LBL_EE_MAXLEN' ),\n panelNode = Y.Node.create( '<div></div>' );\n\n async.series( [ loadPanelHtml, cacheJQuery, loadMedDataTypes, setupAxisTypes ], onAllDone );\n\n function loadPanelHtml( itcb ) {\n // clear any existing content\n jq.me.html( '' );\n isRendered = false;\n\n // load the panel template\n YUI.dcJadeRepository.loadNodeFromTemplate(\n 'editor_chartmd',\n 'FormEditorMojit',\n {},\n panelNode,\n onPanelHtmlLoaded\n );\n\n // add panel template to page\n function onPanelHtmlLoaded( err ) {\n if ( err ) { return itcb( err ); }\n Y.one( '#' + domId ).append( panelNode );\n itcb( null );\n }\n }\n\n function cacheJQuery( itcb ) {\n var\n k;\n\n for ( k in BIND_ELEMENTS ) {\n if ( BIND_ELEMENTS.hasOwnProperty( k ) ) {\n jq[ k ] = $( '#' + k );\n }\n }\n\n jq.btnSelectChartImage = $( '#btnSelectChartImage' );\n\n itcb( null );\n }\n\n function loadMedDataTypes( itcb ) {\n Y.doccirrus.jsonrpc.api.meddata\n .getAllMeddataTypes()\n .then( onTypesLoaded )\n .fail( itcb );\n\n function onTypesLoaded( allMeddataTypes ) {\n var html, k;\n\n allMeddataTypes = allMeddataTypes.data ? allMeddataTypes.data : allMeddataTypes;\n\n for ( k in allMeddataTypes ) {\n if ( allMeddataTypes.hasOwnProperty( k ) ) {\n html = '<option value=\"' + k + '\">' + allMeddataTypes[k] + '</option>';\n jq.selChartMdY.append( html );\n }\n }\n\n itcb( null );\n }\n }\n\n function setupAxisTypes( itcb ) {\n var html, i;\n\n for ( i = 0; i < AXIS_MEDDATA_TYPES.length; i++ ) {\n html = '' +\n '<option value=\"' + AXIS_MEDDATA_TYPES[i] + '\">' +\n i18n( 'v_meddata-schema.medDataTypes.' + AXIS_MEDDATA_TYPES[i] ) +\n '</option>';\n\n jq.selChartMdX.append( html );\n }\n\n itcb( null );\n }\n\n function onAllDone( err ) {\n if ( err ) {\n Y.log( 'Problem initializing chart editor: ' + JSON.stringify( err ), 'warn', NAME );\n return;\n }\n\n function EditChartMDVM() {\n var\n self = this;\n\n self.btnChooseImageI18n = i18n('FormEditorMojit.ctrl.BTN_CHOOSE_IMAGE');\n\n }\n\n ko.applyBindings( new EditChartMDVM(), document.querySelector( '#divElementEditPanelChartMD' ) );\n isRendered = true;\n updateFromElement();\n subscribeToControls();\n }\n\n }", "render () {\n\t\tfor ( let i = 0; i < this.numberOfCircles; i++ ) {\n\t\t\tthis\n\t\t\t\t\t\t\t\t.circles[i]\n\t\t\t\t\t\t\t\t.render( this.context );\n\t\t}\n\t}", "renderElements(data, xScale, renderGroups) {\n\n let { lineG, circleG,/* arrowG,*/ tagG } = renderGroups;\n\n lineG.selectAll('rect').remove();\n circleG.selectAll('circle').remove();\n tagG.selectAll('polyline').remove();\n tagG.selectAll('text').remove();\n\n\n this.renderLines(data, xScale, lineG);\n this.renderCircles(data, xScale, circleG);\n this.renderTags(data, xScale, tagG);\n //if(!data.realEndDate) this.renderArrows(data, xScale,arrowG);\n\n }", "function doRender(ecModel,payload){var api=this._api; // Render all components\n each(this._componentsViews,function(componentView){var componentModel=componentView.__model;componentView.render(componentModel,ecModel,api,payload);updateZ(componentModel,componentView);},this);each(this._chartsViews,function(chart){chart.__alive = false;},this); // Render all charts\n ecModel.eachSeries(function(seriesModel,idx){var chartView=this._chartsMap[seriesModel.__viewId];chartView.__alive = true;chartView.render(seriesModel,ecModel,api,payload);chartView.group.silent = !!seriesModel.get('silent');updateZ(seriesModel,chartView);},this); // Remove groups of unrendered charts\n each(this._chartsViews,function(chart){if(!chart.__alive){chart.remove(ecModel,api);}},this);}", "render() {\n\n return(<div>\n<br />\n<Container>\n <div>\n\n <h2>Top 10 Players</h2>\n\n <BarChart1 data={this.props.chartData1} />\n\n </div>\n\n <div>\n <h2>Top 5 Teams With Most Goals</h2>\n\n <BarChart2 data={this.props.chartData2} />\n </div>\n\n</Container>\n\n\n </div>)\n }", "render() {\n this.renderComponents() // dial + outputs, algedonode, brass pads, strips, lights\n this.renderLabels()\n }", "function doRender(ecModel, payload) {\n var api = this._api;\n // Render all components\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n\n updateZ(componentModel, componentView);\n }, this);\n\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this);\n\n // Render all charts\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n\n chartView.group.silent = !!seriesModel.get('silent');\n\n updateZ(seriesModel, chartView);\n\n updateProgressiveAndBlend(seriesModel, chartView);\n\n }, this);\n\n // If use hover layer\n updateHoverLayerStatus(this._zr, ecModel);\n\n // Remove groups of unrendered charts\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n }", "function doRender(ecModel, payload) {\n var api = this._api;\n // Render all components\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n\n updateZ(componentModel, componentView);\n }, this);\n\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this);\n\n // Render all charts\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n\n chartView.group.silent = !!seriesModel.get('silent');\n\n updateZ(seriesModel, chartView);\n\n updateProgressiveAndBlend(seriesModel, chartView);\n\n }, this);\n\n // If use hover layer\n updateHoverLayerStatus(this._zr, ecModel);\n\n // Remove groups of unrendered charts\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n }", "function chartRenderCharts() {\r\n if(!document.getElementById(\"apex_line2_chart\")) return ;\r\n\r\n // create charts for chart page\r\n if (!chartLaptime) {\r\n chartLaptime = new CustomApexChart(\"#apex_line2_chart\", \"line\");\r\n chartLaptime.setOptions({\r\n 'title' : 'laptime(seconds)/lap',\r\n 'height' : 396,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'Laptime',\r\n });\r\n chartLaptime.render();\r\n }\r\n if (!chartSector1) {\r\n chartSector1 = new CustomApexChart(\"#basic-column-sector1\", \"bar\");\r\n chartSector1.setOptions({\r\n 'height' : 385,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'sector1',\r\n });\r\n chartSector1.render();\r\n }\r\n if (!chartSector2) {\r\n chartSector2 = new CustomApexChart(\"#basic-column-sector2\", \"bar\");\r\n chartSector2.setOptions({\r\n 'height' : 385,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'sector2',\r\n });\r\n chartSector2.render();\r\n }\r\n if (!chartSector3) {\r\n chartSector3 = new CustomApexChart(\"#basic-column-sector3\", \"bar\");\r\n chartSector3.setOptions({\r\n 'height' : 385,\r\n 'xAxisTitle' : 'LAP',\r\n 'yAxisTitle' : 'sector3',\r\n });\r\n chartSector3.render();\r\n }\r\n\r\n chartPageCheckDrivers();\r\n\r\n getCheckedChartDrivers();\r\n\r\n var currentSeries = {};\r\n\r\n checkedChartDrivers.forEach(driverId => {\r\n // chart series name\r\n currentSeries[driverId] = \"\";\r\n if ($(\"#customCheck\"+driverId).length) currentSeries[driverId] = $(\"#customCheck\"+driverId).attr('data-title');\r\n\r\n // chart series data\r\n });\r\n\r\n getDatasCharts(function() {\r\n if (!gameChartsLapsValues || !gameChartsLapsValues.length) return;\r\n console.log(\"[chartRenderCharts] after getDatasCharts\", gameChartsLapsValues, currentSeries, gameChartsData, gameChartsSector1Data, gameChartsSector2Data, gameChartsSector3Data);\r\n\r\n if (chartLaptime) {\r\n chartLaptime.setSeries(currentSeries);\r\n chartLaptime.setXAxis(gameChartsLapsValues);\r\n chartLaptime.setData(gameChartsData);\r\n\r\n if(sliderLaptime){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartLaptime.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartLaptime.yValueMax);\r\n sliderLaptime.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n if (chartSector1) {\r\n chartSector1.setSeries(currentSeries);\r\n chartSector1.setXAxis(gameChartsLapsValues);\r\n chartSector1.setData(gameChartsSector1Data);\r\n\r\n if(sliderSector1){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartSector1.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartSector1.yValueMax);\r\n sliderSector1.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n if (chartSector2) {\r\n chartSector2.setSeries(currentSeries);\r\n chartSector2.setXAxis(gameChartsLapsValues);\r\n chartSector2.setData(gameChartsSector1Data);\r\n\r\n if(sliderSector2){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartSector2.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartSector2.yValueMax);\r\n sliderSector2.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n if (chartSector3) {\r\n chartSector3.setSeries(currentSeries);\r\n chartSector3.setXAxis(gameChartsLapsValues);\r\n chartSector3.setData(gameChartsSector1Data);\r\n\r\n if(sliderSector3){\r\n let tempMin = CustomApexChart.calcYAxisMin(chartSector3.yValueMin);\r\n let tempMax = CustomApexChart.calcYAxisMax(chartSector3.yValueMax);\r\n sliderSector3.update({\r\n from: tempMin,\r\n to: tempMax,\r\n min: tempMin,\r\n max: tempMax\r\n });\r\n }\r\n }\r\n });\r\n\r\n }", "render() {\n this.activeObjects.forEach(function(object) {\n object.render();\n });\n }", "render(){\n\n if (this.props.location === \"bar\"){\n return (\n <div className=\"chart\">\n <div className=\"item\">\n <Bar\n data={this.state.chartData}\n options={{\n title:{\n display:this.props.displayTitle,\n fontSize:25\n },\n legend:{\n display:this.props.displayLegend,\n position:this.props.legendPosition\n },\n scales: {\n yAxes: [{\n scaleLabel: {\n display: false,\n labelString: \"\"\n }\n }],\n xAxes: [{\n scaleLabel: {\n display: false,\n labelString: \"\"\n }\n }] \n }\n }}\n />\n </div>\n </div>\n )\n }\n\n if (this.props.location === \"line\"){\n return (\n <div className=\"chart\">\n <div className=\"item\">\n <Line\n data={this.state.chartData}\n options={{\n title:{\n display:this.props.displayTitle,\n fontSize:25\n },\n legend:{\n display:this.props.displayLegend,\n position:this.props.legendPosition\n },\n scales: {\n yAxes: [{\n scaleLabel: {\n display: false,\n labelString: \"\"\n }\n }],\n xAxes: [{\n scaleLabel: {\n display: false,\n labelString: \"\"\n }\n }] \n }\n }}\n />\n </div>\n </div>\n )\n }\n\n if (this.props.location === \"pie\"){\n return (\n <div className=\"chart\">\n <div className=\"item\">\n <Pie\n data={this.state.chartData}\n options={{\n title:{\n display:this.props.displayTitle,\n fontSize:25\n },\n legend:{\n display:this.props.displayLegend,\n position:this.props.legendPosition\n },\n backgroundColor:this.props.backgroundColor\n }}\n />\n </div>\n </div>\n )\n }\n }", "function renderEverything() {\n renderIngredients();\n renderButtons();\n renderPrice();\n}", "function render() {\n renderCards();\n renderValue();\n}", "render() {\n this.widgets.forEach((widget) => {\n widget.render();\n });\n }", "function render() { \t\n\t// renderMenu(); // dropdown menu to let user switch between years manually\n\trenderDatatext();\n\tif (state.world && state.countries.length > 0) renderMap();\n\trenderKey(); // map legend\n\trenderMapyear();\n\trenderLinechart(\".chart-1\", config.countryGroups.heighincome, \"normal\"); // where to place, what data to use\n\trenderLinechart(\".chart-2\", config.countryGroups.brics, \"normal\");\n\trenderLinechart(\".chart-3\", config.countryGroups.arab, \"large\");\n\trenderLinechart(\".chart-4\", config.countryGroups.mostrising, \"normal\");\n\trenderLinechart(\".chart-5\", config.countryGroups.northamerica, \"normal\");\n\trenderLinechart(\".chart-6\", config.countryGroups.warridden, \"normal\");\n\trenderLinechart(\".chart-7\", config.countryGroups.soviet, \"normal\");\n\trenderLinechart(\".chart-8\", config.countryGroups.mensworld,\"normal\");\n\trenderLinechart(\".chart-9\", state.userselected,\"normal\");\n\trenderUserinput();\n}", "function doRender(ecModel, payload) {\n var api = this._api;\n // Render all components\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n\n updateZ(componentModel, componentView);\n }, this);\n\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this);\n\n // Render all charts\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n\n chartView.group.silent = !!seriesModel.get('silent');\n\n updateZ(seriesModel, chartView);\n\n updateProgressiveAndBlend(seriesModel, chartView);\n }, this);\n\n // If use hover layer\n updateHoverLayerStatus(this._zr, ecModel);\n\n // Remove groups of unrendered charts\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n}", "render() {\n\t\tthis.a1.render(this.context);\n\t\tthis.b1.render(this.context);\n\t\tthis.c1.render(this.context);\n\t\tthis.c2.render(this.context);\n\t\tthis.d1.render(this.context);\n\t\tthis.e1.render(this.context);\n\t\tthis.f1.render(this.context);\n\t\tthis.g1.render(this.context);\n\t\tthis.a1s.render(this.context);\n\t\tthis.c1s.render(this.context);\n\t\tthis.d1s.render(this.context);\n\t\tthis.f1s.render(this.context);\n\t\tthis.g1s.render(this.context);\n\n\t}", "function doRender(ecModel, payload) {\n var api = this._api; // Render all components\n\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n }, this);\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this); // Render all charts\n\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateProgressiveAndBlend(seriesModel, chartView);\n }, this); // If use hover layer\n\n updateHoverLayerStatus(this._zr, ecModel); // Remove groups of unrendered charts\n\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n}", "function doRender(ecModel, payload) {\n var api = this._api; // Render all components\n\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n }, this);\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this); // Render all charts\n\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateProgressiveAndBlend(seriesModel, chartView);\n }, this); // If use hover layer\n\n updateHoverLayerStatus(this._zr, ecModel); // Remove groups of unrendered charts\n\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n}", "function doRender(ecModel, payload) {\n var api = this._api; // Render all components\n\n each(this._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n }, this);\n each(this._chartsViews, function (chart) {\n chart.__alive = false;\n }, this); // Render all charts\n\n ecModel.eachSeries(function (seriesModel, idx) {\n var chartView = this._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n chartView.render(seriesModel, ecModel, api, payload);\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateProgressiveAndBlend(seriesModel, chartView);\n }, this); // If use hover layer\n\n updateHoverLayerStatus(this._zr, ecModel); // Remove groups of unrendered charts\n\n each(this._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n }, this);\n}", "function render_panel() {\n if (shouldAbortRender()) {\n //return;\n }\n \n \n // this.seriesList = [];\n // this.data = [];\n\n var stack = panel.stack ? true : null;\n\n // Populate element\n var options = {\n hooks: {\n draw: [drawHook],\n processOffset: [processOffsetHook],\n },\n legend: { show: false },\n series: {\n stackpercent: panel.stack ? panel.percentage : false,\n stack: panel.percentage ? null : stack,\n bars: {\n show: true,\n fill: 0.9,\n barWidth: 1,\n zero: false,\n lineWidth: 0,\n align: 'center'\n },\n shadowSize: 0\n },\n yaxes: [],\n xaxis: {},\n grid: {\n minBorderMargin: 0,\n markings: [],\n backgroundColor: null,\n borderWidth: 0,\n hoverable: true,\n color: '#c8c8c8',\n margin: { left: 0, right: 0 },\n },\n selection: {\n mode: \"x\",\n color: '#666'\n },\n crosshair: {\n mode: panel.tooltip.shared || dashboard.sharedCrosshair ? \"x\" : null\n }\n };\n\n // var scopedVars = ctrl.panel.scopedVars;\n //// var bucketSize = !panel.bucketSize && panel.bucketSize !== 0 ? null : parseFloat(ctrl.templateSrv.replaceWithText(panel.bucketSize.toString(), scopedVars));\n // var minValue = !panel.minValue && panel.minValue !== 0 ? null : parseFloat(ctrl.templateSrv.replaceWithText(panel.minValue.toString(), scopedVars));\n // var maxValue = !panel.maxValue && panel.maxValue !== 0 ? null : parseFloat(ctrl.templateSrv.replaceWithText(panel.maxValue.toString(), scopedVars));\nif(!isPng){\n\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n series.data = getFFT(series);\n \n options.series.bars.barWidth = ((series.data[series.data.length-1][0] + series.data[0][0])/series.data.length);//(elem.width()/series.data.length);\n\n // if hidden remove points and disable stack\n if (ctrl.hiddenSeries[series.alias]) {\n series.data = [];\n series.stack = false;\n }\n }\n\n // if (data.length && data[0].stats.timeStep) {\n //data[0].stats.timeStep / 1.5;\n // }\n} else {\n \n addAnnotations(options); \n}\n \n // panel.yaxes[1].show = true;\n configureAxisOptions(data, options);\n // addHistogramAxis(options);\n // options.selection = {};\n\n sortedSeries = _.sortBy(data, function(series) { return series.zindex; });\n\n function callPlot(incrementRenderCounter) {\n try {\n $.plot(elem, sortedSeries, options);\n } catch (e) {\n console.log('flotcharts error', e);\n }\n\n if (incrementRenderCounter) {\n ctrl.renderingCompleted();\n }\n }\n \n scope.isPng = isPng;\n \n \n scope.zoomPlot = function(start, end) {\n \n options.xaxis.min = start;\n options.xaxis.max = end;\n\n callPlot(true);\n };\n \n scope.zoomOut = function() {\n if(isPng){\n // this.ctrl.events.emit('zoom-out');\n this.ctrl.publishAppEvent('zoom-out',2);\n } else {\n options.xaxis.min = null;\n options.xaxis.max = null;\n callPlot(true);\n }\n \n };\n \n\n if (shouldDelayDraw(panel)) {\n // temp fix for legends on the side, need to render twice to get dimensions right\n callPlot(false);\n setTimeout(function() { callPlot(true); }, 50);\n legendSideLastValue = panel.legend.rightSide;\n }\n else {\n callPlot(true);\n }\n }", "function doRender(ecModel, payload) {\n\t var api = this._api;\n\t // Render all components\n\t each(this._componentsViews, function (componentView) {\n\t var componentModel = componentView.__model;\n\t componentView.render(componentModel, ecModel, api, payload);\n\n\t updateZ(componentModel, componentView);\n\t }, this);\n\n\t each(this._chartsViews, function (chart) {\n\t chart.__alive = false;\n\t }, this);\n\n\t // Render all charts\n\t ecModel.eachSeries(function (seriesModel, idx) {\n\t var chartView = this._chartsMap[seriesModel.__viewId];\n\t chartView.__alive = true;\n\t chartView.render(seriesModel, ecModel, api, payload);\n\n\t chartView.group.silent = !!seriesModel.get('silent');\n\n\t updateZ(seriesModel, chartView);\n\n\t updateProgressiveAndBlend(seriesModel, chartView);\n\t }, this);\n\n\t // If use hover layer\n\t updateHoverLayerStatus(this._zr, ecModel);\n\n\t // Remove groups of unrendered charts\n\t each(this._chartsViews, function (chart) {\n\t if (!chart.__alive) {\n\t chart.remove(ecModel, api);\n\t }\n\t }, this);\n\t}", "render() {\n let me = $(this);\n let parentModule = me.closest('flx-module');\n let wcModule = parentModule[0];\n let rendered = '';\n if (this.data.length > 0) {\n if (this.tHeader && this.tHeader !== '') {\n let render = flexygo.utils.parser.recursiveCompile(this.data[0], this.tHeader, this);\n rendered += render;\n }\n let uniqueId = flexygo.utils.uniqueId();\n rendered += `<div class=\"zoomElements\">\n <i class=\"flx-icon icon-zoomout icon-zoom-115 zoom-ic minusZoom\"></i>\n <input class=\"sliderZoom\" min=\"0.1\" max= \"2\" value= \"1\" step= \"0.05\" type= \"range\"></input>\n <i class=\"flx-icon icon-zoom-1 icon-zoom-115 zoom-ic plusZoom\" ></i>\n <i class=\"flx-icon icon-focus icon-zoom-115 zoom-ic fitZoom\"></i>\n </div>\n <div class=\"flx-orgchart margintoporgchart\" id=\"` + uniqueId + `\"></div>`;\n if (this.tFooter && this.tFooter !== '') {\n let render = flexygo.utils.parser.recursiveCompile(this.data[0], this.tFooter, this);\n rendered += render;\n }\n me.html(rendered);\n //zoom\n let slider = me.find(\".sliderZoom\");\n slider.on(\"change\", function () {\n me.find(\".flx-orgchart\").css({ \"zoom\": $(this).val() });\n });\n me.find(\".plusZoom\").on(\"click\", function () {\n slider.val(parseFloat(slider.val()) + parseFloat(slider.attr('step')));\n slider.change();\n });\n me.find(\".minusZoom\").on(\"click\", function () {\n slider.val(parseFloat(slider.val()) - parseFloat(slider.attr('step')));\n slider.change();\n });\n me.find(\".fitZoom\").on(\"click\", function () {\n if (parseFloat(me.find(\"svg\").attr(\"width\")) != 0) {\n slider.val($('.cntBody').width() / parseFloat(me.find(\"svg\").attr(\"width\")));\n slider.change();\n }\n });\n let initialNode = new flexygo.api.orgchart.Node();\n initialNode.children = new Array();\n if (this.tBody && this.tBody !== '') {\n for (let i = 0; i < this.data.length; i++) {\n if (flexygo.utils.isBlank(this.data[i].Parent)) {\n let node = new flexygo.api.orgchart.Node();\n node.id = this.data[i].Id;\n node.innerHTML = flexygo.utils.parser.recursiveCompile(this.data[i], this.tBody, this);\n node.children = this.getChildren(this.data[i].Id);\n node.stackChildren = this.stackChildren;\n initialNode.children.push(node);\n }\n }\n }\n this.options.chart.container = \"#\" + uniqueId;\n this.options.chart.callback = {\n onTreeLoaded: () => { this.stopLoading(); this.setInitialZoom(); this.dragScroll(); }\n };\n this.options.nodeStructure = initialNode;\n this.tree = new Treant(this.options);\n }\n if (parentModule && wcModule) {\n wcModule.moduleLoaded(this);\n }\n }", "function renderEverything() {\n renderPepperonni()\n renderMushrooms()\n renderGreenPeppers()\n renderWhiteSauce()\n renderGlutenFreeCrust()\n\n renderButtons()\n renderPrice()\n}", "function renderEverything() {\n renderPepperonni()\n renderMushrooms()\n renderGreenPeppers()\n renderWhiteSauce()\n renderGlutenFreeCrust()\n\n renderButtons()\n renderPrice()\n}", "charts() {\n const l = this.data[this.vue.person]\n .event\n .map(i => i.data.physical.sign)\n const measurements = {}\n for (let event = 0; event < l.length; ++event) {\n for (let item of l[event]) {\n const ident = item.ident.toLowerCase()\n measurements[ident] = measurements[ident] || []\n item = Object.assign({event}, item)\n measurements[ident].push(item)\n }\n }\n\n const run = () => {\n for (let key in measurements) {\n // console.log(key)\n // Patch to combine blood pressure\n if (key === 'bps' || key === 'bpd') {\n console.log(\"In here\")\n console.log(key)\n } else {\n // console.log(\"Trying to render \" + key)\n const m = measurements[key].filter(i => i.event <= this.vue.event)\n const name = `#charts-${key}`\n const cats = m.map(i => this.vue.p.event[i.event].title)\n const cols = [key].concat(m.map(i => parseInt(i.value)))\n const unit = m[0].units.replace(\"&deg;C\", \"Celcius\")\n // Change to Line Graphs\n bb.generate({\n bindto: name,\n axis: {\n x: { \n type: \"category\",\n categories: cats,\n tick : { width : 50 },\n height : 50\n },\n y: { tick: { format: i => `${i} ${unit}` } }\n },\n data: {\n columns: [ cols ],\n types: { [key]: \"spline\", },\n colors: { [key] : \"red\", },\n },\n grid: {\n x: {\n show: true\n },\n y: {\n show: true\n }\n },\n legend : { show: false }\n })\n }\n }\n // Make one blood pressure chart\n var columns = []\n var cats = []\n var unit = []\n for (let key in measurements) {\n if (key === 'bps' || key === 'bpd') {\n const m = measurements[key].filter(i => i.event <= this.vue.event)\n unit = m[0].units\n console.log(m)\n cats = m.map(i => this.vue.p.event[i.event].title)\n const cols = [key].concat(m.map(i => parseInt(i.value)))\n columns.push(cols)\n\n }\n }\n const name = '#charts-bps'\n console.log(cats)\n console.log(columns)\n bb.generate({\n bindto: name,\n axis: {\n x: { \n type: \"category\",\n categories: cats,\n tick : { width : 50 },\n height : 50\n },\n y: { tick: { format: i => `${i} ${unit}` } }\n },\n data: {\n columns: columns,\n types: { 'bps': \"spline\", \n 'bpd': \"spline\"},\n colors: { 'bps' : \"red\", \n 'bpd' : \"blue\"},\n },\n grid: {\n x: {\n show: true\n },\n y: {\n show: true\n }\n },\n legend : { show: false }\n })\n var x = document.getElementsByClassName(\"chart\");\n x[0].innerHTML = \"Blood Pressure\";\n var element = x[1]\n element.parentNode.removeChild(element)\n }\n\n setTimeout(run, 0)\n return Object\n .keys(measurements)\n .map(i => [i, measurements[i]])\n }", "function render() { \n\n $body.append(templates['container']({'id':_uid}))\n $j('#' + _uid).append(templates['heading-no-links']({'title':'Countdown Promotion'}));\n $j('#' + _uid).append(templates['countdown-promo']({'id':_uid}));\n \n chtLeaderboard = new CHART.CountdownLeaderboard(_uid + '-charts-promo-leaderboard', _models.promo.getData('all'), _models.promo.getTargetSeries(20000));\n tblLeaderboard = new TABLE.CountdownLeaderboard(_uid + '-tables-promo-leaderboard', _models.promo.groupByOwner('all', 20000), _models.promo.getTotal('all', 180000)); \n chtLastWeek = new CHART.CountdownLeaderboard(_uid + '-charts-promo-lastweek', _models.promo.getData('lastweek'), _models.promo.getTargetSeries(1540));\n tblLastWeek = new TABLE.CountdownLeaderboard(_uid + '-tables-promo-lastweek', _models.promo.groupByOwner('lastweek', 1540), _models.promo.getTotal('lastweek', 13860)); \n chtWeeklySales = new CHART.CountdownWeeklySales(_uid + '-charts-promo-weeklysales', _models.promo.getData('all'));\n\n }", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "render() {\n // background box.\n this.renderBackground();\n this.renderName();\n this.renderTimeLine();\n this.renderWave();\n }", "function drawCharts() {\n drawPieChart()\n drawAxisTickColors()\n}", "render() {\n\t\treturn (\n\t\t\t<div style={{width: '180px', height: '180px'}}>\n\t\t\t\t<EasiCircleChart value={80.} animationTime={500}\n\t\t\t\t\tmax={100}\n\t\t\t\t\tcolors={['#00D561', '#FFD71E', '#FFA86D', '#F6502F']} title=\"使用率(%)\"/>\n\t\t\t\t<DashboardCircleChart value={340} animationTime={500}\n\t\t\t\t\tmax={500}\n\t\t\t\t\tisScaleVisible={true}\n\t\t\t\t\ttitle=\"重度污染\"\n\t\t\t\t\tcolors={['#00D561', '#FFD71E', '#ffaf52', '#fb9a29', '#F6502F']}/>\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n return (\n <div className=\"ScatterplotGraph\">\n <div className=\"wrapper\">\n <Card>\n <CardBody>\n <div id=\"chart\" />\n </CardBody>\n </Card>\n </div>\n </div>\n );\n }", "draw() {\n const selector = this.selector;\n let gradient;\n if (this.angles.length !== 1) {\n gradient = this.angles.reduce(\n (acc, curr, index) =>\n acc +\n `${this.getColor(index)} ${curr}deg, ${this.getColor(\n index + 1\n )} ${curr}deg, `,\n ''\n );\n let tempGradient = gradient.split(', ');\n tempGradient = tempGradient.slice(0, tempGradient.length - 2);\n gradient = tempGradient.join(', ');\n }\n else {\n gradient = `${this.getColor(0)} 0deg, ${this.getColor(0)} 360deg`;\n }\n\n const chart = document.createElement('DIV');\n const title = document.createElement('H2');\n const chartGraph = document.createElement('DIV');\n const chartData = document.createElement('DIV');\n const chartPercents = document.createElement('P');\n\n chart.setAttribute('class', 'chart');\n title.setAttribute('class', 'chart__title');\n title.textContent = this.title;\n chartGraph.setAttribute('class', `chart__graph chart__${this.chartType}`);\n chartGraph.style.backgroundImage = `conic-gradient(${gradient})`;\n chartData.setAttribute('class', 'chart__data');\n chartPercents.setAttribute('class', 'chart__percents');\n\n this.percents.forEach((percent, index) => {\n const chartPercent = document.createElement('SPAN');\n const chartPiece = document.createElement('I');\n chartPercent.textContent = `${percent}%`;\n chartPercent.setAttribute('class', 'chart__percent');\n chartPiece.setAttribute('class', 'chart__piece');\n chartPiece.style.backgroundColor = this.getColor(index);\n chartPercent.appendChild(chartPiece);\n chartPercents.appendChild(chartPercent);\n });\n chartData.appendChild(chartPercents);\n\n this.data.forEach((data, index) => {\n const chartDataRow = document.createElement('P');\n const chartDataName = document.createElement('SPAN');\n const chartDataValue = document.createElement('SPAN');\n const chartPiece = document.createElement('I');\n chartDataRow.setAttribute('class', 'chart__dataRow');\n chartDataName.setAttribute('class', 'chart__dataName');\n chartDataValue.setAttribute('class', 'chart__dataValue');\n chartDataName.textContent = Object.keys(data)[0];\n chartDataValue.textContent = Object.values(data)[0];\n chartPiece.setAttribute('class', 'chart__piece');\n chartPiece.style.backgroundColor = this.getColor(index);\n chartDataValue.appendChild(chartPiece);\n chartDataRow.appendChild(chartDataName);\n chartDataRow.appendChild(chartDataValue);\n chartData.appendChild(chartDataRow);\n });\n\n chart.appendChild(title);\n chart.appendChild(chartGraph);\n chart.appendChild(chartData);\n chart.dataset.chartId = this.id;\n\n const existId = document.querySelector(`[data-chart-id=\"${this.id}\"]`);\n if(existId){\n existId.parentNode.replaceChild(chart, existId);\n }\n else\n { \n document.querySelector(selector).appendChild(chart);\n }\n }", "renderMetasystemVisibleComponents() {\n this.dials.forEach(d => {\n d.render(this.renderer)\n })\n this.strips.forEach(s => {\n s.render(this.renderer)\n })\n this.lights.forEach(lightPair => {\n lightPair.forEach(light => light.renderAsMetaSystem(this.renderer))\n })\n }", "render() {\n this.getColorsFromCSS();\n this.drawLines();\n }", "generateChartsHTML() {\n\n\t\tlet plantingDate = new Date();\n\t\tlet harvestDate = new Date();\n\t\tlet harvestDateMin = new Date();\n\t\tlet harvestDateMax = new Date();\n\t\tlet rangeSelectorMin = new Date();\n\t\tlet rangeSelectorMax = new Date();\n\t\tlet ccChartDataArray = {}; // Associative array to store chart data\n\t\tlet biomassDates = [];\n\t\tlet biomassValues = [];\n\t\tlet cnDates = [];\n\t\tlet cnValues = [];\n\t\tlet cnMax = 60;\n\n\t\tlet cnRows = [];\n\t\tlet biomassRows = [];\n\n\t\tif (this.props.hasOwnProperty(\"userInputJson\") && this.props[\"userInputJson\"] !== null && this.props[\"userInputJson\"] !== undefined) {\n\n\t\t\tlet plantingYear = this.props[\"userInputJson\"][\"year_planting\"];\n\t\t\tlet harvestYear = plantingYear + 1;\n\t\t\tlet plantingDOY = this.props[\"userInputJson\"][\"doy_planting\"];\n\t\t\tlet harvestDOY = this.props[\"userInputJson\"][\"doy_harvest\"] - config.coverCropTerminationOffsetDays;\n\t\t\tplantingDate = new Date(plantingYear, 0, plantingDOY);\n\t\t\tharvestDate = new Date(harvestYear, 0, harvestDOY);\n\n\t\t\tharvestDateMin = new Date(harvestYear, 0, harvestDOY - (windowDurationDays/2));\n\t\t\tharvestDateMax = new Date(harvestYear, 0, harvestDOY + (windowDurationDays/2));\n\t\t\trangeSelectorMin = new Date(plantingYear, 0, plantingDOY - 1);\n\t\t\trangeSelectorMax = new Date(harvestYear, 0, harvestDOY + windowDurationDays);\n\t\t}\n\n\t\tccChartDataArray = this.state.ccDataArray;// generate charts for with cover crop case\n\t\tfor (let key in ccChartDataArray) {\n\t\t\tif(key.toString() === \"C:N ratio\"){\n\t\t\t\tif(ccChartDataArray[key].chartData !== undefined && ccChartDataArray[key].chartData.datasets.length) {\n\t\t\t\t\tcnRows = ccChartDataArray[key].chartData.datasets[0].data;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(key.toString() === \"TWAD\"){\n\t\t\t\tif(ccChartDataArray[key].chartData !== undefined && ccChartDataArray[key].chartData.datasets.length) {\n\t\t\t\t\tbiomassRows = ccChartDataArray[key].chartData.datasets[0].data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet prevCnDate = null;\n\n\t\tcnRows.forEach(function(element) {\n\t\t\tlet dt = element.x;\n\n\t\t\t// Adds 0s for missing date to make graph cleaner\n\t\t\tif(prevCnDate != null){\n\t\t\t\tlet dayDiff = calculateDayDifference(prevCnDate, dt);\n\t\t\t\twhile(dayDiff > 1){\n\t\t\t\t\tlet newDate = addDays(prevCnDate, 1);\n\t\t\t\t\tcnDates.push(newDate);\n\t\t\t\t\tcnValues.push(null);\n\t\t\t\t\tdayDiff--;\n\t\t\t\t\tprevCnDate = newDate;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcnDates.push(dt);\n\t\t\tcnValues.push(element.y);\n\t\t\tprevCnDate = element.x;\n\t\t});\n\n\t\tcnMax = Math.max(...cnValues);\n\t\tif(cnMax < 21){\n\t\t\tcnMax = 26;\n\t\t}\n\n\t\tlet prevBiomassDate = null;\n\t\tbiomassRows.forEach(function(element) {\n\t\t\tlet dt = element.x;\n\n\t\t\t// Adds 0s for missing date to make graph cleaner\n\t\t\tif(prevBiomassDate != null){\n\t\t\t\tlet dayDiff = calculateDayDifference(prevBiomassDate, dt);\n\t\t\t\twhile(dayDiff > 1){\n\t\t\t\t\tlet newDate = addDays(prevBiomassDate, 1);\n\t\t\t\t\tbiomassDates.push(newDate);\n\t\t\t\t\tbiomassValues.push(null);\n\t\t\t\t\tdayDiff--;\n\t\t\t\t\tprevBiomassDate = newDate;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbiomassDates.push(dt);\n\t\t\tbiomassValues.push(element.y);\n\t\t\tprevBiomassDate = element.x;\n\t\t});\n\n\n\t\tlet resultHtml = [];\n\t\tlet selectorOptions = {\n\t\t\tx: 0.01,\n\t\t\ty: 1.15,\n\t\t\tbuttons: [\n\t\t\t// \t{\n\t\t\t// \tstep: \"month\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"1m\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"month\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 6,\n\t\t\t// \tlabel: \"6m\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"year\",\n\t\t\t// \tstepmode: \"todate\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"YTD\"\n\t\t\t// }, {\n\t\t\t// \tstep: \"year\",\n\t\t\t// \tstepmode: \"backward\",\n\t\t\t// \tcount: 1,\n\t\t\t// \tlabel: \"1y\"\n\t\t\t// },\n\t\t\t\t{\n\t\t\t\tstep: \"all\",\n\t\t\t\tlabel: \"show all\"\n\t\t\t}],\n\n\t\t};\n\n\t\tlet biomass = {\n\t\t\tx: biomassDates, //[\"2019-01-01\", \"2019-03-01\", \"2019-06-01\", \"2019-09-03\"],\n\t\t\ty: biomassValues, //[0, 15, 19, 21],\n\t\t\tname: \"Plant Biomass\",\n\t\t\ttype: \"scatter\",\n\t\t\tmode: \"lines\",\n\t\t\tconnectgaps: false,\n\t\t\tline: {color: \"DeepSkyBlue\"}\n\t\t};\n\n\t\tlet cn = {\n\t\t\tx: cnDates, //[\"2019-01-01\", \"2019-03-01\", \"2019-06-01\", \"2019-09-03\"],\n\t\t\ty: cnValues, //[0, 3, 10, 13],\n\t\t\tname: \"C:N\",\n\t\t\tyaxis: \"y2\",\n\t\t\ttype: \"scatter\",\n\t\t\tmode: \"lines\", //lines+marks\n\t\t\tconnectgaps: false,\n\t\t\tline: {color: \"Orange\"}\n\t\t};\n\n\t\tlet data = [biomass, cn];\n\n\t\tlet highlightShapes = [\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: harvestDateMin,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: harvestDateMax,\n\t\t\t\ty1: 1,\n\t\t\t\tfillcolor: \"rgb(204, 255, 235)\", //\"LightYellow\",\n\t\t\t\topacity: 0.5,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 1, dash: \"dot\"}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"line\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: plantingDate,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: plantingDate,\n\t\t\t\ty1: 1.1,\n\t\t\t\tline: {width: 2}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"line\",\n\t\t\t\txref: \"x\",\n\t\t\t\tyref:\"paper\",\n\t\t\t\tx0: harvestDate,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: harvestDate,\n\t\t\t\ty1: 1.1,\n\t\t\t\tline: {width: 2}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"paper\",\n\t\t\t\tyref:\"y2\",\n\t\t\t\tx0: 0,\n\t\t\t\ty0: 0,\n\t\t\t\tx1: 1,\n\t\t\t\ty1: 20,\n\t\t\t\tfillcolor: \"rgb(240, 240, 194)\",\n\t\t\t\topacity: 0.3,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 0.1}\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"rect\",\n\t\t\t\txref: \"paper\",\n\t\t\t\tyref:\"y2\",\n\t\t\t\tx0: 0,\n\t\t\t\ty0: 20,\n\t\t\t\tx1: 1,\n\t\t\t\ty1: cnMax,\n\t\t\t\tfillcolor: \"rgb(240, 220, 220)\",\n\t\t\t\topacity: 0.3,\n\t\t\t\tlayer: \"below\",\n\t\t\t\tline: {width: 0.1}\n\t\t\t},\n\t\t];\n\n\t\tlet annotations = [\n\t\t\t{\n\t\t\t\tx: plantingDate,\n\t\t\t\ty: 1.06,\n\t\t\t\txref: \"x\",\n\t\t\t\tyref: \"paper\",\n\t\t\t\ttext: \" IN \",\n\t\t\t\tborderpad: 4,\n\t\t\t\tbgcolor: \"SlateGray\",\n\t\t\t\tshowarrow: false,\n\t\t\t\tfont: {\n\t\t\t\t\tsize: 14,\n\t\t\t\t\tcolor: \"White\"\n\t\t\t\t},\n\t\t\t\topacity: 0.8,\n\t\t\t\t// arrowhead: 3,\n\t\t\t\t// ax: -30,\n\t\t\t\t// ay: -40,\n\t\t\t\t//yanchor: \"top\",\n\t\t\t\txshift: -20\n\t\t\t},\n\t\t\t{\n\t\t\t\tx: harvestDate,\n\t\t\t\ty: 1.06,\n\t\t\t\txref: \"x\",\n\t\t\t\tyref: \"paper\",\n\t\t\t\ttext: \"OUT\",\n\t\t\t\tshowarrow: false,\n\t\t\t\tborderpad: 4,\n\t\t\t\tbgcolor: \"SlateGray\",\n\t\t\t\tfont: {\n\t\t\t\t\tsize: 14,\n\t\t\t\t\tcolor: \"White\"\n\t\t\t\t},\n\t\t\t\topacity: 0.8,\n\t\t\t\t// arrowhead: 3,\n\t\t\t\t// ax: -30,\n\t\t\t\t// ay: -40,\n\t\t\t\t//yanchor: \"top\",\n\t\t\t\txshift: -22\n\n\t\t\t},\n\t\t\t// {\n\t\t\t// \ttext: \"Immobilization Begins<sup>*</sup>\",\n\t\t\t// \tshowarrow: true,\n\t\t\t// \tx: 0.5,\n\t\t\t// \ty: 20.25,\n\t\t\t// \tvalign: \"top\",\n\t\t\t// \txref:\"paper\",\n\t\t\t// \tyref: \"y2\",\n\t\t\t// \t// borderwidth: 1,\n\t\t\t// \t// bordercolor: \"black\",\n\t\t\t// \t// hovertext: \"Termination of CR with a C:N ratio ranging from 0-20 has the potential to result in soil N mineralization <br>\" +\n\t\t\t// \t// \t\"Termination of CR with a C:N ratio ranging >20 has the potential to result in soil N immobilization\",\n\t\t\t// }\n\t\t];\n\n\t\tlet layout = {\n\t\t\ttitle: \"Cover Crop Growth & C:N Prediction\",\n\t\t\twidth: 930,\n\t\t\theight: 600,\n\t\t\t// responsive: true,\n\t\t\txaxis: {\n\t\t\t\trangeselector: selectorOptions,\n\t\t\t\trangeslider: {borderwidth: 1},\n\t\t\t\trange: [rangeSelectorMin, rangeSelectorMax],\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tzeroline: true,\n\t\t\t\tticks: \"outside\"\n\t\t\t},\n\t\t\tyaxis: {\n\t\t\t\ttitle: {\n\t\t\t\t\ttext: \"Plant Biomass (lb/acre)\",\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tcolor: \"DeepSkyBlue\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttickfont: {color: \"DeepSkyBlue\"},\n\t\t\t\tshowgrid: false,\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tticks: \"outside\"\n\t\t\t\t// range: [0,5000],\n\t\t\t\t// rangemode: \"tozero\"\n\t\t\t},\n\t\t\tyaxis2: {\n\t\t\t\ttitle: {\n\t\t\t\t\ttext: \"C:N\",\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tcolor: \"Orange\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttickfont: {color: \"Orange\"},\n\t\t\t\toverlaying: \"y\",\n\t\t\t\tside: \"right\",\n\t\t\t\tshowgrid: false,\n\t\t\t\tshowline: true,\n\t\t\t\tlinecolor: \"LightGray\",\n\t\t\t\tticks: \"outside\"\n\t\t\t},\n\t\t\tshapes: highlightShapes,\n\t\t\tannotations: annotations,\n\t\t\tlegend: {x:0.88, y: 1.40, borderwidth: 0.5}\n\t\t};\n\n\n\t\tresultHtml.push(\n\t\t\t\t\t<div >\n\t\t\t\t\t\t<Plot\n\t\t\t\t\t\t\tdata={data}\n\t\t\t\t\t\t\tlayout={layout}\n\t\t\t\t\t\t\tconfig={{\n\t\t\t\t\t\t\t\t\"displayModeBar\": false\n\t\t\t\t\t\t\t}}\n\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>);\n\n\t\treturn resultHtml;\n\t}", "function applyChart() {\n\tresetSpace();\n\tvar filteredConditiontionsMap = fetchAllFilteredConditions();\n\tvar map = BeforeProcessFiltering(filteredConditiontionsMap);\n\tvar chartsSelected = fetchChartSelections();\n\tvar labels = [];\n\tvar vals = [];\n\tfor (let label of map.keys()){\n\t\tlabels.push(label);\n\t\tvals.push(map.get(label));\n\t}\n\t\n\tfor(var i =0;i<chartsSelected.length;i++){\n\t\tdocument.getElementById('parentChart').style.display = \"block\";\n\t\tlet cs = new ChartMain();\n\t\tvar chart = null;\n\t\tlet isBackgroundColorRequired = true;\n\t\tif(chartsSelected[i] == \"Bar Chart\"){\n\t\t\tmakeCanvasElement(\"barchartcanvas\");\n\n\t\t\tlet barChartDecorator = new BarChartDecorator();\n\t\t\tchart = cs.orderChart(\"bar\");\n\t\t\tchart.setLabelAndData(labels,vals);\n\t\t\tbarChartDecorator.applyBackgroundColor(chart);\n\t\t\tbarChartDecorator.applyBorderColor(chart);\n\t\t} else if(chartsSelected[i] == \"Line Chart\"){\n\t\t\tlet lineChartDecorator = new LineChartDecorator();\n\t\t\tmakeCanvasElement(\"linechartcanvas\");\n\n\t\t\tchart = cs.orderChart(\"line\");\n\t\t\tchart.setLabelAndData(labels,vals);\n\t\t\tlineChartDecorator.applyBorderColor(chart);\n\n\t\t} else if(chartsSelected[i] == \"Pie Chart\"){\n\t\t\tlet pieChartDecorator = new PieChartDecorator();\n\t\t\tmakeCanvasElement(\"piechartcanvas\");\n\t\t\tchart = cs.orderChart(\"pie\");\n\t\t\tchart.setLabelAndData(labels,vals); \n\t\t\tpieChartDecorator.applyBackgroundColor(chart);\n\t\t\tpieChartDecorator.applyBorderColor(chart);\t\t\t\n\t\t}else if(chartsSelected[i] == \"Doughnut Chart\"){\n\t\t\tlet doughnutChartDecorator = new DoughnutChartDecorator();\n\t\t\tmakeCanvasElement(\"doughnutchartcanvas\");\n\t\t\tchart = cs.orderChart(\"doughnut\");\n\t\t\tchart.setLabelAndData(labels,vals); \n\t\t\tdoughnutChartDecorator.applyBackgroundColor(chart);\n\t\t\tdoughnutChartDecorator.applyBorderColor(chart);\n\t\t}\n\t\t\n\t\t \n\t\tchart.plot();\n\t}\n}", "componentDidMount() {\n // Extend Highcharts with modules\n if (this.state.modules) {\n this.state.modules.forEach(function (module) {\n module(Highcharts);\n });\n }\n // Set container which the chart should render to.\n this.state.charts.forEach(function (chart, index) {\n chart.ref = new Highcharts.chart(\n chart.container, \n chart.options\n );\n });\n }", "renderCharts(chart, name, x) {\n\t\tlet color;\n\t\tif(x <= 25) color = '#48E229';\n\t\telse if(x > 25 && x <= 45) color = '#F6EB43';\n\t\telse if(x > 45 && x <= 75) color = '#ffc107';\n\t\telse color = '#dc3545';\n\t\tchart.innerHTML += `<div class=\"row p-3\">\n\t\t\t\t<div class=\"col-2\"><h5>${name}</h5></div>\n\t\t\t\t<div class=\"col-10\"><div style=\"padding: 5px; background-color: ${color}; \n\t\t\t\ttext-align: center; width: 0\"><span style=\"color: white;\"></span></div></div>\n\t\t\t\t</div>`;\n\t\tlet width = 0;\n\t\tconst timer = setInterval(() => {\n\t\t\twidth++;\n\t\t\tchart.children[this.br].children[1].children[0].style.width = `${width * 5}px`;\n\t\t\tchart.children[this.br].children[1].children[0].children[0].innerText = width;\n\t\t\tif(width >= x) {\n\t\t\t\tthis.br++;\n\t\t\t\tclearInterval(timer);\n\t\t\t}\n\t\t}, 30);\n\t}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n renderButtons();\n renderPrice();\n renderReceipt()\n}", "render() {\n this.clearCanvas();\n this.sortEntities();\n this.updateScrollToFollow();\n for (let entity of this.entities) {\n if (!entity.visible)\n break;\n if (entity.shouldBeCulled(this.scrollX, this.scrollY))\n continue;\n entity.render(this.context, this.scrollX, this.scrollY);\n }\n // Dibujamos el overlay\n this.context.fillStyle = \"rgba(\" + this.overlayColor.r + \", \" + this.overlayColor.g + \", \" + this.overlayColor.b + \", \" + this.overlayColor.a + \")\";\n this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);\n this.context.fillStyle = \"#000000\";\n // Render del fotograma listo, disparamos el evento\n this.onFrameUpdate.dispatch();\n }", "function Data(){\n return(\n <section className=\"WhatsHealthySection\">\n <div className=\"first\">\n <div className=\"dc-all\">\n <div className=\"MainContent\">\n <div className=\"ChartContainer\">\n <WhatsHealthyChart/>\n </div> \n <div className=\"TextArea\" id=\"Preparation\">\n <h3 className=\"DataTitle\">What Constitutes a Healthy Meal?</h3> \n </div> \n <p className=\"dc-subHead\">Data taken from NHS England's recommended intake per 100g</p>\n </div>\n </div>\n </div>\n <section className=\"od-all\">\n <div className=\"ContentControl\">\n <div className=\"ChartContainer\">\n <FourAverageCharts/>\n </div>\n </div>\n </section>\n <section className=\"AverageToHealth\">\n <div className=\"ah-content\">\n <div className=\"ah-subHead-Layout\">\n <h3 className=\"ah-title\">Are They Healthy?</h3>\n <p className=\"ah-subHead\">Legend: <br/><p id='Healthy'>Healthy, </p><p id='Moderate'>Moderate, </p><p id='Unhealthy'>Unhealthy, </p><p id='Tesco'>Tesco, </p><p id=\"Morrisons\">Morrisons, </p><p id=\"Sainsburys\">Sainsburys, </p><p id=\"Waitrose\">Waitrose</p></p>\n </div>\n <span className=\"ChartContainerComp\">\n <AreAveragesHealthy/>\n </span>\n </div>\n </section>\n <section className=\"hee\">\n <div className=\"he-content\">\n <div className=\"heInnerContent\">\n <div className=\"TitleAndSub\">\n <h3 className=\"he-title\">View The Data</h3>\n <p className=\"he-subHead\" id=\"supermarket-in-view\">All collected supermarket data</p>\n </div>\n <div className=\"allProductGraph\">\n <AllDataChart/>\n </div>\n </div>\n </div>\n </section>\n </section>\n );\n}", "draw() {\n this._updateWidthHeight();\n\n this.initSvg();\n // bar char\n if (this.keysBar) {\n this.aggregateLabelsByKeys(this.selection, this.keysBar);\n }\n\n if (this.keysX && this.keysY) {\n this.aggregateValuesByKeys(this.selection, this.keysX, this.keysY);\n }\n\n this.barChart.draw();\n // scatterplot\n // this.scatter.draw();\n }", "function renderChart() {\n\n if($scope.currentChartModel==null) {\n $scope.app.getObject($element.find('div'), $scope.currentChart).then(function(model) {\n $scope.currentChartModel = model;\n });\n }\n else {\n $scope.currentChartModel.enigmaModel.endSelections(true)\n .then(destroyObject)\n .then(\n function() {\n $scope.app.getObject($element.find('div'), $scope.currentChart)\n .then(function(model) {\n $scope.currentChartModel = model;\n });\n });\n }\n\n }", "function renderAll() {\n renderPatty();\n renderCheese();\n renderTomatoes();\n renderOnions();\n renderLettuce();\n // renderButtons();\n // renderIngredientsBoard();\n renderPrice();\n}", "function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns._zr, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}", "function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns._zr, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}", "function renderSeries(ecIns, ecModel, api, payload, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask));\n chartView.group.silent = !!seriesModel.get('silent');\n updateZ(seriesModel, chartView);\n updateBlend(seriesModel, chartView);\n });\n scheduler.unfinished |= unfinished; // If use hover layer\n\n updateHoverLayerStatus(ecIns._zr, ecModel); // Add aria\n\n aria(ecIns._zr.dom, ecModel);\n}", "function draw() {\n\t\t\tdrawGrid();\n\t\t\tdrawLabels();\n\t\t\tfor(var i = 0; i < series.length; i++){\n\t\t\t\tdrawSeries(series[i]);\n\t\t\t}\n\t\t}", "init() {\n\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function renderData(container, processed_data) {\n \n // Different Container Div States and how to function in each state.\n //\n // 1. Neither height nor width is specified for the containing dv.\n //\n // In this state the widget should be defined by the sum of all its\n // children. Hence, intelligent defaults will be used and it will\n // be rendered.\n //\n // 2. Both height and width are specified.\n //\n // In this state the widget size is defined explicitly, hence the\n // widget will be the size explicity defined and the contents will be\n // horizontally and vertically scaled to fit N sub groups where N is\n // the number of subgroups provided..\n //\n // 3. Only width is specified\n \n // Diffrent Container Div States\n //\n // 1. The client application didn't specify a width or height, so they\n // are expecting the width and height of that div to be defined by the\n // combination of its children and its parent.\n //\n // 2. The client application does specify a width and height, so they\n // are expecting the div to only take up the provided width and height\n // in area.\n // 1. Make everything fit into the specified height and width of the div.\n //\n // 2. \n \n \n // var i;\n var html = \"\";\n // var max_bar_width = 125;\n \n // function calcBarLength(perc, max_bar_width) {\n // var r;\n // r = Math.floor((perc/100) * max_bar_width);\n // if (r == 0) {\n // r = 1;\n // }\n // return r;\n // }\n\n //container.addClass(\"ui-widget\");\n //container.addClass(\"ui-comphist-widget\");\n\n // Obtain the height of the container div and set the font-size to that\n // height in pixels so that I can then make all of the fonts and child\n // elements sized relative to that size.\n var container_width_in_px = container.height();\n //container.css('font-size', container_width_in_px + 'px');\n\n html += '<div class=\"ui-comphist-widget\" style=\"font-size: ' + container_width_in_px + 'px;\">';\n // Create the comparitive histogram header \n html += ' <div class=\"ui-comphist-header\">';\n html += ' <span class=\"ui-comphist-pop-size\">' + processed_data.population_count + '</span>';\n html += ' <span class=\"ui-comphist-pop-label\">' + processed_data.population_label + '</span>';\n html += ' </div>';\n \n html += ' <div class=\"ui-comphist-spacer\">';\n html += ' </div>';\n\n html += ' <div class=\"ui-comphist-pseudotable\">';\n // // Create primary group one bars column.\n html += ' <div class=\"ui-comphist-bars-col\">';\n html += ' <div class=\"ui-comphist-label-row ui-comphist-left-row\">';\n html += ' <div class=\"ui-comphist-group-label ui-comphist-left-label\">' + processed_data.group_1_label + '</div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row\">';\n if (processed_data.group_1_perc == 0) {\n html += ' <div class=\"ui-comphist-sum-bar ui-comphist-left\" style=\"width: 1%;\">';\n } else {\n html += ' <div class=\"ui-comphist-sum-bar ui-comphist-left\" style=\"width: ' + processed_data.group_1_perc + '%;\">';\n }\n html += ' </div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row\">';\n if (processed_data.subgroups[i].group_1_perc == 0) {\n html += ' <div class=\"ui-comphist-bar ui-comphist-left\" style=\"width: 1%;\">';\n } else {\n html += ' <div class=\"ui-comphist-bar ui-comphist-left\" style=\"width: ' + processed_data.subgroups[i].group_1_perc + '%;\">';\n }\n html += ' </div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n }\n html += ' </div>'; // close group one bars column\n // \n // // Create primary group two bars column.\n html += ' <div class=\"ui-comphist-bars-col\">';\n html += ' <div class=\"ui-comphist-label-row\">';\n html += ' <div class=\"ui-comphist-group-label ui-comphist-right-label\">' + processed_data.group_2_label + '</div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row\">';\n if (processed_data.group_2_perc == 0) { \n html += ' <div class=\"ui-comphist-sum-bar ui-comphist-right\" style=\"width: 1%;\">';\n } else {\n html += ' <div class=\"ui-comphist-sum-bar ui-comphist-right\" style=\"width: ' + processed_data.group_2_perc + '%;\">';\n }\n html += ' </div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row\">';\n if (processed_data.subgroups[i].group_2_perc == 0) {\n html += ' <div class=\"ui-comphist-bar ui-comphist-right\" style=\"width: 1%;\">';\n } else {\n html += ' <div class=\"ui-comphist-bar ui-comphist-right\" style=\"width: ' + processed_data.subgroups[i].group_2_perc + '%;\">';\n }\n html += ' </div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n } \n html += ' </div>'; // close group two bars column\n\n // Create the subgroup labels bar\n html += ' <div class=\"ui-comphist-subgroup-label-col\">';\n html += ' <div class=\"ui-comphist-label-row\">';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row\">';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row\">';\n html += ' <span class=\"ui-comphist-subgroup-label ui-comphist-right\">' + processed_data.subgroups[i].label + '</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n }\n html += ' </div>'\n\n // Create the group one stats column\n html += ' <div class=\"ui-comphist-subgroup-col\">';\n html += ' <div class=\"ui-comphist-label-row ui-comphist-left-row\">';\n html += ' <div class=\"ui-comphist-group-label ui-comphist-left-label\">' + processed_data.group_1_label + '</div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row ui-comphist-row-left\">';\n html += ' <span class=\"ui-comphist-sum-val ui-comphist-left\">' + processed_data.group_1_perc + '%</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row ui-comphist-row-left\">';\n html += ' <span class=\"ui-comphist-subgroup-val ui-comphist-left\">' + processed_data.subgroups[i].group_1_perc + '%</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n }\n html += ' </div>';\n // \n // // Create the group two stats column\n html += ' <div class=\"ui-comphist-subgroup-col\">';\n html += ' <div class=\"ui-comphist-label-row\">';\n html += ' <div class=\"ui-comphist-group-label ui-comphist-right-label\">' + processed_data.group_2_label + '</div>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row\">';\n html += ' <span class=\"ui-comphist-sum-val ui-comphist-right\">' + processed_data.group_2_perc + '%</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row\">';\n html += ' <span class=\"ui-comphist-subgroup-val ui-comphist-right\">' + processed_data.subgroups[i].group_2_perc + '%</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n }\n html += ' </div>';\n // \n // // Create the subgroup totals column\n html += ' <div class=\"ui-comphist-totals-col\">';\n html += ' <div class=\"ui-comphist-label-row\">';\n html += ' </div>';\n html += ' <div class=\"ui-comphist-sum-row\">';\n html += ' </div>';\n for (i = 0; i < processed_data.subgroups.length; i++) {\n html += ' <div class=\"ui-comphist-subgroup-row\">';\n html += ' <span class=\"ui-comphist-subgroup-tot-val ui-comphist-right\">' + processed_data.subgroups[i].tot_perc + '%</span>';\n html += ' <div style=\"clear: both;\"></div>';\n html += ' </div>';\n }\n html += ' </div>';\n \n html += \" </div>\"; // close the ui-comphist-pseudotable\n html += \"</div>\"; // close the ui-comphist-widget\n \n container.html(html);\n \n container.mouseover(function (event) {\n var curo = $(event.target);\n if (curo.hasClass(\"ui-comphist-bar\") || curo.hasClass(\"ui-comphist-sum-bar\")) {\n container.trigger(\"barover\", [curo.css(\"width\"), curo.position()]);\n }\n });\n container.mouseout(function (event) {\n var curo = $(event.target);\n if (curo.hasClass(\"ui-comphist-bar\") || curo.hasClass(\"ui-comphist-sum-bar\")) {\n container.trigger(\"barout\", [curo.css(\"width\"), curo.position()]);\n }\n });\n }", "renderChartType(dataset){\n\n if(this.state.chartType == \"line\"){\n return(\n <Line\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"bar\"){\n return(\n <Bar\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"polar\"){\n return(\n <Polar\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"radar\"){\n return(\n <Radar\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"doughnut\"){\n return(\n <Doughnut\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"scatter\"){\n return(\n <Scatter\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"bubble\"){\n return(\n <Bubble\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"pie\"){\n return(\n <Pie\n data={dataset}\n\n />\n );\n }\n }", "function buildCharts() {\n const charts = document.getElementsByClassName( 'simple-chart-target' );\n for ( let i = 0; i < charts.length; i++ ) {\n buildChart( charts[i] );\n }\n}", "renderElements()\n {\n \tlet self = this;\n \t\n \t// TODO: Handle no section?\n \tif( !self.activeSection ) return;\n \t\n \tif( self.renderingElements ) \n \t{\n \t\treturn;\n \t}\n \t\n \tself.renderingElements = true;\n \t\n \tif( !self.currentPage )\n \t{\n \t\tself.currentPage = 0;\n \t}\n \t\n \tself.canvasContent.innerHTML = '';\n \t\n\t self.canvasHeader.innerHTML = self.course.Name + \n\t \t' <span class=\"IconSmall fa-chevron-right\"></span> ' + \n\t \tself.getCurrentSection().Name + \n\t \t' <span class=\"IconSmall fa-chevron-right\"></span> ' + \n\t \tself.getCurrentPage().Name;\n \t\n \tlet act = false;\n \tfor( let a in self.sections )\n \t\tif( a == self.activeSection )\n \t\t\tact = self.sections[ a ];\n \t\n \tlet csId = self.#courseSessionId;\n \t\n \tif( act && act.pages && act.pages[self.currentPage] )\n \t{\n \t\t// Ref the page\n \t\tlet page = act.pages[self.currentPage];\n\t\t\t// Load all elements for the page\n\t\t\tlet m = new Module( 'system' );\n\t\t\tm.onExecuted = function( e, d )\n\t\t\t{\n\t\t\t\tif( e != 'ok' ) \n\t\t\t\t{\n\t\t\t\t\tself.renderingElements = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet els = JSON.parse( d );\n\t\t\t\tfor( let a = 0; a < els.length; a++ )\n\t\t\t\t{\n\t\t\t\t\t// Convert from BASE64\n\t\t\t\t\tif( els[a].Properties.substr && els[a].Properties.substr( 0, 7 ) == 'BASE64:' )\n\t\t\t\t\t{\n\t\t\t\t\t\tels[a].Properties = Base64.decode( els[a].Properties.substr( 7, els[a].Properties.length - 7 ) );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlet ele = self.createElement( els[a].ElementType, els[a] );\n\t\t\t\t\tself.addToCanvas( ele );\n\t\t\t\t\tif( ele.init )\n\t\t\t\t\t\tele.init();\n\t\t\t\t}\n\t\t\t\tFUI.initialize();\n\t\t\t\tself.renderingElements = false;\n\t\t\t\t\n\t\t\t\t// Update page status (tick off the box)\n\t\t\t\tlet p = new Module( 'system' );\n\t\t\t\tp.onExecuted = function( pc, pd )\n\t\t\t\t{\n\t\t\t\t\t// nothing\n\t\t\t\t\tconsole.log( 'What result of page status: ', pc, pd );\n\t\t\t\t}\n\t\t\t\tp.execute( 'appmodule', {\n\t\t\t\t\tappName: 'Courses',\n\t\t\t\t\tcommand: 'setpagestatus',\n\t\t\t\t\tpageId: page.ID,\n\t\t\t\t\tcourseSessionId: csId\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t\tself.redrawNavPanel();\n\t\t\t\n\t\t\t\t// Check which state the buttons are in\n\t\t\t\tself.checkNavButtons();\n\t\t\t}\n\t\t\t\n\t\t\tm.execute( 'appmodule', {\n\t\t\t\tappName: 'Courses',\n\t\t\t\tcommand: 'loadpageelements',\n\t\t\t\tpageId: page.ID\n\t\t\t} );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself.renderingElements = false;\n\t\t}\n }", "mounted() {\n renderChart(this.matchedRhythms, this.$refs.rhythmChart);\n renderChart(this.matchedContourGraph, this.$refs.contourChart);\n renderChart(this.matchedLineLengths, this.$refs.lengthChart);\n renderChart(this.matchedNotes, this.$refs.noteChart);\n renderChart(this.avgQuartersByPos, this.$refs.quartersChart);\n renderChart(this.avgNotesByPos, this.$refs.notesByPosChart);\n renderChart(this.rhymingTones, this.$refs.rhymingChart);\n renderChart(this.finalTones, this.$refs.finalChart);\n renderChart(this.finalNotes, this.$refs.finalNotesChart);\n renderChart(this.allTones, this.$refs.allTonesChart);\n }", "render() {\n return (\n <div class=\"container\" >\n <h2 class=\"text-center\" id=\"title\">{this.props.title}\n <small class=\"small\"> {\"(\"+this.props.patient[0].edad+ \"years)\"}</small> </h2>\n <ul class=\"list-inline small text-center\">\n <li class=\"list-inline-item\">{this.props.patient[0].cellphone}</li>\n <li class=\"list-inline-item\">|</li>\n <li class=\"list-inline-item\">{this.props.patient[0].email}</li>\n </ul>\n <hr></hr> \n <h3 className=\"mt-5\">History</h3>\n <Line data={this.dataLine} options={{ responsive: true }} />\n <hr></hr>\n <h2 class=\"text-center\" id=\"title\">VOLUMEN </h2>\n <p class=\"text-center small\">Volume history per {\"day\"}</p>\n <Line data={this.volDataLine} options={{ responsive: true }} />\n <hr></hr>\n <h2 class=\"text-center\" id=\"title\">COLOR </h2>\n <p class=\"text-center small\">Color history per {\"day\"}</p>\n <Pie data={this.dataPie} options={{ responsive: true }} />\n </div>\n );\n }", "function renderClassChart() {\n\tclassHoverRect();\n\tincrementProgress();\n}", "function renderDomain () {\n renderSites();\n renderEvents();\n renderNarratives();\n }", "function renderAll() {\n renderPatty();\n renderCheese();\n renderTomatoes();\n renderOnions();\n renderLettuce();\n renderButtons();\n renderIngredientsBoard();\n renderPrice();\n}", "function renderEverything() {\n renderPepperonni() ;\n renderMushrooms() ;\n renderGreenPeppers() ;\n renderWhiteSauce() ;\n renderGlutenFreeCrust() ;\n // renderButtons() -- not done, integrated this into the render of each ingredient ;\n renderPrice() ;\n}", "function renderChildComponents(hostLView, components) {\n for (var i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n }", "renderMultGraph() {\n let send_data = [];\n for (let i = 0; i < this.props.data.length; i++) {\n if (this.state.clicked[i.toString()]) {\n send_data.push(this.props.data[i])\n }\n }\n fetch(\"/render-graph\", {\n method: \"POST\",\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({'data': send_data})\n }).then((res) => {\n res\n .json()\n .then((j) => {\n //$(\"#bokeh-plot\").html(j['div']);\n this.setState({bokeh_plot_id: j['id']})\n $(\"#for-script\").html(j['script'])\n })\n })\n }", "function drawCharts() {\n // Get total used in this year\n $.getJSON('get_dashboard_values', function (result) {\n createSpiderChart(result['registers']);\n var year_per = (Math.floor(result.total_used.year.value__sum)/15512066)*100;\n var month_per = (Math.floor(result.total_used.month.value__sum)/1292672)*100;\n\n var gauge1 = loadLiquidFillGauge(\"circle-1\", year_per);\n var gauge1 = loadLiquidFillGauge(\"circle-2\", month_per);\n });\n // Get raw debits\n $.getJSON('api/v1/CouncilmanDebits/?format=json&limit=99999999', function (result) {\n createHorizontalBarChart(sumDebitsByCNPJ(result['objects']));\n createTreeMapChart(sumDebitsByCostObject(result['objects']));\n createBarChart(sumDebitsByCouncilman(result['objects']));\n createDataTable(result['objects']);\n });\n}", "function makeCharts() {\n issueChart();\n countChart();\n averageChart();\n}", "render() {\n this._renderFiltersOptions(this._filtersItems);\n this._renderCards(this._recipesList);\n\n this._addSearchBarEvents();\n this._addOpenFiltersEvents();\n this._addCloseAllFiltersEvent();\n this._addResizeOpenedFilterListsEvent();\n this._addUpButtonEvent();\n }", "function render()\n {\n if (me.triggerEvent('renderBefore', data) === false)\n return;\n\n // remove all child nodes\n container.html('');\n\n // render child nodes\n for (var i=0; i < data.length; i++) {\n data[i].level = 0;\n render_node(data[i], container);\n }\n\n me.triggerEvent('renderAfter', container);\n }", "render () {\r\n return (\r\n <div>\r\n\r\n <Header \r\n onLoading={this.loading} \r\n onLoadingFinish={this.loadingFinish}\r\n onSave={this.onSave}\r\n loading={this.state.loading}\r\n napchart={this.state.napchart}\r\n addOns={this.state.addOns}\r\n changeAddOn={this.changeAddOn}\r\n url={this.state.url}\r\n chartid={this.state.chartid}\r\n title={this.state.title}\r\n description={this.state.description} \r\n />\r\n \r\n <div className={classNames('grid', {loading: this.state.loading})}>\r\n <div className='column left'>\r\n <ColorHub napchart={this.state.napchart} />\r\n <Lanes\r\n napchart={this.state.napchart}\r\n clickLane={this.setNumberOfLanes}\r\n />\r\n <Shapes napchart={this.state.napchart}/>\r\n <MetaInfo\r\n title={this.state.title}\r\n description={this.state.description} \r\n changeTitle={this.changeTitle}\r\n changeDescription={this.changeDescription}\r\n />\r\n </div>\r\n \r\n <div className={classNames('mainChartArea')}>\r\n <Chart \r\n napchart={this.state.napchart}\r\n onUpdate={this.somethingUpdate}\r\n setGlobalNapchart={this.setGlobalNapchart} \r\n onLoading={this.loading} onLoadingFinish={this.loadingFinish}\r\n />\r\n </div>\r\n\r\n \r\n\r\n <InfoColumn\r\n napchart={this.state.napchart}\r\n addOns={this.state.addOns} />\r\n </div>\r\n\r\n \r\n\r\n </div>\r\n )\r\n }", "function createContentForGraphs () {\n resetGraphValuesBeforeRendering();\n //first graph template\n var entireTemplateForGraphs = ``;\n AppData.listOfGraphsData.forEach(function (arrayItem, index, arrayObject) {\n var arrayItemWithDataSeriesAdded = returnDataSeriesForArrayItem(arrayItem); \n var tempGraphTemplate = \n `<div class=\"col-12 col-lg-6 mb-1\">\n <div class=\"card\"><div class=\"card-body\">` + returnGraphPlaceholder(arrayItemWithDataSeriesAdded) + `</div></div>\n </div>`;\n entireTemplateForGraphs = entireTemplateForGraphs + tempGraphTemplate;\n });\n /* since we created placeholder containers (returnGraphPlaceholder), we will start checking when those elements are added to DOM\n we want to attach Graphs when those elements are added to DOM\n */\n startCheckingForAddedGraphsPlaceholders();\n return entireTemplateForGraphs;\n }", "renderAllViewComponents() {\n this._views.forEach((view) => {\n if (view && view.dataContext) {\n this.renderViewModel(view.dataContext);\n }\n });\n }", "render(container) {\n this.renderer.render(container);\n }", "render() {\n $vizCont.selectAll('.letter-details')\n .data(data, d => {\n return d.letter\n })\n .join(\n enter => {\n $letterDet = enter.append('div')\n .attr('class', d => `letter-details letter-details-${d.letter}`)\n\n $leftCont = $letterDet.append('div')\n .attr('class', 'left-container')\n\n $leftBar = $leftCont.append('div')\n .attr('class', 'left-bar')\n .style('width', d => {\n if (d.dif < 0) return `${scaleX(Math.abs(d.dif))}px`\n else return '0px'\n })\n\n $letterDet.append('p')\n .attr('class', 'letter')\n .text(d => d.letter)\n\n $rightCont = $letterDet.append('div')\n .attr('class', 'right-container')\n\n $rightBar = $rightCont.append('div')\n .attr('class', 'right-bar')\n .style('width', d => {\n if (d.dif > 0) return `${scaleX(d.dif)}px`\n else return '0px'\n })\n },\n update => {\n update.select('.left-bar')\n .transition()\n .duration(500)\n .style('width', d => {\n if (d.dif < 0) return `${scaleX(Math.abs(d.dif))}px`\n else return '0px'\n })\n\n update.select('.right-bar')\n .transition()\n .duration(500)\n .style('width', d => {\n if (d.dif > 0) return `${scaleX(d.dif)}px`\n else return '0px'\n })\n\n }\n )\n\n\t\t\t\treturn Chart;\n\t\t\t}", "render() {\n var content = '<div>data not provided</div><hr/>'; // default view for data-less component\n const isDataAvailable = (this.data.length >= 1);\n\n // build html code from templates and row data\n if (isDataAvailable) {\n const keys = Object.keys(this.data[0]);\n const STYLES = this.tpls.styles;\n const HEAD = keys.map(n => this.placehold(this.tpls.headCell, {\n TEXT: n,\n CLASSES: n===this.sortBy ? `sort${this.sortDir < 0 ? ' rev':''}`:'',\n })).join('');\n const DATA = this.data.map(r => this.placehold(this.tpls.dataRow, {\n ROWDATA: keys.map( n => this.placehold(this.tpls.dataCell, {\n CELLDATA: r[n]\n }) ).join('')\n }) ).join('');\n const TABLE = this.placehold(this.tpls.table, {\n DATA,\n HEAD,\n });\n content = this.placehold(this.tpls.component, {\n TABLE,\n STYLES,\n });\n }\n\n this.shadow.innerHTML = content;\n\n // add click columns (header cells) click handlers to sort rows\n if (isDataAvailable) {\n const keys = Object.keys(this.data[0]);\n keys.map(n => {\n var handledElement = this.shadow.querySelector(this.placehold(this.tpls.handledSelector, {FIELDSELECTOR: n}));\n handledElement.addEventListener(\"click\", () => {\n if (n === this.sortBy) {\n this.sortDir = -this.sortDir;\n } else {\n this.sortBy = n;\n this.sortDir = 1;\n }\n this.sortData();\n this.render();\n });\n });\n }\n }", "render() {\n return (\n <div className=\"px-3\">\n <hr />\n Visualization method{this.createVisualizationSelector()}\n <hr />\n </div>\n );\n }" ]
[ "0.74726593", "0.74035674", "0.6937942", "0.68690914", "0.68412125", "0.6785853", "0.6784853", "0.67671984", "0.67398727", "0.67398727", "0.6715055", "0.66594696", "0.6651233", "0.6619226", "0.65332055", "0.65247124", "0.65234154", "0.64998627", "0.64785224", "0.6468529", "0.64461136", "0.64358234", "0.6431736", "0.64189905", "0.6399073", "0.6390518", "0.63792694", "0.63792694", "0.6360622", "0.634943", "0.6344375", "0.6341743", "0.63344204", "0.63303065", "0.62897635", "0.62867033", "0.62638605", "0.6259503", "0.6259503", "0.6259503", "0.6248209", "0.6234892", "0.62301433", "0.62244713", "0.62244713", "0.6218299", "0.6211746", "0.6202348", "0.6202348", "0.6202348", "0.6202348", "0.6202348", "0.6202348", "0.6202348", "0.6194716", "0.618439", "0.6145205", "0.61425817", "0.6119086", "0.6115715", "0.60952294", "0.6092536", "0.6070918", "0.6063306", "0.6051984", "0.6040993", "0.60397863", "0.6030907", "0.60292405", "0.6028967", "0.60250384", "0.6024617", "0.6024617", "0.6024617", "0.6019717", "0.60146224", "0.60137624", "0.6005955", "0.6000462", "0.5987073", "0.5980443", "0.5976068", "0.59736174", "0.5972128", "0.5968806", "0.5951187", "0.5950161", "0.5938636", "0.59379375", "0.59348637", "0.59309655", "0.5928329", "0.5916524", "0.5910342", "0.5908997", "0.5902077", "0.58989376", "0.5891874", "0.58680886" ]
0.6012614
78
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function makeAction(method, actionInfo) { actionInfo.update = 'updateView'; echarts.registerAction(actionInfo, function (payload, ecModel) { var selected = {}; ecModel.eachComponent({ mainType: 'geo', query: payload }, function (geoModel) { geoModel[method](payload.name); var geo = geoModel.coordinateSystem; zrUtil.each(geo.regions, function (region) { selected[region.name] = geoModel.isSelected(region.name) || false; }); }); return { selected: selected, name: payload.name }; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "started () {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "function SigV4Utils() { }", "started() {\r\n\r\n\t}", "static get NOT_READY () {return 0}", "initialize() {\n\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "heartbeat () {\n }", "static final private internal function m106() {}", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "get WSAPlayerX64() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }" ]
[ "0.53504926", "0.4896905", "0.48514667", "0.48116106", "0.4775166", "0.4743932", "0.47342455", "0.47035336", "0.4694186", "0.4694186", "0.46744877", "0.46453032", "0.46394095", "0.4629355", "0.46211302", "0.45832416", "0.45812932", "0.45752546", "0.45698234", "0.45625272", "0.4557475", "0.4549714", "0.45494938", "0.4545794", "0.45383474", "0.4523037", "0.45180768", "0.45005357", "0.4496748", "0.4486438", "0.447462", "0.44716924", "0.4468301", "0.44601226", "0.4456266", "0.4455926", "0.44557476", "0.4445067", "0.44378054", "0.44258687", "0.44258553", "0.4424118", "0.44097725", "0.4406038", "0.4404498", "0.4404498", "0.4404498", "0.43926418", "0.43781474", "0.43708664", "0.43657827", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43545496", "0.43526813", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.43514904", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4350625", "0.4349645", "0.43450522", "0.43440443", "0.43390423", "0.43347356", "0.43347356", "0.43332103", "0.43318707" ]
0.0
-1
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
function _default(option) { // Save geoCoord var mapSeries = []; zrUtil.each(option.series, function (seriesOpt) { if (seriesOpt && seriesOpt.type === 'map') { mapSeries.push(seriesOpt); seriesOpt.map = seriesOpt.map || seriesOpt.mapType; // Put x, y, width, height, x2, y2 in the top level zrUtil.defaults(seriesOpt, seriesOpt.mapLocation); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get Android() {}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "onChildAppStart () {\n\n }", "private internal function m248() {}", "private public function m246() {}", "onMessageStart() { }", "createStream () {\n\n }", "_playbackCompatibility() {\n // Detect audio playback capabilities.\n\n // Detect HTML5 Audio playback.\n // http://caniuse.com/#feat=audio\n this.canUseAudio = Boolean(new Audio());\n console.log('Native HTML5 Audio playback capability: ' +\n this.canUseAudio);\n\n // Detect Cordova Media Playback\n // It allows playing audio using the native bridge inside WebView Apps.\n // https://github.com/apache/cordova-plugin-media/blob/master/doc/index.md\n this.canUseCordovaMedia = Boolean(window.Media);\n console.log('Cordova Media playback capability: ' +\n this.canUseCordovaMedia);\n\n if (!(this.canUseAudio || this.canUseCordovaMedia)) {\n throw new Error(\n 'Some form of audio playback capability is required');\n }\n\n var _audio = new Audio();\n if (_audio.canPlayType === 'function') {\n throw new Error(\n 'Unable to detect audio playback capabilities');\n }\n\n var canPlayOggVorbis = _audio.canPlayType(\n 'audio/ogg; codecs=\"vorbis\"') !== '';\n var canPlayOggOpus = _audio.canPlayType(\n 'audio/ogg; codecs=\"opus\"') !== '';\n var canPlayWave = _audio.canPlayType('audio/wav') !== '';\n var canPlayMP3 = _audio.canPlayType('audio/mpeg; codecs=\"mp3\"') !== '';\n var canPlayAAC = _audio.canPlayType(\n 'audio/mp4; codecs=\"mp4a.40.2\"') !== '';\n var canPlay3GPP = _audio.canPlayType(\n 'audio/3gpp; codecs=\"samr\"') !== '';\n\n console.log('Native Vorbis audio in Ogg container playback capability: ' +\n canPlayOggVorbis);\n console.log('Native Opus audio in Ogg container playback capability: ' +\n canPlayOggOpus);\n console.log('Native PCM audio in Waveform Audio File Format (WAVE) ' +\n 'playback capability: ' + canPlayWave);\n console.log('Native MPEG Audio Layer 3 (MP3) playback capability: ' +\n canPlayMP3);\n console.log('Native Low-Complexity AAC audio in MP4 container playback ' +\n 'capability: ' + canPlayAAC);\n console.log('Native AMR audio in 3GPP container playback capability: ' +\n canPlay3GPP);\n\n if (!(canPlayWave || canPlayMP3)) {\n throw new Error(\n 'Native Wave or MP3 playback is required');\n }\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\n\t}", "onComponentMount() {\n\n }", "constructor() {\n throw new Error('Not implemented');\n }", "supportsPlatform() {\n return true;\n }", "function _____SHARED_functions_____(){}", "constructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "static get tag(){return\"hal-9000\"}", "static getDeviceModel() {\n return \"zhimi.fan.za4\";\n }", "requestContainerInfo() {}", "constructor () { super() }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "static get STATUS() {\n return 0;\n }", "static create () {}", "get() {}", "didMount() {\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "onReady() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function sdk(){\n}", "constructor () {\r\n\t\t\r\n\t}", "transient private protected internal function m182() {}", "function version(){ return \"0.13.0\" }", "static getDeviceModel() {\n return \"zhimi.fan.za5\";\n }", "started () {}", "function getVersion(){return _VERSION}", "transient private internal function m185() {}", "constructor() {\r\n }", "started() { }", "InitVsaEngine() {\n\n }", "started() {\r\n\r\n\t}", "function SigV4Utils() { }", "static get NOT_READY () {return 0}", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "initialize() {\n\n }", "onMessageReceive() {}", "initialize()\n {\n }", "_get () {\n throw new Error('_get not implemented')\n }", "get () {\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function getImplementation( cb ){\n\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "heartbeat () {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "initleancloud() {\n AV.init({\n appId: keys.appId,\n appKey: keys.appKey\n })\n this.globalData.AV = AV\n }", "static final private internal function m106() {}", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "onMessage() {}", "onMessage() {}", "constructor() {\n super();\n this._logger = new pip_services3_components_node_3.CompositeLogger();\n this._connectionResolver = new connect_1.AwsConnectionResolver();\n this._connectTimeout = 30000;\n this._client = null; //AmazonCloudWatchClient\n this._opened = false;\n }", "get WSAPlayerX64() {}" ]
[ "0.5349978", "0.48933455", "0.48501366", "0.48083982", "0.4772584", "0.474481", "0.47349635", "0.47027457", "0.46929818", "0.46929818", "0.4673667", "0.4644517", "0.46389893", "0.46253318", "0.4618249", "0.4582536", "0.45813942", "0.45742747", "0.45687214", "0.45623618", "0.45563498", "0.45493752", "0.45489514", "0.45457798", "0.4538844", "0.45218396", "0.45187637", "0.4498104", "0.44946006", "0.44832855", "0.44729492", "0.44691566", "0.44642788", "0.44588575", "0.44554883", "0.4453296", "0.44531393", "0.4443642", "0.44374335", "0.44267404", "0.44238108", "0.44228086", "0.4407407", "0.44043022", "0.44043022", "0.44043022", "0.44035548", "0.4393825", "0.43761918", "0.43697277", "0.4364149", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43530616", "0.43517888", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43511248", "0.43502304", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43493763", "0.43440503", "0.43416435", "0.43375877", "0.43357816", "0.43357816", "0.43336093", "0.43330038" ]
0.0
-1